]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20201121
[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         cat >conftest.$ac_ext <<_ACEOF
1922 #line 1922 "configure"
1923 #include "confdefs.h"
1924
1925 int
1926 main (void)
1927 {
1928
1929 #ifdef __clang__
1930 #else
1931 make an error
1932 #endif
1933
1934   ;
1935   return 0;
1936 }
1937 _ACEOF
1938 rm -f conftest.$ac_objext
1939 if { (eval echo "$as_me:1939: \"$ac_compile\"") >&5
1940   (eval $ac_compile) 2>&5
1941   ac_status=$?
1942   echo "$as_me:1942: \$? = $ac_status" >&5
1943   (exit $ac_status); } &&
1944          { ac_try='test -s conftest.$ac_objext'
1945   { (eval echo "$as_me:1945: \"$ac_try\"") >&5
1946   (eval $ac_try) 2>&5
1947   ac_status=$?
1948   echo "$as_me:1948: \$? = $ac_status" >&5
1949   (exit $ac_status); }; }; then
1950   CLANG_COMPILER=yes
1951
1952 else
1953   echo "$as_me: failed program was:" >&5
1954 cat conftest.$ac_ext >&5
1955 fi
1956 rm -f conftest.$ac_objext conftest.$ac_ext
1957         CFLAGS="$cf_save_CFLAGS"
1958         echo "$as_me:1958: result: $CLANG_COMPILER" >&5
1959 echo "${ECHO_T}$CLANG_COMPILER" >&6
1960 fi
1961
1962 if test "x$CLANG_COMPILER" = "xyes" ; then
1963         for cf_clang_opt in \
1964                 -Qunused-arguments \
1965                 -Wno-error=implicit-function-declaration
1966         do
1967                 echo "$as_me:1967: checking if option $cf_clang_opt works" >&5
1968 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6
1969                 cf_save_CFLAGS="$CFLAGS"
1970                 CFLAGS="$CFLAGS $cf_clang_opt"
1971                 cat >conftest.$ac_ext <<_ACEOF
1972 #line 1972 "configure"
1973 #include "confdefs.h"
1974
1975                         #include <stdio.h>
1976 int
1977 main (void)
1978 {
1979
1980                         printf("hello!\n");
1981   ;
1982   return 0;
1983 }
1984 _ACEOF
1985 rm -f conftest.$ac_objext conftest$ac_exeext
1986 if { (eval echo "$as_me:1986: \"$ac_link\"") >&5
1987   (eval $ac_link) 2>&5
1988   ac_status=$?
1989   echo "$as_me:1989: \$? = $ac_status" >&5
1990   (exit $ac_status); } &&
1991          { ac_try='test -s conftest$ac_exeext'
1992   { (eval echo "$as_me:1992: \"$ac_try\"") >&5
1993   (eval $ac_try) 2>&5
1994   ac_status=$?
1995   echo "$as_me:1995: \$? = $ac_status" >&5
1996   (exit $ac_status); }; }; then
1997
1998                         cf_clang_optok=yes
1999 else
2000   echo "$as_me: failed program was:" >&5
2001 cat conftest.$ac_ext >&5
2002
2003                         cf_clang_optok=no
2004 fi
2005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2006                 echo "$as_me:2006: result: $cf_clang_optok" >&5
2007 echo "${ECHO_T}$cf_clang_optok" >&6
2008                 CFLAGS="$cf_save_CFLAGS"
2009                 if test $cf_clang_optok = yes; then
2010                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2011
2012 echo "${as_me:-configure}:2012: testing adding option $cf_clang_opt ..." 1>&5
2013
2014         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2015         CFLAGS="${CFLAGS}$cf_clang_opt"
2016
2017                 fi
2018         done
2019 fi
2020
2021 echo "$as_me:2021: checking for $CC option to accept ANSI C" >&5
2022 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2023 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2024   echo $ECHO_N "(cached) $ECHO_C" >&6
2025 else
2026   ac_cv_prog_cc_stdc=no
2027 ac_save_CC=$CC
2028 cat >conftest.$ac_ext <<_ACEOF
2029 #line 2029 "configure"
2030 #include "confdefs.h"
2031 #include <stdarg.h>
2032 #include <stdio.h>
2033 #include <sys/types.h>
2034 #include <sys/stat.h>
2035 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2036 struct buf { int x; };
2037 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2038 static char *e (p, i)
2039      char **p;
2040      int i;
2041 {
2042   return p[i];
2043 }
2044 static char *f (char * (*g) (char **, int), char **p, ...)
2045 {
2046   char *s;
2047   va_list v;
2048   va_start (v,p);
2049   s = g (p, va_arg (v,int));
2050   va_end (v);
2051   return s;
2052 }
2053 int test (int i, double x);
2054 struct s1 {int (*f) (int a);};
2055 struct s2 {int (*f) (double a);};
2056 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2057 int argc;
2058 char **argv;
2059 int
2060 main (void)
2061 {
2062 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2063   ;
2064   return 0;
2065 }
2066 _ACEOF
2067 # Don't try gcc -ansi; that turns off useful extensions and
2068 # breaks some systems' header files.
2069 # AIX                   -qlanglvl=ansi
2070 # Ultrix and OSF/1      -std1
2071 # HP-UX 10.20 and later -Ae
2072 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2073 # SVR4                  -Xc -D__EXTENSIONS__
2074 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2075 do
2076   CC="$ac_save_CC $ac_arg"
2077   rm -f conftest.$ac_objext
2078 if { (eval echo "$as_me:2078: \"$ac_compile\"") >&5
2079   (eval $ac_compile) 2>&5
2080   ac_status=$?
2081   echo "$as_me:2081: \$? = $ac_status" >&5
2082   (exit $ac_status); } &&
2083          { ac_try='test -s conftest.$ac_objext'
2084   { (eval echo "$as_me:2084: \"$ac_try\"") >&5
2085   (eval $ac_try) 2>&5
2086   ac_status=$?
2087   echo "$as_me:2087: \$? = $ac_status" >&5
2088   (exit $ac_status); }; }; then
2089   ac_cv_prog_cc_stdc=$ac_arg
2090 break
2091 else
2092   echo "$as_me: failed program was:" >&5
2093 cat conftest.$ac_ext >&5
2094 fi
2095 rm -f conftest.$ac_objext
2096 done
2097 rm -f conftest.$ac_ext conftest.$ac_objext
2098 CC=$ac_save_CC
2099
2100 fi
2101
2102 case "x$ac_cv_prog_cc_stdc" in
2103   x|xno)
2104     echo "$as_me:2104: result: none needed" >&5
2105 echo "${ECHO_T}none needed" >&6 ;;
2106   *)
2107     echo "$as_me:2107: result: $ac_cv_prog_cc_stdc" >&5
2108 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2109     CC="$CC $ac_cv_prog_cc_stdc" ;;
2110 esac
2111
2112 # This should have been defined by AC_PROG_CC
2113 : ${CC:=cc}
2114
2115 echo "$as_me:2115: checking \$CFLAGS variable" >&5
2116 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2117 case "x$CFLAGS" in
2118 (*-[IUD]*)
2119         echo "$as_me:2119: result: broken" >&5
2120 echo "${ECHO_T}broken" >&6
2121         { echo "$as_me:2121: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2122 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2123         cf_flags="$CFLAGS"
2124         CFLAGS=
2125         for cf_arg in $cf_flags
2126         do
2127
2128 cf_fix_cppflags=no
2129 cf_new_cflags=
2130 cf_new_cppflags=
2131 cf_new_extra_cppflags=
2132
2133 for cf_add_cflags in $cf_arg
2134 do
2135 case $cf_fix_cppflags in
2136 (no)
2137         case $cf_add_cflags in
2138         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2139                 case $cf_add_cflags in
2140                 (-D*)
2141                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2142
2143                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2144                                 && test -z "${cf_tst_cflags}" \
2145                                 && cf_fix_cppflags=yes
2146
2147                         if test $cf_fix_cppflags = yes ; then
2148
2149         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2150         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2151
2152                                 continue
2153                         elif test "${cf_tst_cflags}" = "\"'" ; then
2154
2155         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2156         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2157
2158                                 continue
2159                         fi
2160                         ;;
2161                 esac
2162                 case "$CPPFLAGS" in
2163                 (*$cf_add_cflags)
2164                         ;;
2165                 (*)
2166                         case $cf_add_cflags in
2167                         (-D*)
2168                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2169
2170 CPPFLAGS=`echo "$CPPFLAGS" | \
2171         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2172                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2173
2174                                 ;;
2175                         esac
2176
2177         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2178         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2179
2180                         ;;
2181                 esac
2182                 ;;
2183         (*)
2184
2185         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2186         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2187
2188                 ;;
2189         esac
2190         ;;
2191 (yes)
2192
2193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2195
2196         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2197
2198         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2199                 && test -z "${cf_tst_cflags}" \
2200                 && cf_fix_cppflags=no
2201         ;;
2202 esac
2203 done
2204
2205 if test -n "$cf_new_cflags" ; then
2206
2207         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2208         CFLAGS="${CFLAGS}$cf_new_cflags"
2209
2210 fi
2211
2212 if test -n "$cf_new_cppflags" ; then
2213
2214         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2215         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2216
2217 fi
2218
2219 if test -n "$cf_new_extra_cppflags" ; then
2220
2221         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2222         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2223
2224 fi
2225
2226         done
2227         ;;
2228 (*)
2229         echo "$as_me:2229: result: ok" >&5
2230 echo "${ECHO_T}ok" >&6
2231         ;;
2232 esac
2233
2234 echo "$as_me:2234: checking \$CC variable" >&5
2235 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2236 case "$CC" in
2237 (*[\ \  ]-*)
2238         echo "$as_me:2238: result: broken" >&5
2239 echo "${ECHO_T}broken" >&6
2240         { echo "$as_me:2240: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2241 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2242         # humor him...
2243         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2244         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2245         CC="$cf_prog"
2246         for cf_arg in $cf_flags
2247         do
2248                 case "x$cf_arg" in
2249                 (x-[IUDfgOW]*)
2250
2251 cf_fix_cppflags=no
2252 cf_new_cflags=
2253 cf_new_cppflags=
2254 cf_new_extra_cppflags=
2255
2256 for cf_add_cflags in $cf_arg
2257 do
2258 case $cf_fix_cppflags in
2259 (no)
2260         case $cf_add_cflags in
2261         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2262                 case $cf_add_cflags in
2263                 (-D*)
2264                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2265
2266                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2267                                 && test -z "${cf_tst_cflags}" \
2268                                 && cf_fix_cppflags=yes
2269
2270                         if test $cf_fix_cppflags = yes ; then
2271
2272         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2273         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2274
2275                                 continue
2276                         elif test "${cf_tst_cflags}" = "\"'" ; then
2277
2278         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2279         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2280
2281                                 continue
2282                         fi
2283                         ;;
2284                 esac
2285                 case "$CPPFLAGS" in
2286                 (*$cf_add_cflags)
2287                         ;;
2288                 (*)
2289                         case $cf_add_cflags in
2290                         (-D*)
2291                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2292
2293 CPPFLAGS=`echo "$CPPFLAGS" | \
2294         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2295                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2296
2297                                 ;;
2298                         esac
2299
2300         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2301         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2302
2303                         ;;
2304                 esac
2305                 ;;
2306         (*)
2307
2308         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2309         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2310
2311                 ;;
2312         esac
2313         ;;
2314 (yes)
2315
2316         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2317         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2318
2319         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2320
2321         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2322                 && test -z "${cf_tst_cflags}" \
2323                 && cf_fix_cppflags=no
2324         ;;
2325 esac
2326 done
2327
2328 if test -n "$cf_new_cflags" ; then
2329
2330         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2331         CFLAGS="${CFLAGS}$cf_new_cflags"
2332
2333 fi
2334
2335 if test -n "$cf_new_cppflags" ; then
2336
2337         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2338         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2339
2340 fi
2341
2342 if test -n "$cf_new_extra_cppflags" ; then
2343
2344         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2345         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2346
2347 fi
2348
2349                         ;;
2350                 (*)
2351                         CC="$CC $cf_arg"
2352                         ;;
2353                 esac
2354         done
2355         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2356
2357 echo "${as_me:-configure}:2357: testing resulting CC: '$CC' ..." 1>&5
2358
2359         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2360
2361 echo "${as_me:-configure}:2361: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2362
2363         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2364
2365 echo "${as_me:-configure}:2365: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2366
2367         ;;
2368 (*)
2369         echo "$as_me:2369: result: ok" >&5
2370 echo "${ECHO_T}ok" >&6
2371         ;;
2372 esac
2373
2374 echo "$as_me:2374: checking for inline" >&5
2375 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2376 if test "${ac_cv_c_inline+set}" = set; then
2377   echo $ECHO_N "(cached) $ECHO_C" >&6
2378 else
2379   ac_cv_c_inline=no
2380 for ac_kw in inline __inline__ __inline; do
2381   cat >conftest.$ac_ext <<_ACEOF
2382 #line 2382 "configure"
2383 #include "confdefs.h"
2384 #ifndef __cplusplus
2385 static $ac_kw int static_foo () {return 0; }
2386 $ac_kw int foo () {return 0; }
2387 #endif
2388
2389 _ACEOF
2390 rm -f conftest.$ac_objext
2391 if { (eval echo "$as_me:2391: \"$ac_compile\"") >&5
2392   (eval $ac_compile) 2>&5
2393   ac_status=$?
2394   echo "$as_me:2394: \$? = $ac_status" >&5
2395   (exit $ac_status); } &&
2396          { ac_try='test -s conftest.$ac_objext'
2397   { (eval echo "$as_me:2397: \"$ac_try\"") >&5
2398   (eval $ac_try) 2>&5
2399   ac_status=$?
2400   echo "$as_me:2400: \$? = $ac_status" >&5
2401   (exit $ac_status); }; }; then
2402   ac_cv_c_inline=$ac_kw; break
2403 else
2404   echo "$as_me: failed program was:" >&5
2405 cat conftest.$ac_ext >&5
2406 fi
2407 rm -f conftest.$ac_objext conftest.$ac_ext
2408 done
2409
2410 fi
2411 echo "$as_me:2411: result: $ac_cv_c_inline" >&5
2412 echo "${ECHO_T}$ac_cv_c_inline" >&6
2413 case $ac_cv_c_inline in
2414   inline | yes) ;;
2415   no)
2416 cat >>confdefs.h <<\EOF
2417 #define inline
2418 EOF
2419  ;;
2420   *)  cat >>confdefs.h <<EOF
2421 #define inline $ac_cv_c_inline
2422 EOF
2423  ;;
2424 esac
2425
2426 ac_ext=c
2427 ac_cpp='$CPP $CPPFLAGS'
2428 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2429 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2430 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2431 ac_main_return=return
2432 echo "$as_me:2432: checking how to run the C preprocessor" >&5
2433 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2434 # On Suns, sometimes $CPP names a directory.
2435 if test -n "$CPP" && test -d "$CPP"; then
2436   CPP=
2437 fi
2438 if test -z "$CPP"; then
2439   if test "${ac_cv_prog_CPP+set}" = set; then
2440   echo $ECHO_N "(cached) $ECHO_C" >&6
2441 else
2442       # Double quotes because CPP needs to be expanded
2443     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2444     do
2445       ac_preproc_ok=false
2446 for ac_c_preproc_warn_flag in '' yes
2447 do
2448   # Use a header file that comes with gcc, so configuring glibc
2449   # with a fresh cross-compiler works.
2450   # On the NeXT, cc -E runs the code through the compiler's parser,
2451   # not just through cpp. "Syntax error" is here to catch this case.
2452   cat >conftest.$ac_ext <<_ACEOF
2453 #line 2453 "configure"
2454 #include "confdefs.h"
2455 #include <assert.h>
2456                      Syntax error
2457 _ACEOF
2458 if { (eval echo "$as_me:2458: \"$ac_cpp conftest.$ac_ext\"") >&5
2459   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2460   ac_status=$?
2461   egrep -v '^ *\+' conftest.er1 >conftest.err
2462   rm -f conftest.er1
2463   cat conftest.err >&5
2464   echo "$as_me:2464: \$? = $ac_status" >&5
2465   (exit $ac_status); } >/dev/null; then
2466   if test -s conftest.err; then
2467     ac_cpp_err=$ac_c_preproc_warn_flag
2468   else
2469     ac_cpp_err=
2470   fi
2471 else
2472   ac_cpp_err=yes
2473 fi
2474 if test -z "$ac_cpp_err"; then
2475   :
2476 else
2477   echo "$as_me: failed program was:" >&5
2478   cat conftest.$ac_ext >&5
2479   # Broken: fails on valid input.
2480 continue
2481 fi
2482 rm -f conftest.err conftest.$ac_ext
2483
2484   # OK, works on sane cases.  Now check whether non-existent headers
2485   # can be detected and how.
2486   cat >conftest.$ac_ext <<_ACEOF
2487 #line 2487 "configure"
2488 #include "confdefs.h"
2489 #include <ac_nonexistent.h>
2490 _ACEOF
2491 if { (eval echo "$as_me:2491: \"$ac_cpp conftest.$ac_ext\"") >&5
2492   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2493   ac_status=$?
2494   egrep -v '^ *\+' conftest.er1 >conftest.err
2495   rm -f conftest.er1
2496   cat conftest.err >&5
2497   echo "$as_me:2497: \$? = $ac_status" >&5
2498   (exit $ac_status); } >/dev/null; then
2499   if test -s conftest.err; then
2500     ac_cpp_err=$ac_c_preproc_warn_flag
2501   else
2502     ac_cpp_err=
2503   fi
2504 else
2505   ac_cpp_err=yes
2506 fi
2507 if test -z "$ac_cpp_err"; then
2508   # Broken: success on invalid input.
2509 continue
2510 else
2511   echo "$as_me: failed program was:" >&5
2512   cat conftest.$ac_ext >&5
2513   # Passes both tests.
2514 ac_preproc_ok=:
2515 break
2516 fi
2517 rm -f conftest.err conftest.$ac_ext
2518
2519 done
2520 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2521 rm -f conftest.err conftest.$ac_ext
2522 if $ac_preproc_ok; then
2523   break
2524 fi
2525
2526     done
2527     ac_cv_prog_CPP=$CPP
2528
2529 fi
2530   CPP=$ac_cv_prog_CPP
2531 else
2532   ac_cv_prog_CPP=$CPP
2533 fi
2534 echo "$as_me:2534: result: $CPP" >&5
2535 echo "${ECHO_T}$CPP" >&6
2536 ac_preproc_ok=false
2537 for ac_c_preproc_warn_flag in '' yes
2538 do
2539   # Use a header file that comes with gcc, so configuring glibc
2540   # with a fresh cross-compiler works.
2541   # On the NeXT, cc -E runs the code through the compiler's parser,
2542   # not just through cpp. "Syntax error" is here to catch this case.
2543   cat >conftest.$ac_ext <<_ACEOF
2544 #line 2544 "configure"
2545 #include "confdefs.h"
2546 #include <assert.h>
2547                      Syntax error
2548 _ACEOF
2549 if { (eval echo "$as_me:2549: \"$ac_cpp conftest.$ac_ext\"") >&5
2550   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2551   ac_status=$?
2552   egrep -v '^ *\+' conftest.er1 >conftest.err
2553   rm -f conftest.er1
2554   cat conftest.err >&5
2555   echo "$as_me:2555: \$? = $ac_status" >&5
2556   (exit $ac_status); } >/dev/null; then
2557   if test -s conftest.err; then
2558     ac_cpp_err=$ac_c_preproc_warn_flag
2559   else
2560     ac_cpp_err=
2561   fi
2562 else
2563   ac_cpp_err=yes
2564 fi
2565 if test -z "$ac_cpp_err"; then
2566   :
2567 else
2568   echo "$as_me: failed program was:" >&5
2569   cat conftest.$ac_ext >&5
2570   # Broken: fails on valid input.
2571 continue
2572 fi
2573 rm -f conftest.err conftest.$ac_ext
2574
2575   # OK, works on sane cases.  Now check whether non-existent headers
2576   # can be detected and how.
2577   cat >conftest.$ac_ext <<_ACEOF
2578 #line 2578 "configure"
2579 #include "confdefs.h"
2580 #include <ac_nonexistent.h>
2581 _ACEOF
2582 if { (eval echo "$as_me:2582: \"$ac_cpp conftest.$ac_ext\"") >&5
2583   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2584   ac_status=$?
2585   egrep -v '^ *\+' conftest.er1 >conftest.err
2586   rm -f conftest.er1
2587   cat conftest.err >&5
2588   echo "$as_me:2588: \$? = $ac_status" >&5
2589   (exit $ac_status); } >/dev/null; then
2590   if test -s conftest.err; then
2591     ac_cpp_err=$ac_c_preproc_warn_flag
2592   else
2593     ac_cpp_err=
2594   fi
2595 else
2596   ac_cpp_err=yes
2597 fi
2598 if test -z "$ac_cpp_err"; then
2599   # Broken: success on invalid input.
2600 continue
2601 else
2602   echo "$as_me: failed program was:" >&5
2603   cat conftest.$ac_ext >&5
2604   # Passes both tests.
2605 ac_preproc_ok=:
2606 break
2607 fi
2608 rm -f conftest.err conftest.$ac_ext
2609
2610 done
2611 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2612 rm -f conftest.err conftest.$ac_ext
2613 if $ac_preproc_ok; then
2614   :
2615 else
2616   { { echo "$as_me:2616: error: C preprocessor \"$CPP\" fails sanity check" >&5
2617 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2618    { (exit 1); exit 1; }; }
2619 fi
2620
2621 ac_ext=c
2622 ac_cpp='$CPP $CPPFLAGS'
2623 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2624 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2625 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2626 ac_main_return=return
2627
2628 for ac_prog in mawk gawk nawk awk
2629 do
2630   # Extract the first word of "$ac_prog", so it can be a program name with args.
2631 set dummy $ac_prog; ac_word=$2
2632 echo "$as_me:2632: checking for $ac_word" >&5
2633 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2634 if test "${ac_cv_prog_AWK+set}" = set; then
2635   echo $ECHO_N "(cached) $ECHO_C" >&6
2636 else
2637   if test -n "$AWK"; then
2638   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2639 else
2640   ac_save_IFS=$IFS; IFS=$ac_path_separator
2641 ac_dummy="$PATH"
2642 for ac_dir in $ac_dummy; do
2643   IFS=$ac_save_IFS
2644   test -z "$ac_dir" && ac_dir=.
2645   $as_executable_p "$ac_dir/$ac_word" || continue
2646 ac_cv_prog_AWK="$ac_prog"
2647 echo "$as_me:2647: found $ac_dir/$ac_word" >&5
2648 break
2649 done
2650
2651 fi
2652 fi
2653 AWK=$ac_cv_prog_AWK
2654 if test -n "$AWK"; then
2655   echo "$as_me:2655: result: $AWK" >&5
2656 echo "${ECHO_T}$AWK" >&6
2657 else
2658   echo "$as_me:2658: result: no" >&5
2659 echo "${ECHO_T}no" >&6
2660 fi
2661
2662   test -n "$AWK" && break
2663 done
2664
2665 # Find a good install program.  We prefer a C program (faster),
2666 # so one script is as good as another.  But avoid the broken or
2667 # incompatible versions:
2668 # SysV /etc/install, /usr/sbin/install
2669 # SunOS /usr/etc/install
2670 # IRIX /sbin/install
2671 # AIX /bin/install
2672 # AmigaOS /C/install, which installs bootblocks on floppy discs
2673 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2674 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2675 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2676 # ./install, which can be erroneously created by make from ./install.sh.
2677 echo "$as_me:2677: checking for a BSD compatible install" >&5
2678 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2679 if test -z "$INSTALL"; then
2680 if test "${ac_cv_path_install+set}" = set; then
2681   echo $ECHO_N "(cached) $ECHO_C" >&6
2682 else
2683     ac_save_IFS=$IFS; IFS=$ac_path_separator
2684   for ac_dir in $PATH; do
2685     IFS=$ac_save_IFS
2686     # Account for people who put trailing slashes in PATH elements.
2687     case $ac_dir/ in
2688     / | ./ | .// | /cC/* \
2689     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2690     | /usr/ucb/* ) ;;
2691     *)
2692       # OSF1 and SCO ODT 3.0 have their own names for install.
2693       # Don't use installbsd from OSF since it installs stuff as root
2694       # by default.
2695       for ac_prog in ginstall scoinst install; do
2696         if $as_executable_p "$ac_dir/$ac_prog"; then
2697           if test $ac_prog = install &&
2698             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2699             # AIX install.  It has an incompatible calling convention.
2700             :
2701           elif test $ac_prog = install &&
2702             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2703             # program-specific install script used by HP pwplus--don't use.
2704             :
2705           else
2706             ac_cv_path_install="$ac_dir/$ac_prog -c"
2707             break 2
2708           fi
2709         fi
2710       done
2711       ;;
2712     esac
2713   done
2714
2715 fi
2716   if test "${ac_cv_path_install+set}" = set; then
2717     INSTALL=$ac_cv_path_install
2718   else
2719     # As a last resort, use the slow shell script.  We don't cache a
2720     # path for INSTALL within a source directory, because that will
2721     # break other packages using the cache if that directory is
2722     # removed, or if the path is relative.
2723     INSTALL=$ac_install_sh
2724   fi
2725 fi
2726 echo "$as_me:2726: result: $INSTALL" >&5
2727 echo "${ECHO_T}$INSTALL" >&6
2728
2729 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2730 # It thinks the first close brace ends the variable substitution.
2731 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2732
2733 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2734
2735 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2736
2737 case $INSTALL in
2738 (/*)
2739         ;;
2740 (*)
2741         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2742         test -z "$cf_dir" && cf_dir=.
2743         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2744         ;;
2745 esac
2746
2747 echo "$as_me:2747: checking if you want to install stripped executables" >&5
2748 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2749
2750 # Check whether --enable-stripping or --disable-stripping was given.
2751 if test "${enable_stripping+set}" = set; then
2752   enableval="$enable_stripping"
2753   test "$enableval" != no && enableval=yes
2754         if test "$enableval" != "yes" ; then
2755     with_stripping=no
2756         else
2757                 with_stripping=yes
2758         fi
2759 else
2760   enableval=yes
2761         with_stripping=yes
2762
2763 fi;
2764 echo "$as_me:2764: result: $with_stripping" >&5
2765 echo "${ECHO_T}$with_stripping" >&6
2766
2767 if test "$with_stripping" = yes
2768 then
2769         INSTALL_OPT_S="-s"
2770 else
2771         INSTALL_OPT_S=
2772 fi
2773
2774 : ${INSTALL:=install}
2775 echo "$as_me:2775: checking if install accepts -p option" >&5
2776 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2777 if test "${cf_cv_install_p+set}" = set; then
2778   echo $ECHO_N "(cached) $ECHO_C" >&6
2779 else
2780
2781         rm -rf conftest*
2782         date >conftest.in
2783         mkdir conftest.out
2784         sleep 3
2785         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2786         then
2787                 if test -f conftest.out/conftest.in
2788                 then
2789                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2790                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2791                         if test -s conftest.err
2792                         then
2793                                 cf_cv_install_p=no
2794                         else
2795                                 cf_cv_install_p=yes
2796                         fi
2797                 else
2798                         cf_cv_install_p=no
2799                 fi
2800         else
2801                 cf_cv_install_p=no
2802         fi
2803         rm -rf conftest*
2804
2805 fi
2806 echo "$as_me:2806: result: $cf_cv_install_p" >&5
2807 echo "${ECHO_T}$cf_cv_install_p" >&6
2808
2809 echo "$as_me:2809: checking if install needs to be told about ownership" >&5
2810 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2811 case `$ac_config_guess` in
2812 (*minix)
2813         with_install_o=yes
2814         ;;
2815 (*)
2816         with_install_o=no
2817         ;;
2818 esac
2819
2820 echo "$as_me:2820: result: $with_install_o" >&5
2821 echo "${ECHO_T}$with_install_o" >&6
2822 if test "x$with_install_o" = xyes
2823 then
2824         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'`
2825 else
2826         INSTALL_OPT_O=
2827 fi
2828
2829 for ac_prog in lint cppcheck splint
2830 do
2831   # Extract the first word of "$ac_prog", so it can be a program name with args.
2832 set dummy $ac_prog; ac_word=$2
2833 echo "$as_me:2833: checking for $ac_word" >&5
2834 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2835 if test "${ac_cv_prog_LINT+set}" = set; then
2836   echo $ECHO_N "(cached) $ECHO_C" >&6
2837 else
2838   if test -n "$LINT"; then
2839   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2840 else
2841   ac_save_IFS=$IFS; IFS=$ac_path_separator
2842 ac_dummy="$PATH"
2843 for ac_dir in $ac_dummy; do
2844   IFS=$ac_save_IFS
2845   test -z "$ac_dir" && ac_dir=.
2846   $as_executable_p "$ac_dir/$ac_word" || continue
2847 ac_cv_prog_LINT="$ac_prog"
2848 echo "$as_me:2848: found $ac_dir/$ac_word" >&5
2849 break
2850 done
2851
2852 fi
2853 fi
2854 LINT=$ac_cv_prog_LINT
2855 if test -n "$LINT"; then
2856   echo "$as_me:2856: result: $LINT" >&5
2857 echo "${ECHO_T}$LINT" >&6
2858 else
2859   echo "$as_me:2859: result: no" >&5
2860 echo "${ECHO_T}no" >&6
2861 fi
2862
2863   test -n "$LINT" && break
2864 done
2865
2866 case "x$LINT" in
2867 (xcppcheck|x*/cppcheck)
2868         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2869         ;;
2870 esac
2871
2872 echo "$as_me:2872: checking if filesystem supports mixed-case filenames" >&5
2873 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2874 if test "${cf_cv_mixedcase+set}" = set; then
2875   echo $ECHO_N "(cached) $ECHO_C" >&6
2876 else
2877
2878 if test "$cross_compiling" = yes ; then
2879         case $target_alias in
2880         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
2881                 cf_cv_mixedcase=no
2882                 ;;
2883         (*)
2884                 cf_cv_mixedcase=yes
2885                 ;;
2886         esac
2887 else
2888         rm -f conftest CONFTEST
2889         echo test >conftest
2890         if test -f CONFTEST ; then
2891                 cf_cv_mixedcase=no
2892         else
2893                 cf_cv_mixedcase=yes
2894         fi
2895         rm -f conftest CONFTEST
2896 fi
2897
2898 fi
2899 echo "$as_me:2899: result: $cf_cv_mixedcase" >&5
2900 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2901 test "$cf_cv_mixedcase" = yes &&
2902 cat >>confdefs.h <<\EOF
2903 #define MIXEDCASE_FILENAMES 1
2904 EOF
2905
2906 for ac_prog in exctags ctags
2907 do
2908   # Extract the first word of "$ac_prog", so it can be a program name with args.
2909 set dummy $ac_prog; ac_word=$2
2910 echo "$as_me:2910: checking for $ac_word" >&5
2911 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2912 if test "${ac_cv_prog_CTAGS+set}" = set; then
2913   echo $ECHO_N "(cached) $ECHO_C" >&6
2914 else
2915   if test -n "$CTAGS"; then
2916   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2917 else
2918   ac_save_IFS=$IFS; IFS=$ac_path_separator
2919 ac_dummy="$PATH"
2920 for ac_dir in $ac_dummy; do
2921   IFS=$ac_save_IFS
2922   test -z "$ac_dir" && ac_dir=.
2923   $as_executable_p "$ac_dir/$ac_word" || continue
2924 ac_cv_prog_CTAGS="$ac_prog"
2925 echo "$as_me:2925: found $ac_dir/$ac_word" >&5
2926 break
2927 done
2928
2929 fi
2930 fi
2931 CTAGS=$ac_cv_prog_CTAGS
2932 if test -n "$CTAGS"; then
2933   echo "$as_me:2933: result: $CTAGS" >&5
2934 echo "${ECHO_T}$CTAGS" >&6
2935 else
2936   echo "$as_me:2936: result: no" >&5
2937 echo "${ECHO_T}no" >&6
2938 fi
2939
2940   test -n "$CTAGS" && break
2941 done
2942
2943 for ac_prog in exetags etags
2944 do
2945   # Extract the first word of "$ac_prog", so it can be a program name with args.
2946 set dummy $ac_prog; ac_word=$2
2947 echo "$as_me:2947: checking for $ac_word" >&5
2948 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2949 if test "${ac_cv_prog_ETAGS+set}" = set; then
2950   echo $ECHO_N "(cached) $ECHO_C" >&6
2951 else
2952   if test -n "$ETAGS"; then
2953   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2954 else
2955   ac_save_IFS=$IFS; IFS=$ac_path_separator
2956 ac_dummy="$PATH"
2957 for ac_dir in $ac_dummy; do
2958   IFS=$ac_save_IFS
2959   test -z "$ac_dir" && ac_dir=.
2960   $as_executable_p "$ac_dir/$ac_word" || continue
2961 ac_cv_prog_ETAGS="$ac_prog"
2962 echo "$as_me:2962: found $ac_dir/$ac_word" >&5
2963 break
2964 done
2965
2966 fi
2967 fi
2968 ETAGS=$ac_cv_prog_ETAGS
2969 if test -n "$ETAGS"; then
2970   echo "$as_me:2970: result: $ETAGS" >&5
2971 echo "${ECHO_T}$ETAGS" >&6
2972 else
2973   echo "$as_me:2973: result: no" >&5
2974 echo "${ECHO_T}no" >&6
2975 fi
2976
2977   test -n "$ETAGS" && break
2978 done
2979
2980 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2981 set dummy ${CTAGS:-ctags}; ac_word=$2
2982 echo "$as_me:2982: checking for $ac_word" >&5
2983 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2984 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2985   echo $ECHO_N "(cached) $ECHO_C" >&6
2986 else
2987   if test -n "$MAKE_LOWER_TAGS"; then
2988   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2989 else
2990   ac_save_IFS=$IFS; IFS=$ac_path_separator
2991 ac_dummy="$PATH"
2992 for ac_dir in $ac_dummy; do
2993   IFS=$ac_save_IFS
2994   test -z "$ac_dir" && ac_dir=.
2995   $as_executable_p "$ac_dir/$ac_word" || continue
2996 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2997 echo "$as_me:2997: found $ac_dir/$ac_word" >&5
2998 break
2999 done
3000
3001   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
3002 fi
3003 fi
3004 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3005 if test -n "$MAKE_LOWER_TAGS"; then
3006   echo "$as_me:3006: result: $MAKE_LOWER_TAGS" >&5
3007 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3008 else
3009   echo "$as_me:3009: result: no" >&5
3010 echo "${ECHO_T}no" >&6
3011 fi
3012
3013 if test "$cf_cv_mixedcase" = yes ; then
3014         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3015 set dummy ${ETAGS:-etags}; ac_word=$2
3016 echo "$as_me:3016: checking for $ac_word" >&5
3017 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3018 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3019   echo $ECHO_N "(cached) $ECHO_C" >&6
3020 else
3021   if test -n "$MAKE_UPPER_TAGS"; then
3022   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3023 else
3024   ac_save_IFS=$IFS; IFS=$ac_path_separator
3025 ac_dummy="$PATH"
3026 for ac_dir in $ac_dummy; do
3027   IFS=$ac_save_IFS
3028   test -z "$ac_dir" && ac_dir=.
3029   $as_executable_p "$ac_dir/$ac_word" || continue
3030 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3031 echo "$as_me:3031: found $ac_dir/$ac_word" >&5
3032 break
3033 done
3034
3035   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3036 fi
3037 fi
3038 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3039 if test -n "$MAKE_UPPER_TAGS"; then
3040   echo "$as_me:3040: result: $MAKE_UPPER_TAGS" >&5
3041 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3042 else
3043   echo "$as_me:3043: result: no" >&5
3044 echo "${ECHO_T}no" >&6
3045 fi
3046
3047 else
3048         MAKE_UPPER_TAGS=no
3049 fi
3050
3051 if test "$MAKE_UPPER_TAGS" = yes ; then
3052         MAKE_UPPER_TAGS=
3053 else
3054         MAKE_UPPER_TAGS="#"
3055 fi
3056
3057 if test "$MAKE_LOWER_TAGS" = yes ; then
3058         MAKE_LOWER_TAGS=
3059 else
3060         MAKE_LOWER_TAGS="#"
3061 fi
3062
3063 echo "$as_me:3063: checking if -lm needed for math functions" >&5
3064 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3065 if test "${cf_cv_need_libm+set}" = set; then
3066   echo $ECHO_N "(cached) $ECHO_C" >&6
3067 else
3068
3069         cat >conftest.$ac_ext <<_ACEOF
3070 #line 3070 "configure"
3071 #include "confdefs.h"
3072
3073         #include <stdio.h>
3074         #include <stdlib.h>
3075         #include <math.h>
3076
3077 int
3078 main (void)
3079 {
3080 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3081   ;
3082   return 0;
3083 }
3084 _ACEOF
3085 rm -f conftest.$ac_objext conftest$ac_exeext
3086 if { (eval echo "$as_me:3086: \"$ac_link\"") >&5
3087   (eval $ac_link) 2>&5
3088   ac_status=$?
3089   echo "$as_me:3089: \$? = $ac_status" >&5
3090   (exit $ac_status); } &&
3091          { ac_try='test -s conftest$ac_exeext'
3092   { (eval echo "$as_me:3092: \"$ac_try\"") >&5
3093   (eval $ac_try) 2>&5
3094   ac_status=$?
3095   echo "$as_me:3095: \$? = $ac_status" >&5
3096   (exit $ac_status); }; }; then
3097   cf_cv_need_libm=no
3098 else
3099   echo "$as_me: failed program was:" >&5
3100 cat conftest.$ac_ext >&5
3101 cf_cv_need_libm=yes
3102 fi
3103 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3104 fi
3105 echo "$as_me:3105: result: $cf_cv_need_libm" >&5
3106 echo "${ECHO_T}$cf_cv_need_libm" >&6
3107 if test "$cf_cv_need_libm" = yes
3108 then
3109 MATH_LIB=-lm
3110 fi
3111
3112 top_builddir=`pwd`
3113
3114 CC_G_OPT="-g"
3115 CC_SHARED_OPTS=unknown
3116 CPPFLAGS="$CPPFLAGS"
3117 DFT_DEP_SUFFIX=""
3118 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3119 DFT_UPR_MODEL="NORMAL"
3120 LD="ld"
3121 LDFLAGS_SHARED=""
3122 LDFLAGS_STATIC=""
3123 LD_MODEL=""
3124 LD_SHARED_OPTS=""
3125 LIBTOOL=""
3126 LIBTOOL_OPTS=""
3127 LIB_CLEAN=""
3128 LIB_COMPILE=""
3129 LIB_LINK='${CC}'
3130 LINK_TESTS=""
3131 LOCAL_LDFLAGS=""
3132 PACKAGE="ncurses-examples"
3133 PTHREAD="-lm"
3134 TEST_ARGS=""
3135 TEST_DEPS=""
3136 TEST_LIBS=""
3137 TINFO_LDFLAGS=''
3138 TINFO_LIBS='$(LIBS_CURSES)'
3139 cf_cv_abi_version=""
3140 cf_cv_rel_version=""
3141 includesubdir=""
3142
3143 cf_cv_screen=curses
3144 cf_cv_libtype=
3145
3146 if ( test "$GCC" = yes || test "$GXX" = yes )
3147 then
3148 cat > conftest.i <<EOF
3149 #ifndef GCC_PRINTF
3150 #define GCC_PRINTF 0
3151 #endif
3152 #ifndef GCC_SCANF
3153 #define GCC_SCANF 0
3154 #endif
3155 #ifndef GCC_NORETURN
3156 #define GCC_NORETURN /* nothing */
3157 #endif
3158 #ifndef GCC_UNUSED
3159 #define GCC_UNUSED /* nothing */
3160 #endif
3161 EOF
3162 if test "$GCC" = yes
3163 then
3164         { echo "$as_me:3164: checking for $CC __attribute__ directives..." >&5
3165 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3166 cat > conftest.$ac_ext <<EOF
3167 #line 3167 "${as_me:-configure}"
3168 #include "confdefs.h"
3169 #include "conftest.h"
3170 #include "conftest.i"
3171 #if     GCC_PRINTF
3172 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3173 #else
3174 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3175 #endif
3176 #if     GCC_SCANF
3177 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3178 #else
3179 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3180 #endif
3181 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3182 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3183 extern void foo(void) GCC_NORETURN;
3184 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3185 EOF
3186         cf_printf_attribute=no
3187         cf_scanf_attribute=no
3188         for cf_attribute in scanf printf unused noreturn
3189         do
3190
3191 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3192
3193                 cf_directive="__attribute__(($cf_attribute))"
3194                 echo "checking for $CC $cf_directive" 1>&5
3195
3196                 case $cf_attribute in
3197                 (printf)
3198                         cf_printf_attribute=yes
3199                         cat >conftest.h <<EOF
3200 #define GCC_$cf_ATTRIBUTE 1
3201 EOF
3202                         ;;
3203                 (scanf)
3204                         cf_scanf_attribute=yes
3205                         cat >conftest.h <<EOF
3206 #define GCC_$cf_ATTRIBUTE 1
3207 EOF
3208                         ;;
3209                 (*)
3210                         cat >conftest.h <<EOF
3211 #define GCC_$cf_ATTRIBUTE $cf_directive
3212 EOF
3213                         ;;
3214                 esac
3215
3216                 if { (eval echo "$as_me:3216: \"$ac_compile\"") >&5
3217   (eval $ac_compile) 2>&5
3218   ac_status=$?
3219   echo "$as_me:3219: \$? = $ac_status" >&5
3220   (exit $ac_status); }; then
3221                         test -n "$verbose" && echo "$as_me:3221: result: ... $cf_attribute" >&5
3222 echo "${ECHO_T}... $cf_attribute" >&6
3223                         cat conftest.h >>confdefs.h
3224                         case $cf_attribute in
3225                         (noreturn)
3226
3227 cat >>confdefs.h <<EOF
3228 #define GCC_NORETURN $cf_directive
3229 EOF
3230
3231                                 ;;
3232                         (printf)
3233                                 cf_value='/* nothing */'
3234                                 if test "$cf_printf_attribute" != no ; then
3235                                         cf_value='__attribute__((format(printf,fmt,var)))'
3236
3237 cat >>confdefs.h <<\EOF
3238 #define GCC_PRINTF 1
3239 EOF
3240
3241                                 fi
3242
3243 cat >>confdefs.h <<EOF
3244 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3245 EOF
3246
3247                                 ;;
3248                         (scanf)
3249                                 cf_value='/* nothing */'
3250                                 if test "$cf_scanf_attribute" != no ; then
3251                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3252
3253 cat >>confdefs.h <<\EOF
3254 #define GCC_SCANF 1
3255 EOF
3256
3257                                 fi
3258
3259 cat >>confdefs.h <<EOF
3260 #define GCC_SCANFLIKE(fmt,var) $cf_value
3261 EOF
3262
3263                                 ;;
3264                         (unused)
3265
3266 cat >>confdefs.h <<EOF
3267 #define GCC_UNUSED $cf_directive
3268 EOF
3269
3270                                 ;;
3271                         esac
3272                 fi
3273         done
3274 else
3275         fgrep define conftest.i >>confdefs.h
3276 fi
3277 rm -rf conftest*
3278 fi
3279
3280 echo "$as_me:3280: checking if you want to work around bogus compiler/loader warnings" >&5
3281 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3282
3283 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3284 if test "${enable_string_hacks+set}" = set; then
3285   enableval="$enable_string_hacks"
3286   with_string_hacks=$enableval
3287 else
3288   with_string_hacks=no
3289 fi;
3290 echo "$as_me:3290: result: $with_string_hacks" >&5
3291 echo "${ECHO_T}$with_string_hacks" >&6
3292
3293 if test "x$with_string_hacks" = "xyes"; then
3294
3295 cat >>confdefs.h <<\EOF
3296 #define USE_STRING_HACKS 1
3297 EOF
3298
3299         { echo "$as_me:3299: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3300 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3301         echo "$as_me:3301: checking for strlcat" >&5
3302 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3303 if test "${ac_cv_func_strlcat+set}" = set; then
3304   echo $ECHO_N "(cached) $ECHO_C" >&6
3305 else
3306   cat >conftest.$ac_ext <<_ACEOF
3307 #line 3307 "configure"
3308 #include "confdefs.h"
3309 #define strlcat autoconf_temporary
3310 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3311 #undef strlcat
3312
3313 #ifdef __cplusplus
3314 extern "C"
3315 #endif
3316
3317 /* We use char because int might match the return type of a gcc2
3318    builtin and then its argument prototype would still apply.  */
3319 char strlcat (void);
3320
3321 int
3322 main (void)
3323 {
3324
3325 /* The GNU C library defines stubs for functions which it implements
3326     to always fail with ENOSYS.  Some functions are actually named
3327     something starting with __ and the normal name is an alias.  */
3328 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3329 #error found stub for strlcat
3330 #endif
3331
3332         return strlcat ();
3333   ;
3334   return 0;
3335 }
3336 _ACEOF
3337 rm -f conftest.$ac_objext conftest$ac_exeext
3338 if { (eval echo "$as_me:3338: \"$ac_link\"") >&5
3339   (eval $ac_link) 2>&5
3340   ac_status=$?
3341   echo "$as_me:3341: \$? = $ac_status" >&5
3342   (exit $ac_status); } &&
3343          { ac_try='test -s conftest$ac_exeext'
3344   { (eval echo "$as_me:3344: \"$ac_try\"") >&5
3345   (eval $ac_try) 2>&5
3346   ac_status=$?
3347   echo "$as_me:3347: \$? = $ac_status" >&5
3348   (exit $ac_status); }; }; then
3349   ac_cv_func_strlcat=yes
3350 else
3351   echo "$as_me: failed program was:" >&5
3352 cat conftest.$ac_ext >&5
3353 ac_cv_func_strlcat=no
3354 fi
3355 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3356 fi
3357 echo "$as_me:3357: result: $ac_cv_func_strlcat" >&5
3358 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3359 if test $ac_cv_func_strlcat = yes; then
3360
3361 cat >>confdefs.h <<\EOF
3362 #define HAVE_STRLCAT 1
3363 EOF
3364
3365 else
3366
3367                 echo "$as_me:3367: checking for strlcat in -lbsd" >&5
3368 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3369 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3370   echo $ECHO_N "(cached) $ECHO_C" >&6
3371 else
3372   ac_check_lib_save_LIBS=$LIBS
3373 LIBS="-lbsd  $LIBS"
3374 cat >conftest.$ac_ext <<_ACEOF
3375 #line 3375 "configure"
3376 #include "confdefs.h"
3377
3378 /* Override any gcc2 internal prototype to avoid an error.  */
3379 #ifdef __cplusplus
3380 extern "C"
3381 #endif
3382 /* We use char because int might match the return type of a gcc2
3383    builtin and then its argument prototype would still apply.  */
3384 char strlcat ();
3385 int
3386 main (void)
3387 {
3388 strlcat ();
3389   ;
3390   return 0;
3391 }
3392 _ACEOF
3393 rm -f conftest.$ac_objext conftest$ac_exeext
3394 if { (eval echo "$as_me:3394: \"$ac_link\"") >&5
3395   (eval $ac_link) 2>&5
3396   ac_status=$?
3397   echo "$as_me:3397: \$? = $ac_status" >&5
3398   (exit $ac_status); } &&
3399          { ac_try='test -s conftest$ac_exeext'
3400   { (eval echo "$as_me:3400: \"$ac_try\"") >&5
3401   (eval $ac_try) 2>&5
3402   ac_status=$?
3403   echo "$as_me:3403: \$? = $ac_status" >&5
3404   (exit $ac_status); }; }; then
3405   ac_cv_lib_bsd_strlcat=yes
3406 else
3407   echo "$as_me: failed program was:" >&5
3408 cat conftest.$ac_ext >&5
3409 ac_cv_lib_bsd_strlcat=no
3410 fi
3411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3412 LIBS=$ac_check_lib_save_LIBS
3413 fi
3414 echo "$as_me:3414: result: $ac_cv_lib_bsd_strlcat" >&5
3415 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3416 if test $ac_cv_lib_bsd_strlcat = yes; then
3417
3418 cf_add_libs="$LIBS"
3419 # reverse order
3420 cf_add_0lib=
3421 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3422 # filter duplicates
3423 for cf_add_1lib in $cf_add_0lib; do
3424         for cf_add_2lib in $cf_add_libs; do
3425                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3426                         cf_add_1lib=
3427                         break
3428                 fi
3429         done
3430         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3431 done
3432 LIBS="$cf_add_libs"
3433
3434 for ac_header in bsd/string.h
3435 do
3436 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3437 echo "$as_me:3437: checking for $ac_header" >&5
3438 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3439 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3440   echo $ECHO_N "(cached) $ECHO_C" >&6
3441 else
3442   cat >conftest.$ac_ext <<_ACEOF
3443 #line 3443 "configure"
3444 #include "confdefs.h"
3445 #include <$ac_header>
3446 _ACEOF
3447 if { (eval echo "$as_me:3447: \"$ac_cpp conftest.$ac_ext\"") >&5
3448   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3449   ac_status=$?
3450   egrep -v '^ *\+' conftest.er1 >conftest.err
3451   rm -f conftest.er1
3452   cat conftest.err >&5
3453   echo "$as_me:3453: \$? = $ac_status" >&5
3454   (exit $ac_status); } >/dev/null; then
3455   if test -s conftest.err; then
3456     ac_cpp_err=$ac_c_preproc_warn_flag
3457   else
3458     ac_cpp_err=
3459   fi
3460 else
3461   ac_cpp_err=yes
3462 fi
3463 if test -z "$ac_cpp_err"; then
3464   eval "$as_ac_Header=yes"
3465 else
3466   echo "$as_me: failed program was:" >&5
3467   cat conftest.$ac_ext >&5
3468   eval "$as_ac_Header=no"
3469 fi
3470 rm -f conftest.err conftest.$ac_ext
3471 fi
3472 echo "$as_me:3472: result: `eval echo '${'$as_ac_Header'}'`" >&5
3473 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3474 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3475   cat >>confdefs.h <<EOF
3476 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3477 EOF
3478
3479 fi
3480 done
3481
3482 cat >>confdefs.h <<\EOF
3483 #define HAVE_STRLCAT 1
3484 EOF
3485
3486 fi
3487
3488 fi
3489
3490 for ac_func in strlcpy snprintf
3491 do
3492 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3493 echo "$as_me:3493: checking for $ac_func" >&5
3494 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3495 if eval "test \"\${$as_ac_var+set}\" = set"; then
3496   echo $ECHO_N "(cached) $ECHO_C" >&6
3497 else
3498   cat >conftest.$ac_ext <<_ACEOF
3499 #line 3499 "configure"
3500 #include "confdefs.h"
3501 #define $ac_func autoconf_temporary
3502 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3503 #undef $ac_func
3504
3505 #ifdef __cplusplus
3506 extern "C"
3507 #endif
3508
3509 /* We use char because int might match the return type of a gcc2
3510    builtin and then its argument prototype would still apply.  */
3511 char $ac_func (void);
3512
3513 int
3514 main (void)
3515 {
3516
3517 /* The GNU C library defines stubs for functions which it implements
3518     to always fail with ENOSYS.  Some functions are actually named
3519     something starting with __ and the normal name is an alias.  */
3520 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3521 #error found stub for $ac_func
3522 #endif
3523
3524         return $ac_func ();
3525   ;
3526   return 0;
3527 }
3528 _ACEOF
3529 rm -f conftest.$ac_objext conftest$ac_exeext
3530 if { (eval echo "$as_me:3530: \"$ac_link\"") >&5
3531   (eval $ac_link) 2>&5
3532   ac_status=$?
3533   echo "$as_me:3533: \$? = $ac_status" >&5
3534   (exit $ac_status); } &&
3535          { ac_try='test -s conftest$ac_exeext'
3536   { (eval echo "$as_me:3536: \"$ac_try\"") >&5
3537   (eval $ac_try) 2>&5
3538   ac_status=$?
3539   echo "$as_me:3539: \$? = $ac_status" >&5
3540   (exit $ac_status); }; }; then
3541   eval "$as_ac_var=yes"
3542 else
3543   echo "$as_me: failed program was:" >&5
3544 cat conftest.$ac_ext >&5
3545 eval "$as_ac_var=no"
3546 fi
3547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3548 fi
3549 echo "$as_me:3549: result: `eval echo '${'$as_ac_var'}'`" >&5
3550 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3551 if test `eval echo '${'$as_ac_var'}'` = yes; then
3552   cat >>confdefs.h <<EOF
3553 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3554 EOF
3555
3556 fi
3557 done
3558
3559 fi
3560
3561 echo "$as_me:3561: checking if the POSIX test-macros are already defined" >&5
3562 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3563 if test "${cf_cv_posix_visible+set}" = set; then
3564   echo $ECHO_N "(cached) $ECHO_C" >&6
3565 else
3566
3567 cat >conftest.$ac_ext <<_ACEOF
3568 #line 3568 "configure"
3569 #include "confdefs.h"
3570 #include <stdio.h>
3571 int
3572 main (void)
3573 {
3574
3575 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3576         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3577         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3578         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3579 #error conflicting symbols found
3580 #endif
3581
3582   ;
3583   return 0;
3584 }
3585 _ACEOF
3586 rm -f conftest.$ac_objext
3587 if { (eval echo "$as_me:3587: \"$ac_compile\"") >&5
3588   (eval $ac_compile) 2>&5
3589   ac_status=$?
3590   echo "$as_me:3590: \$? = $ac_status" >&5
3591   (exit $ac_status); } &&
3592          { ac_try='test -s conftest.$ac_objext'
3593   { (eval echo "$as_me:3593: \"$ac_try\"") >&5
3594   (eval $ac_try) 2>&5
3595   ac_status=$?
3596   echo "$as_me:3596: \$? = $ac_status" >&5
3597   (exit $ac_status); }; }; then
3598   cf_cv_posix_visible=no
3599 else
3600   echo "$as_me: failed program was:" >&5
3601 cat conftest.$ac_ext >&5
3602 cf_cv_posix_visible=yes
3603 fi
3604 rm -f conftest.$ac_objext conftest.$ac_ext
3605
3606 fi
3607 echo "$as_me:3607: result: $cf_cv_posix_visible" >&5
3608 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3609
3610 if test "$cf_cv_posix_visible" = no; then
3611
3612 cf_XOPEN_SOURCE=600
3613 cf_POSIX_C_SOURCE=199506L
3614 cf_xopen_source=
3615
3616 case $host_os in
3617 (aix[4-7]*)
3618         cf_xopen_source="-D_ALL_SOURCE"
3619         ;;
3620 (msys)
3621         cf_XOPEN_SOURCE=600
3622         ;;
3623 (darwin[0-8].*)
3624         cf_xopen_source="-D_APPLE_C_SOURCE"
3625         ;;
3626 (darwin*)
3627         cf_xopen_source="-D_DARWIN_C_SOURCE"
3628         cf_XOPEN_SOURCE=
3629         ;;
3630 (freebsd*|dragonfly*|midnightbsd*)
3631         # 5.x headers associate
3632         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3633         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3634         cf_POSIX_C_SOURCE=200112L
3635         cf_XOPEN_SOURCE=600
3636         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3637         ;;
3638 (hpux11*)
3639         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3640         ;;
3641 (hpux*)
3642         cf_xopen_source="-D_HPUX_SOURCE"
3643         ;;
3644 (irix[56].*)
3645         cf_xopen_source="-D_SGI_SOURCE"
3646         cf_XOPEN_SOURCE=
3647         ;;
3648 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3649
3650 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3651
3652 echo "$as_me:3652: checking if this is the GNU C library" >&5
3653 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3654 if test "${cf_cv_gnu_library+set}" = set; then
3655   echo $ECHO_N "(cached) $ECHO_C" >&6
3656 else
3657
3658 cat >conftest.$ac_ext <<_ACEOF
3659 #line 3659 "configure"
3660 #include "confdefs.h"
3661 #include <sys/types.h>
3662 int
3663 main (void)
3664 {
3665
3666         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3667                 return 0;
3668         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3669                 return 0;
3670         #else
3671         #       error not GNU C library
3672         #endif
3673   ;
3674   return 0;
3675 }
3676 _ACEOF
3677 rm -f conftest.$ac_objext
3678 if { (eval echo "$as_me:3678: \"$ac_compile\"") >&5
3679   (eval $ac_compile) 2>&5
3680   ac_status=$?
3681   echo "$as_me:3681: \$? = $ac_status" >&5
3682   (exit $ac_status); } &&
3683          { ac_try='test -s conftest.$ac_objext'
3684   { (eval echo "$as_me:3684: \"$ac_try\"") >&5
3685   (eval $ac_try) 2>&5
3686   ac_status=$?
3687   echo "$as_me:3687: \$? = $ac_status" >&5
3688   (exit $ac_status); }; }; then
3689   cf_cv_gnu_library=yes
3690 else
3691   echo "$as_me: failed program was:" >&5
3692 cat conftest.$ac_ext >&5
3693 cf_cv_gnu_library=no
3694 fi
3695 rm -f conftest.$ac_objext conftest.$ac_ext
3696
3697 fi
3698 echo "$as_me:3698: result: $cf_cv_gnu_library" >&5
3699 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3700
3701 if test x$cf_cv_gnu_library = xyes; then
3702
3703         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3704         # was changed to help a little.  newlib incorporated the change about 4
3705         # years later.
3706         echo "$as_me:3706: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3707 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3708 if test "${cf_cv_gnu_library_219+set}" = set; then
3709   echo $ECHO_N "(cached) $ECHO_C" >&6
3710 else
3711
3712                 cf_save="$CPPFLAGS"
3713
3714         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3715         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3716
3717                 cat >conftest.$ac_ext <<_ACEOF
3718 #line 3718 "configure"
3719 #include "confdefs.h"
3720 #include <sys/types.h>
3721 int
3722 main (void)
3723 {
3724
3725                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3726                                 return 0;
3727                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3728                                 return 0;
3729                         #else
3730                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3731                         #endif
3732   ;
3733   return 0;
3734 }
3735 _ACEOF
3736 rm -f conftest.$ac_objext
3737 if { (eval echo "$as_me:3737: \"$ac_compile\"") >&5
3738   (eval $ac_compile) 2>&5
3739   ac_status=$?
3740   echo "$as_me:3740: \$? = $ac_status" >&5
3741   (exit $ac_status); } &&
3742          { ac_try='test -s conftest.$ac_objext'
3743   { (eval echo "$as_me:3743: \"$ac_try\"") >&5
3744   (eval $ac_try) 2>&5
3745   ac_status=$?
3746   echo "$as_me:3746: \$? = $ac_status" >&5
3747   (exit $ac_status); }; }; then
3748   cf_cv_gnu_library_219=yes
3749 else
3750   echo "$as_me: failed program was:" >&5
3751 cat conftest.$ac_ext >&5
3752 cf_cv_gnu_library_219=no
3753 fi
3754 rm -f conftest.$ac_objext conftest.$ac_ext
3755                 CPPFLAGS="$cf_save"
3756
3757 fi
3758 echo "$as_me:3758: result: $cf_cv_gnu_library_219" >&5
3759 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3760
3761         if test "x$cf_cv_gnu_library_219" = xyes; then
3762                 cf_save="$CPPFLAGS"
3763                 echo "$as_me:3763: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3764 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3765 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3766   echo $ECHO_N "(cached) $ECHO_C" >&6
3767 else
3768
3769 cf_fix_cppflags=no
3770 cf_new_cflags=
3771 cf_new_cppflags=
3772 cf_new_extra_cppflags=
3773
3774 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3775 do
3776 case $cf_fix_cppflags in
3777 (no)
3778         case $cf_add_cflags in
3779         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3780                 case $cf_add_cflags in
3781                 (-D*)
3782                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3783
3784                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3785                                 && test -z "${cf_tst_cflags}" \
3786                                 && cf_fix_cppflags=yes
3787
3788                         if test $cf_fix_cppflags = yes ; then
3789
3790         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3791         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3792
3793                                 continue
3794                         elif test "${cf_tst_cflags}" = "\"'" ; then
3795
3796         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3797         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3798
3799                                 continue
3800                         fi
3801                         ;;
3802                 esac
3803                 case "$CPPFLAGS" in
3804                 (*$cf_add_cflags)
3805                         ;;
3806                 (*)
3807                         case $cf_add_cflags in
3808                         (-D*)
3809                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3810
3811 CPPFLAGS=`echo "$CPPFLAGS" | \
3812         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3813                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3814
3815                                 ;;
3816                         esac
3817
3818         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3819         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3820
3821                         ;;
3822                 esac
3823                 ;;
3824         (*)
3825
3826         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3827         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3828
3829                 ;;
3830         esac
3831         ;;
3832 (yes)
3833
3834         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3835         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3836
3837         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3838
3839         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3840                 && test -z "${cf_tst_cflags}" \
3841                 && cf_fix_cppflags=no
3842         ;;
3843 esac
3844 done
3845
3846 if test -n "$cf_new_cflags" ; then
3847
3848         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3849         CFLAGS="${CFLAGS}$cf_new_cflags"
3850
3851 fi
3852
3853 if test -n "$cf_new_cppflags" ; then
3854
3855         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3856         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3857
3858 fi
3859
3860 if test -n "$cf_new_extra_cppflags" ; then
3861
3862         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3863         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3864
3865 fi
3866
3867                         cat >conftest.$ac_ext <<_ACEOF
3868 #line 3868 "configure"
3869 #include "confdefs.h"
3870
3871                                 #include <limits.h>
3872                                 #include <sys/types.h>
3873
3874 int
3875 main (void)
3876 {
3877
3878                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3879                                         return 0;
3880                                 #else
3881                                 #       error GNU C library is too old
3882                                 #endif
3883   ;
3884   return 0;
3885 }
3886 _ACEOF
3887 rm -f conftest.$ac_objext
3888 if { (eval echo "$as_me:3888: \"$ac_compile\"") >&5
3889   (eval $ac_compile) 2>&5
3890   ac_status=$?
3891   echo "$as_me:3891: \$? = $ac_status" >&5
3892   (exit $ac_status); } &&
3893          { ac_try='test -s conftest.$ac_objext'
3894   { (eval echo "$as_me:3894: \"$ac_try\"") >&5
3895   (eval $ac_try) 2>&5
3896   ac_status=$?
3897   echo "$as_me:3897: \$? = $ac_status" >&5
3898   (exit $ac_status); }; }; then
3899   cf_cv_gnu_dftsrc_219=yes
3900 else
3901   echo "$as_me: failed program was:" >&5
3902 cat conftest.$ac_ext >&5
3903 cf_cv_gnu_dftsrc_219=no
3904 fi
3905 rm -f conftest.$ac_objext conftest.$ac_ext
3906
3907 fi
3908 echo "$as_me:3908: result: $cf_cv_gnu_dftsrc_219" >&5
3909 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3910                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3911         else
3912                 cf_cv_gnu_dftsrc_219=maybe
3913         fi
3914
3915         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3916
3917                 echo "$as_me:3917: checking if we must define _GNU_SOURCE" >&5
3918 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3919 if test "${cf_cv_gnu_source+set}" = set; then
3920   echo $ECHO_N "(cached) $ECHO_C" >&6
3921 else
3922
3923                 cat >conftest.$ac_ext <<_ACEOF
3924 #line 3924 "configure"
3925 #include "confdefs.h"
3926 #include <sys/types.h>
3927 int
3928 main (void)
3929 {
3930
3931                         #ifndef _XOPEN_SOURCE
3932                         #error  expected _XOPEN_SOURCE to be defined
3933                         #endif
3934   ;
3935   return 0;
3936 }
3937 _ACEOF
3938 rm -f conftest.$ac_objext
3939 if { (eval echo "$as_me:3939: \"$ac_compile\"") >&5
3940   (eval $ac_compile) 2>&5
3941   ac_status=$?
3942   echo "$as_me:3942: \$? = $ac_status" >&5
3943   (exit $ac_status); } &&
3944          { ac_try='test -s conftest.$ac_objext'
3945   { (eval echo "$as_me:3945: \"$ac_try\"") >&5
3946   (eval $ac_try) 2>&5
3947   ac_status=$?
3948   echo "$as_me:3948: \$? = $ac_status" >&5
3949   (exit $ac_status); }; }; then
3950   cf_cv_gnu_source=no
3951 else
3952   echo "$as_me: failed program was:" >&5
3953 cat conftest.$ac_ext >&5
3954 cf_save="$CPPFLAGS"
3955
3956 cf_fix_cppflags=no
3957 cf_new_cflags=
3958 cf_new_cppflags=
3959 cf_new_extra_cppflags=
3960
3961 for cf_add_cflags in -D_GNU_SOURCE
3962 do
3963 case $cf_fix_cppflags in
3964 (no)
3965         case $cf_add_cflags in
3966         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3967                 case $cf_add_cflags in
3968                 (-D*)
3969                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3970
3971                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3972                                 && test -z "${cf_tst_cflags}" \
3973                                 && cf_fix_cppflags=yes
3974
3975                         if test $cf_fix_cppflags = yes ; then
3976
3977         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3978         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3979
3980                                 continue
3981                         elif test "${cf_tst_cflags}" = "\"'" ; then
3982
3983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3985
3986                                 continue
3987                         fi
3988                         ;;
3989                 esac
3990                 case "$CPPFLAGS" in
3991                 (*$cf_add_cflags)
3992                         ;;
3993                 (*)
3994                         case $cf_add_cflags in
3995                         (-D*)
3996                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3997
3998 CPPFLAGS=`echo "$CPPFLAGS" | \
3999         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4000                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4001
4002                                 ;;
4003                         esac
4004
4005         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4006         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4007
4008                         ;;
4009                 esac
4010                 ;;
4011         (*)
4012
4013         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4014         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4015
4016                 ;;
4017         esac
4018         ;;
4019 (yes)
4020
4021         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4022         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4023
4024         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4025
4026         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4027                 && test -z "${cf_tst_cflags}" \
4028                 && cf_fix_cppflags=no
4029         ;;
4030 esac
4031 done
4032
4033 if test -n "$cf_new_cflags" ; then
4034
4035         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4036         CFLAGS="${CFLAGS}$cf_new_cflags"
4037
4038 fi
4039
4040 if test -n "$cf_new_cppflags" ; then
4041
4042         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4043         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4044
4045 fi
4046
4047 if test -n "$cf_new_extra_cppflags" ; then
4048
4049         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4050         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4051
4052 fi
4053
4054                          cat >conftest.$ac_ext <<_ACEOF
4055 #line 4055 "configure"
4056 #include "confdefs.h"
4057 #include <sys/types.h>
4058 int
4059 main (void)
4060 {
4061
4062                                 #ifdef _XOPEN_SOURCE
4063                                 #error  expected _XOPEN_SOURCE to be undefined
4064                                 #endif
4065   ;
4066   return 0;
4067 }
4068 _ACEOF
4069 rm -f conftest.$ac_objext
4070 if { (eval echo "$as_me:4070: \"$ac_compile\"") >&5
4071   (eval $ac_compile) 2>&5
4072   ac_status=$?
4073   echo "$as_me:4073: \$? = $ac_status" >&5
4074   (exit $ac_status); } &&
4075          { ac_try='test -s conftest.$ac_objext'
4076   { (eval echo "$as_me:4076: \"$ac_try\"") >&5
4077   (eval $ac_try) 2>&5
4078   ac_status=$?
4079   echo "$as_me:4079: \$? = $ac_status" >&5
4080   (exit $ac_status); }; }; then
4081   cf_cv_gnu_source=no
4082 else
4083   echo "$as_me: failed program was:" >&5
4084 cat conftest.$ac_ext >&5
4085 cf_cv_gnu_source=yes
4086 fi
4087 rm -f conftest.$ac_objext conftest.$ac_ext
4088                         CPPFLAGS="$cf_save"
4089
4090 fi
4091 rm -f conftest.$ac_objext conftest.$ac_ext
4092
4093 fi
4094 echo "$as_me:4094: result: $cf_cv_gnu_source" >&5
4095 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4096
4097                 if test "$cf_cv_gnu_source" = yes
4098                 then
4099                 echo "$as_me:4099: checking if we should also define _DEFAULT_SOURCE" >&5
4100 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4101 if test "${cf_cv_default_source+set}" = set; then
4102   echo $ECHO_N "(cached) $ECHO_C" >&6
4103 else
4104
4105         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4106         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4107
4108                         cat >conftest.$ac_ext <<_ACEOF
4109 #line 4109 "configure"
4110 #include "confdefs.h"
4111 #include <sys/types.h>
4112 int
4113 main (void)
4114 {
4115
4116                                 #ifdef _DEFAULT_SOURCE
4117                                 #error  expected _DEFAULT_SOURCE to be undefined
4118                                 #endif
4119   ;
4120   return 0;
4121 }
4122 _ACEOF
4123 rm -f conftest.$ac_objext
4124 if { (eval echo "$as_me:4124: \"$ac_compile\"") >&5
4125   (eval $ac_compile) 2>&5
4126   ac_status=$?
4127   echo "$as_me:4127: \$? = $ac_status" >&5
4128   (exit $ac_status); } &&
4129          { ac_try='test -s conftest.$ac_objext'
4130   { (eval echo "$as_me:4130: \"$ac_try\"") >&5
4131   (eval $ac_try) 2>&5
4132   ac_status=$?
4133   echo "$as_me:4133: \$? = $ac_status" >&5
4134   (exit $ac_status); }; }; then
4135   cf_cv_default_source=no
4136 else
4137   echo "$as_me: failed program was:" >&5
4138 cat conftest.$ac_ext >&5
4139 cf_cv_default_source=yes
4140 fi
4141 rm -f conftest.$ac_objext conftest.$ac_ext
4142
4143 fi
4144 echo "$as_me:4144: result: $cf_cv_default_source" >&5
4145 echo "${ECHO_T}$cf_cv_default_source" >&6
4146                         if test "$cf_cv_default_source" = yes
4147                         then
4148
4149         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4150         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4151
4152                         fi
4153                 fi
4154         fi
4155
4156 fi
4157
4158         ;;
4159 (minix*)
4160         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4161         ;;
4162 (mirbsd*)
4163         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4164         cf_XOPEN_SOURCE=
4165
4166 if test "$cf_cv_posix_visible" = no; then
4167
4168 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4169
4170 cf_save_CFLAGS="$CFLAGS"
4171 cf_save_CPPFLAGS="$CPPFLAGS"
4172
4173 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4174         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4175                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4176
4177 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4178         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4179                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4180
4181 echo "$as_me:4181: checking if we should define _POSIX_C_SOURCE" >&5
4182 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4183 if test "${cf_cv_posix_c_source+set}" = set; then
4184   echo $ECHO_N "(cached) $ECHO_C" >&6
4185 else
4186
4187 echo "${as_me:-configure}:4187: testing if the symbol is already defined go no further ..." 1>&5
4188
4189         cat >conftest.$ac_ext <<_ACEOF
4190 #line 4190 "configure"
4191 #include "confdefs.h"
4192 #include <sys/types.h>
4193 int
4194 main (void)
4195 {
4196
4197 #ifndef _POSIX_C_SOURCE
4198 make an error
4199 #endif
4200   ;
4201   return 0;
4202 }
4203 _ACEOF
4204 rm -f conftest.$ac_objext
4205 if { (eval echo "$as_me:4205: \"$ac_compile\"") >&5
4206   (eval $ac_compile) 2>&5
4207   ac_status=$?
4208   echo "$as_me:4208: \$? = $ac_status" >&5
4209   (exit $ac_status); } &&
4210          { ac_try='test -s conftest.$ac_objext'
4211   { (eval echo "$as_me:4211: \"$ac_try\"") >&5
4212   (eval $ac_try) 2>&5
4213   ac_status=$?
4214   echo "$as_me:4214: \$? = $ac_status" >&5
4215   (exit $ac_status); }; }; then
4216   cf_cv_posix_c_source=no
4217 else
4218   echo "$as_me: failed program was:" >&5
4219 cat conftest.$ac_ext >&5
4220 cf_want_posix_source=no
4221          case .$cf_POSIX_C_SOURCE in
4222          (.[12]??*)
4223                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4224                 ;;
4225          (.2)
4226                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4227                 cf_want_posix_source=yes
4228                 ;;
4229          (.*)
4230                 cf_want_posix_source=yes
4231                 ;;
4232          esac
4233          if test "$cf_want_posix_source" = yes ; then
4234                 cat >conftest.$ac_ext <<_ACEOF
4235 #line 4235 "configure"
4236 #include "confdefs.h"
4237 #include <sys/types.h>
4238 int
4239 main (void)
4240 {
4241
4242 #ifdef _POSIX_SOURCE
4243 make an error
4244 #endif
4245   ;
4246   return 0;
4247 }
4248 _ACEOF
4249 rm -f conftest.$ac_objext
4250 if { (eval echo "$as_me:4250: \"$ac_compile\"") >&5
4251   (eval $ac_compile) 2>&5
4252   ac_status=$?
4253   echo "$as_me:4253: \$? = $ac_status" >&5
4254   (exit $ac_status); } &&
4255          { ac_try='test -s conftest.$ac_objext'
4256   { (eval echo "$as_me:4256: \"$ac_try\"") >&5
4257   (eval $ac_try) 2>&5
4258   ac_status=$?
4259   echo "$as_me:4259: \$? = $ac_status" >&5
4260   (exit $ac_status); }; }; then
4261   :
4262 else
4263   echo "$as_me: failed program was:" >&5
4264 cat conftest.$ac_ext >&5
4265 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4266 fi
4267 rm -f conftest.$ac_objext conftest.$ac_ext
4268          fi
4269
4270 echo "${as_me:-configure}:4270: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4271
4272          CFLAGS="$cf_trim_CFLAGS"
4273          CPPFLAGS="$cf_trim_CPPFLAGS"
4274
4275         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4276         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4277
4278 echo "${as_me:-configure}:4278: testing if the second compile does not leave our definition intact error ..." 1>&5
4279
4280          cat >conftest.$ac_ext <<_ACEOF
4281 #line 4281 "configure"
4282 #include "confdefs.h"
4283 #include <sys/types.h>
4284 int
4285 main (void)
4286 {
4287
4288 #ifndef _POSIX_C_SOURCE
4289 make an error
4290 #endif
4291   ;
4292   return 0;
4293 }
4294 _ACEOF
4295 rm -f conftest.$ac_objext
4296 if { (eval echo "$as_me:4296: \"$ac_compile\"") >&5
4297   (eval $ac_compile) 2>&5
4298   ac_status=$?
4299   echo "$as_me:4299: \$? = $ac_status" >&5
4300   (exit $ac_status); } &&
4301          { ac_try='test -s conftest.$ac_objext'
4302   { (eval echo "$as_me:4302: \"$ac_try\"") >&5
4303   (eval $ac_try) 2>&5
4304   ac_status=$?
4305   echo "$as_me:4305: \$? = $ac_status" >&5
4306   (exit $ac_status); }; }; then
4307   :
4308 else
4309   echo "$as_me: failed program was:" >&5
4310 cat conftest.$ac_ext >&5
4311 cf_cv_posix_c_source=no
4312 fi
4313 rm -f conftest.$ac_objext conftest.$ac_ext
4314          CFLAGS="$cf_save_CFLAGS"
4315          CPPFLAGS="$cf_save_CPPFLAGS"
4316
4317 fi
4318 rm -f conftest.$ac_objext conftest.$ac_ext
4319
4320 fi
4321 echo "$as_me:4321: result: $cf_cv_posix_c_source" >&5
4322 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4323
4324 if test "$cf_cv_posix_c_source" != no ; then
4325         CFLAGS="$cf_trim_CFLAGS"
4326         CPPFLAGS="$cf_trim_CPPFLAGS"
4327
4328 cf_fix_cppflags=no
4329 cf_new_cflags=
4330 cf_new_cppflags=
4331 cf_new_extra_cppflags=
4332
4333 for cf_add_cflags in $cf_cv_posix_c_source
4334 do
4335 case $cf_fix_cppflags in
4336 (no)
4337         case $cf_add_cflags in
4338         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4339                 case $cf_add_cflags in
4340                 (-D*)
4341                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4342
4343                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4344                                 && test -z "${cf_tst_cflags}" \
4345                                 && cf_fix_cppflags=yes
4346
4347                         if test $cf_fix_cppflags = yes ; then
4348
4349         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4350         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4351
4352                                 continue
4353                         elif test "${cf_tst_cflags}" = "\"'" ; then
4354
4355         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4356         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4357
4358                                 continue
4359                         fi
4360                         ;;
4361                 esac
4362                 case "$CPPFLAGS" in
4363                 (*$cf_add_cflags)
4364                         ;;
4365                 (*)
4366                         case $cf_add_cflags in
4367                         (-D*)
4368                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4369
4370 CPPFLAGS=`echo "$CPPFLAGS" | \
4371         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4372                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4373
4374                                 ;;
4375                         esac
4376
4377         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4378         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4379
4380                         ;;
4381                 esac
4382                 ;;
4383         (*)
4384
4385         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4386         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4387
4388                 ;;
4389         esac
4390         ;;
4391 (yes)
4392
4393         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4394         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4395
4396         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4397
4398         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4399                 && test -z "${cf_tst_cflags}" \
4400                 && cf_fix_cppflags=no
4401         ;;
4402 esac
4403 done
4404
4405 if test -n "$cf_new_cflags" ; then
4406
4407         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4408         CFLAGS="${CFLAGS}$cf_new_cflags"
4409
4410 fi
4411
4412 if test -n "$cf_new_cppflags" ; then
4413
4414         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4415         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4416
4417 fi
4418
4419 if test -n "$cf_new_extra_cppflags" ; then
4420
4421         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4422         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4423
4424 fi
4425
4426 fi
4427
4428 fi # cf_cv_posix_visible
4429
4430         ;;
4431 (netbsd*)
4432         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4433         ;;
4434 (openbsd[4-9]*)
4435         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4436         cf_xopen_source="-D_BSD_SOURCE"
4437         cf_XOPEN_SOURCE=600
4438         ;;
4439 (openbsd*)
4440         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4441         ;;
4442 (osf[45]*)
4443         cf_xopen_source="-D_OSF_SOURCE"
4444         ;;
4445 (nto-qnx*)
4446         cf_xopen_source="-D_QNX_SOURCE"
4447         ;;
4448 (sco*)
4449         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4450         ;;
4451 (solaris2.*)
4452         cf_xopen_source="-D__EXTENSIONS__"
4453         cf_cv_xopen_source=broken
4454         ;;
4455 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4456         cf_XOPEN_SOURCE=
4457         cf_POSIX_C_SOURCE=
4458         ;;
4459 (*)
4460
4461 echo "$as_me:4461: checking if we should define _XOPEN_SOURCE" >&5
4462 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4463 if test "${cf_cv_xopen_source+set}" = set; then
4464   echo $ECHO_N "(cached) $ECHO_C" >&6
4465 else
4466
4467         cat >conftest.$ac_ext <<_ACEOF
4468 #line 4468 "configure"
4469 #include "confdefs.h"
4470
4471 #include <stdlib.h>
4472 #include <string.h>
4473 #include <sys/types.h>
4474
4475 int
4476 main (void)
4477 {
4478
4479 #ifndef _XOPEN_SOURCE
4480 make an error
4481 #endif
4482   ;
4483   return 0;
4484 }
4485 _ACEOF
4486 rm -f conftest.$ac_objext
4487 if { (eval echo "$as_me:4487: \"$ac_compile\"") >&5
4488   (eval $ac_compile) 2>&5
4489   ac_status=$?
4490   echo "$as_me:4490: \$? = $ac_status" >&5
4491   (exit $ac_status); } &&
4492          { ac_try='test -s conftest.$ac_objext'
4493   { (eval echo "$as_me:4493: \"$ac_try\"") >&5
4494   (eval $ac_try) 2>&5
4495   ac_status=$?
4496   echo "$as_me:4496: \$? = $ac_status" >&5
4497   (exit $ac_status); }; }; then
4498   cf_cv_xopen_source=no
4499 else
4500   echo "$as_me: failed program was:" >&5
4501 cat conftest.$ac_ext >&5
4502 cf_save="$CPPFLAGS"
4503
4504         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4505         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4506
4507          cat >conftest.$ac_ext <<_ACEOF
4508 #line 4508 "configure"
4509 #include "confdefs.h"
4510
4511 #include <stdlib.h>
4512 #include <string.h>
4513 #include <sys/types.h>
4514
4515 int
4516 main (void)
4517 {
4518
4519 #ifdef _XOPEN_SOURCE
4520 make an error
4521 #endif
4522   ;
4523   return 0;
4524 }
4525 _ACEOF
4526 rm -f conftest.$ac_objext
4527 if { (eval echo "$as_me:4527: \"$ac_compile\"") >&5
4528   (eval $ac_compile) 2>&5
4529   ac_status=$?
4530   echo "$as_me:4530: \$? = $ac_status" >&5
4531   (exit $ac_status); } &&
4532          { ac_try='test -s conftest.$ac_objext'
4533   { (eval echo "$as_me:4533: \"$ac_try\"") >&5
4534   (eval $ac_try) 2>&5
4535   ac_status=$?
4536   echo "$as_me:4536: \$? = $ac_status" >&5
4537   (exit $ac_status); }; }; then
4538   cf_cv_xopen_source=no
4539 else
4540   echo "$as_me: failed program was:" >&5
4541 cat conftest.$ac_ext >&5
4542 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4543 fi
4544 rm -f conftest.$ac_objext conftest.$ac_ext
4545         CPPFLAGS="$cf_save"
4546
4547 fi
4548 rm -f conftest.$ac_objext conftest.$ac_ext
4549
4550 fi
4551 echo "$as_me:4551: result: $cf_cv_xopen_source" >&5
4552 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4553
4554 if test "$cf_cv_xopen_source" != no ; then
4555
4556 CFLAGS=`echo "$CFLAGS" | \
4557         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4558                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4559
4560 CPPFLAGS=`echo "$CPPFLAGS" | \
4561         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4562                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4563
4564         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4565
4566 cf_fix_cppflags=no
4567 cf_new_cflags=
4568 cf_new_cppflags=
4569 cf_new_extra_cppflags=
4570
4571 for cf_add_cflags in $cf_temp_xopen_source
4572 do
4573 case $cf_fix_cppflags in
4574 (no)
4575         case $cf_add_cflags in
4576         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4577                 case $cf_add_cflags in
4578                 (-D*)
4579                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4580
4581                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4582                                 && test -z "${cf_tst_cflags}" \
4583                                 && cf_fix_cppflags=yes
4584
4585                         if test $cf_fix_cppflags = yes ; then
4586
4587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4589
4590                                 continue
4591                         elif test "${cf_tst_cflags}" = "\"'" ; then
4592
4593         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4594         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4595
4596                                 continue
4597                         fi
4598                         ;;
4599                 esac
4600                 case "$CPPFLAGS" in
4601                 (*$cf_add_cflags)
4602                         ;;
4603                 (*)
4604                         case $cf_add_cflags in
4605                         (-D*)
4606                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4607
4608 CPPFLAGS=`echo "$CPPFLAGS" | \
4609         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4610                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4611
4612                                 ;;
4613                         esac
4614
4615         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4616         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4617
4618                         ;;
4619                 esac
4620                 ;;
4621         (*)
4622
4623         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4624         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4625
4626                 ;;
4627         esac
4628         ;;
4629 (yes)
4630
4631         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4632         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4633
4634         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4635
4636         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4637                 && test -z "${cf_tst_cflags}" \
4638                 && cf_fix_cppflags=no
4639         ;;
4640 esac
4641 done
4642
4643 if test -n "$cf_new_cflags" ; then
4644
4645         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4646         CFLAGS="${CFLAGS}$cf_new_cflags"
4647
4648 fi
4649
4650 if test -n "$cf_new_cppflags" ; then
4651
4652         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4653         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4654
4655 fi
4656
4657 if test -n "$cf_new_extra_cppflags" ; then
4658
4659         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4660         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4661
4662 fi
4663
4664 fi
4665
4666 if test "$cf_cv_posix_visible" = no; then
4667
4668 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4669
4670 cf_save_CFLAGS="$CFLAGS"
4671 cf_save_CPPFLAGS="$CPPFLAGS"
4672
4673 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4674         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4675                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4676
4677 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4678         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4679                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4680
4681 echo "$as_me:4681: checking if we should define _POSIX_C_SOURCE" >&5
4682 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4683 if test "${cf_cv_posix_c_source+set}" = set; then
4684   echo $ECHO_N "(cached) $ECHO_C" >&6
4685 else
4686
4687 echo "${as_me:-configure}:4687: testing if the symbol is already defined go no further ..." 1>&5
4688
4689         cat >conftest.$ac_ext <<_ACEOF
4690 #line 4690 "configure"
4691 #include "confdefs.h"
4692 #include <sys/types.h>
4693 int
4694 main (void)
4695 {
4696
4697 #ifndef _POSIX_C_SOURCE
4698 make an error
4699 #endif
4700   ;
4701   return 0;
4702 }
4703 _ACEOF
4704 rm -f conftest.$ac_objext
4705 if { (eval echo "$as_me:4705: \"$ac_compile\"") >&5
4706   (eval $ac_compile) 2>&5
4707   ac_status=$?
4708   echo "$as_me:4708: \$? = $ac_status" >&5
4709   (exit $ac_status); } &&
4710          { ac_try='test -s conftest.$ac_objext'
4711   { (eval echo "$as_me:4711: \"$ac_try\"") >&5
4712   (eval $ac_try) 2>&5
4713   ac_status=$?
4714   echo "$as_me:4714: \$? = $ac_status" >&5
4715   (exit $ac_status); }; }; then
4716   cf_cv_posix_c_source=no
4717 else
4718   echo "$as_me: failed program was:" >&5
4719 cat conftest.$ac_ext >&5
4720 cf_want_posix_source=no
4721          case .$cf_POSIX_C_SOURCE in
4722          (.[12]??*)
4723                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4724                 ;;
4725          (.2)
4726                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4727                 cf_want_posix_source=yes
4728                 ;;
4729          (.*)
4730                 cf_want_posix_source=yes
4731                 ;;
4732          esac
4733          if test "$cf_want_posix_source" = yes ; then
4734                 cat >conftest.$ac_ext <<_ACEOF
4735 #line 4735 "configure"
4736 #include "confdefs.h"
4737 #include <sys/types.h>
4738 int
4739 main (void)
4740 {
4741
4742 #ifdef _POSIX_SOURCE
4743 make an error
4744 #endif
4745   ;
4746   return 0;
4747 }
4748 _ACEOF
4749 rm -f conftest.$ac_objext
4750 if { (eval echo "$as_me:4750: \"$ac_compile\"") >&5
4751   (eval $ac_compile) 2>&5
4752   ac_status=$?
4753   echo "$as_me:4753: \$? = $ac_status" >&5
4754   (exit $ac_status); } &&
4755          { ac_try='test -s conftest.$ac_objext'
4756   { (eval echo "$as_me:4756: \"$ac_try\"") >&5
4757   (eval $ac_try) 2>&5
4758   ac_status=$?
4759   echo "$as_me:4759: \$? = $ac_status" >&5
4760   (exit $ac_status); }; }; then
4761   :
4762 else
4763   echo "$as_me: failed program was:" >&5
4764 cat conftest.$ac_ext >&5
4765 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4766 fi
4767 rm -f conftest.$ac_objext conftest.$ac_ext
4768          fi
4769
4770 echo "${as_me:-configure}:4770: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4771
4772          CFLAGS="$cf_trim_CFLAGS"
4773          CPPFLAGS="$cf_trim_CPPFLAGS"
4774
4775         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4776         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4777
4778 echo "${as_me:-configure}:4778: testing if the second compile does not leave our definition intact error ..." 1>&5
4779
4780          cat >conftest.$ac_ext <<_ACEOF
4781 #line 4781 "configure"
4782 #include "confdefs.h"
4783 #include <sys/types.h>
4784 int
4785 main (void)
4786 {
4787
4788 #ifndef _POSIX_C_SOURCE
4789 make an error
4790 #endif
4791   ;
4792   return 0;
4793 }
4794 _ACEOF
4795 rm -f conftest.$ac_objext
4796 if { (eval echo "$as_me:4796: \"$ac_compile\"") >&5
4797   (eval $ac_compile) 2>&5
4798   ac_status=$?
4799   echo "$as_me:4799: \$? = $ac_status" >&5
4800   (exit $ac_status); } &&
4801          { ac_try='test -s conftest.$ac_objext'
4802   { (eval echo "$as_me:4802: \"$ac_try\"") >&5
4803   (eval $ac_try) 2>&5
4804   ac_status=$?
4805   echo "$as_me:4805: \$? = $ac_status" >&5
4806   (exit $ac_status); }; }; then
4807   :
4808 else
4809   echo "$as_me: failed program was:" >&5
4810 cat conftest.$ac_ext >&5
4811 cf_cv_posix_c_source=no
4812 fi
4813 rm -f conftest.$ac_objext conftest.$ac_ext
4814          CFLAGS="$cf_save_CFLAGS"
4815          CPPFLAGS="$cf_save_CPPFLAGS"
4816
4817 fi
4818 rm -f conftest.$ac_objext conftest.$ac_ext
4819
4820 fi
4821 echo "$as_me:4821: result: $cf_cv_posix_c_source" >&5
4822 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4823
4824 if test "$cf_cv_posix_c_source" != no ; then
4825         CFLAGS="$cf_trim_CFLAGS"
4826         CPPFLAGS="$cf_trim_CPPFLAGS"
4827
4828 cf_fix_cppflags=no
4829 cf_new_cflags=
4830 cf_new_cppflags=
4831 cf_new_extra_cppflags=
4832
4833 for cf_add_cflags in $cf_cv_posix_c_source
4834 do
4835 case $cf_fix_cppflags in
4836 (no)
4837         case $cf_add_cflags in
4838         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4839                 case $cf_add_cflags in
4840                 (-D*)
4841                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4842
4843                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4844                                 && test -z "${cf_tst_cflags}" \
4845                                 && cf_fix_cppflags=yes
4846
4847                         if test $cf_fix_cppflags = yes ; then
4848
4849         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4850         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4851
4852                                 continue
4853                         elif test "${cf_tst_cflags}" = "\"'" ; then
4854
4855         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4856         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4857
4858                                 continue
4859                         fi
4860                         ;;
4861                 esac
4862                 case "$CPPFLAGS" in
4863                 (*$cf_add_cflags)
4864                         ;;
4865                 (*)
4866                         case $cf_add_cflags in
4867                         (-D*)
4868                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4869
4870 CPPFLAGS=`echo "$CPPFLAGS" | \
4871         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4872                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4873
4874                                 ;;
4875                         esac
4876
4877         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4878         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4879
4880                         ;;
4881                 esac
4882                 ;;
4883         (*)
4884
4885         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4886         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4887
4888                 ;;
4889         esac
4890         ;;
4891 (yes)
4892
4893         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4894         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4895
4896         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4897
4898         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4899                 && test -z "${cf_tst_cflags}" \
4900                 && cf_fix_cppflags=no
4901         ;;
4902 esac
4903 done
4904
4905 if test -n "$cf_new_cflags" ; then
4906
4907         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4908         CFLAGS="${CFLAGS}$cf_new_cflags"
4909
4910 fi
4911
4912 if test -n "$cf_new_cppflags" ; then
4913
4914         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4915         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4916
4917 fi
4918
4919 if test -n "$cf_new_extra_cppflags" ; then
4920
4921         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4922         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4923
4924 fi
4925
4926 fi
4927
4928 fi # cf_cv_posix_visible
4929
4930         ;;
4931 esac
4932
4933 if test -n "$cf_xopen_source" ; then
4934
4935 cf_fix_cppflags=no
4936 cf_new_cflags=
4937 cf_new_cppflags=
4938 cf_new_extra_cppflags=
4939
4940 for cf_add_cflags in $cf_xopen_source
4941 do
4942 case $cf_fix_cppflags in
4943 (no)
4944         case $cf_add_cflags in
4945         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4946                 case $cf_add_cflags in
4947                 (-D*)
4948                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4949
4950                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4951                                 && test -z "${cf_tst_cflags}" \
4952                                 && cf_fix_cppflags=yes
4953
4954                         if test $cf_fix_cppflags = yes ; then
4955
4956         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4957         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4958
4959                                 continue
4960                         elif test "${cf_tst_cflags}" = "\"'" ; then
4961
4962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4964
4965                                 continue
4966                         fi
4967                         ;;
4968                 esac
4969                 case "$CPPFLAGS" in
4970                 (*$cf_add_cflags)
4971                         ;;
4972                 (*)
4973                         case $cf_add_cflags in
4974                         (-D*)
4975                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4976
4977 CPPFLAGS=`echo "$CPPFLAGS" | \
4978         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4979                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4980
4981                                 ;;
4982                         esac
4983
4984         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4985         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4986
4987                         ;;
4988                 esac
4989                 ;;
4990         (*)
4991
4992         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4993         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4994
4995                 ;;
4996         esac
4997         ;;
4998 (yes)
4999
5000         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5001         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5002
5003         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5004
5005         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5006                 && test -z "${cf_tst_cflags}" \
5007                 && cf_fix_cppflags=no
5008         ;;
5009 esac
5010 done
5011
5012 if test -n "$cf_new_cflags" ; then
5013         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5014
5015 echo "${as_me:-configure}:5015: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5016
5017         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5018         CFLAGS="${CFLAGS}$cf_new_cflags"
5019
5020 fi
5021
5022 if test -n "$cf_new_cppflags" ; then
5023         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5024
5025 echo "${as_me:-configure}:5025: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5026
5027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5028         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5029
5030 fi
5031
5032 if test -n "$cf_new_extra_cppflags" ; then
5033         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5034
5035 echo "${as_me:-configure}:5035: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5036
5037         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5038         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5039
5040 fi
5041
5042 fi
5043
5044 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5045         echo "$as_me:5045: checking if _XOPEN_SOURCE really is set" >&5
5046 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5047         cat >conftest.$ac_ext <<_ACEOF
5048 #line 5048 "configure"
5049 #include "confdefs.h"
5050 #include <stdlib.h>
5051 int
5052 main (void)
5053 {
5054
5055 #ifndef _XOPEN_SOURCE
5056 make an error
5057 #endif
5058   ;
5059   return 0;
5060 }
5061 _ACEOF
5062 rm -f conftest.$ac_objext
5063 if { (eval echo "$as_me:5063: \"$ac_compile\"") >&5
5064   (eval $ac_compile) 2>&5
5065   ac_status=$?
5066   echo "$as_me:5066: \$? = $ac_status" >&5
5067   (exit $ac_status); } &&
5068          { ac_try='test -s conftest.$ac_objext'
5069   { (eval echo "$as_me:5069: \"$ac_try\"") >&5
5070   (eval $ac_try) 2>&5
5071   ac_status=$?
5072   echo "$as_me:5072: \$? = $ac_status" >&5
5073   (exit $ac_status); }; }; then
5074   cf_XOPEN_SOURCE_set=yes
5075 else
5076   echo "$as_me: failed program was:" >&5
5077 cat conftest.$ac_ext >&5
5078 cf_XOPEN_SOURCE_set=no
5079 fi
5080 rm -f conftest.$ac_objext conftest.$ac_ext
5081         echo "$as_me:5081: result: $cf_XOPEN_SOURCE_set" >&5
5082 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5083         if test $cf_XOPEN_SOURCE_set = yes
5084         then
5085                 cat >conftest.$ac_ext <<_ACEOF
5086 #line 5086 "configure"
5087 #include "confdefs.h"
5088 #include <stdlib.h>
5089 int
5090 main (void)
5091 {
5092
5093 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5094 make an error
5095 #endif
5096   ;
5097   return 0;
5098 }
5099 _ACEOF
5100 rm -f conftest.$ac_objext
5101 if { (eval echo "$as_me:5101: \"$ac_compile\"") >&5
5102   (eval $ac_compile) 2>&5
5103   ac_status=$?
5104   echo "$as_me:5104: \$? = $ac_status" >&5
5105   (exit $ac_status); } &&
5106          { ac_try='test -s conftest.$ac_objext'
5107   { (eval echo "$as_me:5107: \"$ac_try\"") >&5
5108   (eval $ac_try) 2>&5
5109   ac_status=$?
5110   echo "$as_me:5110: \$? = $ac_status" >&5
5111   (exit $ac_status); }; }; then
5112   cf_XOPEN_SOURCE_set_ok=yes
5113 else
5114   echo "$as_me: failed program was:" >&5
5115 cat conftest.$ac_ext >&5
5116 cf_XOPEN_SOURCE_set_ok=no
5117 fi
5118 rm -f conftest.$ac_objext conftest.$ac_ext
5119                 if test $cf_XOPEN_SOURCE_set_ok = no
5120                 then
5121                         { echo "$as_me:5121: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5122 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5123                 fi
5124         else
5125
5126 echo "$as_me:5126: checking if we should define _XOPEN_SOURCE" >&5
5127 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5128 if test "${cf_cv_xopen_source+set}" = set; then
5129   echo $ECHO_N "(cached) $ECHO_C" >&6
5130 else
5131
5132         cat >conftest.$ac_ext <<_ACEOF
5133 #line 5133 "configure"
5134 #include "confdefs.h"
5135
5136 #include <stdlib.h>
5137 #include <string.h>
5138 #include <sys/types.h>
5139
5140 int
5141 main (void)
5142 {
5143
5144 #ifndef _XOPEN_SOURCE
5145 make an error
5146 #endif
5147   ;
5148   return 0;
5149 }
5150 _ACEOF
5151 rm -f conftest.$ac_objext
5152 if { (eval echo "$as_me:5152: \"$ac_compile\"") >&5
5153   (eval $ac_compile) 2>&5
5154   ac_status=$?
5155   echo "$as_me:5155: \$? = $ac_status" >&5
5156   (exit $ac_status); } &&
5157          { ac_try='test -s conftest.$ac_objext'
5158   { (eval echo "$as_me:5158: \"$ac_try\"") >&5
5159   (eval $ac_try) 2>&5
5160   ac_status=$?
5161   echo "$as_me:5161: \$? = $ac_status" >&5
5162   (exit $ac_status); }; }; then
5163   cf_cv_xopen_source=no
5164 else
5165   echo "$as_me: failed program was:" >&5
5166 cat conftest.$ac_ext >&5
5167 cf_save="$CPPFLAGS"
5168
5169         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5170         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5171
5172          cat >conftest.$ac_ext <<_ACEOF
5173 #line 5173 "configure"
5174 #include "confdefs.h"
5175
5176 #include <stdlib.h>
5177 #include <string.h>
5178 #include <sys/types.h>
5179
5180 int
5181 main (void)
5182 {
5183
5184 #ifdef _XOPEN_SOURCE
5185 make an error
5186 #endif
5187   ;
5188   return 0;
5189 }
5190 _ACEOF
5191 rm -f conftest.$ac_objext
5192 if { (eval echo "$as_me:5192: \"$ac_compile\"") >&5
5193   (eval $ac_compile) 2>&5
5194   ac_status=$?
5195   echo "$as_me:5195: \$? = $ac_status" >&5
5196   (exit $ac_status); } &&
5197          { ac_try='test -s conftest.$ac_objext'
5198   { (eval echo "$as_me:5198: \"$ac_try\"") >&5
5199   (eval $ac_try) 2>&5
5200   ac_status=$?
5201   echo "$as_me:5201: \$? = $ac_status" >&5
5202   (exit $ac_status); }; }; then
5203   cf_cv_xopen_source=no
5204 else
5205   echo "$as_me: failed program was:" >&5
5206 cat conftest.$ac_ext >&5
5207 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5208 fi
5209 rm -f conftest.$ac_objext conftest.$ac_ext
5210         CPPFLAGS="$cf_save"
5211
5212 fi
5213 rm -f conftest.$ac_objext conftest.$ac_ext
5214
5215 fi
5216 echo "$as_me:5216: result: $cf_cv_xopen_source" >&5
5217 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5218
5219 if test "$cf_cv_xopen_source" != no ; then
5220
5221 CFLAGS=`echo "$CFLAGS" | \
5222         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5223                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5224
5225 CPPFLAGS=`echo "$CPPFLAGS" | \
5226         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5227                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5228
5229         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5230
5231 cf_fix_cppflags=no
5232 cf_new_cflags=
5233 cf_new_cppflags=
5234 cf_new_extra_cppflags=
5235
5236 for cf_add_cflags in $cf_temp_xopen_source
5237 do
5238 case $cf_fix_cppflags in
5239 (no)
5240         case $cf_add_cflags in
5241         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5242                 case $cf_add_cflags in
5243                 (-D*)
5244                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5245
5246                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5247                                 && test -z "${cf_tst_cflags}" \
5248                                 && cf_fix_cppflags=yes
5249
5250                         if test $cf_fix_cppflags = yes ; then
5251
5252         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5253         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5254
5255                                 continue
5256                         elif test "${cf_tst_cflags}" = "\"'" ; then
5257
5258         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5259         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5260
5261                                 continue
5262                         fi
5263                         ;;
5264                 esac
5265                 case "$CPPFLAGS" in
5266                 (*$cf_add_cflags)
5267                         ;;
5268                 (*)
5269                         case $cf_add_cflags in
5270                         (-D*)
5271                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5272
5273 CPPFLAGS=`echo "$CPPFLAGS" | \
5274         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5275                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5276
5277                                 ;;
5278                         esac
5279
5280         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5281         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5282
5283                         ;;
5284                 esac
5285                 ;;
5286         (*)
5287
5288         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5289         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5290
5291                 ;;
5292         esac
5293         ;;
5294 (yes)
5295
5296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5298
5299         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5300
5301         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5302                 && test -z "${cf_tst_cflags}" \
5303                 && cf_fix_cppflags=no
5304         ;;
5305 esac
5306 done
5307
5308 if test -n "$cf_new_cflags" ; then
5309
5310         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5311         CFLAGS="${CFLAGS}$cf_new_cflags"
5312
5313 fi
5314
5315 if test -n "$cf_new_cppflags" ; then
5316
5317         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5318         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5319
5320 fi
5321
5322 if test -n "$cf_new_extra_cppflags" ; then
5323
5324         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5325         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5326
5327 fi
5328
5329 fi
5330
5331         fi
5332 fi
5333 fi # cf_cv_posix_visible
5334
5335 echo "$as_me:5335: checking for signal global datatype" >&5
5336 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5337 if test "${cf_cv_sig_atomic_t+set}" = set; then
5338   echo $ECHO_N "(cached) $ECHO_C" >&6
5339 else
5340
5341         for cf_type in \
5342                 "volatile sig_atomic_t" \
5343                 "sig_atomic_t" \
5344                 "int"
5345         do
5346         cat >conftest.$ac_ext <<_ACEOF
5347 #line 5347 "configure"
5348 #include "confdefs.h"
5349
5350 #include <sys/types.h>
5351 #include <signal.h>
5352 #include <stdio.h>
5353
5354 extern $cf_type x;
5355 $cf_type x;
5356 static void handler(int sig)
5357 {
5358         (void)sig;
5359         x = 5;
5360 }
5361 int
5362 main (void)
5363 {
5364 signal(SIGINT, handler);
5365                  x = 1
5366   ;
5367   return 0;
5368 }
5369 _ACEOF
5370 rm -f conftest.$ac_objext
5371 if { (eval echo "$as_me:5371: \"$ac_compile\"") >&5
5372   (eval $ac_compile) 2>&5
5373   ac_status=$?
5374   echo "$as_me:5374: \$? = $ac_status" >&5
5375   (exit $ac_status); } &&
5376          { ac_try='test -s conftest.$ac_objext'
5377   { (eval echo "$as_me:5377: \"$ac_try\"") >&5
5378   (eval $ac_try) 2>&5
5379   ac_status=$?
5380   echo "$as_me:5380: \$? = $ac_status" >&5
5381   (exit $ac_status); }; }; then
5382   cf_cv_sig_atomic_t=$cf_type
5383 else
5384   echo "$as_me: failed program was:" >&5
5385 cat conftest.$ac_ext >&5
5386 cf_cv_sig_atomic_t=no
5387 fi
5388 rm -f conftest.$ac_objext conftest.$ac_ext
5389                 test "$cf_cv_sig_atomic_t" != no && break
5390         done
5391
5392 fi
5393
5394 echo "$as_me:5394: result: $cf_cv_sig_atomic_t" >&5
5395 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5396 test "$cf_cv_sig_atomic_t" != no &&
5397 cat >>confdefs.h <<EOF
5398 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5399 EOF
5400
5401 # Work around breakage on OS X
5402
5403 echo "$as_me:5403: checking if SIGWINCH is defined" >&5
5404 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5405 if test "${cf_cv_define_sigwinch+set}" = set; then
5406   echo $ECHO_N "(cached) $ECHO_C" >&6
5407 else
5408
5409         cat >conftest.$ac_ext <<_ACEOF
5410 #line 5410 "configure"
5411 #include "confdefs.h"
5412
5413 #include <sys/types.h>
5414 #include <sys/signal.h>
5415
5416 int
5417 main (void)
5418 {
5419 int x = SIGWINCH; (void)x
5420   ;
5421   return 0;
5422 }
5423 _ACEOF
5424 rm -f conftest.$ac_objext
5425 if { (eval echo "$as_me:5425: \"$ac_compile\"") >&5
5426   (eval $ac_compile) 2>&5
5427   ac_status=$?
5428   echo "$as_me:5428: \$? = $ac_status" >&5
5429   (exit $ac_status); } &&
5430          { ac_try='test -s conftest.$ac_objext'
5431   { (eval echo "$as_me:5431: \"$ac_try\"") >&5
5432   (eval $ac_try) 2>&5
5433   ac_status=$?
5434   echo "$as_me:5434: \$? = $ac_status" >&5
5435   (exit $ac_status); }; }; then
5436   cf_cv_define_sigwinch=yes
5437 else
5438   echo "$as_me: failed program was:" >&5
5439 cat conftest.$ac_ext >&5
5440 cat >conftest.$ac_ext <<_ACEOF
5441 #line 5441 "configure"
5442 #include "confdefs.h"
5443
5444 #undef _XOPEN_SOURCE
5445 #undef _POSIX_SOURCE
5446 #undef _POSIX_C_SOURCE
5447 #include <sys/types.h>
5448 #include <sys/signal.h>
5449
5450 int
5451 main (void)
5452 {
5453 int x = SIGWINCH; (void)x
5454   ;
5455   return 0;
5456 }
5457 _ACEOF
5458 rm -f conftest.$ac_objext
5459 if { (eval echo "$as_me:5459: \"$ac_compile\"") >&5
5460   (eval $ac_compile) 2>&5
5461   ac_status=$?
5462   echo "$as_me:5462: \$? = $ac_status" >&5
5463   (exit $ac_status); } &&
5464          { ac_try='test -s conftest.$ac_objext'
5465   { (eval echo "$as_me:5465: \"$ac_try\"") >&5
5466   (eval $ac_try) 2>&5
5467   ac_status=$?
5468   echo "$as_me:5468: \$? = $ac_status" >&5
5469   (exit $ac_status); }; }; then
5470   cf_cv_define_sigwinch=maybe
5471 else
5472   echo "$as_me: failed program was:" >&5
5473 cat conftest.$ac_ext >&5
5474 cf_cv_define_sigwinch=no
5475 fi
5476 rm -f conftest.$ac_objext conftest.$ac_ext
5477
5478 fi
5479 rm -f conftest.$ac_objext conftest.$ac_ext
5480
5481 fi
5482 echo "$as_me:5482: result: $cf_cv_define_sigwinch" >&5
5483 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5484
5485 if test "$cf_cv_define_sigwinch" = maybe ; then
5486 echo "$as_me:5486: checking for actual SIGWINCH definition" >&5
5487 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5488 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5489   echo $ECHO_N "(cached) $ECHO_C" >&6
5490 else
5491
5492 cf_cv_fixup_sigwinch=unknown
5493 cf_sigwinch=32
5494 while test $cf_sigwinch != 1
5495 do
5496         cat >conftest.$ac_ext <<_ACEOF
5497 #line 5497 "configure"
5498 #include "confdefs.h"
5499
5500 #undef _XOPEN_SOURCE
5501 #undef _POSIX_SOURCE
5502 #undef _POSIX_C_SOURCE
5503 #include <sys/types.h>
5504 #include <sys/signal.h>
5505
5506 int
5507 main (void)
5508 {
5509
5510 #if SIGWINCH != $cf_sigwinch
5511 make an error
5512 #endif
5513 int x = SIGWINCH; (void)x
5514   ;
5515   return 0;
5516 }
5517 _ACEOF
5518 rm -f conftest.$ac_objext
5519 if { (eval echo "$as_me:5519: \"$ac_compile\"") >&5
5520   (eval $ac_compile) 2>&5
5521   ac_status=$?
5522   echo "$as_me:5522: \$? = $ac_status" >&5
5523   (exit $ac_status); } &&
5524          { ac_try='test -s conftest.$ac_objext'
5525   { (eval echo "$as_me:5525: \"$ac_try\"") >&5
5526   (eval $ac_try) 2>&5
5527   ac_status=$?
5528   echo "$as_me:5528: \$? = $ac_status" >&5
5529   (exit $ac_status); }; }; then
5530   cf_cv_fixup_sigwinch=$cf_sigwinch
5531          break
5532 else
5533   echo "$as_me: failed program was:" >&5
5534 cat conftest.$ac_ext >&5
5535 fi
5536 rm -f conftest.$ac_objext conftest.$ac_ext
5537
5538 cf_sigwinch=`expr $cf_sigwinch - 1`
5539 done
5540
5541 fi
5542 echo "$as_me:5542: result: $cf_cv_fixup_sigwinch" >&5
5543 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5544
5545         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5546                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5547         fi
5548 fi
5549
5550 # Checks for CODESET support.
5551
5552 echo "$as_me:5552: checking for nl_langinfo and CODESET" >&5
5553 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5554 if test "${am_cv_langinfo_codeset+set}" = set; then
5555   echo $ECHO_N "(cached) $ECHO_C" >&6
5556 else
5557   cat >conftest.$ac_ext <<_ACEOF
5558 #line 5558 "configure"
5559 #include "confdefs.h"
5560 #include <langinfo.h>
5561 int
5562 main (void)
5563 {
5564 char* cs = nl_langinfo(CODESET); (void)cs
5565   ;
5566   return 0;
5567 }
5568 _ACEOF
5569 rm -f conftest.$ac_objext conftest$ac_exeext
5570 if { (eval echo "$as_me:5570: \"$ac_link\"") >&5
5571   (eval $ac_link) 2>&5
5572   ac_status=$?
5573   echo "$as_me:5573: \$? = $ac_status" >&5
5574   (exit $ac_status); } &&
5575          { ac_try='test -s conftest$ac_exeext'
5576   { (eval echo "$as_me:5576: \"$ac_try\"") >&5
5577   (eval $ac_try) 2>&5
5578   ac_status=$?
5579   echo "$as_me:5579: \$? = $ac_status" >&5
5580   (exit $ac_status); }; }; then
5581   am_cv_langinfo_codeset=yes
5582 else
5583   echo "$as_me: failed program was:" >&5
5584 cat conftest.$ac_ext >&5
5585 am_cv_langinfo_codeset=no
5586 fi
5587 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5588
5589 fi
5590 echo "$as_me:5590: result: $am_cv_langinfo_codeset" >&5
5591 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5592         if test $am_cv_langinfo_codeset = yes; then
5593
5594 cat >>confdefs.h <<\EOF
5595 #define HAVE_LANGINFO_CODESET 1
5596 EOF
5597
5598         fi
5599
5600 echo "$as_me:5600: checking if you want to use pkg-config" >&5
5601 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5602
5603 # Check whether --with-pkg-config or --without-pkg-config was given.
5604 if test "${with_pkg_config+set}" = set; then
5605   withval="$with_pkg_config"
5606   cf_pkg_config=$withval
5607 else
5608   cf_pkg_config=yes
5609 fi;
5610 echo "$as_me:5610: result: $cf_pkg_config" >&5
5611 echo "${ECHO_T}$cf_pkg_config" >&6
5612
5613 case $cf_pkg_config in
5614 (no)
5615         PKG_CONFIG=none
5616         ;;
5617 (yes)
5618
5619 if test -n "$ac_tool_prefix"; then
5620   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5621 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5622 echo "$as_me:5622: checking for $ac_word" >&5
5623 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5624 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5625   echo $ECHO_N "(cached) $ECHO_C" >&6
5626 else
5627   case $PKG_CONFIG in
5628   [\\/]* | ?:[\\/]*)
5629   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5630   ;;
5631   *)
5632   ac_save_IFS=$IFS; IFS=$ac_path_separator
5633 ac_dummy="$PATH"
5634 for ac_dir in $ac_dummy; do
5635   IFS=$ac_save_IFS
5636   test -z "$ac_dir" && ac_dir=.
5637   if $as_executable_p "$ac_dir/$ac_word"; then
5638    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5639    echo "$as_me:5639: found $ac_dir/$ac_word" >&5
5640    break
5641 fi
5642 done
5643
5644   ;;
5645 esac
5646 fi
5647 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5648
5649 if test -n "$PKG_CONFIG"; then
5650   echo "$as_me:5650: result: $PKG_CONFIG" >&5
5651 echo "${ECHO_T}$PKG_CONFIG" >&6
5652 else
5653   echo "$as_me:5653: result: no" >&5
5654 echo "${ECHO_T}no" >&6
5655 fi
5656
5657 fi
5658 if test -z "$ac_cv_path_PKG_CONFIG"; then
5659   ac_pt_PKG_CONFIG=$PKG_CONFIG
5660   # Extract the first word of "pkg-config", so it can be a program name with args.
5661 set dummy pkg-config; ac_word=$2
5662 echo "$as_me:5662: checking for $ac_word" >&5
5663 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5664 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5665   echo $ECHO_N "(cached) $ECHO_C" >&6
5666 else
5667   case $ac_pt_PKG_CONFIG in
5668   [\\/]* | ?:[\\/]*)
5669   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5670   ;;
5671   *)
5672   ac_save_IFS=$IFS; IFS=$ac_path_separator
5673 ac_dummy="$PATH"
5674 for ac_dir in $ac_dummy; do
5675   IFS=$ac_save_IFS
5676   test -z "$ac_dir" && ac_dir=.
5677   if $as_executable_p "$ac_dir/$ac_word"; then
5678    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5679    echo "$as_me:5679: found $ac_dir/$ac_word" >&5
5680    break
5681 fi
5682 done
5683
5684   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5685   ;;
5686 esac
5687 fi
5688 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5689
5690 if test -n "$ac_pt_PKG_CONFIG"; then
5691   echo "$as_me:5691: result: $ac_pt_PKG_CONFIG" >&5
5692 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5693 else
5694   echo "$as_me:5694: result: no" >&5
5695 echo "${ECHO_T}no" >&6
5696 fi
5697
5698   PKG_CONFIG=$ac_pt_PKG_CONFIG
5699 else
5700   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5701 fi
5702
5703         ;;
5704 (*)
5705         PKG_CONFIG=$withval
5706         ;;
5707 esac
5708
5709 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5710 if test "$PKG_CONFIG" != none ; then
5711
5712 if test "x$prefix" != xNONE; then
5713         cf_path_syntax="$prefix"
5714 else
5715         cf_path_syntax="$ac_default_prefix"
5716 fi
5717
5718 case ".$PKG_CONFIG" in
5719 (.\$\(*\)*|.\'*\'*)
5720         ;;
5721 (..|./*|.\\*)
5722         ;;
5723 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5724         ;;
5725 (.\${*prefix}*|.\${*dir}*)
5726         eval PKG_CONFIG="$PKG_CONFIG"
5727         case ".$PKG_CONFIG" in
5728         (.NONE/*)
5729                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5730                 ;;
5731         esac
5732         ;;
5733 (.no|.NONE/*)
5734         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5735         ;;
5736 (*)
5737         { { echo "$as_me:5737: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5738 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5739    { (exit 1); exit 1; }; }
5740         ;;
5741 esac
5742
5743 elif test "x$cf_pkg_config" != xno ; then
5744         { echo "$as_me:5744: WARNING: pkg-config is not installed" >&5
5745 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5746 fi
5747
5748 echo "$as_me:5748: checking if you want to see long compiling messages" >&5
5749 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5750
5751 # Check whether --enable-echo or --disable-echo was given.
5752 if test "${enable_echo+set}" = set; then
5753   enableval="$enable_echo"
5754   test "$enableval" != no && enableval=yes
5755         if test "$enableval" != "yes" ; then
5756
5757         ECHO_LT='--silent'
5758         ECHO_LD='@echo linking $@;'
5759         RULE_CC='@echo compiling $<'
5760         SHOW_CC='@echo compiling $@'
5761         ECHO_CC='@'
5762
5763         else
5764
5765         ECHO_LT=''
5766         ECHO_LD=''
5767         RULE_CC=''
5768         SHOW_CC=''
5769         ECHO_CC=''
5770
5771         fi
5772 else
5773   enableval=yes
5774
5775         ECHO_LT=''
5776         ECHO_LD=''
5777         RULE_CC=''
5778         SHOW_CC=''
5779         ECHO_CC=''
5780
5781 fi;
5782 echo "$as_me:5782: result: $enableval" >&5
5783 echo "${ECHO_T}$enableval" >&6
5784
5785 echo "$as_me:5785: checking for ncurses wrap-prefix" >&5
5786 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5787
5788 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5789 if test "${with_ncurses_wrap_prefix+set}" = set; then
5790   withval="$with_ncurses_wrap_prefix"
5791   NCURSES_WRAP_PREFIX=$withval
5792 else
5793   NCURSES_WRAP_PREFIX=_nc_
5794 fi;
5795 echo "$as_me:5795: result: $NCURSES_WRAP_PREFIX" >&5
5796 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5797
5798 echo "$as_me:5798: checking if you want to check for wide-character functions" >&5
5799 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5800
5801 # Check whether --enable-widec or --disable-widec was given.
5802 if test "${enable_widec+set}" = set; then
5803   enableval="$enable_widec"
5804   test "$enableval" != no && enableval=yes
5805         if test "$enableval" != "yes" ; then
5806     cf_enable_widec=no
5807         else
5808                 cf_enable_widec=yes
5809         fi
5810 else
5811   enableval=yes
5812         cf_enable_widec=yes
5813
5814 fi;
5815 echo "$as_me:5815: result: $cf_enable_widec" >&5
5816 echo "${ECHO_T}$cf_enable_widec" >&6
5817
5818 echo "$as_me:5818: checking for specific curses-directory" >&5
5819 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5820
5821 # Check whether --with-curses-dir or --without-curses-dir was given.
5822 if test "${with_curses_dir+set}" = set; then
5823   withval="$with_curses_dir"
5824   cf_cv_curses_dir=$withval
5825 else
5826   cf_cv_curses_dir=no
5827 fi;
5828 echo "$as_me:5828: result: $cf_cv_curses_dir" >&5
5829 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5830
5831 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5832 then
5833
5834 if test "x$prefix" != xNONE; then
5835         cf_path_syntax="$prefix"
5836 else
5837         cf_path_syntax="$ac_default_prefix"
5838 fi
5839
5840 case ".$withval" in
5841 (.\$\(*\)*|.\'*\'*)
5842         ;;
5843 (..|./*|.\\*)
5844         ;;
5845 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5846         ;;
5847 (.\${*prefix}*|.\${*dir}*)
5848         eval withval="$withval"
5849         case ".$withval" in
5850         (.NONE/*)
5851                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5852                 ;;
5853         esac
5854         ;;
5855 (.no|.NONE/*)
5856         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5857         ;;
5858 (*)
5859         { { echo "$as_me:5859: error: expected a pathname, not \"$withval\"" >&5
5860 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5861    { (exit 1); exit 1; }; }
5862         ;;
5863 esac
5864
5865         if test -d "$cf_cv_curses_dir"
5866         then
5867
5868 if test -n "$cf_cv_curses_dir/include" ; then
5869   for cf_add_incdir in $cf_cv_curses_dir/include
5870   do
5871         while test $cf_add_incdir != /usr/include
5872         do
5873           if test -d $cf_add_incdir
5874           then
5875                 cf_have_incdir=no
5876                 if test -n "$CFLAGS$CPPFLAGS" ; then
5877                   # a loop is needed to ensure we can add subdirs of existing dirs
5878                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5879                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5880                           cf_have_incdir=yes; break
5881                         fi
5882                   done
5883                 fi
5884
5885                 if test "$cf_have_incdir" = no ; then
5886                   if test "$cf_add_incdir" = /usr/local/include ; then
5887                         if test "$GCC" = yes
5888                         then
5889                           cf_save_CPPFLAGS=$CPPFLAGS
5890
5891         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5892         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5893
5894                           cat >conftest.$ac_ext <<_ACEOF
5895 #line 5895 "configure"
5896 #include "confdefs.h"
5897 #include <stdio.h>
5898 int
5899 main (void)
5900 {
5901 printf("Hello")
5902   ;
5903   return 0;
5904 }
5905 _ACEOF
5906 rm -f conftest.$ac_objext
5907 if { (eval echo "$as_me:5907: \"$ac_compile\"") >&5
5908   (eval $ac_compile) 2>&5
5909   ac_status=$?
5910   echo "$as_me:5910: \$? = $ac_status" >&5
5911   (exit $ac_status); } &&
5912          { ac_try='test -s conftest.$ac_objext'
5913   { (eval echo "$as_me:5913: \"$ac_try\"") >&5
5914   (eval $ac_try) 2>&5
5915   ac_status=$?
5916   echo "$as_me:5916: \$? = $ac_status" >&5
5917   (exit $ac_status); }; }; then
5918   :
5919 else
5920   echo "$as_me: failed program was:" >&5
5921 cat conftest.$ac_ext >&5
5922 cf_have_incdir=yes
5923 fi
5924 rm -f conftest.$ac_objext conftest.$ac_ext
5925                           CPPFLAGS=$cf_save_CPPFLAGS
5926                         fi
5927                   fi
5928                 fi
5929
5930                 if test "$cf_have_incdir" = no ; then
5931                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5932
5933 echo "${as_me:-configure}:5933: testing adding $cf_add_incdir to include-path ..." 1>&5
5934
5935                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5936
5937                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5938                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5939                   cf_add_incdir="$cf_top_incdir"
5940                 else
5941                   break
5942                 fi
5943           else
5944                 break
5945           fi
5946         done
5947   done
5948 fi
5949
5950 if test -n "$cf_cv_curses_dir/lib" ; then
5951         for cf_add_libdir in $cf_cv_curses_dir/lib
5952         do
5953                 if test $cf_add_libdir = /usr/lib ; then
5954                         :
5955                 elif test -d $cf_add_libdir
5956                 then
5957                         cf_have_libdir=no
5958                         if test -n "$LDFLAGS$LIBS" ; then
5959                                 # a loop is needed to ensure we can add subdirs of existing dirs
5960                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5961                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5962                                                 cf_have_libdir=yes; break
5963                                         fi
5964                                 done
5965                         fi
5966                         if test "$cf_have_libdir" = no ; then
5967                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5968
5969 echo "${as_me:-configure}:5969: testing adding $cf_add_libdir to library-path ..." 1>&5
5970
5971                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5972                         fi
5973                 fi
5974         done
5975 fi
5976
5977         fi
5978 fi
5979
5980 cf_cv_screen=curses
5981
5982 echo "$as_me:5982: checking for specified curses library type" >&5
5983 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5984
5985 # Check whether --with-screen or --without-screen was given.
5986 if test "${with_screen+set}" = set; then
5987   withval="$with_screen"
5988   cf_cv_screen=$withval
5989 else
5990
5991 # Check whether --with-ncursesw or --without-ncursesw was given.
5992 if test "${with_ncursesw+set}" = set; then
5993   withval="$with_ncursesw"
5994   cf_cv_screen=ncursesw
5995 else
5996
5997 # Check whether --with-ncurses or --without-ncurses was given.
5998 if test "${with_ncurses+set}" = set; then
5999   withval="$with_ncurses"
6000   cf_cv_screen=ncurses
6001 else
6002
6003 # Check whether --with-pdcurses or --without-pdcurses was given.
6004 if test "${with_pdcurses+set}" = set; then
6005   withval="$with_pdcurses"
6006   cf_cv_screen=pdcurses
6007 else
6008
6009 # Check whether --with-curses-colr or --without-curses-colr was given.
6010 if test "${with_curses_colr+set}" = set; then
6011   withval="$with_curses_colr"
6012   cf_cv_screen=curses_colr
6013 else
6014
6015 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6016 if test "${with_curses_5lib+set}" = set; then
6017   withval="$with_curses_5lib"
6018   cf_cv_screen=curses_5lib
6019 fi;
6020 fi;
6021 fi;
6022 fi;
6023 fi;
6024 fi;
6025
6026 echo "$as_me:6026: result: $cf_cv_screen" >&5
6027 echo "${ECHO_T}$cf_cv_screen" >&6
6028
6029 case $cf_cv_screen in
6030 (curses|curses_*)
6031
6032 echo "$as_me:6032: checking for extra include directories" >&5
6033 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6034 if test "${cf_cv_curses_incdir+set}" = set; then
6035   echo $ECHO_N "(cached) $ECHO_C" >&6
6036 else
6037
6038 cf_cv_curses_incdir=no
6039 case $host_os in
6040 (hpux10.*)
6041         if test "x$cf_cv_screen" = "xcurses_colr"
6042         then
6043                 test -d /usr/include/curses_colr && \
6044                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6045         fi
6046         ;;
6047 (sunos3*|sunos4*)
6048         if test "x$cf_cv_screen" = "xcurses_5lib"
6049         then
6050                 test -d /usr/5lib && \
6051                 test -d /usr/5include && \
6052                 cf_cv_curses_incdir="-I/usr/5include"
6053         fi
6054         ;;
6055 esac
6056
6057 fi
6058 echo "$as_me:6058: result: $cf_cv_curses_incdir" >&5
6059 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6060 if test "$cf_cv_curses_incdir" != no
6061 then
6062
6063         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6064         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6065
6066 fi
6067
6068 echo "$as_me:6068: checking if we have identified curses headers" >&5
6069 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6070 if test "${cf_cv_ncurses_header+set}" = set; then
6071   echo $ECHO_N "(cached) $ECHO_C" >&6
6072 else
6073
6074 cf_cv_ncurses_header=none
6075 for cf_header in \
6076         ncurses.h  \
6077         curses.h  ncurses/ncurses.h ncurses/curses.h
6078 do
6079 cat >conftest.$ac_ext <<_ACEOF
6080 #line 6080 "configure"
6081 #include "confdefs.h"
6082 #include <${cf_header}>
6083 int
6084 main (void)
6085 {
6086 initscr(); tgoto("?", 0,0)
6087   ;
6088   return 0;
6089 }
6090 _ACEOF
6091 rm -f conftest.$ac_objext
6092 if { (eval echo "$as_me:6092: \"$ac_compile\"") >&5
6093   (eval $ac_compile) 2>&5
6094   ac_status=$?
6095   echo "$as_me:6095: \$? = $ac_status" >&5
6096   (exit $ac_status); } &&
6097          { ac_try='test -s conftest.$ac_objext'
6098   { (eval echo "$as_me:6098: \"$ac_try\"") >&5
6099   (eval $ac_try) 2>&5
6100   ac_status=$?
6101   echo "$as_me:6101: \$? = $ac_status" >&5
6102   (exit $ac_status); }; }; then
6103   cf_cv_ncurses_header=$cf_header; break
6104 else
6105   echo "$as_me: failed program was:" >&5
6106 cat conftest.$ac_ext >&5
6107 fi
6108 rm -f conftest.$ac_objext conftest.$ac_ext
6109 done
6110
6111 fi
6112 echo "$as_me:6112: result: $cf_cv_ncurses_header" >&5
6113 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6114
6115 if test "$cf_cv_ncurses_header" = none ; then
6116         { { echo "$as_me:6116: error: No curses header-files found" >&5
6117 echo "$as_me: error: No curses header-files found" >&2;}
6118    { (exit 1); exit 1; }; }
6119 fi
6120
6121 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6122
6123 for ac_header in $cf_cv_ncurses_header
6124 do
6125 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6126 echo "$as_me:6126: checking for $ac_header" >&5
6127 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6128 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6129   echo $ECHO_N "(cached) $ECHO_C" >&6
6130 else
6131   cat >conftest.$ac_ext <<_ACEOF
6132 #line 6132 "configure"
6133 #include "confdefs.h"
6134 #include <$ac_header>
6135 _ACEOF
6136 if { (eval echo "$as_me:6136: \"$ac_cpp conftest.$ac_ext\"") >&5
6137   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6138   ac_status=$?
6139   egrep -v '^ *\+' conftest.er1 >conftest.err
6140   rm -f conftest.er1
6141   cat conftest.err >&5
6142   echo "$as_me:6142: \$? = $ac_status" >&5
6143   (exit $ac_status); } >/dev/null; then
6144   if test -s conftest.err; then
6145     ac_cpp_err=$ac_c_preproc_warn_flag
6146   else
6147     ac_cpp_err=
6148   fi
6149 else
6150   ac_cpp_err=yes
6151 fi
6152 if test -z "$ac_cpp_err"; then
6153   eval "$as_ac_Header=yes"
6154 else
6155   echo "$as_me: failed program was:" >&5
6156   cat conftest.$ac_ext >&5
6157   eval "$as_ac_Header=no"
6158 fi
6159 rm -f conftest.err conftest.$ac_ext
6160 fi
6161 echo "$as_me:6161: result: `eval echo '${'$as_ac_Header'}'`" >&5
6162 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6163 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6164   cat >>confdefs.h <<EOF
6165 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6166 EOF
6167
6168 fi
6169 done
6170
6171 echo "$as_me:6171: checking for terminfo header" >&5
6172 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6173 if test "${cf_cv_term_header+set}" = set; then
6174   echo $ECHO_N "(cached) $ECHO_C" >&6
6175 else
6176
6177 case ${cf_cv_ncurses_header} in
6178 (*/ncurses.h|*/ncursesw.h)
6179         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6180         ;;
6181 (*)
6182         cf_term_header=term.h
6183         ;;
6184 esac
6185
6186 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6187 do
6188 cat >conftest.$ac_ext <<_ACEOF
6189 #line 6189 "configure"
6190 #include "confdefs.h"
6191 #include <stdio.h>
6192 #include <${cf_cv_ncurses_header:-curses.h}>
6193 #include <$cf_test>
6194
6195 int
6196 main (void)
6197 {
6198 int x = auto_left_margin; (void)x
6199   ;
6200   return 0;
6201 }
6202 _ACEOF
6203 rm -f conftest.$ac_objext
6204 if { (eval echo "$as_me:6204: \"$ac_compile\"") >&5
6205   (eval $ac_compile) 2>&5
6206   ac_status=$?
6207   echo "$as_me:6207: \$? = $ac_status" >&5
6208   (exit $ac_status); } &&
6209          { ac_try='test -s conftest.$ac_objext'
6210   { (eval echo "$as_me:6210: \"$ac_try\"") >&5
6211   (eval $ac_try) 2>&5
6212   ac_status=$?
6213   echo "$as_me:6213: \$? = $ac_status" >&5
6214   (exit $ac_status); }; }; then
6215
6216         cf_cv_term_header="$cf_test"
6217 else
6218   echo "$as_me: failed program was:" >&5
6219 cat conftest.$ac_ext >&5
6220
6221         cf_cv_term_header=unknown
6222
6223 fi
6224 rm -f conftest.$ac_objext conftest.$ac_ext
6225         test "$cf_cv_term_header" != unknown && break
6226 done
6227
6228 fi
6229 echo "$as_me:6229: result: $cf_cv_term_header" >&5
6230 echo "${ECHO_T}$cf_cv_term_header" >&6
6231
6232 # Set definitions to allow ifdef'ing to accommodate subdirectories
6233
6234 case $cf_cv_term_header in
6235 (*term.h)
6236
6237 cat >>confdefs.h <<\EOF
6238 #define HAVE_TERM_H 1
6239 EOF
6240
6241         ;;
6242 esac
6243
6244 case $cf_cv_term_header in
6245 (ncurses/term.h)
6246
6247 cat >>confdefs.h <<\EOF
6248 #define HAVE_NCURSES_TERM_H 1
6249 EOF
6250
6251         ;;
6252 (ncursesw/term.h)
6253
6254 cat >>confdefs.h <<\EOF
6255 #define HAVE_NCURSESW_TERM_H 1
6256 EOF
6257
6258         ;;
6259 esac
6260
6261 echo "$as_me:6261: checking for ncurses version" >&5
6262 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6263 if test "${cf_cv_ncurses_version+set}" = set; then
6264   echo $ECHO_N "(cached) $ECHO_C" >&6
6265 else
6266
6267         cf_cv_ncurses_version=no
6268         cf_tempfile=out$$
6269         rm -f $cf_tempfile
6270         if test "$cross_compiling" = yes; then
6271
6272         # This will not work if the preprocessor splits the line after the
6273         # Autoconf token.  The 'unproto' program does that.
6274         cat > conftest.$ac_ext <<EOF
6275 #include <${cf_cv_ncurses_header:-curses.h}>
6276 #undef Autoconf
6277 #ifdef NCURSES_VERSION
6278 Autoconf NCURSES_VERSION
6279 #else
6280 #ifdef __NCURSES_H
6281 Autoconf "old"
6282 #endif
6283 ;
6284 #endif
6285 EOF
6286         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6287         { (eval echo "$as_me:6287: \"$cf_try\"") >&5
6288   (eval $cf_try) 2>&5
6289   ac_status=$?
6290   echo "$as_me:6290: \$? = $ac_status" >&5
6291   (exit $ac_status); }
6292         if test -f conftest.out ; then
6293                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6294                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6295                 rm -f conftest.out
6296         fi
6297
6298 else
6299   cat >conftest.$ac_ext <<_ACEOF
6300 #line 6300 "configure"
6301 #include "confdefs.h"
6302
6303 #include <${cf_cv_ncurses_header:-curses.h}>
6304 #include <stdio.h>
6305 int main(void)
6306 {
6307         FILE *fp = fopen("$cf_tempfile", "w");
6308 #ifdef NCURSES_VERSION
6309 # ifdef NCURSES_VERSION_PATCH
6310         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6311 # else
6312         fprintf(fp, "%s\n", NCURSES_VERSION);
6313 # endif
6314 #else
6315 # ifdef __NCURSES_H
6316         fprintf(fp, "old\n");
6317 # else
6318         make an error
6319 # endif
6320 #endif
6321         ${cf_cv_main_return:-return}(0);
6322 }
6323 _ACEOF
6324 rm -f conftest$ac_exeext
6325 if { (eval echo "$as_me:6325: \"$ac_link\"") >&5
6326   (eval $ac_link) 2>&5
6327   ac_status=$?
6328   echo "$as_me:6328: \$? = $ac_status" >&5
6329   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6330   { (eval echo "$as_me:6330: \"$ac_try\"") >&5
6331   (eval $ac_try) 2>&5
6332   ac_status=$?
6333   echo "$as_me:6333: \$? = $ac_status" >&5
6334   (exit $ac_status); }; }; then
6335
6336         cf_cv_ncurses_version=`cat $cf_tempfile`
6337 else
6338   echo "$as_me: program exited with status $ac_status" >&5
6339 echo "$as_me: failed program was:" >&5
6340 cat conftest.$ac_ext >&5
6341 fi
6342 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6343 fi
6344         rm -f $cf_tempfile
6345
6346 fi
6347 echo "$as_me:6347: result: $cf_cv_ncurses_version" >&5
6348 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6349 test "$cf_cv_ncurses_version" = no ||
6350 cat >>confdefs.h <<\EOF
6351 #define NCURSES 1
6352 EOF
6353
6354 echo "$as_me:6354: checking if we have identified curses libraries" >&5
6355 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6356 cat >conftest.$ac_ext <<_ACEOF
6357 #line 6357 "configure"
6358 #include "confdefs.h"
6359 #include <${cf_cv_ncurses_header:-curses.h}>
6360 int
6361 main (void)
6362 {
6363 initscr(); tgoto("?", 0,0)
6364   ;
6365   return 0;
6366 }
6367 _ACEOF
6368 rm -f conftest.$ac_objext conftest$ac_exeext
6369 if { (eval echo "$as_me:6369: \"$ac_link\"") >&5
6370   (eval $ac_link) 2>&5
6371   ac_status=$?
6372   echo "$as_me:6372: \$? = $ac_status" >&5
6373   (exit $ac_status); } &&
6374          { ac_try='test -s conftest$ac_exeext'
6375   { (eval echo "$as_me:6375: \"$ac_try\"") >&5
6376   (eval $ac_try) 2>&5
6377   ac_status=$?
6378   echo "$as_me:6378: \$? = $ac_status" >&5
6379   (exit $ac_status); }; }; then
6380   cf_result=yes
6381 else
6382   echo "$as_me: failed program was:" >&5
6383 cat conftest.$ac_ext >&5
6384 cf_result=no
6385 fi
6386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6387 echo "$as_me:6387: result: $cf_result" >&5
6388 echo "${ECHO_T}$cf_result" >&6
6389
6390 if test "$cf_result" = no ; then
6391 case $host_os in
6392 (freebsd*)
6393         echo "$as_me:6393: checking for tgoto in -lmytinfo" >&5
6394 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6395 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6396   echo $ECHO_N "(cached) $ECHO_C" >&6
6397 else
6398   ac_check_lib_save_LIBS=$LIBS
6399 LIBS="-lmytinfo  $LIBS"
6400 cat >conftest.$ac_ext <<_ACEOF
6401 #line 6401 "configure"
6402 #include "confdefs.h"
6403
6404 /* Override any gcc2 internal prototype to avoid an error.  */
6405 #ifdef __cplusplus
6406 extern "C"
6407 #endif
6408 /* We use char because int might match the return type of a gcc2
6409    builtin and then its argument prototype would still apply.  */
6410 char tgoto ();
6411 int
6412 main (void)
6413 {
6414 tgoto ();
6415   ;
6416   return 0;
6417 }
6418 _ACEOF
6419 rm -f conftest.$ac_objext conftest$ac_exeext
6420 if { (eval echo "$as_me:6420: \"$ac_link\"") >&5
6421   (eval $ac_link) 2>&5
6422   ac_status=$?
6423   echo "$as_me:6423: \$? = $ac_status" >&5
6424   (exit $ac_status); } &&
6425          { ac_try='test -s conftest$ac_exeext'
6426   { (eval echo "$as_me:6426: \"$ac_try\"") >&5
6427   (eval $ac_try) 2>&5
6428   ac_status=$?
6429   echo "$as_me:6429: \$? = $ac_status" >&5
6430   (exit $ac_status); }; }; then
6431   ac_cv_lib_mytinfo_tgoto=yes
6432 else
6433   echo "$as_me: failed program was:" >&5
6434 cat conftest.$ac_ext >&5
6435 ac_cv_lib_mytinfo_tgoto=no
6436 fi
6437 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6438 LIBS=$ac_check_lib_save_LIBS
6439 fi
6440 echo "$as_me:6440: result: $ac_cv_lib_mytinfo_tgoto" >&5
6441 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6442 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6443
6444 cf_add_libs="$LIBS"
6445 # reverse order
6446 cf_add_0lib=
6447 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6448 # filter duplicates
6449 for cf_add_1lib in $cf_add_0lib; do
6450         for cf_add_2lib in $cf_add_libs; do
6451                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6452                         cf_add_1lib=
6453                         break
6454                 fi
6455         done
6456         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6457 done
6458 LIBS="$cf_add_libs"
6459
6460 fi
6461
6462         ;;
6463 (hpux10.*)
6464         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6465         # next (1998), and xcurses "newer" (2000).  There is no header file for
6466         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6467         # term.h) for cur_colr
6468         if test "x$cf_cv_screen" = "xcurses_colr"
6469         then
6470                 echo "$as_me:6470: checking for initscr in -lcur_colr" >&5
6471 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6472 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6473   echo $ECHO_N "(cached) $ECHO_C" >&6
6474 else
6475   ac_check_lib_save_LIBS=$LIBS
6476 LIBS="-lcur_colr  $LIBS"
6477 cat >conftest.$ac_ext <<_ACEOF
6478 #line 6478 "configure"
6479 #include "confdefs.h"
6480
6481 /* Override any gcc2 internal prototype to avoid an error.  */
6482 #ifdef __cplusplus
6483 extern "C"
6484 #endif
6485 /* We use char because int might match the return type of a gcc2
6486    builtin and then its argument prototype would still apply.  */
6487 char initscr ();
6488 int
6489 main (void)
6490 {
6491 initscr ();
6492   ;
6493   return 0;
6494 }
6495 _ACEOF
6496 rm -f conftest.$ac_objext conftest$ac_exeext
6497 if { (eval echo "$as_me:6497: \"$ac_link\"") >&5
6498   (eval $ac_link) 2>&5
6499   ac_status=$?
6500   echo "$as_me:6500: \$? = $ac_status" >&5
6501   (exit $ac_status); } &&
6502          { ac_try='test -s conftest$ac_exeext'
6503   { (eval echo "$as_me:6503: \"$ac_try\"") >&5
6504   (eval $ac_try) 2>&5
6505   ac_status=$?
6506   echo "$as_me:6506: \$? = $ac_status" >&5
6507   (exit $ac_status); }; }; then
6508   ac_cv_lib_cur_colr_initscr=yes
6509 else
6510   echo "$as_me: failed program was:" >&5
6511 cat conftest.$ac_ext >&5
6512 ac_cv_lib_cur_colr_initscr=no
6513 fi
6514 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6515 LIBS=$ac_check_lib_save_LIBS
6516 fi
6517 echo "$as_me:6517: result: $ac_cv_lib_cur_colr_initscr" >&5
6518 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6519 if test $ac_cv_lib_cur_colr_initscr = yes; then
6520
6521 cf_add_libs="$LIBS"
6522 # reverse order
6523 cf_add_0lib=
6524 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6525 # filter duplicates
6526 for cf_add_1lib in $cf_add_0lib; do
6527         for cf_add_2lib in $cf_add_libs; do
6528                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6529                         cf_add_1lib=
6530                         break
6531                 fi
6532         done
6533         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6534 done
6535 LIBS="$cf_add_libs"
6536
6537                         ac_cv_func_initscr=yes
6538
6539 else
6540
6541                 echo "$as_me:6541: checking for initscr in -lHcurses" >&5
6542 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6543 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6544   echo $ECHO_N "(cached) $ECHO_C" >&6
6545 else
6546   ac_check_lib_save_LIBS=$LIBS
6547 LIBS="-lHcurses  $LIBS"
6548 cat >conftest.$ac_ext <<_ACEOF
6549 #line 6549 "configure"
6550 #include "confdefs.h"
6551
6552 /* Override any gcc2 internal prototype to avoid an error.  */
6553 #ifdef __cplusplus
6554 extern "C"
6555 #endif
6556 /* We use char because int might match the return type of a gcc2
6557    builtin and then its argument prototype would still apply.  */
6558 char initscr ();
6559 int
6560 main (void)
6561 {
6562 initscr ();
6563   ;
6564   return 0;
6565 }
6566 _ACEOF
6567 rm -f conftest.$ac_objext conftest$ac_exeext
6568 if { (eval echo "$as_me:6568: \"$ac_link\"") >&5
6569   (eval $ac_link) 2>&5
6570   ac_status=$?
6571   echo "$as_me:6571: \$? = $ac_status" >&5
6572   (exit $ac_status); } &&
6573          { ac_try='test -s conftest$ac_exeext'
6574   { (eval echo "$as_me:6574: \"$ac_try\"") >&5
6575   (eval $ac_try) 2>&5
6576   ac_status=$?
6577   echo "$as_me:6577: \$? = $ac_status" >&5
6578   (exit $ac_status); }; }; then
6579   ac_cv_lib_Hcurses_initscr=yes
6580 else
6581   echo "$as_me: failed program was:" >&5
6582 cat conftest.$ac_ext >&5
6583 ac_cv_lib_Hcurses_initscr=no
6584 fi
6585 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6586 LIBS=$ac_check_lib_save_LIBS
6587 fi
6588 echo "$as_me:6588: result: $ac_cv_lib_Hcurses_initscr" >&5
6589 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6590 if test $ac_cv_lib_Hcurses_initscr = yes; then
6591
6592                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6593
6594 cf_add_libs="$LIBS"
6595 # reverse order
6596 cf_add_0lib=
6597 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6598 # filter duplicates
6599 for cf_add_1lib in $cf_add_0lib; do
6600         for cf_add_2lib in $cf_add_libs; do
6601                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6602                         cf_add_1lib=
6603                         break
6604                 fi
6605         done
6606         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6607 done
6608 LIBS="$cf_add_libs"
6609
6610         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6611         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6612
6613                         ac_cv_func_initscr=yes
6614
6615 fi
6616
6617 fi
6618
6619         fi
6620         ;;
6621 (linux*)
6622         case `arch 2>/dev/null` in
6623         (x86_64)
6624                 if test -d /lib64
6625                 then
6626
6627 if test -n "/lib64" ; then
6628         for cf_add_libdir in /lib64
6629         do
6630                 if test $cf_add_libdir = /usr/lib ; then
6631                         :
6632                 elif test -d $cf_add_libdir
6633                 then
6634                         cf_have_libdir=no
6635                         if test -n "$LDFLAGS$LIBS" ; then
6636                                 # a loop is needed to ensure we can add subdirs of existing dirs
6637                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6638                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6639                                                 cf_have_libdir=yes; break
6640                                         fi
6641                                 done
6642                         fi
6643                         if test "$cf_have_libdir" = no ; then
6644                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6645
6646 echo "${as_me:-configure}:6646: testing adding $cf_add_libdir to library-path ..." 1>&5
6647
6648                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6649                         fi
6650                 fi
6651         done
6652 fi
6653
6654                 else
6655
6656 if test -n "/lib" ; then
6657         for cf_add_libdir in /lib
6658         do
6659                 if test $cf_add_libdir = /usr/lib ; then
6660                         :
6661                 elif test -d $cf_add_libdir
6662                 then
6663                         cf_have_libdir=no
6664                         if test -n "$LDFLAGS$LIBS" ; then
6665                                 # a loop is needed to ensure we can add subdirs of existing dirs
6666                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6667                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6668                                                 cf_have_libdir=yes; break
6669                                         fi
6670                                 done
6671                         fi
6672                         if test "$cf_have_libdir" = no ; then
6673                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6674
6675 echo "${as_me:-configure}:6675: testing adding $cf_add_libdir to library-path ..." 1>&5
6676
6677                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6678                         fi
6679                 fi
6680         done
6681 fi
6682
6683                 fi
6684                 ;;
6685         (*)
6686
6687 if test -n "/lib" ; then
6688         for cf_add_libdir in /lib
6689         do
6690                 if test $cf_add_libdir = /usr/lib ; then
6691                         :
6692                 elif test -d $cf_add_libdir
6693                 then
6694                         cf_have_libdir=no
6695                         if test -n "$LDFLAGS$LIBS" ; then
6696                                 # a loop is needed to ensure we can add subdirs of existing dirs
6697                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6698                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6699                                                 cf_have_libdir=yes; break
6700                                         fi
6701                                 done
6702                         fi
6703                         if test "$cf_have_libdir" = no ; then
6704                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6705
6706 echo "${as_me:-configure}:6706: testing adding $cf_add_libdir to library-path ..." 1>&5
6707
6708                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6709                         fi
6710                 fi
6711         done
6712 fi
6713
6714                 ;;
6715         esac
6716         ;;
6717 (sunos3*|sunos4*)
6718         if test "x$cf_cv_screen" = "xcurses_5lib"
6719         then
6720                 if test -d /usr/5lib ; then
6721
6722 if test -n "/usr/5lib" ; then
6723         for cf_add_libdir in /usr/5lib
6724         do
6725                 if test $cf_add_libdir = /usr/lib ; then
6726                         :
6727                 elif test -d $cf_add_libdir
6728                 then
6729                         cf_have_libdir=no
6730                         if test -n "$LDFLAGS$LIBS" ; then
6731                                 # a loop is needed to ensure we can add subdirs of existing dirs
6732                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6733                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6734                                                 cf_have_libdir=yes; break
6735                                         fi
6736                                 done
6737                         fi
6738                         if test "$cf_have_libdir" = no ; then
6739                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6740
6741 echo "${as_me:-configure}:6741: testing adding $cf_add_libdir to library-path ..." 1>&5
6742
6743                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6744                         fi
6745                 fi
6746         done
6747 fi
6748
6749 cf_add_libs="$LIBS"
6750 # reverse order
6751 cf_add_0lib=
6752 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6753 # filter duplicates
6754 for cf_add_1lib in $cf_add_0lib; do
6755         for cf_add_2lib in $cf_add_libs; do
6756                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6757                         cf_add_1lib=
6758                         break
6759                 fi
6760         done
6761         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6762 done
6763 LIBS="$cf_add_libs"
6764
6765                 fi
6766         fi
6767         ac_cv_func_initscr=yes
6768         ;;
6769 esac
6770
6771 if test ".$ac_cv_func_initscr" != .yes ; then
6772         cf_save_LIBS="$LIBS"
6773
6774         if test ".${cf_cv_ncurses_version:-no}" != .no
6775         then
6776                 cf_check_list="ncurses curses cursesX"
6777         else
6778                 cf_check_list="cursesX curses ncurses"
6779         fi
6780
6781         # Check for library containing tgoto.  Do this before curses library
6782         # because it may be needed to link the test-case for initscr.
6783         if test "x$cf_term_lib" = x
6784         then
6785                 echo "$as_me:6785: checking for tgoto" >&5
6786 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6787 if test "${ac_cv_func_tgoto+set}" = set; then
6788   echo $ECHO_N "(cached) $ECHO_C" >&6
6789 else
6790   cat >conftest.$ac_ext <<_ACEOF
6791 #line 6791 "configure"
6792 #include "confdefs.h"
6793 #define tgoto autoconf_temporary
6794 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6795 #undef tgoto
6796
6797 #ifdef __cplusplus
6798 extern "C"
6799 #endif
6800
6801 /* We use char because int might match the return type of a gcc2
6802    builtin and then its argument prototype would still apply.  */
6803 char tgoto (void);
6804
6805 int
6806 main (void)
6807 {
6808
6809 /* The GNU C library defines stubs for functions which it implements
6810     to always fail with ENOSYS.  Some functions are actually named
6811     something starting with __ and the normal name is an alias.  */
6812 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6813 #error found stub for tgoto
6814 #endif
6815
6816         return tgoto ();
6817   ;
6818   return 0;
6819 }
6820 _ACEOF
6821 rm -f conftest.$ac_objext conftest$ac_exeext
6822 if { (eval echo "$as_me:6822: \"$ac_link\"") >&5
6823   (eval $ac_link) 2>&5
6824   ac_status=$?
6825   echo "$as_me:6825: \$? = $ac_status" >&5
6826   (exit $ac_status); } &&
6827          { ac_try='test -s conftest$ac_exeext'
6828   { (eval echo "$as_me:6828: \"$ac_try\"") >&5
6829   (eval $ac_try) 2>&5
6830   ac_status=$?
6831   echo "$as_me:6831: \$? = $ac_status" >&5
6832   (exit $ac_status); }; }; then
6833   ac_cv_func_tgoto=yes
6834 else
6835   echo "$as_me: failed program was:" >&5
6836 cat conftest.$ac_ext >&5
6837 ac_cv_func_tgoto=no
6838 fi
6839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6840 fi
6841 echo "$as_me:6841: result: $ac_cv_func_tgoto" >&5
6842 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6843 if test $ac_cv_func_tgoto = yes; then
6844   cf_term_lib=predefined
6845 else
6846
6847                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6848                         do
6849                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6850 echo "$as_me:6850: checking for tgoto in -l$cf_term_lib" >&5
6851 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6852 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6853   echo $ECHO_N "(cached) $ECHO_C" >&6
6854 else
6855   ac_check_lib_save_LIBS=$LIBS
6856 LIBS="-l$cf_term_lib  $LIBS"
6857 cat >conftest.$ac_ext <<_ACEOF
6858 #line 6858 "configure"
6859 #include "confdefs.h"
6860
6861 /* Override any gcc2 internal prototype to avoid an error.  */
6862 #ifdef __cplusplus
6863 extern "C"
6864 #endif
6865 /* We use char because int might match the return type of a gcc2
6866    builtin and then its argument prototype would still apply.  */
6867 char tgoto ();
6868 int
6869 main (void)
6870 {
6871 tgoto ();
6872   ;
6873   return 0;
6874 }
6875 _ACEOF
6876 rm -f conftest.$ac_objext conftest$ac_exeext
6877 if { (eval echo "$as_me:6877: \"$ac_link\"") >&5
6878   (eval $ac_link) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit $ac_status); } &&
6882          { ac_try='test -s conftest$ac_exeext'
6883   { (eval echo "$as_me:6883: \"$ac_try\"") >&5
6884   (eval $ac_try) 2>&5
6885   ac_status=$?
6886   echo "$as_me:6886: \$? = $ac_status" >&5
6887   (exit $ac_status); }; }; then
6888   eval "$as_ac_Lib=yes"
6889 else
6890   echo "$as_me: failed program was:" >&5
6891 cat conftest.$ac_ext >&5
6892 eval "$as_ac_Lib=no"
6893 fi
6894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6895 LIBS=$ac_check_lib_save_LIBS
6896 fi
6897 echo "$as_me:6897: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6898 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6899 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6900
6901                                         : ${cf_nculib_root:=$cf_term_lib}
6902                                         break
6903
6904 fi
6905
6906                         done
6907
6908 fi
6909
6910         fi
6911
6912         # Check for library containing initscr
6913         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6914         if test "x$cf_curs_lib" = x
6915         then
6916                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6917                 do
6918                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6919                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6920                                 echo "$as_me:6920: checking if we can link with $cf_curs_lib library" >&5
6921 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6922                                 cat >conftest.$ac_ext <<_ACEOF
6923 #line 6923 "configure"
6924 #include "confdefs.h"
6925 #include <${cf_cv_ncurses_header:-curses.h}>
6926 int
6927 main (void)
6928 {
6929 initscr()
6930   ;
6931   return 0;
6932 }
6933 _ACEOF
6934 rm -f conftest.$ac_objext conftest$ac_exeext
6935 if { (eval echo "$as_me:6935: \"$ac_link\"") >&5
6936   (eval $ac_link) 2>&5
6937   ac_status=$?
6938   echo "$as_me:6938: \$? = $ac_status" >&5
6939   (exit $ac_status); } &&
6940          { ac_try='test -s conftest$ac_exeext'
6941   { (eval echo "$as_me:6941: \"$ac_try\"") >&5
6942   (eval $ac_try) 2>&5
6943   ac_status=$?
6944   echo "$as_me:6944: \$? = $ac_status" >&5
6945   (exit $ac_status); }; }; then
6946   cf_result=yes
6947 else
6948   echo "$as_me: failed program was:" >&5
6949 cat conftest.$ac_ext >&5
6950 cf_result=no
6951 fi
6952 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6953                                 echo "$as_me:6953: result: $cf_result" >&5
6954 echo "${ECHO_T}$cf_result" >&6
6955                                 test $cf_result = yes && break
6956                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6957                                 cf_result=no
6958                         elif test "$cf_term_lib" != predefined ; then
6959                                 echo "$as_me:6959: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6960 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6961                                 cat >conftest.$ac_ext <<_ACEOF
6962 #line 6962 "configure"
6963 #include "confdefs.h"
6964 #include <${cf_cv_ncurses_header:-curses.h}>
6965 int
6966 main (void)
6967 {
6968 initscr(); tgoto((char *)0, 0, 0);
6969   ;
6970   return 0;
6971 }
6972 _ACEOF
6973 rm -f conftest.$ac_objext conftest$ac_exeext
6974 if { (eval echo "$as_me:6974: \"$ac_link\"") >&5
6975   (eval $ac_link) 2>&5
6976   ac_status=$?
6977   echo "$as_me:6977: \$? = $ac_status" >&5
6978   (exit $ac_status); } &&
6979          { ac_try='test -s conftest$ac_exeext'
6980   { (eval echo "$as_me:6980: \"$ac_try\"") >&5
6981   (eval $ac_try) 2>&5
6982   ac_status=$?
6983   echo "$as_me:6983: \$? = $ac_status" >&5
6984   (exit $ac_status); }; }; then
6985   cf_result=no
6986 else
6987   echo "$as_me: failed program was:" >&5
6988 cat conftest.$ac_ext >&5
6989
6990                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6991                                         cat >conftest.$ac_ext <<_ACEOF
6992 #line 6992 "configure"
6993 #include "confdefs.h"
6994 #include <${cf_cv_ncurses_header:-curses.h}>
6995 int
6996 main (void)
6997 {
6998 initscr()
6999   ;
7000   return 0;
7001 }
7002 _ACEOF
7003 rm -f conftest.$ac_objext conftest$ac_exeext
7004 if { (eval echo "$as_me:7004: \"$ac_link\"") >&5
7005   (eval $ac_link) 2>&5
7006   ac_status=$?
7007   echo "$as_me:7007: \$? = $ac_status" >&5
7008   (exit $ac_status); } &&
7009          { ac_try='test -s conftest$ac_exeext'
7010   { (eval echo "$as_me:7010: \"$ac_try\"") >&5
7011   (eval $ac_try) 2>&5
7012   ac_status=$?
7013   echo "$as_me:7013: \$? = $ac_status" >&5
7014   (exit $ac_status); }; }; then
7015   cf_result=yes
7016 else
7017   echo "$as_me: failed program was:" >&5
7018 cat conftest.$ac_ext >&5
7019 cf_result=error
7020 fi
7021 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7022
7023 fi
7024 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7025                                 echo "$as_me:7025: result: $cf_result" >&5
7026 echo "${ECHO_T}$cf_result" >&6
7027                                 test $cf_result != error && break
7028                         fi
7029                 done
7030         fi
7031         test $cf_curs_lib = unknown && { { echo "$as_me:7031: error: no curses library found" >&5
7032 echo "$as_me: error: no curses library found" >&2;}
7033    { (exit 1); exit 1; }; }
7034 fi
7035 fi
7036
7037         ;;
7038 (ncursesw*)
7039
7040 echo "$as_me:7040: checking for multibyte character support" >&5
7041 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7042 if test "${cf_cv_utf8_lib+set}" = set; then
7043   echo $ECHO_N "(cached) $ECHO_C" >&6
7044 else
7045
7046         cf_save_LIBS="$LIBS"
7047         cat >conftest.$ac_ext <<_ACEOF
7048 #line 7048 "configure"
7049 #include "confdefs.h"
7050
7051 #include <stdlib.h>
7052 int
7053 main (void)
7054 {
7055 putwc(0,0);
7056   ;
7057   return 0;
7058 }
7059 _ACEOF
7060 rm -f conftest.$ac_objext conftest$ac_exeext
7061 if { (eval echo "$as_me:7061: \"$ac_link\"") >&5
7062   (eval $ac_link) 2>&5
7063   ac_status=$?
7064   echo "$as_me:7064: \$? = $ac_status" >&5
7065   (exit $ac_status); } &&
7066          { ac_try='test -s conftest$ac_exeext'
7067   { (eval echo "$as_me:7067: \"$ac_try\"") >&5
7068   (eval $ac_try) 2>&5
7069   ac_status=$?
7070   echo "$as_me:7070: \$? = $ac_status" >&5
7071   (exit $ac_status); }; }; then
7072   cf_cv_utf8_lib=yes
7073 else
7074   echo "$as_me: failed program was:" >&5
7075 cat conftest.$ac_ext >&5
7076
7077 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7078 # will be set on completion of the AC_TRY_LINK below.
7079 cf_cv_header_path_utf8=
7080 cf_cv_library_path_utf8=
7081
7082 echo "${as_me:-configure}:7082: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7083
7084 cf_save_LIBS="$LIBS"
7085
7086 cat >conftest.$ac_ext <<_ACEOF
7087 #line 7087 "configure"
7088 #include "confdefs.h"
7089
7090 #include <libutf8.h>
7091 int
7092 main (void)
7093 {
7094 putwc(0,0);
7095   ;
7096   return 0;
7097 }
7098 _ACEOF
7099 rm -f conftest.$ac_objext conftest$ac_exeext
7100 if { (eval echo "$as_me:7100: \"$ac_link\"") >&5
7101   (eval $ac_link) 2>&5
7102   ac_status=$?
7103   echo "$as_me:7103: \$? = $ac_status" >&5
7104   (exit $ac_status); } &&
7105          { ac_try='test -s conftest$ac_exeext'
7106   { (eval echo "$as_me:7106: \"$ac_try\"") >&5
7107   (eval $ac_try) 2>&5
7108   ac_status=$?
7109   echo "$as_me:7109: \$? = $ac_status" >&5
7110   (exit $ac_status); }; }; then
7111
7112         cf_cv_find_linkage_utf8=yes
7113         cf_cv_header_path_utf8=/usr/include
7114         cf_cv_library_path_utf8=/usr/lib
7115
7116 else
7117   echo "$as_me: failed program was:" >&5
7118 cat conftest.$ac_ext >&5
7119
7120 LIBS="-lutf8  $cf_save_LIBS"
7121
7122 cat >conftest.$ac_ext <<_ACEOF
7123 #line 7123 "configure"
7124 #include "confdefs.h"
7125
7126 #include <libutf8.h>
7127 int
7128 main (void)
7129 {
7130 putwc(0,0);
7131   ;
7132   return 0;
7133 }
7134 _ACEOF
7135 rm -f conftest.$ac_objext conftest$ac_exeext
7136 if { (eval echo "$as_me:7136: \"$ac_link\"") >&5
7137   (eval $ac_link) 2>&5
7138   ac_status=$?
7139   echo "$as_me:7139: \$? = $ac_status" >&5
7140   (exit $ac_status); } &&
7141          { ac_try='test -s conftest$ac_exeext'
7142   { (eval echo "$as_me:7142: \"$ac_try\"") >&5
7143   (eval $ac_try) 2>&5
7144   ac_status=$?
7145   echo "$as_me:7145: \$? = $ac_status" >&5
7146   (exit $ac_status); }; }; then
7147
7148         cf_cv_find_linkage_utf8=yes
7149         cf_cv_header_path_utf8=/usr/include
7150         cf_cv_library_path_utf8=/usr/lib
7151         cf_cv_library_file_utf8="-lutf8"
7152
7153 else
7154   echo "$as_me: failed program was:" >&5
7155 cat conftest.$ac_ext >&5
7156
7157         cf_cv_find_linkage_utf8=no
7158         LIBS="$cf_save_LIBS"
7159
7160         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7161
7162 echo "${as_me:-configure}:7162: testing find linkage for utf8 library ..." 1>&5
7163
7164 echo "${as_me:-configure}:7164: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7165
7166         cf_save_CPPFLAGS="$CPPFLAGS"
7167         cf_test_CPPFLAGS="$CPPFLAGS"
7168
7169 cf_search=
7170
7171 # collect the current set of include-directories from compiler flags
7172 cf_header_path_list=""
7173 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7174         for cf_header_path in $CPPFLAGS $CFLAGS
7175         do
7176                 case $cf_header_path in
7177                 (-I*)
7178                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7179
7180 test "x$cf_header_path" != "xNONE" && \
7181 test -d "$cf_header_path" && \
7182  {
7183         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7184         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7185         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7186         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7187         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7188         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7189 }
7190
7191                         cf_header_path_list="$cf_header_path_list $cf_search"
7192                         ;;
7193                 esac
7194         done
7195 fi
7196
7197 # add the variations for the package we are looking for
7198
7199 cf_search=
7200
7201 test "x$prefix" != "xNONE" && \
7202 test -d "$prefix" && \
7203  {
7204         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7205         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7206         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7207         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7208         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7209         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7210 }
7211
7212 for cf_subdir_prefix in \
7213         /usr \
7214         /usr/local \
7215         /usr/pkg \
7216         /opt \
7217         /opt/local \
7218         $HOME
7219 do
7220
7221 test "x$cf_subdir_prefix" != "x$prefix" && \
7222 test -d "$cf_subdir_prefix" && \
7223 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7224         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7225         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7226         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7227         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7228         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7229         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7230 }
7231
7232 done
7233
7234 test "$includedir" != NONE && \
7235 test "$includedir" != "/usr/include" && \
7236 test -d "$includedir" && {
7237         test -d $includedir &&    cf_search="$cf_search $includedir"
7238         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7239 }
7240
7241 test "$oldincludedir" != NONE && \
7242 test "$oldincludedir" != "/usr/include" && \
7243 test -d "$oldincludedir" && {
7244         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7245         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7246 }
7247
7248 cf_search="$cf_search $cf_header_path_list"
7249
7250         for cf_cv_header_path_utf8 in $cf_search
7251         do
7252                 if test -d $cf_cv_header_path_utf8 ; then
7253                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7254
7255 echo "${as_me:-configure}:7255: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7256
7257                         CPPFLAGS="$cf_save_CPPFLAGS"
7258
7259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7260         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7261
7262                         cat >conftest.$ac_ext <<_ACEOF
7263 #line 7263 "configure"
7264 #include "confdefs.h"
7265
7266 #include <libutf8.h>
7267 int
7268 main (void)
7269 {
7270 putwc(0,0);
7271   ;
7272   return 0;
7273 }
7274 _ACEOF
7275 rm -f conftest.$ac_objext
7276 if { (eval echo "$as_me:7276: \"$ac_compile\"") >&5
7277   (eval $ac_compile) 2>&5
7278   ac_status=$?
7279   echo "$as_me:7279: \$? = $ac_status" >&5
7280   (exit $ac_status); } &&
7281          { ac_try='test -s conftest.$ac_objext'
7282   { (eval echo "$as_me:7282: \"$ac_try\"") >&5
7283   (eval $ac_try) 2>&5
7284   ac_status=$?
7285   echo "$as_me:7285: \$? = $ac_status" >&5
7286   (exit $ac_status); }; }; then
7287
7288                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7289
7290 echo "${as_me:-configure}:7290: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7291
7292                                 cf_cv_find_linkage_utf8=maybe
7293                                 cf_test_CPPFLAGS="$CPPFLAGS"
7294                                 break
7295 else
7296   echo "$as_me: failed program was:" >&5
7297 cat conftest.$ac_ext >&5
7298
7299                                 CPPFLAGS="$cf_save_CPPFLAGS"
7300
7301 fi
7302 rm -f conftest.$ac_objext conftest.$ac_ext
7303                 fi
7304         done
7305
7306         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7307
7308 echo "${as_me:-configure}:7308: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7309
7310                 cf_save_LIBS="$LIBS"
7311                 cf_save_LDFLAGS="$LDFLAGS"
7312
7313                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7314
7315 cf_search=
7316 cf_library_path_list=""
7317 if test -n "${LDFLAGS}${LIBS}" ; then
7318         for cf_library_path in $LDFLAGS $LIBS
7319         do
7320                 case $cf_library_path in
7321                 (-L*)
7322                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7323
7324 test "x$cf_library_path" != "xNONE" && \
7325 test -d "$cf_library_path" && \
7326  {
7327         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7328         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7329         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7330         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7331         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7332         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7333 }
7334
7335                         cf_library_path_list="$cf_library_path_list $cf_search"
7336                         ;;
7337                 esac
7338         done
7339 fi
7340
7341 cf_search=
7342
7343 test "x$prefix" != "xNONE" && \
7344 test -d "$prefix" && \
7345  {
7346         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7347         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7348         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7349         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7350         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7351         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7352 }
7353
7354 for cf_subdir_prefix in \
7355         /usr \
7356         /usr/local \
7357         /usr/pkg \
7358         /opt \
7359         /opt/local \
7360         $HOME
7361 do
7362
7363 test "x$cf_subdir_prefix" != "x$prefix" && \
7364 test -d "$cf_subdir_prefix" && \
7365 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7366         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7367         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7368         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7369         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7370         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7371         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7372 }
7373
7374 done
7375
7376 cf_search="$cf_library_path_list $cf_search"
7377
7378                         for cf_cv_library_path_utf8 in $cf_search
7379                         do
7380                                 if test -d $cf_cv_library_path_utf8 ; then
7381                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7382
7383 echo "${as_me:-configure}:7383: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7384
7385                                         CPPFLAGS="$cf_test_CPPFLAGS"
7386                                         LIBS="-lutf8  $cf_save_LIBS"
7387                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7388                                         cat >conftest.$ac_ext <<_ACEOF
7389 #line 7389 "configure"
7390 #include "confdefs.h"
7391
7392 #include <libutf8.h>
7393 int
7394 main (void)
7395 {
7396 putwc(0,0);
7397   ;
7398   return 0;
7399 }
7400 _ACEOF
7401 rm -f conftest.$ac_objext conftest$ac_exeext
7402 if { (eval echo "$as_me:7402: \"$ac_link\"") >&5
7403   (eval $ac_link) 2>&5
7404   ac_status=$?
7405   echo "$as_me:7405: \$? = $ac_status" >&5
7406   (exit $ac_status); } &&
7407          { ac_try='test -s conftest$ac_exeext'
7408   { (eval echo "$as_me:7408: \"$ac_try\"") >&5
7409   (eval $ac_try) 2>&5
7410   ac_status=$?
7411   echo "$as_me:7411: \$? = $ac_status" >&5
7412   (exit $ac_status); }; }; then
7413
7414                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7415
7416 echo "${as_me:-configure}:7416: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7417
7418                                         cf_cv_find_linkage_utf8=yes
7419                                         cf_cv_library_file_utf8="-lutf8"
7420                                         break
7421 else
7422   echo "$as_me: failed program was:" >&5
7423 cat conftest.$ac_ext >&5
7424
7425                                         CPPFLAGS="$cf_save_CPPFLAGS"
7426                                         LIBS="$cf_save_LIBS"
7427                                         LDFLAGS="$cf_save_LDFLAGS"
7428
7429 fi
7430 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7431                                 fi
7432                         done
7433                         CPPFLAGS="$cf_save_CPPFLAGS"
7434                         LDFLAGS="$cf_save_LDFLAGS"
7435                 fi
7436
7437         else
7438                 cf_cv_find_linkage_utf8=no
7439         fi
7440
7441 fi
7442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7443
7444 fi
7445 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7446
7447 LIBS="$cf_save_LIBS"
7448
7449 if test "$cf_cv_find_linkage_utf8" = yes ; then
7450 cf_cv_utf8_lib=add-on
7451 else
7452 cf_cv_utf8_lib=no
7453 fi
7454
7455 fi
7456 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7457 fi
7458 echo "$as_me:7458: result: $cf_cv_utf8_lib" >&5
7459 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7460
7461 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7462 # ncurses/ncursesw:
7463 if test "$cf_cv_utf8_lib" = "add-on" ; then
7464
7465 cat >>confdefs.h <<\EOF
7466 #define HAVE_LIBUTF8_H 1
7467 EOF
7468
7469 if test -n "$cf_cv_header_path_utf8" ; then
7470   for cf_add_incdir in $cf_cv_header_path_utf8
7471   do
7472         while test $cf_add_incdir != /usr/include
7473         do
7474           if test -d $cf_add_incdir
7475           then
7476                 cf_have_incdir=no
7477                 if test -n "$CFLAGS$CPPFLAGS" ; then
7478                   # a loop is needed to ensure we can add subdirs of existing dirs
7479                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7480                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7481                           cf_have_incdir=yes; break
7482                         fi
7483                   done
7484                 fi
7485
7486                 if test "$cf_have_incdir" = no ; then
7487                   if test "$cf_add_incdir" = /usr/local/include ; then
7488                         if test "$GCC" = yes
7489                         then
7490                           cf_save_CPPFLAGS=$CPPFLAGS
7491
7492         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7493         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7494
7495                           cat >conftest.$ac_ext <<_ACEOF
7496 #line 7496 "configure"
7497 #include "confdefs.h"
7498 #include <stdio.h>
7499 int
7500 main (void)
7501 {
7502 printf("Hello")
7503   ;
7504   return 0;
7505 }
7506 _ACEOF
7507 rm -f conftest.$ac_objext
7508 if { (eval echo "$as_me:7508: \"$ac_compile\"") >&5
7509   (eval $ac_compile) 2>&5
7510   ac_status=$?
7511   echo "$as_me:7511: \$? = $ac_status" >&5
7512   (exit $ac_status); } &&
7513          { ac_try='test -s conftest.$ac_objext'
7514   { (eval echo "$as_me:7514: \"$ac_try\"") >&5
7515   (eval $ac_try) 2>&5
7516   ac_status=$?
7517   echo "$as_me:7517: \$? = $ac_status" >&5
7518   (exit $ac_status); }; }; then
7519   :
7520 else
7521   echo "$as_me: failed program was:" >&5
7522 cat conftest.$ac_ext >&5
7523 cf_have_incdir=yes
7524 fi
7525 rm -f conftest.$ac_objext conftest.$ac_ext
7526                           CPPFLAGS=$cf_save_CPPFLAGS
7527                         fi
7528                   fi
7529                 fi
7530
7531                 if test "$cf_have_incdir" = no ; then
7532                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7533
7534 echo "${as_me:-configure}:7534: testing adding $cf_add_incdir to include-path ..." 1>&5
7535
7536                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7537
7538                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7539                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7540                   cf_add_incdir="$cf_top_incdir"
7541                 else
7542                   break
7543                 fi
7544           else
7545                 break
7546           fi
7547         done
7548   done
7549 fi
7550
7551 if test -n "$cf_cv_library_path_utf8" ; then
7552         for cf_add_libdir in $cf_cv_library_path_utf8
7553         do
7554                 if test $cf_add_libdir = /usr/lib ; then
7555                         :
7556                 elif test -d $cf_add_libdir
7557                 then
7558                         cf_have_libdir=no
7559                         if test -n "$LDFLAGS$LIBS" ; then
7560                                 # a loop is needed to ensure we can add subdirs of existing dirs
7561                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7562                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7563                                                 cf_have_libdir=yes; break
7564                                         fi
7565                                 done
7566                         fi
7567                         if test "$cf_have_libdir" = no ; then
7568                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7569
7570 echo "${as_me:-configure}:7570: testing adding $cf_add_libdir to library-path ..." 1>&5
7571
7572                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7573                         fi
7574                 fi
7575         done
7576 fi
7577
7578 cf_add_libs="$LIBS"
7579 # reverse order
7580 cf_add_0lib=
7581 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7582 # filter duplicates
7583 for cf_add_1lib in $cf_add_0lib; do
7584         for cf_add_2lib in $cf_add_libs; do
7585                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7586                         cf_add_1lib=
7587                         break
7588                 fi
7589         done
7590         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7591 done
7592 LIBS="$cf_add_libs"
7593
7594 fi
7595
7596 cf_ncuconfig_root=$cf_cv_screen
7597 cf_have_ncuconfig=no
7598
7599 if test "x${PKG_CONFIG:=none}" != xnone; then
7600         echo "$as_me:7600: checking pkg-config for $cf_ncuconfig_root" >&5
7601 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7602         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7603                 echo "$as_me:7603: result: yes" >&5
7604 echo "${ECHO_T}yes" >&6
7605
7606                 echo "$as_me:7606: checking if the $cf_ncuconfig_root package files work" >&5
7607 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7608                 cf_have_ncuconfig=unknown
7609
7610                 cf_save_CFLAGS="$CFLAGS"
7611                 cf_save_CPPFLAGS="$CPPFLAGS"
7612                 cf_save_LIBS="$LIBS"
7613
7614                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7615                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7616
7617                 # while -W for passing linker flags is prevalent, it is not "standard".
7618                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7619                 # incompatible _and_ non-standard -W option which gives an error.  Work
7620                 # around that pitfall.
7621                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7622                 (x*c[89]9@@*-W*)
7623
7624 cf_fix_cppflags=no
7625 cf_new_cflags=
7626 cf_new_cppflags=
7627 cf_new_extra_cppflags=
7628
7629 for cf_add_cflags in $cf_pkg_cflags
7630 do
7631 case $cf_fix_cppflags in
7632 (no)
7633         case $cf_add_cflags in
7634         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7635                 case $cf_add_cflags in
7636                 (-D*)
7637                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7638
7639                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7640                                 && test -z "${cf_tst_cflags}" \
7641                                 && cf_fix_cppflags=yes
7642
7643                         if test $cf_fix_cppflags = yes ; then
7644
7645         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7646         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7647
7648                                 continue
7649                         elif test "${cf_tst_cflags}" = "\"'" ; then
7650
7651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7653
7654                                 continue
7655                         fi
7656                         ;;
7657                 esac
7658                 case "$CPPFLAGS" in
7659                 (*$cf_add_cflags)
7660                         ;;
7661                 (*)
7662                         case $cf_add_cflags in
7663                         (-D*)
7664                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7665
7666 CPPFLAGS=`echo "$CPPFLAGS" | \
7667         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7668                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7669
7670                                 ;;
7671                         esac
7672
7673         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7674         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7675
7676                         ;;
7677                 esac
7678                 ;;
7679         (*)
7680
7681         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7682         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7683
7684                 ;;
7685         esac
7686         ;;
7687 (yes)
7688
7689         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7690         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7691
7692         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7693
7694         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7695                 && test -z "${cf_tst_cflags}" \
7696                 && cf_fix_cppflags=no
7697         ;;
7698 esac
7699 done
7700
7701 if test -n "$cf_new_cflags" ; then
7702
7703         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7704         CFLAGS="${CFLAGS}$cf_new_cflags"
7705
7706 fi
7707
7708 if test -n "$cf_new_cppflags" ; then
7709
7710         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7711         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7712
7713 fi
7714
7715 if test -n "$cf_new_extra_cppflags" ; then
7716
7717         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7718         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7719
7720 fi
7721
7722 cf_add_libs="$LIBS"
7723 # reverse order
7724 cf_add_0lib=
7725 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7726 # filter duplicates
7727 for cf_add_1lib in $cf_add_0lib; do
7728         for cf_add_2lib in $cf_add_libs; do
7729                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7730                         cf_add_1lib=
7731                         break
7732                 fi
7733         done
7734         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7735 done
7736 LIBS="$cf_add_libs"
7737
7738                         cat >conftest.$ac_ext <<_ACEOF
7739 #line 7739 "configure"
7740 #include "confdefs.h"
7741 #include <${cf_cv_ncurses_header:-curses.h}>
7742 int
7743 main (void)
7744 {
7745 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7746   ;
7747   return 0;
7748 }
7749 _ACEOF
7750 rm -f conftest.$ac_objext conftest$ac_exeext
7751 if { (eval echo "$as_me:7751: \"$ac_link\"") >&5
7752   (eval $ac_link) 2>&5
7753   ac_status=$?
7754   echo "$as_me:7754: \$? = $ac_status" >&5
7755   (exit $ac_status); } &&
7756          { ac_try='test -s conftest$ac_exeext'
7757   { (eval echo "$as_me:7757: \"$ac_try\"") >&5
7758   (eval $ac_try) 2>&5
7759   ac_status=$?
7760   echo "$as_me:7760: \$? = $ac_status" >&5
7761   (exit $ac_status); }; }; then
7762   if test "$cross_compiling" = yes; then
7763   cf_test_ncuconfig=maybe
7764 else
7765   cat >conftest.$ac_ext <<_ACEOF
7766 #line 7766 "configure"
7767 #include "confdefs.h"
7768 #include <${cf_cv_ncurses_header:-curses.h}>
7769                                         int main(void)
7770                                         { char *xx = curses_version(); return (xx == 0); }
7771 _ACEOF
7772 rm -f conftest$ac_exeext
7773 if { (eval echo "$as_me:7773: \"$ac_link\"") >&5
7774   (eval $ac_link) 2>&5
7775   ac_status=$?
7776   echo "$as_me:7776: \$? = $ac_status" >&5
7777   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7778   { (eval echo "$as_me:7778: \"$ac_try\"") >&5
7779   (eval $ac_try) 2>&5
7780   ac_status=$?
7781   echo "$as_me:7781: \$? = $ac_status" >&5
7782   (exit $ac_status); }; }; then
7783   cf_test_ncuconfig=yes
7784 else
7785   echo "$as_me: program exited with status $ac_status" >&5
7786 echo "$as_me: failed program was:" >&5
7787 cat conftest.$ac_ext >&5
7788 cf_test_ncuconfig=no
7789 fi
7790 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7791 fi
7792 else
7793   echo "$as_me: failed program was:" >&5
7794 cat conftest.$ac_ext >&5
7795 cf_test_ncuconfig=no
7796 fi
7797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7798
7799                         CFLAGS="$cf_save_CFLAGS"
7800                         CPPFLAGS="$cf_save_CPPFLAGS"
7801                         LIBS="$cf_save_LIBS"
7802
7803                         if test "x$cf_test_ncuconfig" != xyes; then
7804                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7805                                 cf_pkg_cflags="$cf_temp"
7806                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7807                                 cf_pkg_libs="$cf_temp"
7808                         fi
7809                         ;;
7810                 esac
7811
7812 cf_fix_cppflags=no
7813 cf_new_cflags=
7814 cf_new_cppflags=
7815 cf_new_extra_cppflags=
7816
7817 for cf_add_cflags in $cf_pkg_cflags
7818 do
7819 case $cf_fix_cppflags in
7820 (no)
7821         case $cf_add_cflags in
7822         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7823                 case $cf_add_cflags in
7824                 (-D*)
7825                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7826
7827                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7828                                 && test -z "${cf_tst_cflags}" \
7829                                 && cf_fix_cppflags=yes
7830
7831                         if test $cf_fix_cppflags = yes ; then
7832
7833         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7834         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7835
7836                                 continue
7837                         elif test "${cf_tst_cflags}" = "\"'" ; then
7838
7839         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7840         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7841
7842                                 continue
7843                         fi
7844                         ;;
7845                 esac
7846                 case "$CPPFLAGS" in
7847                 (*$cf_add_cflags)
7848                         ;;
7849                 (*)
7850                         case $cf_add_cflags in
7851                         (-D*)
7852                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7853
7854 CPPFLAGS=`echo "$CPPFLAGS" | \
7855         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7856                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7857
7858                                 ;;
7859                         esac
7860
7861         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7862         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7863
7864                         ;;
7865                 esac
7866                 ;;
7867         (*)
7868
7869         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7870         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7871
7872                 ;;
7873         esac
7874         ;;
7875 (yes)
7876
7877         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7878         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7879
7880         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7881
7882         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7883                 && test -z "${cf_tst_cflags}" \
7884                 && cf_fix_cppflags=no
7885         ;;
7886 esac
7887 done
7888
7889 if test -n "$cf_new_cflags" ; then
7890
7891         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7892         CFLAGS="${CFLAGS}$cf_new_cflags"
7893
7894 fi
7895
7896 if test -n "$cf_new_cppflags" ; then
7897
7898         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7899         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7900
7901 fi
7902
7903 if test -n "$cf_new_extra_cppflags" ; then
7904
7905         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7906         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7907
7908 fi
7909
7910 cf_add_libs="$LIBS"
7911 # reverse order
7912 cf_add_0lib=
7913 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7914 # filter duplicates
7915 for cf_add_1lib in $cf_add_0lib; do
7916         for cf_add_2lib in $cf_add_libs; do
7917                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7918                         cf_add_1lib=
7919                         break
7920                 fi
7921         done
7922         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7923 done
7924 LIBS="$cf_add_libs"
7925
7926                 cat >conftest.$ac_ext <<_ACEOF
7927 #line 7927 "configure"
7928 #include "confdefs.h"
7929 #include <${cf_cv_ncurses_header:-curses.h}>
7930 int
7931 main (void)
7932 {
7933 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7934   ;
7935   return 0;
7936 }
7937 _ACEOF
7938 rm -f conftest.$ac_objext conftest$ac_exeext
7939 if { (eval echo "$as_me:7939: \"$ac_link\"") >&5
7940   (eval $ac_link) 2>&5
7941   ac_status=$?
7942   echo "$as_me:7942: \$? = $ac_status" >&5
7943   (exit $ac_status); } &&
7944          { ac_try='test -s conftest$ac_exeext'
7945   { (eval echo "$as_me:7945: \"$ac_try\"") >&5
7946   (eval $ac_try) 2>&5
7947   ac_status=$?
7948   echo "$as_me:7948: \$? = $ac_status" >&5
7949   (exit $ac_status); }; }; then
7950   if test "$cross_compiling" = yes; then
7951   cf_have_ncuconfig=maybe
7952 else
7953   cat >conftest.$ac_ext <<_ACEOF
7954 #line 7954 "configure"
7955 #include "confdefs.h"
7956 #include <${cf_cv_ncurses_header:-curses.h}>
7957                                 int main(void)
7958                                 { char *xx = curses_version(); return (xx == 0); }
7959 _ACEOF
7960 rm -f conftest$ac_exeext
7961 if { (eval echo "$as_me:7961: \"$ac_link\"") >&5
7962   (eval $ac_link) 2>&5
7963   ac_status=$?
7964   echo "$as_me:7964: \$? = $ac_status" >&5
7965   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7966   { (eval echo "$as_me:7966: \"$ac_try\"") >&5
7967   (eval $ac_try) 2>&5
7968   ac_status=$?
7969   echo "$as_me:7969: \$? = $ac_status" >&5
7970   (exit $ac_status); }; }; then
7971   cf_have_ncuconfig=yes
7972 else
7973   echo "$as_me: program exited with status $ac_status" >&5
7974 echo "$as_me: failed program was:" >&5
7975 cat conftest.$ac_ext >&5
7976 cf_have_ncuconfig=no
7977 fi
7978 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7979 fi
7980 else
7981   echo "$as_me: failed program was:" >&5
7982 cat conftest.$ac_ext >&5
7983 cf_have_ncuconfig=no
7984 fi
7985 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7986                 echo "$as_me:7986: result: $cf_have_ncuconfig" >&5
7987 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7988                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7989                 if test "$cf_have_ncuconfig" != "yes"
7990                 then
7991                         CPPFLAGS="$cf_save_CPPFLAGS"
7992                         LIBS="$cf_save_LIBS"
7993                         NCURSES_CONFIG_PKG=none
7994                 else
7995
7996 cat >>confdefs.h <<\EOF
7997 #define NCURSES 1
7998 EOF
7999
8000                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8001
8002 echo "$as_me:8002: checking for terminfo header" >&5
8003 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8004 if test "${cf_cv_term_header+set}" = set; then
8005   echo $ECHO_N "(cached) $ECHO_C" >&6
8006 else
8007
8008 case ${cf_cv_ncurses_header} in
8009 (*/ncurses.h|*/ncursesw.h)
8010         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8011         ;;
8012 (*)
8013         cf_term_header=term.h
8014         ;;
8015 esac
8016
8017 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8018 do
8019 cat >conftest.$ac_ext <<_ACEOF
8020 #line 8020 "configure"
8021 #include "confdefs.h"
8022 #include <stdio.h>
8023 #include <${cf_cv_ncurses_header:-curses.h}>
8024 #include <$cf_test>
8025
8026 int
8027 main (void)
8028 {
8029 int x = auto_left_margin; (void)x
8030   ;
8031   return 0;
8032 }
8033 _ACEOF
8034 rm -f conftest.$ac_objext
8035 if { (eval echo "$as_me:8035: \"$ac_compile\"") >&5
8036   (eval $ac_compile) 2>&5
8037   ac_status=$?
8038   echo "$as_me:8038: \$? = $ac_status" >&5
8039   (exit $ac_status); } &&
8040          { ac_try='test -s conftest.$ac_objext'
8041   { (eval echo "$as_me:8041: \"$ac_try\"") >&5
8042   (eval $ac_try) 2>&5
8043   ac_status=$?
8044   echo "$as_me:8044: \$? = $ac_status" >&5
8045   (exit $ac_status); }; }; then
8046
8047         cf_cv_term_header="$cf_test"
8048 else
8049   echo "$as_me: failed program was:" >&5
8050 cat conftest.$ac_ext >&5
8051
8052         cf_cv_term_header=unknown
8053
8054 fi
8055 rm -f conftest.$ac_objext conftest.$ac_ext
8056         test "$cf_cv_term_header" != unknown && break
8057 done
8058
8059 fi
8060 echo "$as_me:8060: result: $cf_cv_term_header" >&5
8061 echo "${ECHO_T}$cf_cv_term_header" >&6
8062
8063 # Set definitions to allow ifdef'ing to accommodate subdirectories
8064
8065 case $cf_cv_term_header in
8066 (*term.h)
8067
8068 cat >>confdefs.h <<\EOF
8069 #define HAVE_TERM_H 1
8070 EOF
8071
8072         ;;
8073 esac
8074
8075 case $cf_cv_term_header in
8076 (ncurses/term.h)
8077
8078 cat >>confdefs.h <<\EOF
8079 #define HAVE_NCURSES_TERM_H 1
8080 EOF
8081
8082         ;;
8083 (ncursesw/term.h)
8084
8085 cat >>confdefs.h <<\EOF
8086 #define HAVE_NCURSESW_TERM_H 1
8087 EOF
8088
8089         ;;
8090 esac
8091
8092                 fi
8093
8094         else
8095                 echo "$as_me:8095: result: no" >&5
8096 echo "${ECHO_T}no" >&6
8097                 NCURSES_CONFIG_PKG=none
8098         fi
8099 else
8100         NCURSES_CONFIG_PKG=none
8101 fi
8102
8103 if test "x$cf_have_ncuconfig" = "xno"; then
8104         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8105
8106 if test -n "$ac_tool_prefix"; then
8107   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8108   do
8109     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8110 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8111 echo "$as_me:8111: checking for $ac_word" >&5
8112 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8113 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8114   echo $ECHO_N "(cached) $ECHO_C" >&6
8115 else
8116   if test -n "$NCURSES_CONFIG"; then
8117   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8118 else
8119   ac_save_IFS=$IFS; IFS=$ac_path_separator
8120 ac_dummy="$PATH"
8121 for ac_dir in $ac_dummy; do
8122   IFS=$ac_save_IFS
8123   test -z "$ac_dir" && ac_dir=.
8124   $as_executable_p "$ac_dir/$ac_word" || continue
8125 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8126 echo "$as_me:8126: found $ac_dir/$ac_word" >&5
8127 break
8128 done
8129
8130 fi
8131 fi
8132 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8133 if test -n "$NCURSES_CONFIG"; then
8134   echo "$as_me:8134: result: $NCURSES_CONFIG" >&5
8135 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8136 else
8137   echo "$as_me:8137: result: no" >&5
8138 echo "${ECHO_T}no" >&6
8139 fi
8140
8141     test -n "$NCURSES_CONFIG" && break
8142   done
8143 fi
8144 if test -z "$NCURSES_CONFIG"; then
8145   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8146   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8147 do
8148   # Extract the first word of "$ac_prog", so it can be a program name with args.
8149 set dummy $ac_prog; ac_word=$2
8150 echo "$as_me:8150: checking for $ac_word" >&5
8151 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8152 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8153   echo $ECHO_N "(cached) $ECHO_C" >&6
8154 else
8155   if test -n "$ac_ct_NCURSES_CONFIG"; then
8156   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8157 else
8158   ac_save_IFS=$IFS; IFS=$ac_path_separator
8159 ac_dummy="$PATH"
8160 for ac_dir in $ac_dummy; do
8161   IFS=$ac_save_IFS
8162   test -z "$ac_dir" && ac_dir=.
8163   $as_executable_p "$ac_dir/$ac_word" || continue
8164 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8165 echo "$as_me:8165: found $ac_dir/$ac_word" >&5
8166 break
8167 done
8168
8169 fi
8170 fi
8171 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8172 if test -n "$ac_ct_NCURSES_CONFIG"; then
8173   echo "$as_me:8173: result: $ac_ct_NCURSES_CONFIG" >&5
8174 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8175 else
8176   echo "$as_me:8176: result: no" >&5
8177 echo "${ECHO_T}no" >&6
8178 fi
8179
8180   test -n "$ac_ct_NCURSES_CONFIG" && break
8181 done
8182 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8183
8184   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8185 fi
8186
8187         if test "$NCURSES_CONFIG" != none ; then
8188
8189 cf_fix_cppflags=no
8190 cf_new_cflags=
8191 cf_new_cppflags=
8192 cf_new_extra_cppflags=
8193
8194 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8195 do
8196 case $cf_fix_cppflags in
8197 (no)
8198         case $cf_add_cflags in
8199         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8200                 case $cf_add_cflags in
8201                 (-D*)
8202                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8203
8204                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8205                                 && test -z "${cf_tst_cflags}" \
8206                                 && cf_fix_cppflags=yes
8207
8208                         if test $cf_fix_cppflags = yes ; then
8209
8210         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8211         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8212
8213                                 continue
8214                         elif test "${cf_tst_cflags}" = "\"'" ; then
8215
8216         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8217         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8218
8219                                 continue
8220                         fi
8221                         ;;
8222                 esac
8223                 case "$CPPFLAGS" in
8224                 (*$cf_add_cflags)
8225                         ;;
8226                 (*)
8227                         case $cf_add_cflags in
8228                         (-D*)
8229                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8230
8231 CPPFLAGS=`echo "$CPPFLAGS" | \
8232         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8233                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8234
8235                                 ;;
8236                         esac
8237
8238         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8239         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8240
8241                         ;;
8242                 esac
8243                 ;;
8244         (*)
8245
8246         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8247         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8248
8249                 ;;
8250         esac
8251         ;;
8252 (yes)
8253
8254         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8255         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8256
8257         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8258
8259         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8260                 && test -z "${cf_tst_cflags}" \
8261                 && cf_fix_cppflags=no
8262         ;;
8263 esac
8264 done
8265
8266 if test -n "$cf_new_cflags" ; then
8267
8268         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8269         CFLAGS="${CFLAGS}$cf_new_cflags"
8270
8271 fi
8272
8273 if test -n "$cf_new_cppflags" ; then
8274
8275         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8276         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8277
8278 fi
8279
8280 if test -n "$cf_new_extra_cppflags" ; then
8281
8282         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8283         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8284
8285 fi
8286
8287 cf_add_libs="$LIBS"
8288 # reverse order
8289 cf_add_0lib=
8290 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8291 # filter duplicates
8292 for cf_add_1lib in $cf_add_0lib; do
8293         for cf_add_2lib in $cf_add_libs; do
8294                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8295                         cf_add_1lib=
8296                         break
8297                 fi
8298         done
8299         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8300 done
8301 LIBS="$cf_add_libs"
8302
8303                 # even with config script, some packages use no-override for curses.h
8304
8305 echo "$as_me:8305: checking if we have identified curses headers" >&5
8306 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8307 if test "${cf_cv_ncurses_header+set}" = set; then
8308   echo $ECHO_N "(cached) $ECHO_C" >&6
8309 else
8310
8311 cf_cv_ncurses_header=none
8312 for cf_header in \
8313         ncurses.h $cf_cv_screen/ncurses.h \
8314         curses.h $cf_cv_screen/curses.h
8315 do
8316 cat >conftest.$ac_ext <<_ACEOF
8317 #line 8317 "configure"
8318 #include "confdefs.h"
8319 #include <${cf_header}>
8320 int
8321 main (void)
8322 {
8323 initscr(); tgoto("?", 0,0)
8324   ;
8325   return 0;
8326 }
8327 _ACEOF
8328 rm -f conftest.$ac_objext
8329 if { (eval echo "$as_me:8329: \"$ac_compile\"") >&5
8330   (eval $ac_compile) 2>&5
8331   ac_status=$?
8332   echo "$as_me:8332: \$? = $ac_status" >&5
8333   (exit $ac_status); } &&
8334          { ac_try='test -s conftest.$ac_objext'
8335   { (eval echo "$as_me:8335: \"$ac_try\"") >&5
8336   (eval $ac_try) 2>&5
8337   ac_status=$?
8338   echo "$as_me:8338: \$? = $ac_status" >&5
8339   (exit $ac_status); }; }; then
8340   cf_cv_ncurses_header=$cf_header; break
8341 else
8342   echo "$as_me: failed program was:" >&5
8343 cat conftest.$ac_ext >&5
8344 fi
8345 rm -f conftest.$ac_objext conftest.$ac_ext
8346 done
8347
8348 fi
8349 echo "$as_me:8349: result: $cf_cv_ncurses_header" >&5
8350 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8351
8352 if test "$cf_cv_ncurses_header" = none ; then
8353         { { echo "$as_me:8353: error: No curses header-files found" >&5
8354 echo "$as_me: error: No curses header-files found" >&2;}
8355    { (exit 1); exit 1; }; }
8356 fi
8357
8358 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8359
8360 for ac_header in $cf_cv_ncurses_header
8361 do
8362 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8363 echo "$as_me:8363: checking for $ac_header" >&5
8364 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8365 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8366   echo $ECHO_N "(cached) $ECHO_C" >&6
8367 else
8368   cat >conftest.$ac_ext <<_ACEOF
8369 #line 8369 "configure"
8370 #include "confdefs.h"
8371 #include <$ac_header>
8372 _ACEOF
8373 if { (eval echo "$as_me:8373: \"$ac_cpp conftest.$ac_ext\"") >&5
8374   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8375   ac_status=$?
8376   egrep -v '^ *\+' conftest.er1 >conftest.err
8377   rm -f conftest.er1
8378   cat conftest.err >&5
8379   echo "$as_me:8379: \$? = $ac_status" >&5
8380   (exit $ac_status); } >/dev/null; then
8381   if test -s conftest.err; then
8382     ac_cpp_err=$ac_c_preproc_warn_flag
8383   else
8384     ac_cpp_err=
8385   fi
8386 else
8387   ac_cpp_err=yes
8388 fi
8389 if test -z "$ac_cpp_err"; then
8390   eval "$as_ac_Header=yes"
8391 else
8392   echo "$as_me: failed program was:" >&5
8393   cat conftest.$ac_ext >&5
8394   eval "$as_ac_Header=no"
8395 fi
8396 rm -f conftest.err conftest.$ac_ext
8397 fi
8398 echo "$as_me:8398: result: `eval echo '${'$as_ac_Header'}'`" >&5
8399 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8400 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8401   cat >>confdefs.h <<EOF
8402 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8403 EOF
8404
8405 fi
8406 done
8407
8408 cat >>confdefs.h <<\EOF
8409 #define NCURSES 1
8410 EOF
8411
8412 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8413
8414                 cat >>confdefs.h <<EOF
8415 #define $cf_nculib_ROOT 1
8416 EOF
8417
8418                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8419
8420         else
8421
8422 cf_ncuhdr_root=$cf_cv_screen
8423
8424 test -n "$cf_cv_curses_dir" && \
8425 test "$cf_cv_curses_dir" != "no" && { \
8426
8427 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8428   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8429   do
8430         while test $cf_add_incdir != /usr/include
8431         do
8432           if test -d $cf_add_incdir
8433           then
8434                 cf_have_incdir=no
8435                 if test -n "$CFLAGS$CPPFLAGS" ; then
8436                   # a loop is needed to ensure we can add subdirs of existing dirs
8437                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8438                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8439                           cf_have_incdir=yes; break
8440                         fi
8441                   done
8442                 fi
8443
8444                 if test "$cf_have_incdir" = no ; then
8445                   if test "$cf_add_incdir" = /usr/local/include ; then
8446                         if test "$GCC" = yes
8447                         then
8448                           cf_save_CPPFLAGS=$CPPFLAGS
8449
8450         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8451         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8452
8453                           cat >conftest.$ac_ext <<_ACEOF
8454 #line 8454 "configure"
8455 #include "confdefs.h"
8456 #include <stdio.h>
8457 int
8458 main (void)
8459 {
8460 printf("Hello")
8461   ;
8462   return 0;
8463 }
8464 _ACEOF
8465 rm -f conftest.$ac_objext
8466 if { (eval echo "$as_me:8466: \"$ac_compile\"") >&5
8467   (eval $ac_compile) 2>&5
8468   ac_status=$?
8469   echo "$as_me:8469: \$? = $ac_status" >&5
8470   (exit $ac_status); } &&
8471          { ac_try='test -s conftest.$ac_objext'
8472   { (eval echo "$as_me:8472: \"$ac_try\"") >&5
8473   (eval $ac_try) 2>&5
8474   ac_status=$?
8475   echo "$as_me:8475: \$? = $ac_status" >&5
8476   (exit $ac_status); }; }; then
8477   :
8478 else
8479   echo "$as_me: failed program was:" >&5
8480 cat conftest.$ac_ext >&5
8481 cf_have_incdir=yes
8482 fi
8483 rm -f conftest.$ac_objext conftest.$ac_ext
8484                           CPPFLAGS=$cf_save_CPPFLAGS
8485                         fi
8486                   fi
8487                 fi
8488
8489                 if test "$cf_have_incdir" = no ; then
8490                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8491
8492 echo "${as_me:-configure}:8492: testing adding $cf_add_incdir to include-path ..." 1>&5
8493
8494                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8495
8496                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8497                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8498                   cf_add_incdir="$cf_top_incdir"
8499                 else
8500                   break
8501                 fi
8502           else
8503                 break
8504           fi
8505         done
8506   done
8507 fi
8508
8509 }
8510
8511 echo "$as_me:8511: checking for $cf_ncuhdr_root header in include-path" >&5
8512 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8513 if test "${cf_cv_ncurses_h+set}" = set; then
8514   echo $ECHO_N "(cached) $ECHO_C" >&6
8515 else
8516
8517         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8518         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8519         for cf_header in $cf_header_list
8520         do
8521
8522         cat >conftest.$ac_ext <<_ACEOF
8523 #line 8523 "configure"
8524 #include "confdefs.h"
8525
8526 #include <$cf_header>
8527 int
8528 main (void)
8529 {
8530
8531 #ifdef NCURSES_VERSION
8532
8533 printf("%s\n", NCURSES_VERSION);
8534 #else
8535 #ifdef __NCURSES_H
8536 printf("old\n");
8537 #else
8538         make an error
8539 #endif
8540 #endif
8541
8542   ;
8543   return 0;
8544 }
8545 _ACEOF
8546 rm -f conftest.$ac_objext
8547 if { (eval echo "$as_me:8547: \"$ac_compile\"") >&5
8548   (eval $ac_compile) 2>&5
8549   ac_status=$?
8550   echo "$as_me:8550: \$? = $ac_status" >&5
8551   (exit $ac_status); } &&
8552          { ac_try='test -s conftest.$ac_objext'
8553   { (eval echo "$as_me:8553: \"$ac_try\"") >&5
8554   (eval $ac_try) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit $ac_status); }; }; then
8558   cf_cv_ncurses_h=$cf_header
8559
8560 else
8561   echo "$as_me: failed program was:" >&5
8562 cat conftest.$ac_ext >&5
8563 cf_cv_ncurses_h=no
8564 fi
8565 rm -f conftest.$ac_objext conftest.$ac_ext
8566
8567                 test "$cf_cv_ncurses_h" != no && break
8568         done
8569
8570 fi
8571 echo "$as_me:8571: result: $cf_cv_ncurses_h" >&5
8572 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8573
8574 if test "$cf_cv_ncurses_h" != no ; then
8575         cf_cv_ncurses_header=$cf_cv_ncurses_h
8576 else
8577
8578 echo "$as_me:8578: checking for $cf_ncuhdr_root include-path" >&5
8579 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8580 if test "${cf_cv_ncurses_h2+set}" = set; then
8581   echo $ECHO_N "(cached) $ECHO_C" >&6
8582 else
8583
8584         test -n "$verbose" && echo
8585
8586 cf_search=
8587
8588 # collect the current set of include-directories from compiler flags
8589 cf_header_path_list=""
8590 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8591         for cf_header_path in $CPPFLAGS $CFLAGS
8592         do
8593                 case $cf_header_path in
8594                 (-I*)
8595                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8596
8597 test "x$cf_header_path" != "xNONE" && \
8598 test -d "$cf_header_path" && \
8599  {
8600         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8601         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8602         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8603         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8604         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8605         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"
8606 }
8607
8608                         cf_header_path_list="$cf_header_path_list $cf_search"
8609                         ;;
8610                 esac
8611         done
8612 fi
8613
8614 # add the variations for the package we are looking for
8615
8616 cf_search=
8617
8618 test "x$prefix" != "xNONE" && \
8619 test -d "$prefix" && \
8620  {
8621         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8622         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8623         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8624         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8625         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8626         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8627 }
8628
8629 for cf_subdir_prefix in \
8630         /usr \
8631         /usr/local \
8632         /usr/pkg \
8633         /opt \
8634         /opt/local \
8635         $HOME
8636 do
8637
8638 test "x$cf_subdir_prefix" != "x$prefix" && \
8639 test -d "$cf_subdir_prefix" && \
8640 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8641         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8642         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8643         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8644         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8645         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8646         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"
8647 }
8648
8649 done
8650
8651 test "$includedir" != NONE && \
8652 test "$includedir" != "/usr/include" && \
8653 test -d "$includedir" && {
8654         test -d $includedir &&    cf_search="$cf_search $includedir"
8655         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8656 }
8657
8658 test "$oldincludedir" != NONE && \
8659 test "$oldincludedir" != "/usr/include" && \
8660 test -d "$oldincludedir" && {
8661         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8662         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8663 }
8664
8665 cf_search="$cf_search $cf_header_path_list"
8666
8667         test -n "$verbose" && echo search path $cf_search
8668         cf_save2_CPPFLAGS="$CPPFLAGS"
8669         for cf_incdir in $cf_search
8670         do
8671
8672 if test -n "$cf_incdir" ; then
8673   for cf_add_incdir in $cf_incdir
8674   do
8675         while test $cf_add_incdir != /usr/include
8676         do
8677           if test -d $cf_add_incdir
8678           then
8679                 cf_have_incdir=no
8680                 if test -n "$CFLAGS$CPPFLAGS" ; then
8681                   # a loop is needed to ensure we can add subdirs of existing dirs
8682                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8683                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8684                           cf_have_incdir=yes; break
8685                         fi
8686                   done
8687                 fi
8688
8689                 if test "$cf_have_incdir" = no ; then
8690                   if test "$cf_add_incdir" = /usr/local/include ; then
8691                         if test "$GCC" = yes
8692                         then
8693                           cf_save_CPPFLAGS=$CPPFLAGS
8694
8695         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8696         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8697
8698                           cat >conftest.$ac_ext <<_ACEOF
8699 #line 8699 "configure"
8700 #include "confdefs.h"
8701 #include <stdio.h>
8702 int
8703 main (void)
8704 {
8705 printf("Hello")
8706   ;
8707   return 0;
8708 }
8709 _ACEOF
8710 rm -f conftest.$ac_objext
8711 if { (eval echo "$as_me:8711: \"$ac_compile\"") >&5
8712   (eval $ac_compile) 2>&5
8713   ac_status=$?
8714   echo "$as_me:8714: \$? = $ac_status" >&5
8715   (exit $ac_status); } &&
8716          { ac_try='test -s conftest.$ac_objext'
8717   { (eval echo "$as_me:8717: \"$ac_try\"") >&5
8718   (eval $ac_try) 2>&5
8719   ac_status=$?
8720   echo "$as_me:8720: \$? = $ac_status" >&5
8721   (exit $ac_status); }; }; then
8722   :
8723 else
8724   echo "$as_me: failed program was:" >&5
8725 cat conftest.$ac_ext >&5
8726 cf_have_incdir=yes
8727 fi
8728 rm -f conftest.$ac_objext conftest.$ac_ext
8729                           CPPFLAGS=$cf_save_CPPFLAGS
8730                         fi
8731                   fi
8732                 fi
8733
8734                 if test "$cf_have_incdir" = no ; then
8735                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8736
8737 echo "${as_me:-configure}:8737: testing adding $cf_add_incdir to include-path ..." 1>&5
8738
8739                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8740
8741                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8742                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8743                   cf_add_incdir="$cf_top_incdir"
8744                 else
8745                   break
8746                 fi
8747           else
8748                 break
8749           fi
8750         done
8751   done
8752 fi
8753
8754                 for cf_header in \
8755                         ncurses.h \
8756                         curses.h
8757                 do
8758
8759         cat >conftest.$ac_ext <<_ACEOF
8760 #line 8760 "configure"
8761 #include "confdefs.h"
8762
8763 #include <$cf_header>
8764 int
8765 main (void)
8766 {
8767
8768 #ifdef NCURSES_VERSION
8769
8770 printf("%s\n", NCURSES_VERSION);
8771 #else
8772 #ifdef __NCURSES_H
8773 printf("old\n");
8774 #else
8775         make an error
8776 #endif
8777 #endif
8778
8779   ;
8780   return 0;
8781 }
8782 _ACEOF
8783 rm -f conftest.$ac_objext
8784 if { (eval echo "$as_me:8784: \"$ac_compile\"") >&5
8785   (eval $ac_compile) 2>&5
8786   ac_status=$?
8787   echo "$as_me:8787: \$? = $ac_status" >&5
8788   (exit $ac_status); } &&
8789          { ac_try='test -s conftest.$ac_objext'
8790   { (eval echo "$as_me:8790: \"$ac_try\"") >&5
8791   (eval $ac_try) 2>&5
8792   ac_status=$?
8793   echo "$as_me:8793: \$? = $ac_status" >&5
8794   (exit $ac_status); }; }; then
8795   cf_cv_ncurses_h2=$cf_header
8796
8797 else
8798   echo "$as_me: failed program was:" >&5
8799 cat conftest.$ac_ext >&5
8800 cf_cv_ncurses_h2=no
8801 fi
8802 rm -f conftest.$ac_objext conftest.$ac_ext
8803
8804                         if test "$cf_cv_ncurses_h2" != no ; then
8805                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8806                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8807                                 break
8808                         fi
8809                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8810                 done
8811                 CPPFLAGS="$cf_save2_CPPFLAGS"
8812                 test "$cf_cv_ncurses_h2" != no && break
8813         done
8814         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8814: error: not found" >&5
8815 echo "$as_me: error: not found" >&2;}
8816    { (exit 1); exit 1; }; }
8817
8818 fi
8819 echo "$as_me:8819: result: $cf_cv_ncurses_h2" >&5
8820 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8821
8822         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8823         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8824         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8825                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8826         fi
8827
8828 if test -n "$cf_1st_incdir" ; then
8829   for cf_add_incdir in $cf_1st_incdir
8830   do
8831         while test $cf_add_incdir != /usr/include
8832         do
8833           if test -d $cf_add_incdir
8834           then
8835                 cf_have_incdir=no
8836                 if test -n "$CFLAGS$CPPFLAGS" ; then
8837                   # a loop is needed to ensure we can add subdirs of existing dirs
8838                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8839                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8840                           cf_have_incdir=yes; break
8841                         fi
8842                   done
8843                 fi
8844
8845                 if test "$cf_have_incdir" = no ; then
8846                   if test "$cf_add_incdir" = /usr/local/include ; then
8847                         if test "$GCC" = yes
8848                         then
8849                           cf_save_CPPFLAGS=$CPPFLAGS
8850
8851         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8852         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8853
8854                           cat >conftest.$ac_ext <<_ACEOF
8855 #line 8855 "configure"
8856 #include "confdefs.h"
8857 #include <stdio.h>
8858 int
8859 main (void)
8860 {
8861 printf("Hello")
8862   ;
8863   return 0;
8864 }
8865 _ACEOF
8866 rm -f conftest.$ac_objext
8867 if { (eval echo "$as_me:8867: \"$ac_compile\"") >&5
8868   (eval $ac_compile) 2>&5
8869   ac_status=$?
8870   echo "$as_me:8870: \$? = $ac_status" >&5
8871   (exit $ac_status); } &&
8872          { ac_try='test -s conftest.$ac_objext'
8873   { (eval echo "$as_me:8873: \"$ac_try\"") >&5
8874   (eval $ac_try) 2>&5
8875   ac_status=$?
8876   echo "$as_me:8876: \$? = $ac_status" >&5
8877   (exit $ac_status); }; }; then
8878   :
8879 else
8880   echo "$as_me: failed program was:" >&5
8881 cat conftest.$ac_ext >&5
8882 cf_have_incdir=yes
8883 fi
8884 rm -f conftest.$ac_objext conftest.$ac_ext
8885                           CPPFLAGS=$cf_save_CPPFLAGS
8886                         fi
8887                   fi
8888                 fi
8889
8890                 if test "$cf_have_incdir" = no ; then
8891                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8892
8893 echo "${as_me:-configure}:8893: testing adding $cf_add_incdir to include-path ..." 1>&5
8894
8895                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8896
8897                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8898                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8899                   cf_add_incdir="$cf_top_incdir"
8900                 else
8901                   break
8902                 fi
8903           else
8904                 break
8905           fi
8906         done
8907   done
8908 fi
8909
8910 fi
8911
8912 # Set definitions to allow ifdef'ing for ncurses.h
8913
8914 case $cf_cv_ncurses_header in
8915 (*ncurses.h)
8916
8917 cat >>confdefs.h <<\EOF
8918 #define HAVE_NCURSES_H 1
8919 EOF
8920
8921         ;;
8922 esac
8923
8924 case $cf_cv_ncurses_header in
8925 (ncurses/curses.h|ncurses/ncurses.h)
8926
8927 cat >>confdefs.h <<\EOF
8928 #define HAVE_NCURSES_NCURSES_H 1
8929 EOF
8930
8931         ;;
8932 (ncursesw/curses.h|ncursesw/ncurses.h)
8933
8934 cat >>confdefs.h <<\EOF
8935 #define HAVE_NCURSESW_NCURSES_H 1
8936 EOF
8937
8938         ;;
8939 esac
8940
8941 echo "$as_me:8941: checking for terminfo header" >&5
8942 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8943 if test "${cf_cv_term_header+set}" = set; then
8944   echo $ECHO_N "(cached) $ECHO_C" >&6
8945 else
8946
8947 case ${cf_cv_ncurses_header} in
8948 (*/ncurses.h|*/ncursesw.h)
8949         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8950         ;;
8951 (*)
8952         cf_term_header=term.h
8953         ;;
8954 esac
8955
8956 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8957 do
8958 cat >conftest.$ac_ext <<_ACEOF
8959 #line 8959 "configure"
8960 #include "confdefs.h"
8961 #include <stdio.h>
8962 #include <${cf_cv_ncurses_header:-curses.h}>
8963 #include <$cf_test>
8964
8965 int
8966 main (void)
8967 {
8968 int x = auto_left_margin; (void)x
8969   ;
8970   return 0;
8971 }
8972 _ACEOF
8973 rm -f conftest.$ac_objext
8974 if { (eval echo "$as_me:8974: \"$ac_compile\"") >&5
8975   (eval $ac_compile) 2>&5
8976   ac_status=$?
8977   echo "$as_me:8977: \$? = $ac_status" >&5
8978   (exit $ac_status); } &&
8979          { ac_try='test -s conftest.$ac_objext'
8980   { (eval echo "$as_me:8980: \"$ac_try\"") >&5
8981   (eval $ac_try) 2>&5
8982   ac_status=$?
8983   echo "$as_me:8983: \$? = $ac_status" >&5
8984   (exit $ac_status); }; }; then
8985
8986         cf_cv_term_header="$cf_test"
8987 else
8988   echo "$as_me: failed program was:" >&5
8989 cat conftest.$ac_ext >&5
8990
8991         cf_cv_term_header=unknown
8992
8993 fi
8994 rm -f conftest.$ac_objext conftest.$ac_ext
8995         test "$cf_cv_term_header" != unknown && break
8996 done
8997
8998 fi
8999 echo "$as_me:8999: result: $cf_cv_term_header" >&5
9000 echo "${ECHO_T}$cf_cv_term_header" >&6
9001
9002 # Set definitions to allow ifdef'ing to accommodate subdirectories
9003
9004 case $cf_cv_term_header in
9005 (*term.h)
9006
9007 cat >>confdefs.h <<\EOF
9008 #define HAVE_TERM_H 1
9009 EOF
9010
9011         ;;
9012 esac
9013
9014 case $cf_cv_term_header in
9015 (ncurses/term.h)
9016
9017 cat >>confdefs.h <<\EOF
9018 #define HAVE_NCURSES_TERM_H 1
9019 EOF
9020
9021         ;;
9022 (ncursesw/term.h)
9023
9024 cat >>confdefs.h <<\EOF
9025 #define HAVE_NCURSESW_TERM_H 1
9026 EOF
9027
9028         ;;
9029 esac
9030
9031 # some applications need this, but should check for NCURSES_VERSION
9032
9033 cat >>confdefs.h <<\EOF
9034 #define NCURSES 1
9035 EOF
9036
9037 echo "$as_me:9037: checking for ncurses version" >&5
9038 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9039 if test "${cf_cv_ncurses_version+set}" = set; then
9040   echo $ECHO_N "(cached) $ECHO_C" >&6
9041 else
9042
9043         cf_cv_ncurses_version=no
9044         cf_tempfile=out$$
9045         rm -f $cf_tempfile
9046         if test "$cross_compiling" = yes; then
9047
9048         # This will not work if the preprocessor splits the line after the
9049         # Autoconf token.  The 'unproto' program does that.
9050         cat > conftest.$ac_ext <<EOF
9051 #include <${cf_cv_ncurses_header:-curses.h}>
9052 #undef Autoconf
9053 #ifdef NCURSES_VERSION
9054 Autoconf NCURSES_VERSION
9055 #else
9056 #ifdef __NCURSES_H
9057 Autoconf "old"
9058 #endif
9059 ;
9060 #endif
9061 EOF
9062         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9063         { (eval echo "$as_me:9063: \"$cf_try\"") >&5
9064   (eval $cf_try) 2>&5
9065   ac_status=$?
9066   echo "$as_me:9066: \$? = $ac_status" >&5
9067   (exit $ac_status); }
9068         if test -f conftest.out ; then
9069                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9070                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9071                 rm -f conftest.out
9072         fi
9073
9074 else
9075   cat >conftest.$ac_ext <<_ACEOF
9076 #line 9076 "configure"
9077 #include "confdefs.h"
9078
9079 #include <${cf_cv_ncurses_header:-curses.h}>
9080 #include <stdio.h>
9081 int main(void)
9082 {
9083         FILE *fp = fopen("$cf_tempfile", "w");
9084 #ifdef NCURSES_VERSION
9085 # ifdef NCURSES_VERSION_PATCH
9086         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9087 # else
9088         fprintf(fp, "%s\n", NCURSES_VERSION);
9089 # endif
9090 #else
9091 # ifdef __NCURSES_H
9092         fprintf(fp, "old\n");
9093 # else
9094         make an error
9095 # endif
9096 #endif
9097         ${cf_cv_main_return:-return}(0);
9098 }
9099 _ACEOF
9100 rm -f conftest$ac_exeext
9101 if { (eval echo "$as_me:9101: \"$ac_link\"") >&5
9102   (eval $ac_link) 2>&5
9103   ac_status=$?
9104   echo "$as_me:9104: \$? = $ac_status" >&5
9105   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9106   { (eval echo "$as_me:9106: \"$ac_try\"") >&5
9107   (eval $ac_try) 2>&5
9108   ac_status=$?
9109   echo "$as_me:9109: \$? = $ac_status" >&5
9110   (exit $ac_status); }; }; then
9111
9112         cf_cv_ncurses_version=`cat $cf_tempfile`
9113 else
9114   echo "$as_me: program exited with status $ac_status" >&5
9115 echo "$as_me: failed program was:" >&5
9116 cat conftest.$ac_ext >&5
9117 fi
9118 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9119 fi
9120         rm -f $cf_tempfile
9121
9122 fi
9123 echo "$as_me:9123: result: $cf_cv_ncurses_version" >&5
9124 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9125 test "$cf_cv_ncurses_version" = no ||
9126 cat >>confdefs.h <<\EOF
9127 #define NCURSES 1
9128 EOF
9129
9130 cf_nculib_root=$cf_cv_screen
9131         # This works, except for the special case where we find gpm, but
9132         # ncurses is in a nonstandard location via $LIBS, and we really want
9133         # to link gpm.
9134 cf_ncurses_LIBS=""
9135 cf_ncurses_SAVE="$LIBS"
9136 echo "$as_me:9136: checking for Gpm_Open in -lgpm" >&5
9137 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9138 if test "${ac_cv_lib_gpm_Gpm_Open+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 Gpm_Open ();
9154 int
9155 main (void)
9156 {
9157 Gpm_Open ();
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_Gpm_Open=yes
9175 else
9176   echo "$as_me: failed program was:" >&5
9177 cat conftest.$ac_ext >&5
9178 ac_cv_lib_gpm_Gpm_Open=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_Gpm_Open" >&5
9184 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9185 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9186   echo "$as_me:9186: checking for initscr in -lgpm" >&5
9187 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9188 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9189   echo $ECHO_N "(cached) $ECHO_C" >&6
9190 else
9191   ac_check_lib_save_LIBS=$LIBS
9192 LIBS="-lgpm  $LIBS"
9193 cat >conftest.$ac_ext <<_ACEOF
9194 #line 9194 "configure"
9195 #include "confdefs.h"
9196
9197 /* Override any gcc2 internal prototype to avoid an error.  */
9198 #ifdef __cplusplus
9199 extern "C"
9200 #endif
9201 /* We use char because int might match the return type of a gcc2
9202    builtin and then its argument prototype would still apply.  */
9203 char initscr ();
9204 int
9205 main (void)
9206 {
9207 initscr ();
9208   ;
9209   return 0;
9210 }
9211 _ACEOF
9212 rm -f conftest.$ac_objext conftest$ac_exeext
9213 if { (eval echo "$as_me:9213: \"$ac_link\"") >&5
9214   (eval $ac_link) 2>&5
9215   ac_status=$?
9216   echo "$as_me:9216: \$? = $ac_status" >&5
9217   (exit $ac_status); } &&
9218          { ac_try='test -s conftest$ac_exeext'
9219   { (eval echo "$as_me:9219: \"$ac_try\"") >&5
9220   (eval $ac_try) 2>&5
9221   ac_status=$?
9222   echo "$as_me:9222: \$? = $ac_status" >&5
9223   (exit $ac_status); }; }; then
9224   ac_cv_lib_gpm_initscr=yes
9225 else
9226   echo "$as_me: failed program was:" >&5
9227 cat conftest.$ac_ext >&5
9228 ac_cv_lib_gpm_initscr=no
9229 fi
9230 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9231 LIBS=$ac_check_lib_save_LIBS
9232 fi
9233 echo "$as_me:9233: result: $ac_cv_lib_gpm_initscr" >&5
9234 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9235 if test $ac_cv_lib_gpm_initscr = yes; then
9236   LIBS="$cf_ncurses_SAVE"
9237 else
9238   cf_ncurses_LIBS="-lgpm"
9239 fi
9240
9241 fi
9242
9243 case $host_os in
9244 (freebsd*)
9245         # This is only necessary if you are linking against an obsolete
9246         # version of ncurses (but it should do no harm, since it's static).
9247         if test "$cf_nculib_root" = ncurses ; then
9248                 echo "$as_me:9248: checking for tgoto in -lmytinfo" >&5
9249 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9250 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9251   echo $ECHO_N "(cached) $ECHO_C" >&6
9252 else
9253   ac_check_lib_save_LIBS=$LIBS
9254 LIBS="-lmytinfo  $LIBS"
9255 cat >conftest.$ac_ext <<_ACEOF
9256 #line 9256 "configure"
9257 #include "confdefs.h"
9258
9259 /* Override any gcc2 internal prototype to avoid an error.  */
9260 #ifdef __cplusplus
9261 extern "C"
9262 #endif
9263 /* We use char because int might match the return type of a gcc2
9264    builtin and then its argument prototype would still apply.  */
9265 char tgoto ();
9266 int
9267 main (void)
9268 {
9269 tgoto ();
9270   ;
9271   return 0;
9272 }
9273 _ACEOF
9274 rm -f conftest.$ac_objext conftest$ac_exeext
9275 if { (eval echo "$as_me:9275: \"$ac_link\"") >&5
9276   (eval $ac_link) 2>&5
9277   ac_status=$?
9278   echo "$as_me:9278: \$? = $ac_status" >&5
9279   (exit $ac_status); } &&
9280          { ac_try='test -s conftest$ac_exeext'
9281   { (eval echo "$as_me:9281: \"$ac_try\"") >&5
9282   (eval $ac_try) 2>&5
9283   ac_status=$?
9284   echo "$as_me:9284: \$? = $ac_status" >&5
9285   (exit $ac_status); }; }; then
9286   ac_cv_lib_mytinfo_tgoto=yes
9287 else
9288   echo "$as_me: failed program was:" >&5
9289 cat conftest.$ac_ext >&5
9290 ac_cv_lib_mytinfo_tgoto=no
9291 fi
9292 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9293 LIBS=$ac_check_lib_save_LIBS
9294 fi
9295 echo "$as_me:9295: result: $ac_cv_lib_mytinfo_tgoto" >&5
9296 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9297 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9298   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9299 fi
9300
9301         fi
9302         ;;
9303 esac
9304
9305 cf_add_libs="$LIBS"
9306 # reverse order
9307 cf_add_0lib=
9308 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9309 # filter duplicates
9310 for cf_add_1lib in $cf_add_0lib; do
9311         for cf_add_2lib in $cf_add_libs; do
9312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9313                         cf_add_1lib=
9314                         break
9315                 fi
9316         done
9317         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9318 done
9319 LIBS="$cf_add_libs"
9320
9321 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9322 then
9323
9324 cf_add_libs="$LIBS"
9325 # reverse order
9326 cf_add_0lib=
9327 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9328 # filter duplicates
9329 for cf_add_1lib in $cf_add_0lib; do
9330         for cf_add_2lib in $cf_add_libs; do
9331                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9332                         cf_add_1lib=
9333                         break
9334                 fi
9335         done
9336         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9337 done
9338 LIBS="$cf_add_libs"
9339
9340 else
9341
9342         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9343         cf_libdir=""
9344         echo "$as_me:9344: checking for initscr" >&5
9345 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9346 if test "${ac_cv_func_initscr+set}" = set; then
9347   echo $ECHO_N "(cached) $ECHO_C" >&6
9348 else
9349   cat >conftest.$ac_ext <<_ACEOF
9350 #line 9350 "configure"
9351 #include "confdefs.h"
9352 #define initscr autoconf_temporary
9353 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9354 #undef initscr
9355
9356 #ifdef __cplusplus
9357 extern "C"
9358 #endif
9359
9360 /* We use char because int might match the return type of a gcc2
9361    builtin and then its argument prototype would still apply.  */
9362 char initscr (void);
9363
9364 int
9365 main (void)
9366 {
9367
9368 /* The GNU C library defines stubs for functions which it implements
9369     to always fail with ENOSYS.  Some functions are actually named
9370     something starting with __ and the normal name is an alias.  */
9371 #if defined (__stub_initscr) || defined (__stub___initscr)
9372 #error found stub for initscr
9373 #endif
9374
9375         return initscr ();
9376   ;
9377   return 0;
9378 }
9379 _ACEOF
9380 rm -f conftest.$ac_objext conftest$ac_exeext
9381 if { (eval echo "$as_me:9381: \"$ac_link\"") >&5
9382   (eval $ac_link) 2>&5
9383   ac_status=$?
9384   echo "$as_me:9384: \$? = $ac_status" >&5
9385   (exit $ac_status); } &&
9386          { ac_try='test -s conftest$ac_exeext'
9387   { (eval echo "$as_me:9387: \"$ac_try\"") >&5
9388   (eval $ac_try) 2>&5
9389   ac_status=$?
9390   echo "$as_me:9390: \$? = $ac_status" >&5
9391   (exit $ac_status); }; }; then
9392   ac_cv_func_initscr=yes
9393 else
9394   echo "$as_me: failed program was:" >&5
9395 cat conftest.$ac_ext >&5
9396 ac_cv_func_initscr=no
9397 fi
9398 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9399 fi
9400 echo "$as_me:9400: result: $ac_cv_func_initscr" >&5
9401 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9402 if test $ac_cv_func_initscr = yes; then
9403   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9404 else
9405
9406                 cf_save_LIBS="$LIBS"
9407                 echo "$as_me:9407: checking for initscr in -l$cf_nculib_root" >&5
9408 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9409                 LIBS="-l$cf_nculib_root $LIBS"
9410                 cat >conftest.$ac_ext <<_ACEOF
9411 #line 9411 "configure"
9412 #include "confdefs.h"
9413 #include <${cf_cv_ncurses_header:-curses.h}>
9414 int
9415 main (void)
9416 {
9417 initscr()
9418   ;
9419   return 0;
9420 }
9421 _ACEOF
9422 rm -f conftest.$ac_objext conftest$ac_exeext
9423 if { (eval echo "$as_me:9423: \"$ac_link\"") >&5
9424   (eval $ac_link) 2>&5
9425   ac_status=$?
9426   echo "$as_me:9426: \$? = $ac_status" >&5
9427   (exit $ac_status); } &&
9428          { ac_try='test -s conftest$ac_exeext'
9429   { (eval echo "$as_me:9429: \"$ac_try\"") >&5
9430   (eval $ac_try) 2>&5
9431   ac_status=$?
9432   echo "$as_me:9432: \$? = $ac_status" >&5
9433   (exit $ac_status); }; }; then
9434   echo "$as_me:9434: result: yes" >&5
9435 echo "${ECHO_T}yes" >&6
9436                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9437
9438 else
9439   echo "$as_me: failed program was:" >&5
9440 cat conftest.$ac_ext >&5
9441 echo "$as_me:9441: result: no" >&5
9442 echo "${ECHO_T}no" >&6
9443
9444 cf_search=
9445 cf_library_path_list=""
9446 if test -n "${LDFLAGS}${LIBS}" ; then
9447         for cf_library_path in $LDFLAGS $LIBS
9448         do
9449                 case $cf_library_path in
9450                 (-L*)
9451                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9452
9453 test "x$cf_library_path" != "xNONE" && \
9454 test -d "$cf_library_path" && \
9455  {
9456         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9457         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9458         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9459         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9460         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9461         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"
9462 }
9463
9464                         cf_library_path_list="$cf_library_path_list $cf_search"
9465                         ;;
9466                 esac
9467         done
9468 fi
9469
9470 cf_search=
9471
9472 test "x$prefix" != "xNONE" && \
9473 test -d "$prefix" && \
9474  {
9475         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9476         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9477         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9478         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9479         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9480         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9481 }
9482
9483 for cf_subdir_prefix in \
9484         /usr \
9485         /usr/local \
9486         /usr/pkg \
9487         /opt \
9488         /opt/local \
9489         $HOME
9490 do
9491
9492 test "x$cf_subdir_prefix" != "x$prefix" && \
9493 test -d "$cf_subdir_prefix" && \
9494 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9495         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9496         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9497         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9498         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9499         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9500         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"
9501 }
9502
9503 done
9504
9505 cf_search="$cf_library_path_list $cf_search"
9506
9507                         for cf_libdir in $cf_search
9508                         do
9509                                 echo "$as_me:9509: checking for -l$cf_nculib_root in $cf_libdir" >&5
9510 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9511                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9512                                 cat >conftest.$ac_ext <<_ACEOF
9513 #line 9513 "configure"
9514 #include "confdefs.h"
9515 #include <${cf_cv_ncurses_header:-curses.h}>
9516 int
9517 main (void)
9518 {
9519 initscr()
9520   ;
9521   return 0;
9522 }
9523 _ACEOF
9524 rm -f conftest.$ac_objext conftest$ac_exeext
9525 if { (eval echo "$as_me:9525: \"$ac_link\"") >&5
9526   (eval $ac_link) 2>&5
9527   ac_status=$?
9528   echo "$as_me:9528: \$? = $ac_status" >&5
9529   (exit $ac_status); } &&
9530          { ac_try='test -s conftest$ac_exeext'
9531   { (eval echo "$as_me:9531: \"$ac_try\"") >&5
9532   (eval $ac_try) 2>&5
9533   ac_status=$?
9534   echo "$as_me:9534: \$? = $ac_status" >&5
9535   (exit $ac_status); }; }; then
9536   echo "$as_me:9536: result: yes" >&5
9537 echo "${ECHO_T}yes" >&6
9538                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9539                                          break
9540 else
9541   echo "$as_me: failed program was:" >&5
9542 cat conftest.$ac_ext >&5
9543 echo "$as_me:9543: result: no" >&5
9544 echo "${ECHO_T}no" >&6
9545                                          LIBS="$cf_save_LIBS"
9546 fi
9547 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9548                         done
9549
9550 fi
9551 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9552
9553 fi
9554
9555 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9556
9557 if test $cf_found_library = no ; then
9558         { { echo "$as_me:9558: error: Cannot link $cf_nculib_root library" >&5
9559 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9560    { (exit 1); exit 1; }; }
9561 fi
9562
9563 fi
9564
9565 if test -n "$cf_ncurses_LIBS" ; then
9566         echo "$as_me:9566: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9567 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9568         cf_ncurses_SAVE="$LIBS"
9569         for p in $cf_ncurses_LIBS ; do
9570                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9571                 if test "$q" != "$LIBS" ; then
9572                         LIBS="$q"
9573                 fi
9574         done
9575         cat >conftest.$ac_ext <<_ACEOF
9576 #line 9576 "configure"
9577 #include "confdefs.h"
9578 #include <${cf_cv_ncurses_header:-curses.h}>
9579 int
9580 main (void)
9581 {
9582 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9583   ;
9584   return 0;
9585 }
9586 _ACEOF
9587 rm -f conftest.$ac_objext conftest$ac_exeext
9588 if { (eval echo "$as_me:9588: \"$ac_link\"") >&5
9589   (eval $ac_link) 2>&5
9590   ac_status=$?
9591   echo "$as_me:9591: \$? = $ac_status" >&5
9592   (exit $ac_status); } &&
9593          { ac_try='test -s conftest$ac_exeext'
9594   { (eval echo "$as_me:9594: \"$ac_try\"") >&5
9595   (eval $ac_try) 2>&5
9596   ac_status=$?
9597   echo "$as_me:9597: \$? = $ac_status" >&5
9598   (exit $ac_status); }; }; then
9599   echo "$as_me:9599: result: yes" >&5
9600 echo "${ECHO_T}yes" >&6
9601 else
9602   echo "$as_me: failed program was:" >&5
9603 cat conftest.$ac_ext >&5
9604 echo "$as_me:9604: result: no" >&5
9605 echo "${ECHO_T}no" >&6
9606                  LIBS="$cf_ncurses_SAVE"
9607 fi
9608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9609 fi
9610
9611 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9612
9613 cat >>confdefs.h <<EOF
9614 #define $cf_nculib_ROOT 1
9615 EOF
9616
9617         fi
9618 else
9619         NCURSES_CONFIG=none
9620 fi
9621
9622         ;;
9623 (ncurses*)
9624
9625 cf_ncuconfig_root=$cf_cv_screen
9626 cf_have_ncuconfig=no
9627
9628 if test "x${PKG_CONFIG:=none}" != xnone; then
9629         echo "$as_me:9629: checking pkg-config for $cf_ncuconfig_root" >&5
9630 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9631         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9632                 echo "$as_me:9632: result: yes" >&5
9633 echo "${ECHO_T}yes" >&6
9634
9635                 echo "$as_me:9635: checking if the $cf_ncuconfig_root package files work" >&5
9636 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9637                 cf_have_ncuconfig=unknown
9638
9639                 cf_save_CFLAGS="$CFLAGS"
9640                 cf_save_CPPFLAGS="$CPPFLAGS"
9641                 cf_save_LIBS="$LIBS"
9642
9643                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9644                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9645
9646                 # while -W for passing linker flags is prevalent, it is not "standard".
9647                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9648                 # incompatible _and_ non-standard -W option which gives an error.  Work
9649                 # around that pitfall.
9650                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9651                 (x*c[89]9@@*-W*)
9652
9653 cf_fix_cppflags=no
9654 cf_new_cflags=
9655 cf_new_cppflags=
9656 cf_new_extra_cppflags=
9657
9658 for cf_add_cflags in $cf_pkg_cflags
9659 do
9660 case $cf_fix_cppflags in
9661 (no)
9662         case $cf_add_cflags in
9663         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9664                 case $cf_add_cflags in
9665                 (-D*)
9666                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9667
9668                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9669                                 && test -z "${cf_tst_cflags}" \
9670                                 && cf_fix_cppflags=yes
9671
9672                         if test $cf_fix_cppflags = yes ; then
9673
9674         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9675         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9676
9677                                 continue
9678                         elif test "${cf_tst_cflags}" = "\"'" ; then
9679
9680         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9681         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9682
9683                                 continue
9684                         fi
9685                         ;;
9686                 esac
9687                 case "$CPPFLAGS" in
9688                 (*$cf_add_cflags)
9689                         ;;
9690                 (*)
9691                         case $cf_add_cflags in
9692                         (-D*)
9693                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9694
9695 CPPFLAGS=`echo "$CPPFLAGS" | \
9696         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9697                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9698
9699                                 ;;
9700                         esac
9701
9702         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9703         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9704
9705                         ;;
9706                 esac
9707                 ;;
9708         (*)
9709
9710         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9711         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9712
9713                 ;;
9714         esac
9715         ;;
9716 (yes)
9717
9718         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9719         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9720
9721         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9722
9723         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9724                 && test -z "${cf_tst_cflags}" \
9725                 && cf_fix_cppflags=no
9726         ;;
9727 esac
9728 done
9729
9730 if test -n "$cf_new_cflags" ; then
9731
9732         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9733         CFLAGS="${CFLAGS}$cf_new_cflags"
9734
9735 fi
9736
9737 if test -n "$cf_new_cppflags" ; then
9738
9739         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9740         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9741
9742 fi
9743
9744 if test -n "$cf_new_extra_cppflags" ; then
9745
9746         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9747         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9748
9749 fi
9750
9751 cf_add_libs="$LIBS"
9752 # reverse order
9753 cf_add_0lib=
9754 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9755 # filter duplicates
9756 for cf_add_1lib in $cf_add_0lib; do
9757         for cf_add_2lib in $cf_add_libs; do
9758                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9759                         cf_add_1lib=
9760                         break
9761                 fi
9762         done
9763         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9764 done
9765 LIBS="$cf_add_libs"
9766
9767                         cat >conftest.$ac_ext <<_ACEOF
9768 #line 9768 "configure"
9769 #include "confdefs.h"
9770 #include <${cf_cv_ncurses_header:-curses.h}>
9771 int
9772 main (void)
9773 {
9774 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9775   ;
9776   return 0;
9777 }
9778 _ACEOF
9779 rm -f conftest.$ac_objext conftest$ac_exeext
9780 if { (eval echo "$as_me:9780: \"$ac_link\"") >&5
9781   (eval $ac_link) 2>&5
9782   ac_status=$?
9783   echo "$as_me:9783: \$? = $ac_status" >&5
9784   (exit $ac_status); } &&
9785          { ac_try='test -s conftest$ac_exeext'
9786   { (eval echo "$as_me:9786: \"$ac_try\"") >&5
9787   (eval $ac_try) 2>&5
9788   ac_status=$?
9789   echo "$as_me:9789: \$? = $ac_status" >&5
9790   (exit $ac_status); }; }; then
9791   if test "$cross_compiling" = yes; then
9792   cf_test_ncuconfig=maybe
9793 else
9794   cat >conftest.$ac_ext <<_ACEOF
9795 #line 9795 "configure"
9796 #include "confdefs.h"
9797 #include <${cf_cv_ncurses_header:-curses.h}>
9798                                         int main(void)
9799                                         { char *xx = curses_version(); return (xx == 0); }
9800 _ACEOF
9801 rm -f conftest$ac_exeext
9802 if { (eval echo "$as_me:9802: \"$ac_link\"") >&5
9803   (eval $ac_link) 2>&5
9804   ac_status=$?
9805   echo "$as_me:9805: \$? = $ac_status" >&5
9806   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9807   { (eval echo "$as_me:9807: \"$ac_try\"") >&5
9808   (eval $ac_try) 2>&5
9809   ac_status=$?
9810   echo "$as_me:9810: \$? = $ac_status" >&5
9811   (exit $ac_status); }; }; then
9812   cf_test_ncuconfig=yes
9813 else
9814   echo "$as_me: program exited with status $ac_status" >&5
9815 echo "$as_me: failed program was:" >&5
9816 cat conftest.$ac_ext >&5
9817 cf_test_ncuconfig=no
9818 fi
9819 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9820 fi
9821 else
9822   echo "$as_me: failed program was:" >&5
9823 cat conftest.$ac_ext >&5
9824 cf_test_ncuconfig=no
9825 fi
9826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9827
9828                         CFLAGS="$cf_save_CFLAGS"
9829                         CPPFLAGS="$cf_save_CPPFLAGS"
9830                         LIBS="$cf_save_LIBS"
9831
9832                         if test "x$cf_test_ncuconfig" != xyes; then
9833                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9834                                 cf_pkg_cflags="$cf_temp"
9835                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9836                                 cf_pkg_libs="$cf_temp"
9837                         fi
9838                         ;;
9839                 esac
9840
9841 cf_fix_cppflags=no
9842 cf_new_cflags=
9843 cf_new_cppflags=
9844 cf_new_extra_cppflags=
9845
9846 for cf_add_cflags in $cf_pkg_cflags
9847 do
9848 case $cf_fix_cppflags in
9849 (no)
9850         case $cf_add_cflags in
9851         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9852                 case $cf_add_cflags in
9853                 (-D*)
9854                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9855
9856                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9857                                 && test -z "${cf_tst_cflags}" \
9858                                 && cf_fix_cppflags=yes
9859
9860                         if test $cf_fix_cppflags = yes ; then
9861
9862         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9863         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9864
9865                                 continue
9866                         elif test "${cf_tst_cflags}" = "\"'" ; then
9867
9868         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9869         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9870
9871                                 continue
9872                         fi
9873                         ;;
9874                 esac
9875                 case "$CPPFLAGS" in
9876                 (*$cf_add_cflags)
9877                         ;;
9878                 (*)
9879                         case $cf_add_cflags in
9880                         (-D*)
9881                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9882
9883 CPPFLAGS=`echo "$CPPFLAGS" | \
9884         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9885                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9886
9887                                 ;;
9888                         esac
9889
9890         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9891         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9892
9893                         ;;
9894                 esac
9895                 ;;
9896         (*)
9897
9898         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9899         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9900
9901                 ;;
9902         esac
9903         ;;
9904 (yes)
9905
9906         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9907         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9908
9909         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9910
9911         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9912                 && test -z "${cf_tst_cflags}" \
9913                 && cf_fix_cppflags=no
9914         ;;
9915 esac
9916 done
9917
9918 if test -n "$cf_new_cflags" ; then
9919
9920         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9921         CFLAGS="${CFLAGS}$cf_new_cflags"
9922
9923 fi
9924
9925 if test -n "$cf_new_cppflags" ; then
9926
9927         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9928         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9929
9930 fi
9931
9932 if test -n "$cf_new_extra_cppflags" ; then
9933
9934         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9935         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9936
9937 fi
9938
9939 cf_add_libs="$LIBS"
9940 # reverse order
9941 cf_add_0lib=
9942 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9943 # filter duplicates
9944 for cf_add_1lib in $cf_add_0lib; do
9945         for cf_add_2lib in $cf_add_libs; do
9946                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9947                         cf_add_1lib=
9948                         break
9949                 fi
9950         done
9951         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9952 done
9953 LIBS="$cf_add_libs"
9954
9955                 cat >conftest.$ac_ext <<_ACEOF
9956 #line 9956 "configure"
9957 #include "confdefs.h"
9958 #include <${cf_cv_ncurses_header:-curses.h}>
9959 int
9960 main (void)
9961 {
9962 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9963   ;
9964   return 0;
9965 }
9966 _ACEOF
9967 rm -f conftest.$ac_objext conftest$ac_exeext
9968 if { (eval echo "$as_me:9968: \"$ac_link\"") >&5
9969   (eval $ac_link) 2>&5
9970   ac_status=$?
9971   echo "$as_me:9971: \$? = $ac_status" >&5
9972   (exit $ac_status); } &&
9973          { ac_try='test -s conftest$ac_exeext'
9974   { (eval echo "$as_me:9974: \"$ac_try\"") >&5
9975   (eval $ac_try) 2>&5
9976   ac_status=$?
9977   echo "$as_me:9977: \$? = $ac_status" >&5
9978   (exit $ac_status); }; }; then
9979   if test "$cross_compiling" = yes; then
9980   cf_have_ncuconfig=maybe
9981 else
9982   cat >conftest.$ac_ext <<_ACEOF
9983 #line 9983 "configure"
9984 #include "confdefs.h"
9985 #include <${cf_cv_ncurses_header:-curses.h}>
9986                                 int main(void)
9987                                 { char *xx = curses_version(); return (xx == 0); }
9988 _ACEOF
9989 rm -f conftest$ac_exeext
9990 if { (eval echo "$as_me:9990: \"$ac_link\"") >&5
9991   (eval $ac_link) 2>&5
9992   ac_status=$?
9993   echo "$as_me:9993: \$? = $ac_status" >&5
9994   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9995   { (eval echo "$as_me:9995: \"$ac_try\"") >&5
9996   (eval $ac_try) 2>&5
9997   ac_status=$?
9998   echo "$as_me:9998: \$? = $ac_status" >&5
9999   (exit $ac_status); }; }; then
10000   cf_have_ncuconfig=yes
10001 else
10002   echo "$as_me: program exited with status $ac_status" >&5
10003 echo "$as_me: failed program was:" >&5
10004 cat conftest.$ac_ext >&5
10005 cf_have_ncuconfig=no
10006 fi
10007 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10008 fi
10009 else
10010   echo "$as_me: failed program was:" >&5
10011 cat conftest.$ac_ext >&5
10012 cf_have_ncuconfig=no
10013 fi
10014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10015                 echo "$as_me:10015: result: $cf_have_ncuconfig" >&5
10016 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10017                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10018                 if test "$cf_have_ncuconfig" != "yes"
10019                 then
10020                         CPPFLAGS="$cf_save_CPPFLAGS"
10021                         LIBS="$cf_save_LIBS"
10022                         NCURSES_CONFIG_PKG=none
10023                 else
10024
10025 cat >>confdefs.h <<\EOF
10026 #define NCURSES 1
10027 EOF
10028
10029                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10030
10031 echo "$as_me:10031: checking for terminfo header" >&5
10032 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10033 if test "${cf_cv_term_header+set}" = set; then
10034   echo $ECHO_N "(cached) $ECHO_C" >&6
10035 else
10036
10037 case ${cf_cv_ncurses_header} in
10038 (*/ncurses.h|*/ncursesw.h)
10039         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10040         ;;
10041 (*)
10042         cf_term_header=term.h
10043         ;;
10044 esac
10045
10046 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10047 do
10048 cat >conftest.$ac_ext <<_ACEOF
10049 #line 10049 "configure"
10050 #include "confdefs.h"
10051 #include <stdio.h>
10052 #include <${cf_cv_ncurses_header:-curses.h}>
10053 #include <$cf_test>
10054
10055 int
10056 main (void)
10057 {
10058 int x = auto_left_margin; (void)x
10059   ;
10060   return 0;
10061 }
10062 _ACEOF
10063 rm -f conftest.$ac_objext
10064 if { (eval echo "$as_me:10064: \"$ac_compile\"") >&5
10065   (eval $ac_compile) 2>&5
10066   ac_status=$?
10067   echo "$as_me:10067: \$? = $ac_status" >&5
10068   (exit $ac_status); } &&
10069          { ac_try='test -s conftest.$ac_objext'
10070   { (eval echo "$as_me:10070: \"$ac_try\"") >&5
10071   (eval $ac_try) 2>&5
10072   ac_status=$?
10073   echo "$as_me:10073: \$? = $ac_status" >&5
10074   (exit $ac_status); }; }; then
10075
10076         cf_cv_term_header="$cf_test"
10077 else
10078   echo "$as_me: failed program was:" >&5
10079 cat conftest.$ac_ext >&5
10080
10081         cf_cv_term_header=unknown
10082
10083 fi
10084 rm -f conftest.$ac_objext conftest.$ac_ext
10085         test "$cf_cv_term_header" != unknown && break
10086 done
10087
10088 fi
10089 echo "$as_me:10089: result: $cf_cv_term_header" >&5
10090 echo "${ECHO_T}$cf_cv_term_header" >&6
10091
10092 # Set definitions to allow ifdef'ing to accommodate subdirectories
10093
10094 case $cf_cv_term_header in
10095 (*term.h)
10096
10097 cat >>confdefs.h <<\EOF
10098 #define HAVE_TERM_H 1
10099 EOF
10100
10101         ;;
10102 esac
10103
10104 case $cf_cv_term_header in
10105 (ncurses/term.h)
10106
10107 cat >>confdefs.h <<\EOF
10108 #define HAVE_NCURSES_TERM_H 1
10109 EOF
10110
10111         ;;
10112 (ncursesw/term.h)
10113
10114 cat >>confdefs.h <<\EOF
10115 #define HAVE_NCURSESW_TERM_H 1
10116 EOF
10117
10118         ;;
10119 esac
10120
10121                 fi
10122
10123         else
10124                 echo "$as_me:10124: result: no" >&5
10125 echo "${ECHO_T}no" >&6
10126                 NCURSES_CONFIG_PKG=none
10127         fi
10128 else
10129         NCURSES_CONFIG_PKG=none
10130 fi
10131
10132 if test "x$cf_have_ncuconfig" = "xno"; then
10133         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10134
10135 if test -n "$ac_tool_prefix"; then
10136   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10137   do
10138     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10139 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10140 echo "$as_me:10140: checking for $ac_word" >&5
10141 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10142 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10143   echo $ECHO_N "(cached) $ECHO_C" >&6
10144 else
10145   if test -n "$NCURSES_CONFIG"; then
10146   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10147 else
10148   ac_save_IFS=$IFS; IFS=$ac_path_separator
10149 ac_dummy="$PATH"
10150 for ac_dir in $ac_dummy; do
10151   IFS=$ac_save_IFS
10152   test -z "$ac_dir" && ac_dir=.
10153   $as_executable_p "$ac_dir/$ac_word" || continue
10154 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10155 echo "$as_me:10155: found $ac_dir/$ac_word" >&5
10156 break
10157 done
10158
10159 fi
10160 fi
10161 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10162 if test -n "$NCURSES_CONFIG"; then
10163   echo "$as_me:10163: result: $NCURSES_CONFIG" >&5
10164 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10165 else
10166   echo "$as_me:10166: result: no" >&5
10167 echo "${ECHO_T}no" >&6
10168 fi
10169
10170     test -n "$NCURSES_CONFIG" && break
10171   done
10172 fi
10173 if test -z "$NCURSES_CONFIG"; then
10174   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10175   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10176 do
10177   # Extract the first word of "$ac_prog", so it can be a program name with args.
10178 set dummy $ac_prog; ac_word=$2
10179 echo "$as_me:10179: checking for $ac_word" >&5
10180 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10181 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10182   echo $ECHO_N "(cached) $ECHO_C" >&6
10183 else
10184   if test -n "$ac_ct_NCURSES_CONFIG"; then
10185   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10186 else
10187   ac_save_IFS=$IFS; IFS=$ac_path_separator
10188 ac_dummy="$PATH"
10189 for ac_dir in $ac_dummy; do
10190   IFS=$ac_save_IFS
10191   test -z "$ac_dir" && ac_dir=.
10192   $as_executable_p "$ac_dir/$ac_word" || continue
10193 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10194 echo "$as_me:10194: found $ac_dir/$ac_word" >&5
10195 break
10196 done
10197
10198 fi
10199 fi
10200 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10201 if test -n "$ac_ct_NCURSES_CONFIG"; then
10202   echo "$as_me:10202: result: $ac_ct_NCURSES_CONFIG" >&5
10203 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10204 else
10205   echo "$as_me:10205: result: no" >&5
10206 echo "${ECHO_T}no" >&6
10207 fi
10208
10209   test -n "$ac_ct_NCURSES_CONFIG" && break
10210 done
10211 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10212
10213   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10214 fi
10215
10216         if test "$NCURSES_CONFIG" != none ; then
10217
10218 cf_fix_cppflags=no
10219 cf_new_cflags=
10220 cf_new_cppflags=
10221 cf_new_extra_cppflags=
10222
10223 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10224 do
10225 case $cf_fix_cppflags in
10226 (no)
10227         case $cf_add_cflags in
10228         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10229                 case $cf_add_cflags in
10230                 (-D*)
10231                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10232
10233                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10234                                 && test -z "${cf_tst_cflags}" \
10235                                 && cf_fix_cppflags=yes
10236
10237                         if test $cf_fix_cppflags = yes ; then
10238
10239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10241
10242                                 continue
10243                         elif test "${cf_tst_cflags}" = "\"'" ; then
10244
10245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10247
10248                                 continue
10249                         fi
10250                         ;;
10251                 esac
10252                 case "$CPPFLAGS" in
10253                 (*$cf_add_cflags)
10254                         ;;
10255                 (*)
10256                         case $cf_add_cflags in
10257                         (-D*)
10258                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10259
10260 CPPFLAGS=`echo "$CPPFLAGS" | \
10261         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10262                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10263
10264                                 ;;
10265                         esac
10266
10267         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10268         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10269
10270                         ;;
10271                 esac
10272                 ;;
10273         (*)
10274
10275         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10276         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10277
10278                 ;;
10279         esac
10280         ;;
10281 (yes)
10282
10283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10285
10286         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10287
10288         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10289                 && test -z "${cf_tst_cflags}" \
10290                 && cf_fix_cppflags=no
10291         ;;
10292 esac
10293 done
10294
10295 if test -n "$cf_new_cflags" ; then
10296
10297         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10298         CFLAGS="${CFLAGS}$cf_new_cflags"
10299
10300 fi
10301
10302 if test -n "$cf_new_cppflags" ; then
10303
10304         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10305         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10306
10307 fi
10308
10309 if test -n "$cf_new_extra_cppflags" ; then
10310
10311         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10312         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10313
10314 fi
10315
10316 cf_add_libs="$LIBS"
10317 # reverse order
10318 cf_add_0lib=
10319 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10320 # filter duplicates
10321 for cf_add_1lib in $cf_add_0lib; do
10322         for cf_add_2lib in $cf_add_libs; do
10323                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10324                         cf_add_1lib=
10325                         break
10326                 fi
10327         done
10328         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10329 done
10330 LIBS="$cf_add_libs"
10331
10332                 # even with config script, some packages use no-override for curses.h
10333
10334 echo "$as_me:10334: checking if we have identified curses headers" >&5
10335 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10336 if test "${cf_cv_ncurses_header+set}" = set; then
10337   echo $ECHO_N "(cached) $ECHO_C" >&6
10338 else
10339
10340 cf_cv_ncurses_header=none
10341 for cf_header in \
10342         ncurses.h $cf_cv_screen/ncurses.h \
10343         curses.h $cf_cv_screen/curses.h
10344 do
10345 cat >conftest.$ac_ext <<_ACEOF
10346 #line 10346 "configure"
10347 #include "confdefs.h"
10348 #include <${cf_header}>
10349 int
10350 main (void)
10351 {
10352 initscr(); tgoto("?", 0,0)
10353   ;
10354   return 0;
10355 }
10356 _ACEOF
10357 rm -f conftest.$ac_objext
10358 if { (eval echo "$as_me:10358: \"$ac_compile\"") >&5
10359   (eval $ac_compile) 2>&5
10360   ac_status=$?
10361   echo "$as_me:10361: \$? = $ac_status" >&5
10362   (exit $ac_status); } &&
10363          { ac_try='test -s conftest.$ac_objext'
10364   { (eval echo "$as_me:10364: \"$ac_try\"") >&5
10365   (eval $ac_try) 2>&5
10366   ac_status=$?
10367   echo "$as_me:10367: \$? = $ac_status" >&5
10368   (exit $ac_status); }; }; then
10369   cf_cv_ncurses_header=$cf_header; break
10370 else
10371   echo "$as_me: failed program was:" >&5
10372 cat conftest.$ac_ext >&5
10373 fi
10374 rm -f conftest.$ac_objext conftest.$ac_ext
10375 done
10376
10377 fi
10378 echo "$as_me:10378: result: $cf_cv_ncurses_header" >&5
10379 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10380
10381 if test "$cf_cv_ncurses_header" = none ; then
10382         { { echo "$as_me:10382: error: No curses header-files found" >&5
10383 echo "$as_me: error: No curses header-files found" >&2;}
10384    { (exit 1); exit 1; }; }
10385 fi
10386
10387 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10388
10389 for ac_header in $cf_cv_ncurses_header
10390 do
10391 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10392 echo "$as_me:10392: checking for $ac_header" >&5
10393 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10394 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10395   echo $ECHO_N "(cached) $ECHO_C" >&6
10396 else
10397   cat >conftest.$ac_ext <<_ACEOF
10398 #line 10398 "configure"
10399 #include "confdefs.h"
10400 #include <$ac_header>
10401 _ACEOF
10402 if { (eval echo "$as_me:10402: \"$ac_cpp conftest.$ac_ext\"") >&5
10403   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10404   ac_status=$?
10405   egrep -v '^ *\+' conftest.er1 >conftest.err
10406   rm -f conftest.er1
10407   cat conftest.err >&5
10408   echo "$as_me:10408: \$? = $ac_status" >&5
10409   (exit $ac_status); } >/dev/null; then
10410   if test -s conftest.err; then
10411     ac_cpp_err=$ac_c_preproc_warn_flag
10412   else
10413     ac_cpp_err=
10414   fi
10415 else
10416   ac_cpp_err=yes
10417 fi
10418 if test -z "$ac_cpp_err"; then
10419   eval "$as_ac_Header=yes"
10420 else
10421   echo "$as_me: failed program was:" >&5
10422   cat conftest.$ac_ext >&5
10423   eval "$as_ac_Header=no"
10424 fi
10425 rm -f conftest.err conftest.$ac_ext
10426 fi
10427 echo "$as_me:10427: result: `eval echo '${'$as_ac_Header'}'`" >&5
10428 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10429 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10430   cat >>confdefs.h <<EOF
10431 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10432 EOF
10433
10434 fi
10435 done
10436
10437 cat >>confdefs.h <<\EOF
10438 #define NCURSES 1
10439 EOF
10440
10441 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10442
10443                 cat >>confdefs.h <<EOF
10444 #define $cf_nculib_ROOT 1
10445 EOF
10446
10447                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10448
10449         else
10450
10451 cf_ncuhdr_root=$cf_cv_screen
10452
10453 test -n "$cf_cv_curses_dir" && \
10454 test "$cf_cv_curses_dir" != "no" && { \
10455
10456 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10457   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10458   do
10459         while test $cf_add_incdir != /usr/include
10460         do
10461           if test -d $cf_add_incdir
10462           then
10463                 cf_have_incdir=no
10464                 if test -n "$CFLAGS$CPPFLAGS" ; then
10465                   # a loop is needed to ensure we can add subdirs of existing dirs
10466                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10467                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10468                           cf_have_incdir=yes; break
10469                         fi
10470                   done
10471                 fi
10472
10473                 if test "$cf_have_incdir" = no ; then
10474                   if test "$cf_add_incdir" = /usr/local/include ; then
10475                         if test "$GCC" = yes
10476                         then
10477                           cf_save_CPPFLAGS=$CPPFLAGS
10478
10479         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10480         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10481
10482                           cat >conftest.$ac_ext <<_ACEOF
10483 #line 10483 "configure"
10484 #include "confdefs.h"
10485 #include <stdio.h>
10486 int
10487 main (void)
10488 {
10489 printf("Hello")
10490   ;
10491   return 0;
10492 }
10493 _ACEOF
10494 rm -f conftest.$ac_objext
10495 if { (eval echo "$as_me:10495: \"$ac_compile\"") >&5
10496   (eval $ac_compile) 2>&5
10497   ac_status=$?
10498   echo "$as_me:10498: \$? = $ac_status" >&5
10499   (exit $ac_status); } &&
10500          { ac_try='test -s conftest.$ac_objext'
10501   { (eval echo "$as_me:10501: \"$ac_try\"") >&5
10502   (eval $ac_try) 2>&5
10503   ac_status=$?
10504   echo "$as_me:10504: \$? = $ac_status" >&5
10505   (exit $ac_status); }; }; then
10506   :
10507 else
10508   echo "$as_me: failed program was:" >&5
10509 cat conftest.$ac_ext >&5
10510 cf_have_incdir=yes
10511 fi
10512 rm -f conftest.$ac_objext conftest.$ac_ext
10513                           CPPFLAGS=$cf_save_CPPFLAGS
10514                         fi
10515                   fi
10516                 fi
10517
10518                 if test "$cf_have_incdir" = no ; then
10519                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10520
10521 echo "${as_me:-configure}:10521: testing adding $cf_add_incdir to include-path ..." 1>&5
10522
10523                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10524
10525                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10526                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10527                   cf_add_incdir="$cf_top_incdir"
10528                 else
10529                   break
10530                 fi
10531           else
10532                 break
10533           fi
10534         done
10535   done
10536 fi
10537
10538 }
10539
10540 echo "$as_me:10540: checking for $cf_ncuhdr_root header in include-path" >&5
10541 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10542 if test "${cf_cv_ncurses_h+set}" = set; then
10543   echo $ECHO_N "(cached) $ECHO_C" >&6
10544 else
10545
10546         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10547         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10548         for cf_header in $cf_header_list
10549         do
10550
10551         cat >conftest.$ac_ext <<_ACEOF
10552 #line 10552 "configure"
10553 #include "confdefs.h"
10554
10555 #include <$cf_header>
10556 int
10557 main (void)
10558 {
10559
10560 #ifdef NCURSES_VERSION
10561
10562 printf("%s\n", NCURSES_VERSION);
10563 #else
10564 #ifdef __NCURSES_H
10565 printf("old\n");
10566 #else
10567         make an error
10568 #endif
10569 #endif
10570
10571   ;
10572   return 0;
10573 }
10574 _ACEOF
10575 rm -f conftest.$ac_objext
10576 if { (eval echo "$as_me:10576: \"$ac_compile\"") >&5
10577   (eval $ac_compile) 2>&5
10578   ac_status=$?
10579   echo "$as_me:10579: \$? = $ac_status" >&5
10580   (exit $ac_status); } &&
10581          { ac_try='test -s conftest.$ac_objext'
10582   { (eval echo "$as_me:10582: \"$ac_try\"") >&5
10583   (eval $ac_try) 2>&5
10584   ac_status=$?
10585   echo "$as_me:10585: \$? = $ac_status" >&5
10586   (exit $ac_status); }; }; then
10587   cf_cv_ncurses_h=$cf_header
10588
10589 else
10590   echo "$as_me: failed program was:" >&5
10591 cat conftest.$ac_ext >&5
10592 cf_cv_ncurses_h=no
10593 fi
10594 rm -f conftest.$ac_objext conftest.$ac_ext
10595
10596                 test "$cf_cv_ncurses_h" != no && break
10597         done
10598
10599 fi
10600 echo "$as_me:10600: result: $cf_cv_ncurses_h" >&5
10601 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10602
10603 if test "$cf_cv_ncurses_h" != no ; then
10604         cf_cv_ncurses_header=$cf_cv_ncurses_h
10605 else
10606
10607 echo "$as_me:10607: checking for $cf_ncuhdr_root include-path" >&5
10608 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10609 if test "${cf_cv_ncurses_h2+set}" = set; then
10610   echo $ECHO_N "(cached) $ECHO_C" >&6
10611 else
10612
10613         test -n "$verbose" && echo
10614
10615 cf_search=
10616
10617 # collect the current set of include-directories from compiler flags
10618 cf_header_path_list=""
10619 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10620         for cf_header_path in $CPPFLAGS $CFLAGS
10621         do
10622                 case $cf_header_path in
10623                 (-I*)
10624                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10625
10626 test "x$cf_header_path" != "xNONE" && \
10627 test -d "$cf_header_path" && \
10628  {
10629         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10630         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10631         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10632         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10633         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10634         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"
10635 }
10636
10637                         cf_header_path_list="$cf_header_path_list $cf_search"
10638                         ;;
10639                 esac
10640         done
10641 fi
10642
10643 # add the variations for the package we are looking for
10644
10645 cf_search=
10646
10647 test "x$prefix" != "xNONE" && \
10648 test -d "$prefix" && \
10649  {
10650         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10651         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10652         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10653         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10654         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10655         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10656 }
10657
10658 for cf_subdir_prefix in \
10659         /usr \
10660         /usr/local \
10661         /usr/pkg \
10662         /opt \
10663         /opt/local \
10664         $HOME
10665 do
10666
10667 test "x$cf_subdir_prefix" != "x$prefix" && \
10668 test -d "$cf_subdir_prefix" && \
10669 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10670         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10671         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10672         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10673         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10674         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10675         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"
10676 }
10677
10678 done
10679
10680 test "$includedir" != NONE && \
10681 test "$includedir" != "/usr/include" && \
10682 test -d "$includedir" && {
10683         test -d $includedir &&    cf_search="$cf_search $includedir"
10684         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10685 }
10686
10687 test "$oldincludedir" != NONE && \
10688 test "$oldincludedir" != "/usr/include" && \
10689 test -d "$oldincludedir" && {
10690         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10691         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10692 }
10693
10694 cf_search="$cf_search $cf_header_path_list"
10695
10696         test -n "$verbose" && echo search path $cf_search
10697         cf_save2_CPPFLAGS="$CPPFLAGS"
10698         for cf_incdir in $cf_search
10699         do
10700
10701 if test -n "$cf_incdir" ; then
10702   for cf_add_incdir in $cf_incdir
10703   do
10704         while test $cf_add_incdir != /usr/include
10705         do
10706           if test -d $cf_add_incdir
10707           then
10708                 cf_have_incdir=no
10709                 if test -n "$CFLAGS$CPPFLAGS" ; then
10710                   # a loop is needed to ensure we can add subdirs of existing dirs
10711                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10712                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10713                           cf_have_incdir=yes; break
10714                         fi
10715                   done
10716                 fi
10717
10718                 if test "$cf_have_incdir" = no ; then
10719                   if test "$cf_add_incdir" = /usr/local/include ; then
10720                         if test "$GCC" = yes
10721                         then
10722                           cf_save_CPPFLAGS=$CPPFLAGS
10723
10724         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10725         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10726
10727                           cat >conftest.$ac_ext <<_ACEOF
10728 #line 10728 "configure"
10729 #include "confdefs.h"
10730 #include <stdio.h>
10731 int
10732 main (void)
10733 {
10734 printf("Hello")
10735   ;
10736   return 0;
10737 }
10738 _ACEOF
10739 rm -f conftest.$ac_objext
10740 if { (eval echo "$as_me:10740: \"$ac_compile\"") >&5
10741   (eval $ac_compile) 2>&5
10742   ac_status=$?
10743   echo "$as_me:10743: \$? = $ac_status" >&5
10744   (exit $ac_status); } &&
10745          { ac_try='test -s conftest.$ac_objext'
10746   { (eval echo "$as_me:10746: \"$ac_try\"") >&5
10747   (eval $ac_try) 2>&5
10748   ac_status=$?
10749   echo "$as_me:10749: \$? = $ac_status" >&5
10750   (exit $ac_status); }; }; then
10751   :
10752 else
10753   echo "$as_me: failed program was:" >&5
10754 cat conftest.$ac_ext >&5
10755 cf_have_incdir=yes
10756 fi
10757 rm -f conftest.$ac_objext conftest.$ac_ext
10758                           CPPFLAGS=$cf_save_CPPFLAGS
10759                         fi
10760                   fi
10761                 fi
10762
10763                 if test "$cf_have_incdir" = no ; then
10764                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10765
10766 echo "${as_me:-configure}:10766: testing adding $cf_add_incdir to include-path ..." 1>&5
10767
10768                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10769
10770                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10771                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10772                   cf_add_incdir="$cf_top_incdir"
10773                 else
10774                   break
10775                 fi
10776           else
10777                 break
10778           fi
10779         done
10780   done
10781 fi
10782
10783                 for cf_header in \
10784                         ncurses.h \
10785                         curses.h
10786                 do
10787
10788         cat >conftest.$ac_ext <<_ACEOF
10789 #line 10789 "configure"
10790 #include "confdefs.h"
10791
10792 #include <$cf_header>
10793 int
10794 main (void)
10795 {
10796
10797 #ifdef NCURSES_VERSION
10798
10799 printf("%s\n", NCURSES_VERSION);
10800 #else
10801 #ifdef __NCURSES_H
10802 printf("old\n");
10803 #else
10804         make an error
10805 #endif
10806 #endif
10807
10808   ;
10809   return 0;
10810 }
10811 _ACEOF
10812 rm -f conftest.$ac_objext
10813 if { (eval echo "$as_me:10813: \"$ac_compile\"") >&5
10814   (eval $ac_compile) 2>&5
10815   ac_status=$?
10816   echo "$as_me:10816: \$? = $ac_status" >&5
10817   (exit $ac_status); } &&
10818          { ac_try='test -s conftest.$ac_objext'
10819   { (eval echo "$as_me:10819: \"$ac_try\"") >&5
10820   (eval $ac_try) 2>&5
10821   ac_status=$?
10822   echo "$as_me:10822: \$? = $ac_status" >&5
10823   (exit $ac_status); }; }; then
10824   cf_cv_ncurses_h2=$cf_header
10825
10826 else
10827   echo "$as_me: failed program was:" >&5
10828 cat conftest.$ac_ext >&5
10829 cf_cv_ncurses_h2=no
10830 fi
10831 rm -f conftest.$ac_objext conftest.$ac_ext
10832
10833                         if test "$cf_cv_ncurses_h2" != no ; then
10834                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10835                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10836                                 break
10837                         fi
10838                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10839                 done
10840                 CPPFLAGS="$cf_save2_CPPFLAGS"
10841                 test "$cf_cv_ncurses_h2" != no && break
10842         done
10843         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10843: error: not found" >&5
10844 echo "$as_me: error: not found" >&2;}
10845    { (exit 1); exit 1; }; }
10846
10847 fi
10848 echo "$as_me:10848: result: $cf_cv_ncurses_h2" >&5
10849 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10850
10851         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10852         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10853         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10854                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10855         fi
10856
10857 if test -n "$cf_1st_incdir" ; then
10858   for cf_add_incdir in $cf_1st_incdir
10859   do
10860         while test $cf_add_incdir != /usr/include
10861         do
10862           if test -d $cf_add_incdir
10863           then
10864                 cf_have_incdir=no
10865                 if test -n "$CFLAGS$CPPFLAGS" ; then
10866                   # a loop is needed to ensure we can add subdirs of existing dirs
10867                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10868                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10869                           cf_have_incdir=yes; break
10870                         fi
10871                   done
10872                 fi
10873
10874                 if test "$cf_have_incdir" = no ; then
10875                   if test "$cf_add_incdir" = /usr/local/include ; then
10876                         if test "$GCC" = yes
10877                         then
10878                           cf_save_CPPFLAGS=$CPPFLAGS
10879
10880         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10881         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10882
10883                           cat >conftest.$ac_ext <<_ACEOF
10884 #line 10884 "configure"
10885 #include "confdefs.h"
10886 #include <stdio.h>
10887 int
10888 main (void)
10889 {
10890 printf("Hello")
10891   ;
10892   return 0;
10893 }
10894 _ACEOF
10895 rm -f conftest.$ac_objext
10896 if { (eval echo "$as_me:10896: \"$ac_compile\"") >&5
10897   (eval $ac_compile) 2>&5
10898   ac_status=$?
10899   echo "$as_me:10899: \$? = $ac_status" >&5
10900   (exit $ac_status); } &&
10901          { ac_try='test -s conftest.$ac_objext'
10902   { (eval echo "$as_me:10902: \"$ac_try\"") >&5
10903   (eval $ac_try) 2>&5
10904   ac_status=$?
10905   echo "$as_me:10905: \$? = $ac_status" >&5
10906   (exit $ac_status); }; }; then
10907   :
10908 else
10909   echo "$as_me: failed program was:" >&5
10910 cat conftest.$ac_ext >&5
10911 cf_have_incdir=yes
10912 fi
10913 rm -f conftest.$ac_objext conftest.$ac_ext
10914                           CPPFLAGS=$cf_save_CPPFLAGS
10915                         fi
10916                   fi
10917                 fi
10918
10919                 if test "$cf_have_incdir" = no ; then
10920                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10921
10922 echo "${as_me:-configure}:10922: testing adding $cf_add_incdir to include-path ..." 1>&5
10923
10924                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10925
10926                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10927                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10928                   cf_add_incdir="$cf_top_incdir"
10929                 else
10930                   break
10931                 fi
10932           else
10933                 break
10934           fi
10935         done
10936   done
10937 fi
10938
10939 fi
10940
10941 # Set definitions to allow ifdef'ing for ncurses.h
10942
10943 case $cf_cv_ncurses_header in
10944 (*ncurses.h)
10945
10946 cat >>confdefs.h <<\EOF
10947 #define HAVE_NCURSES_H 1
10948 EOF
10949
10950         ;;
10951 esac
10952
10953 case $cf_cv_ncurses_header in
10954 (ncurses/curses.h|ncurses/ncurses.h)
10955
10956 cat >>confdefs.h <<\EOF
10957 #define HAVE_NCURSES_NCURSES_H 1
10958 EOF
10959
10960         ;;
10961 (ncursesw/curses.h|ncursesw/ncurses.h)
10962
10963 cat >>confdefs.h <<\EOF
10964 #define HAVE_NCURSESW_NCURSES_H 1
10965 EOF
10966
10967         ;;
10968 esac
10969
10970 echo "$as_me:10970: checking for terminfo header" >&5
10971 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10972 if test "${cf_cv_term_header+set}" = set; then
10973   echo $ECHO_N "(cached) $ECHO_C" >&6
10974 else
10975
10976 case ${cf_cv_ncurses_header} in
10977 (*/ncurses.h|*/ncursesw.h)
10978         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10979         ;;
10980 (*)
10981         cf_term_header=term.h
10982         ;;
10983 esac
10984
10985 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10986 do
10987 cat >conftest.$ac_ext <<_ACEOF
10988 #line 10988 "configure"
10989 #include "confdefs.h"
10990 #include <stdio.h>
10991 #include <${cf_cv_ncurses_header:-curses.h}>
10992 #include <$cf_test>
10993
10994 int
10995 main (void)
10996 {
10997 int x = auto_left_margin; (void)x
10998   ;
10999   return 0;
11000 }
11001 _ACEOF
11002 rm -f conftest.$ac_objext
11003 if { (eval echo "$as_me:11003: \"$ac_compile\"") >&5
11004   (eval $ac_compile) 2>&5
11005   ac_status=$?
11006   echo "$as_me:11006: \$? = $ac_status" >&5
11007   (exit $ac_status); } &&
11008          { ac_try='test -s conftest.$ac_objext'
11009   { (eval echo "$as_me:11009: \"$ac_try\"") >&5
11010   (eval $ac_try) 2>&5
11011   ac_status=$?
11012   echo "$as_me:11012: \$? = $ac_status" >&5
11013   (exit $ac_status); }; }; then
11014
11015         cf_cv_term_header="$cf_test"
11016 else
11017   echo "$as_me: failed program was:" >&5
11018 cat conftest.$ac_ext >&5
11019
11020         cf_cv_term_header=unknown
11021
11022 fi
11023 rm -f conftest.$ac_objext conftest.$ac_ext
11024         test "$cf_cv_term_header" != unknown && break
11025 done
11026
11027 fi
11028 echo "$as_me:11028: result: $cf_cv_term_header" >&5
11029 echo "${ECHO_T}$cf_cv_term_header" >&6
11030
11031 # Set definitions to allow ifdef'ing to accommodate subdirectories
11032
11033 case $cf_cv_term_header in
11034 (*term.h)
11035
11036 cat >>confdefs.h <<\EOF
11037 #define HAVE_TERM_H 1
11038 EOF
11039
11040         ;;
11041 esac
11042
11043 case $cf_cv_term_header in
11044 (ncurses/term.h)
11045
11046 cat >>confdefs.h <<\EOF
11047 #define HAVE_NCURSES_TERM_H 1
11048 EOF
11049
11050         ;;
11051 (ncursesw/term.h)
11052
11053 cat >>confdefs.h <<\EOF
11054 #define HAVE_NCURSESW_TERM_H 1
11055 EOF
11056
11057         ;;
11058 esac
11059
11060 # some applications need this, but should check for NCURSES_VERSION
11061
11062 cat >>confdefs.h <<\EOF
11063 #define NCURSES 1
11064 EOF
11065
11066 echo "$as_me:11066: checking for ncurses version" >&5
11067 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11068 if test "${cf_cv_ncurses_version+set}" = set; then
11069   echo $ECHO_N "(cached) $ECHO_C" >&6
11070 else
11071
11072         cf_cv_ncurses_version=no
11073         cf_tempfile=out$$
11074         rm -f $cf_tempfile
11075         if test "$cross_compiling" = yes; then
11076
11077         # This will not work if the preprocessor splits the line after the
11078         # Autoconf token.  The 'unproto' program does that.
11079         cat > conftest.$ac_ext <<EOF
11080 #include <${cf_cv_ncurses_header:-curses.h}>
11081 #undef Autoconf
11082 #ifdef NCURSES_VERSION
11083 Autoconf NCURSES_VERSION
11084 #else
11085 #ifdef __NCURSES_H
11086 Autoconf "old"
11087 #endif
11088 ;
11089 #endif
11090 EOF
11091         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11092         { (eval echo "$as_me:11092: \"$cf_try\"") >&5
11093   (eval $cf_try) 2>&5
11094   ac_status=$?
11095   echo "$as_me:11095: \$? = $ac_status" >&5
11096   (exit $ac_status); }
11097         if test -f conftest.out ; then
11098                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11099                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11100                 rm -f conftest.out
11101         fi
11102
11103 else
11104   cat >conftest.$ac_ext <<_ACEOF
11105 #line 11105 "configure"
11106 #include "confdefs.h"
11107
11108 #include <${cf_cv_ncurses_header:-curses.h}>
11109 #include <stdio.h>
11110 int main(void)
11111 {
11112         FILE *fp = fopen("$cf_tempfile", "w");
11113 #ifdef NCURSES_VERSION
11114 # ifdef NCURSES_VERSION_PATCH
11115         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11116 # else
11117         fprintf(fp, "%s\n", NCURSES_VERSION);
11118 # endif
11119 #else
11120 # ifdef __NCURSES_H
11121         fprintf(fp, "old\n");
11122 # else
11123         make an error
11124 # endif
11125 #endif
11126         ${cf_cv_main_return:-return}(0);
11127 }
11128 _ACEOF
11129 rm -f conftest$ac_exeext
11130 if { (eval echo "$as_me:11130: \"$ac_link\"") >&5
11131   (eval $ac_link) 2>&5
11132   ac_status=$?
11133   echo "$as_me:11133: \$? = $ac_status" >&5
11134   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11135   { (eval echo "$as_me:11135: \"$ac_try\"") >&5
11136   (eval $ac_try) 2>&5
11137   ac_status=$?
11138   echo "$as_me:11138: \$? = $ac_status" >&5
11139   (exit $ac_status); }; }; then
11140
11141         cf_cv_ncurses_version=`cat $cf_tempfile`
11142 else
11143   echo "$as_me: program exited with status $ac_status" >&5
11144 echo "$as_me: failed program was:" >&5
11145 cat conftest.$ac_ext >&5
11146 fi
11147 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11148 fi
11149         rm -f $cf_tempfile
11150
11151 fi
11152 echo "$as_me:11152: result: $cf_cv_ncurses_version" >&5
11153 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11154 test "$cf_cv_ncurses_version" = no ||
11155 cat >>confdefs.h <<\EOF
11156 #define NCURSES 1
11157 EOF
11158
11159 cf_nculib_root=$cf_cv_screen
11160         # This works, except for the special case where we find gpm, but
11161         # ncurses is in a nonstandard location via $LIBS, and we really want
11162         # to link gpm.
11163 cf_ncurses_LIBS=""
11164 cf_ncurses_SAVE="$LIBS"
11165 echo "$as_me:11165: checking for Gpm_Open in -lgpm" >&5
11166 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11167 if test "${ac_cv_lib_gpm_Gpm_Open+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 Gpm_Open ();
11183 int
11184 main (void)
11185 {
11186 Gpm_Open ();
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_Gpm_Open=yes
11204 else
11205   echo "$as_me: failed program was:" >&5
11206 cat conftest.$ac_ext >&5
11207 ac_cv_lib_gpm_Gpm_Open=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_Gpm_Open" >&5
11213 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11214 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11215   echo "$as_me:11215: checking for initscr in -lgpm" >&5
11216 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11217 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11218   echo $ECHO_N "(cached) $ECHO_C" >&6
11219 else
11220   ac_check_lib_save_LIBS=$LIBS
11221 LIBS="-lgpm  $LIBS"
11222 cat >conftest.$ac_ext <<_ACEOF
11223 #line 11223 "configure"
11224 #include "confdefs.h"
11225
11226 /* Override any gcc2 internal prototype to avoid an error.  */
11227 #ifdef __cplusplus
11228 extern "C"
11229 #endif
11230 /* We use char because int might match the return type of a gcc2
11231    builtin and then its argument prototype would still apply.  */
11232 char initscr ();
11233 int
11234 main (void)
11235 {
11236 initscr ();
11237   ;
11238   return 0;
11239 }
11240 _ACEOF
11241 rm -f conftest.$ac_objext conftest$ac_exeext
11242 if { (eval echo "$as_me:11242: \"$ac_link\"") >&5
11243   (eval $ac_link) 2>&5
11244   ac_status=$?
11245   echo "$as_me:11245: \$? = $ac_status" >&5
11246   (exit $ac_status); } &&
11247          { ac_try='test -s conftest$ac_exeext'
11248   { (eval echo "$as_me:11248: \"$ac_try\"") >&5
11249   (eval $ac_try) 2>&5
11250   ac_status=$?
11251   echo "$as_me:11251: \$? = $ac_status" >&5
11252   (exit $ac_status); }; }; then
11253   ac_cv_lib_gpm_initscr=yes
11254 else
11255   echo "$as_me: failed program was:" >&5
11256 cat conftest.$ac_ext >&5
11257 ac_cv_lib_gpm_initscr=no
11258 fi
11259 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11260 LIBS=$ac_check_lib_save_LIBS
11261 fi
11262 echo "$as_me:11262: result: $ac_cv_lib_gpm_initscr" >&5
11263 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11264 if test $ac_cv_lib_gpm_initscr = yes; then
11265   LIBS="$cf_ncurses_SAVE"
11266 else
11267   cf_ncurses_LIBS="-lgpm"
11268 fi
11269
11270 fi
11271
11272 case $host_os in
11273 (freebsd*)
11274         # This is only necessary if you are linking against an obsolete
11275         # version of ncurses (but it should do no harm, since it's static).
11276         if test "$cf_nculib_root" = ncurses ; then
11277                 echo "$as_me:11277: checking for tgoto in -lmytinfo" >&5
11278 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11279 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11280   echo $ECHO_N "(cached) $ECHO_C" >&6
11281 else
11282   ac_check_lib_save_LIBS=$LIBS
11283 LIBS="-lmytinfo  $LIBS"
11284 cat >conftest.$ac_ext <<_ACEOF
11285 #line 11285 "configure"
11286 #include "confdefs.h"
11287
11288 /* Override any gcc2 internal prototype to avoid an error.  */
11289 #ifdef __cplusplus
11290 extern "C"
11291 #endif
11292 /* We use char because int might match the return type of a gcc2
11293    builtin and then its argument prototype would still apply.  */
11294 char tgoto ();
11295 int
11296 main (void)
11297 {
11298 tgoto ();
11299   ;
11300   return 0;
11301 }
11302 _ACEOF
11303 rm -f conftest.$ac_objext conftest$ac_exeext
11304 if { (eval echo "$as_me:11304: \"$ac_link\"") >&5
11305   (eval $ac_link) 2>&5
11306   ac_status=$?
11307   echo "$as_me:11307: \$? = $ac_status" >&5
11308   (exit $ac_status); } &&
11309          { ac_try='test -s conftest$ac_exeext'
11310   { (eval echo "$as_me:11310: \"$ac_try\"") >&5
11311   (eval $ac_try) 2>&5
11312   ac_status=$?
11313   echo "$as_me:11313: \$? = $ac_status" >&5
11314   (exit $ac_status); }; }; then
11315   ac_cv_lib_mytinfo_tgoto=yes
11316 else
11317   echo "$as_me: failed program was:" >&5
11318 cat conftest.$ac_ext >&5
11319 ac_cv_lib_mytinfo_tgoto=no
11320 fi
11321 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11322 LIBS=$ac_check_lib_save_LIBS
11323 fi
11324 echo "$as_me:11324: result: $ac_cv_lib_mytinfo_tgoto" >&5
11325 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11326 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11327   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11328 fi
11329
11330         fi
11331         ;;
11332 esac
11333
11334 cf_add_libs="$LIBS"
11335 # reverse order
11336 cf_add_0lib=
11337 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11338 # filter duplicates
11339 for cf_add_1lib in $cf_add_0lib; do
11340         for cf_add_2lib in $cf_add_libs; do
11341                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11342                         cf_add_1lib=
11343                         break
11344                 fi
11345         done
11346         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11347 done
11348 LIBS="$cf_add_libs"
11349
11350 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11351 then
11352
11353 cf_add_libs="$LIBS"
11354 # reverse order
11355 cf_add_0lib=
11356 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11357 # filter duplicates
11358 for cf_add_1lib in $cf_add_0lib; do
11359         for cf_add_2lib in $cf_add_libs; do
11360                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11361                         cf_add_1lib=
11362                         break
11363                 fi
11364         done
11365         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11366 done
11367 LIBS="$cf_add_libs"
11368
11369 else
11370
11371         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11372         cf_libdir=""
11373         echo "$as_me:11373: checking for initscr" >&5
11374 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11375 if test "${ac_cv_func_initscr+set}" = set; then
11376   echo $ECHO_N "(cached) $ECHO_C" >&6
11377 else
11378   cat >conftest.$ac_ext <<_ACEOF
11379 #line 11379 "configure"
11380 #include "confdefs.h"
11381 #define initscr autoconf_temporary
11382 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11383 #undef initscr
11384
11385 #ifdef __cplusplus
11386 extern "C"
11387 #endif
11388
11389 /* We use char because int might match the return type of a gcc2
11390    builtin and then its argument prototype would still apply.  */
11391 char initscr (void);
11392
11393 int
11394 main (void)
11395 {
11396
11397 /* The GNU C library defines stubs for functions which it implements
11398     to always fail with ENOSYS.  Some functions are actually named
11399     something starting with __ and the normal name is an alias.  */
11400 #if defined (__stub_initscr) || defined (__stub___initscr)
11401 #error found stub for initscr
11402 #endif
11403
11404         return initscr ();
11405   ;
11406   return 0;
11407 }
11408 _ACEOF
11409 rm -f conftest.$ac_objext conftest$ac_exeext
11410 if { (eval echo "$as_me:11410: \"$ac_link\"") >&5
11411   (eval $ac_link) 2>&5
11412   ac_status=$?
11413   echo "$as_me:11413: \$? = $ac_status" >&5
11414   (exit $ac_status); } &&
11415          { ac_try='test -s conftest$ac_exeext'
11416   { (eval echo "$as_me:11416: \"$ac_try\"") >&5
11417   (eval $ac_try) 2>&5
11418   ac_status=$?
11419   echo "$as_me:11419: \$? = $ac_status" >&5
11420   (exit $ac_status); }; }; then
11421   ac_cv_func_initscr=yes
11422 else
11423   echo "$as_me: failed program was:" >&5
11424 cat conftest.$ac_ext >&5
11425 ac_cv_func_initscr=no
11426 fi
11427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11428 fi
11429 echo "$as_me:11429: result: $ac_cv_func_initscr" >&5
11430 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11431 if test $ac_cv_func_initscr = yes; then
11432   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11433 else
11434
11435                 cf_save_LIBS="$LIBS"
11436                 echo "$as_me:11436: checking for initscr in -l$cf_nculib_root" >&5
11437 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11438                 LIBS="-l$cf_nculib_root $LIBS"
11439                 cat >conftest.$ac_ext <<_ACEOF
11440 #line 11440 "configure"
11441 #include "confdefs.h"
11442 #include <${cf_cv_ncurses_header:-curses.h}>
11443 int
11444 main (void)
11445 {
11446 initscr()
11447   ;
11448   return 0;
11449 }
11450 _ACEOF
11451 rm -f conftest.$ac_objext conftest$ac_exeext
11452 if { (eval echo "$as_me:11452: \"$ac_link\"") >&5
11453   (eval $ac_link) 2>&5
11454   ac_status=$?
11455   echo "$as_me:11455: \$? = $ac_status" >&5
11456   (exit $ac_status); } &&
11457          { ac_try='test -s conftest$ac_exeext'
11458   { (eval echo "$as_me:11458: \"$ac_try\"") >&5
11459   (eval $ac_try) 2>&5
11460   ac_status=$?
11461   echo "$as_me:11461: \$? = $ac_status" >&5
11462   (exit $ac_status); }; }; then
11463   echo "$as_me:11463: result: yes" >&5
11464 echo "${ECHO_T}yes" >&6
11465                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11466
11467 else
11468   echo "$as_me: failed program was:" >&5
11469 cat conftest.$ac_ext >&5
11470 echo "$as_me:11470: result: no" >&5
11471 echo "${ECHO_T}no" >&6
11472
11473 cf_search=
11474 cf_library_path_list=""
11475 if test -n "${LDFLAGS}${LIBS}" ; then
11476         for cf_library_path in $LDFLAGS $LIBS
11477         do
11478                 case $cf_library_path in
11479                 (-L*)
11480                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11481
11482 test "x$cf_library_path" != "xNONE" && \
11483 test -d "$cf_library_path" && \
11484  {
11485         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11486         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11487         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11488         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11489         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11490         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"
11491 }
11492
11493                         cf_library_path_list="$cf_library_path_list $cf_search"
11494                         ;;
11495                 esac
11496         done
11497 fi
11498
11499 cf_search=
11500
11501 test "x$prefix" != "xNONE" && \
11502 test -d "$prefix" && \
11503  {
11504         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11505         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11506         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11507         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11508         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11509         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11510 }
11511
11512 for cf_subdir_prefix in \
11513         /usr \
11514         /usr/local \
11515         /usr/pkg \
11516         /opt \
11517         /opt/local \
11518         $HOME
11519 do
11520
11521 test "x$cf_subdir_prefix" != "x$prefix" && \
11522 test -d "$cf_subdir_prefix" && \
11523 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11524         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11525         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11526         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11527         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11528         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11529         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"
11530 }
11531
11532 done
11533
11534 cf_search="$cf_library_path_list $cf_search"
11535
11536                         for cf_libdir in $cf_search
11537                         do
11538                                 echo "$as_me:11538: checking for -l$cf_nculib_root in $cf_libdir" >&5
11539 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11540                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11541                                 cat >conftest.$ac_ext <<_ACEOF
11542 #line 11542 "configure"
11543 #include "confdefs.h"
11544 #include <${cf_cv_ncurses_header:-curses.h}>
11545 int
11546 main (void)
11547 {
11548 initscr()
11549   ;
11550   return 0;
11551 }
11552 _ACEOF
11553 rm -f conftest.$ac_objext conftest$ac_exeext
11554 if { (eval echo "$as_me:11554: \"$ac_link\"") >&5
11555   (eval $ac_link) 2>&5
11556   ac_status=$?
11557   echo "$as_me:11557: \$? = $ac_status" >&5
11558   (exit $ac_status); } &&
11559          { ac_try='test -s conftest$ac_exeext'
11560   { (eval echo "$as_me:11560: \"$ac_try\"") >&5
11561   (eval $ac_try) 2>&5
11562   ac_status=$?
11563   echo "$as_me:11563: \$? = $ac_status" >&5
11564   (exit $ac_status); }; }; then
11565   echo "$as_me:11565: result: yes" >&5
11566 echo "${ECHO_T}yes" >&6
11567                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11568                                          break
11569 else
11570   echo "$as_me: failed program was:" >&5
11571 cat conftest.$ac_ext >&5
11572 echo "$as_me:11572: result: no" >&5
11573 echo "${ECHO_T}no" >&6
11574                                          LIBS="$cf_save_LIBS"
11575 fi
11576 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11577                         done
11578
11579 fi
11580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11581
11582 fi
11583
11584 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11585
11586 if test $cf_found_library = no ; then
11587         { { echo "$as_me:11587: error: Cannot link $cf_nculib_root library" >&5
11588 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11589    { (exit 1); exit 1; }; }
11590 fi
11591
11592 fi
11593
11594 if test -n "$cf_ncurses_LIBS" ; then
11595         echo "$as_me:11595: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11596 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11597         cf_ncurses_SAVE="$LIBS"
11598         for p in $cf_ncurses_LIBS ; do
11599                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11600                 if test "$q" != "$LIBS" ; then
11601                         LIBS="$q"
11602                 fi
11603         done
11604         cat >conftest.$ac_ext <<_ACEOF
11605 #line 11605 "configure"
11606 #include "confdefs.h"
11607 #include <${cf_cv_ncurses_header:-curses.h}>
11608 int
11609 main (void)
11610 {
11611 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11612   ;
11613   return 0;
11614 }
11615 _ACEOF
11616 rm -f conftest.$ac_objext conftest$ac_exeext
11617 if { (eval echo "$as_me:11617: \"$ac_link\"") >&5
11618   (eval $ac_link) 2>&5
11619   ac_status=$?
11620   echo "$as_me:11620: \$? = $ac_status" >&5
11621   (exit $ac_status); } &&
11622          { ac_try='test -s conftest$ac_exeext'
11623   { (eval echo "$as_me:11623: \"$ac_try\"") >&5
11624   (eval $ac_try) 2>&5
11625   ac_status=$?
11626   echo "$as_me:11626: \$? = $ac_status" >&5
11627   (exit $ac_status); }; }; then
11628   echo "$as_me:11628: result: yes" >&5
11629 echo "${ECHO_T}yes" >&6
11630 else
11631   echo "$as_me: failed program was:" >&5
11632 cat conftest.$ac_ext >&5
11633 echo "$as_me:11633: result: no" >&5
11634 echo "${ECHO_T}no" >&6
11635                  LIBS="$cf_ncurses_SAVE"
11636 fi
11637 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11638 fi
11639
11640 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11641
11642 cat >>confdefs.h <<EOF
11643 #define $cf_nculib_ROOT 1
11644 EOF
11645
11646         fi
11647 else
11648         NCURSES_CONFIG=none
11649 fi
11650
11651         ;;
11652 (pdcurses)
11653         echo "$as_me:11653: checking for X" >&5
11654 echo $ECHO_N "checking for X... $ECHO_C" >&6
11655
11656 # Check whether --with-x or --without-x was given.
11657 if test "${with_x+set}" = set; then
11658   withval="$with_x"
11659
11660 fi;
11661 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11662 if test "x$with_x" = xno; then
11663   # The user explicitly disabled X.
11664   have_x=disabled
11665 else
11666   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11667     # Both variables are already set.
11668     have_x=yes
11669   else
11670     if test "${ac_cv_have_x+set}" = set; then
11671   echo $ECHO_N "(cached) $ECHO_C" >&6
11672 else
11673   # One or both of the vars are not set, and there is no cached value.
11674 ac_x_includes=no ac_x_libraries=no
11675 rm -fr conftest.dir
11676 if mkdir conftest.dir; then
11677   cd conftest.dir
11678   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11679   cat >Imakefile <<'EOF'
11680 acfindx:
11681         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11682 EOF
11683   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11684     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11685     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11686     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11687     for ac_extension in a so sl dylib dll; do
11688       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11689          test -f $ac_im_libdir/libX11.$ac_extension; then
11690         ac_im_usrlibdir=$ac_im_libdir; break
11691       fi
11692     done
11693     # Screen out bogus values from the imake configuration.  They are
11694     # bogus both because they are the default anyway, and because
11695     # using them would break gcc on systems where it needs fixed includes.
11696     case $ac_im_incroot in
11697         /usr/include) ;;
11698         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11699     esac
11700     case $ac_im_usrlibdir in
11701         /usr/lib | /lib) ;;
11702         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11703     esac
11704   fi
11705   cd ..
11706   rm -fr conftest.dir
11707 fi
11708
11709 # Standard set of common directories for X headers.
11710 # Check X11 before X11Rn because it is often a symlink to the current release.
11711 ac_x_header_dirs='
11712 /usr/X11/include
11713 /usr/X11R7/include
11714 /usr/X11R6/include
11715 /usr/X11R5/include
11716 /usr/X11R4/include
11717
11718 /opt/local/include
11719 /opt/X11/include
11720
11721 /usr/include/X11
11722 /usr/include/X11R7
11723 /usr/include/X11R6
11724 /usr/include/X11R5
11725 /usr/include/X11R4
11726
11727 /usr/local/X11/include
11728 /usr/local/X11R7/include
11729 /usr/local/X11R6/include
11730 /usr/local/X11R5/include
11731 /usr/local/X11R4/include
11732
11733 /usr/local/include/X11
11734 /usr/local/include/X11R7
11735 /usr/local/include/X11R6
11736 /usr/local/include/X11R5
11737 /usr/local/include/X11R4
11738
11739 /usr/X386/include
11740 /usr/x386/include
11741 /usr/XFree86/include/X11
11742
11743 /usr/include
11744 /usr/local/include
11745 /usr/unsupported/include
11746 /usr/athena/include
11747 /usr/local/x11r5/include
11748 /usr/lpp/Xamples/include
11749
11750 /usr/openwin/include
11751 /usr/openwin/share/include'
11752
11753 if test "$ac_x_includes" = no; then
11754   # Guess where to find include files, by looking for Intrinsic.h.
11755   # First, try using that file with no special directory specified.
11756   cat >conftest.$ac_ext <<_ACEOF
11757 #line 11757 "configure"
11758 #include "confdefs.h"
11759 #include <X11/Intrinsic.h>
11760 _ACEOF
11761 if { (eval echo "$as_me:11761: \"$ac_cpp conftest.$ac_ext\"") >&5
11762   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11763   ac_status=$?
11764   egrep -v '^ *\+' conftest.er1 >conftest.err
11765   rm -f conftest.er1
11766   cat conftest.err >&5
11767   echo "$as_me:11767: \$? = $ac_status" >&5
11768   (exit $ac_status); } >/dev/null; then
11769   if test -s conftest.err; then
11770     ac_cpp_err=$ac_c_preproc_warn_flag
11771   else
11772     ac_cpp_err=
11773   fi
11774 else
11775   ac_cpp_err=yes
11776 fi
11777 if test -z "$ac_cpp_err"; then
11778   # We can compile using X headers with no special include directory.
11779 ac_x_includes=
11780 else
11781   echo "$as_me: failed program was:" >&5
11782   cat conftest.$ac_ext >&5
11783   for ac_dir in $ac_x_header_dirs; do
11784   if test -r "$ac_dir/X11/Intrinsic.h"; then
11785     ac_x_includes=$ac_dir
11786     break
11787   fi
11788 done
11789 fi
11790 rm -f conftest.err conftest.$ac_ext
11791 fi # $ac_x_includes = no
11792
11793 if test "$ac_x_libraries" = no; then
11794   # Check for the libraries.
11795   # See if we find them without any special options.
11796   # Don't add to $LIBS permanently.
11797   ac_save_LIBS=$LIBS
11798   LIBS="-lXt $LIBS"
11799   cat >conftest.$ac_ext <<_ACEOF
11800 #line 11800 "configure"
11801 #include "confdefs.h"
11802 #include <X11/Intrinsic.h>
11803 int
11804 main (void)
11805 {
11806 XtMalloc (0)
11807   ;
11808   return 0;
11809 }
11810 _ACEOF
11811 rm -f conftest.$ac_objext conftest$ac_exeext
11812 if { (eval echo "$as_me:11812: \"$ac_link\"") >&5
11813   (eval $ac_link) 2>&5
11814   ac_status=$?
11815   echo "$as_me:11815: \$? = $ac_status" >&5
11816   (exit $ac_status); } &&
11817          { ac_try='test -s conftest$ac_exeext'
11818   { (eval echo "$as_me:11818: \"$ac_try\"") >&5
11819   (eval $ac_try) 2>&5
11820   ac_status=$?
11821   echo "$as_me:11821: \$? = $ac_status" >&5
11822   (exit $ac_status); }; }; then
11823   LIBS=$ac_save_LIBS
11824 # We can link X programs with no special library path.
11825 ac_x_libraries=
11826 else
11827   echo "$as_me: failed program was:" >&5
11828 cat conftest.$ac_ext >&5
11829 LIBS=$ac_save_LIBS
11830 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11831 do
11832   # Don't even attempt the hair of trying to link an X program!
11833   for ac_extension in a so sl dylib dll; do
11834     if test -r $ac_dir/libXt.$ac_extension; then
11835       ac_x_libraries=$ac_dir
11836       break 2
11837     fi
11838   done
11839 done
11840 fi
11841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11842 fi # $ac_x_libraries = no
11843
11844 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11845   # Didn't find X anywhere.  Cache the known absence of X.
11846   ac_cv_have_x="have_x=no"
11847 else
11848   # Record where we found X for the cache.
11849   ac_cv_have_x="have_x=yes \
11850                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11851 fi
11852 fi
11853
11854   fi
11855   eval "$ac_cv_have_x"
11856 fi # $with_x != no
11857
11858 if test "$have_x" != yes; then
11859   echo "$as_me:11859: result: $have_x" >&5
11860 echo "${ECHO_T}$have_x" >&6
11861   no_x=yes
11862 else
11863   # If each of the values was on the command line, it overrides each guess.
11864   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11865   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11866   # Update the cache value to reflect the command line values.
11867   ac_cv_have_x="have_x=yes \
11868                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11869   echo "$as_me:11869: result: libraries $x_libraries, headers $x_includes" >&5
11870 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11871 fi
11872
11873 if test "$no_x" = yes; then
11874   # Not all programs may use this symbol, but it does not hurt to define it.
11875
11876 cat >>confdefs.h <<\EOF
11877 #define X_DISPLAY_MISSING 1
11878 EOF
11879
11880   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11881 else
11882   if test -n "$x_includes"; then
11883     X_CFLAGS="$X_CFLAGS -I$x_includes"
11884   fi
11885
11886   # It would also be nice to do this for all -L options, not just this one.
11887   if test -n "$x_libraries"; then
11888     X_LIBS="$X_LIBS -L$x_libraries"
11889     # For Solaris; some versions of Sun CC require a space after -R and
11890     # others require no space.  Words are not sufficient . . . .
11891     case `(uname -sr) 2>/dev/null` in
11892     "SunOS 5"*)
11893       echo "$as_me:11893: checking whether -R must be followed by a space" >&5
11894 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11895       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11896       cat >conftest.$ac_ext <<_ACEOF
11897 #line 11897 "configure"
11898 #include "confdefs.h"
11899
11900 int
11901 main (void)
11902 {
11903
11904   ;
11905   return 0;
11906 }
11907 _ACEOF
11908 rm -f conftest.$ac_objext conftest$ac_exeext
11909 if { (eval echo "$as_me:11909: \"$ac_link\"") >&5
11910   (eval $ac_link) 2>&5
11911   ac_status=$?
11912   echo "$as_me:11912: \$? = $ac_status" >&5
11913   (exit $ac_status); } &&
11914          { ac_try='test -s conftest$ac_exeext'
11915   { (eval echo "$as_me:11915: \"$ac_try\"") >&5
11916   (eval $ac_try) 2>&5
11917   ac_status=$?
11918   echo "$as_me:11918: \$? = $ac_status" >&5
11919   (exit $ac_status); }; }; then
11920   ac_R_nospace=yes
11921 else
11922   echo "$as_me: failed program was:" >&5
11923 cat conftest.$ac_ext >&5
11924 ac_R_nospace=no
11925 fi
11926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11927       if test $ac_R_nospace = yes; then
11928         echo "$as_me:11928: result: no" >&5
11929 echo "${ECHO_T}no" >&6
11930         X_LIBS="$X_LIBS -R$x_libraries"
11931       else
11932         LIBS="$ac_xsave_LIBS -R $x_libraries"
11933         cat >conftest.$ac_ext <<_ACEOF
11934 #line 11934 "configure"
11935 #include "confdefs.h"
11936
11937 int
11938 main (void)
11939 {
11940
11941   ;
11942   return 0;
11943 }
11944 _ACEOF
11945 rm -f conftest.$ac_objext conftest$ac_exeext
11946 if { (eval echo "$as_me:11946: \"$ac_link\"") >&5
11947   (eval $ac_link) 2>&5
11948   ac_status=$?
11949   echo "$as_me:11949: \$? = $ac_status" >&5
11950   (exit $ac_status); } &&
11951          { ac_try='test -s conftest$ac_exeext'
11952   { (eval echo "$as_me:11952: \"$ac_try\"") >&5
11953   (eval $ac_try) 2>&5
11954   ac_status=$?
11955   echo "$as_me:11955: \$? = $ac_status" >&5
11956   (exit $ac_status); }; }; then
11957   ac_R_space=yes
11958 else
11959   echo "$as_me: failed program was:" >&5
11960 cat conftest.$ac_ext >&5
11961 ac_R_space=no
11962 fi
11963 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11964         if test $ac_R_space = yes; then
11965           echo "$as_me:11965: result: yes" >&5
11966 echo "${ECHO_T}yes" >&6
11967           X_LIBS="$X_LIBS -R $x_libraries"
11968         else
11969           echo "$as_me:11969: result: neither works" >&5
11970 echo "${ECHO_T}neither works" >&6
11971         fi
11972       fi
11973       LIBS=$ac_xsave_LIBS
11974     esac
11975   fi
11976
11977   # Check for system-dependent libraries X programs must link with.
11978   # Do this before checking for the system-independent R6 libraries
11979   # (-lICE), since we may need -lsocket or whatever for X linking.
11980
11981   if test "$ISC" = yes; then
11982     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11983   else
11984     # Martyn Johnson says this is needed for Ultrix, if the X
11985     # libraries were built with DECnet support.  And Karl Berry says
11986     # the Alpha needs dnet_stub (dnet does not exist).
11987     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11988     cat >conftest.$ac_ext <<_ACEOF
11989 #line 11989 "configure"
11990 #include "confdefs.h"
11991
11992 /* Override any gcc2 internal prototype to avoid an error.  */
11993 #ifdef __cplusplus
11994 extern "C"
11995 #endif
11996 /* We use char because int might match the return type of a gcc2
11997    builtin and then its argument prototype would still apply.  */
11998 char XOpenDisplay ();
11999 int
12000 main (void)
12001 {
12002 XOpenDisplay ();
12003   ;
12004   return 0;
12005 }
12006 _ACEOF
12007 rm -f conftest.$ac_objext conftest$ac_exeext
12008 if { (eval echo "$as_me:12008: \"$ac_link\"") >&5
12009   (eval $ac_link) 2>&5
12010   ac_status=$?
12011   echo "$as_me:12011: \$? = $ac_status" >&5
12012   (exit $ac_status); } &&
12013          { ac_try='test -s conftest$ac_exeext'
12014   { (eval echo "$as_me:12014: \"$ac_try\"") >&5
12015   (eval $ac_try) 2>&5
12016   ac_status=$?
12017   echo "$as_me:12017: \$? = $ac_status" >&5
12018   (exit $ac_status); }; }; then
12019   :
12020 else
12021   echo "$as_me: failed program was:" >&5
12022 cat conftest.$ac_ext >&5
12023 echo "$as_me:12023: checking for dnet_ntoa in -ldnet" >&5
12024 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12025 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12026   echo $ECHO_N "(cached) $ECHO_C" >&6
12027 else
12028   ac_check_lib_save_LIBS=$LIBS
12029 LIBS="-ldnet  $LIBS"
12030 cat >conftest.$ac_ext <<_ACEOF
12031 #line 12031 "configure"
12032 #include "confdefs.h"
12033
12034 /* Override any gcc2 internal prototype to avoid an error.  */
12035 #ifdef __cplusplus
12036 extern "C"
12037 #endif
12038 /* We use char because int might match the return type of a gcc2
12039    builtin and then its argument prototype would still apply.  */
12040 char dnet_ntoa ();
12041 int
12042 main (void)
12043 {
12044 dnet_ntoa ();
12045   ;
12046   return 0;
12047 }
12048 _ACEOF
12049 rm -f conftest.$ac_objext conftest$ac_exeext
12050 if { (eval echo "$as_me:12050: \"$ac_link\"") >&5
12051   (eval $ac_link) 2>&5
12052   ac_status=$?
12053   echo "$as_me:12053: \$? = $ac_status" >&5
12054   (exit $ac_status); } &&
12055          { ac_try='test -s conftest$ac_exeext'
12056   { (eval echo "$as_me:12056: \"$ac_try\"") >&5
12057   (eval $ac_try) 2>&5
12058   ac_status=$?
12059   echo "$as_me:12059: \$? = $ac_status" >&5
12060   (exit $ac_status); }; }; then
12061   ac_cv_lib_dnet_dnet_ntoa=yes
12062 else
12063   echo "$as_me: failed program was:" >&5
12064 cat conftest.$ac_ext >&5
12065 ac_cv_lib_dnet_dnet_ntoa=no
12066 fi
12067 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12068 LIBS=$ac_check_lib_save_LIBS
12069 fi
12070 echo "$as_me:12070: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12071 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12072 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12073   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12074 fi
12075
12076     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12077       echo "$as_me:12077: checking for dnet_ntoa in -ldnet_stub" >&5
12078 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12079 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12080   echo $ECHO_N "(cached) $ECHO_C" >&6
12081 else
12082   ac_check_lib_save_LIBS=$LIBS
12083 LIBS="-ldnet_stub  $LIBS"
12084 cat >conftest.$ac_ext <<_ACEOF
12085 #line 12085 "configure"
12086 #include "confdefs.h"
12087
12088 /* Override any gcc2 internal prototype to avoid an error.  */
12089 #ifdef __cplusplus
12090 extern "C"
12091 #endif
12092 /* We use char because int might match the return type of a gcc2
12093    builtin and then its argument prototype would still apply.  */
12094 char dnet_ntoa ();
12095 int
12096 main (void)
12097 {
12098 dnet_ntoa ();
12099   ;
12100   return 0;
12101 }
12102 _ACEOF
12103 rm -f conftest.$ac_objext conftest$ac_exeext
12104 if { (eval echo "$as_me:12104: \"$ac_link\"") >&5
12105   (eval $ac_link) 2>&5
12106   ac_status=$?
12107   echo "$as_me:12107: \$? = $ac_status" >&5
12108   (exit $ac_status); } &&
12109          { ac_try='test -s conftest$ac_exeext'
12110   { (eval echo "$as_me:12110: \"$ac_try\"") >&5
12111   (eval $ac_try) 2>&5
12112   ac_status=$?
12113   echo "$as_me:12113: \$? = $ac_status" >&5
12114   (exit $ac_status); }; }; then
12115   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12116 else
12117   echo "$as_me: failed program was:" >&5
12118 cat conftest.$ac_ext >&5
12119 ac_cv_lib_dnet_stub_dnet_ntoa=no
12120 fi
12121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12122 LIBS=$ac_check_lib_save_LIBS
12123 fi
12124 echo "$as_me:12124: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12125 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12126 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12127   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12128 fi
12129
12130     fi
12131 fi
12132 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12133     LIBS="$ac_xsave_LIBS"
12134
12135     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12136     # to get the SysV transport functions.
12137     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12138     # needs -lnsl.
12139     # The nsl library prevents programs from opening the X display
12140     # on Irix 5.2, according to T.E. Dickey.
12141     # The functions gethostbyname, getservbyname, and inet_addr are
12142     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12143     echo "$as_me:12143: checking for gethostbyname" >&5
12144 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12145 if test "${ac_cv_func_gethostbyname+set}" = set; then
12146   echo $ECHO_N "(cached) $ECHO_C" >&6
12147 else
12148   cat >conftest.$ac_ext <<_ACEOF
12149 #line 12149 "configure"
12150 #include "confdefs.h"
12151 #define gethostbyname autoconf_temporary
12152 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12153 #undef gethostbyname
12154
12155 #ifdef __cplusplus
12156 extern "C"
12157 #endif
12158
12159 /* We use char because int might match the return type of a gcc2
12160    builtin and then its argument prototype would still apply.  */
12161 char gethostbyname (void);
12162
12163 int
12164 main (void)
12165 {
12166
12167 /* The GNU C library defines stubs for functions which it implements
12168     to always fail with ENOSYS.  Some functions are actually named
12169     something starting with __ and the normal name is an alias.  */
12170 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12171 #error found stub for gethostbyname
12172 #endif
12173
12174         return 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_func_gethostbyname=yes
12192 else
12193   echo "$as_me: failed program was:" >&5
12194 cat conftest.$ac_ext >&5
12195 ac_cv_func_gethostbyname=no
12196 fi
12197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12198 fi
12199 echo "$as_me:12199: result: $ac_cv_func_gethostbyname" >&5
12200 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12201
12202     if test $ac_cv_func_gethostbyname = no; then
12203       echo "$as_me:12203: checking for gethostbyname in -lnsl" >&5
12204 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12205 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12206   echo $ECHO_N "(cached) $ECHO_C" >&6
12207 else
12208   ac_check_lib_save_LIBS=$LIBS
12209 LIBS="-lnsl  $LIBS"
12210 cat >conftest.$ac_ext <<_ACEOF
12211 #line 12211 "configure"
12212 #include "confdefs.h"
12213
12214 /* Override any gcc2 internal prototype to avoid an error.  */
12215 #ifdef __cplusplus
12216 extern "C"
12217 #endif
12218 /* We use char because int might match the return type of a gcc2
12219    builtin and then its argument prototype would still apply.  */
12220 char gethostbyname ();
12221 int
12222 main (void)
12223 {
12224 gethostbyname ();
12225   ;
12226   return 0;
12227 }
12228 _ACEOF
12229 rm -f conftest.$ac_objext conftest$ac_exeext
12230 if { (eval echo "$as_me:12230: \"$ac_link\"") >&5
12231   (eval $ac_link) 2>&5
12232   ac_status=$?
12233   echo "$as_me:12233: \$? = $ac_status" >&5
12234   (exit $ac_status); } &&
12235          { ac_try='test -s conftest$ac_exeext'
12236   { (eval echo "$as_me:12236: \"$ac_try\"") >&5
12237   (eval $ac_try) 2>&5
12238   ac_status=$?
12239   echo "$as_me:12239: \$? = $ac_status" >&5
12240   (exit $ac_status); }; }; then
12241   ac_cv_lib_nsl_gethostbyname=yes
12242 else
12243   echo "$as_me: failed program was:" >&5
12244 cat conftest.$ac_ext >&5
12245 ac_cv_lib_nsl_gethostbyname=no
12246 fi
12247 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12248 LIBS=$ac_check_lib_save_LIBS
12249 fi
12250 echo "$as_me:12250: result: $ac_cv_lib_nsl_gethostbyname" >&5
12251 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12252 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12253   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12254 fi
12255
12256       if test $ac_cv_lib_nsl_gethostbyname = no; then
12257         echo "$as_me:12257: checking for gethostbyname in -lbsd" >&5
12258 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12259 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12260   echo $ECHO_N "(cached) $ECHO_C" >&6
12261 else
12262   ac_check_lib_save_LIBS=$LIBS
12263 LIBS="-lbsd  $LIBS"
12264 cat >conftest.$ac_ext <<_ACEOF
12265 #line 12265 "configure"
12266 #include "confdefs.h"
12267
12268 /* Override any gcc2 internal prototype to avoid an error.  */
12269 #ifdef __cplusplus
12270 extern "C"
12271 #endif
12272 /* We use char because int might match the return type of a gcc2
12273    builtin and then its argument prototype would still apply.  */
12274 char gethostbyname ();
12275 int
12276 main (void)
12277 {
12278 gethostbyname ();
12279   ;
12280   return 0;
12281 }
12282 _ACEOF
12283 rm -f conftest.$ac_objext conftest$ac_exeext
12284 if { (eval echo "$as_me:12284: \"$ac_link\"") >&5
12285   (eval $ac_link) 2>&5
12286   ac_status=$?
12287   echo "$as_me:12287: \$? = $ac_status" >&5
12288   (exit $ac_status); } &&
12289          { ac_try='test -s conftest$ac_exeext'
12290   { (eval echo "$as_me:12290: \"$ac_try\"") >&5
12291   (eval $ac_try) 2>&5
12292   ac_status=$?
12293   echo "$as_me:12293: \$? = $ac_status" >&5
12294   (exit $ac_status); }; }; then
12295   ac_cv_lib_bsd_gethostbyname=yes
12296 else
12297   echo "$as_me: failed program was:" >&5
12298 cat conftest.$ac_ext >&5
12299 ac_cv_lib_bsd_gethostbyname=no
12300 fi
12301 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12302 LIBS=$ac_check_lib_save_LIBS
12303 fi
12304 echo "$as_me:12304: result: $ac_cv_lib_bsd_gethostbyname" >&5
12305 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12306 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12307   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12308 fi
12309
12310       fi
12311     fi
12312
12313     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12314     # socket/setsockopt and other routines are undefined under SCO ODT
12315     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12316     # on later versions), says Simon Leinen: it contains gethostby*
12317     # variants that don't use the nameserver (or something).  -lsocket
12318     # must be given before -lnsl if both are needed.  We assume that
12319     # if connect needs -lnsl, so does gethostbyname.
12320     echo "$as_me:12320: checking for connect" >&5
12321 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12322 if test "${ac_cv_func_connect+set}" = set; then
12323   echo $ECHO_N "(cached) $ECHO_C" >&6
12324 else
12325   cat >conftest.$ac_ext <<_ACEOF
12326 #line 12326 "configure"
12327 #include "confdefs.h"
12328 #define connect autoconf_temporary
12329 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12330 #undef connect
12331
12332 #ifdef __cplusplus
12333 extern "C"
12334 #endif
12335
12336 /* We use char because int might match the return type of a gcc2
12337    builtin and then its argument prototype would still apply.  */
12338 char connect (void);
12339
12340 int
12341 main (void)
12342 {
12343
12344 /* The GNU C library defines stubs for functions which it implements
12345     to always fail with ENOSYS.  Some functions are actually named
12346     something starting with __ and the normal name is an alias.  */
12347 #if defined (__stub_connect) || defined (__stub___connect)
12348 #error found stub for connect
12349 #endif
12350
12351         return 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_func_connect=yes
12369 else
12370   echo "$as_me: failed program was:" >&5
12371 cat conftest.$ac_ext >&5
12372 ac_cv_func_connect=no
12373 fi
12374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12375 fi
12376 echo "$as_me:12376: result: $ac_cv_func_connect" >&5
12377 echo "${ECHO_T}$ac_cv_func_connect" >&6
12378
12379     if test $ac_cv_func_connect = no; then
12380       echo "$as_me:12380: checking for connect in -lsocket" >&5
12381 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12382 if test "${ac_cv_lib_socket_connect+set}" = set; then
12383   echo $ECHO_N "(cached) $ECHO_C" >&6
12384 else
12385   ac_check_lib_save_LIBS=$LIBS
12386 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12387 cat >conftest.$ac_ext <<_ACEOF
12388 #line 12388 "configure"
12389 #include "confdefs.h"
12390
12391 /* Override any gcc2 internal prototype to avoid an error.  */
12392 #ifdef __cplusplus
12393 extern "C"
12394 #endif
12395 /* We use char because int might match the return type of a gcc2
12396    builtin and then its argument prototype would still apply.  */
12397 char connect ();
12398 int
12399 main (void)
12400 {
12401 connect ();
12402   ;
12403   return 0;
12404 }
12405 _ACEOF
12406 rm -f conftest.$ac_objext conftest$ac_exeext
12407 if { (eval echo "$as_me:12407: \"$ac_link\"") >&5
12408   (eval $ac_link) 2>&5
12409   ac_status=$?
12410   echo "$as_me:12410: \$? = $ac_status" >&5
12411   (exit $ac_status); } &&
12412          { ac_try='test -s conftest$ac_exeext'
12413   { (eval echo "$as_me:12413: \"$ac_try\"") >&5
12414   (eval $ac_try) 2>&5
12415   ac_status=$?
12416   echo "$as_me:12416: \$? = $ac_status" >&5
12417   (exit $ac_status); }; }; then
12418   ac_cv_lib_socket_connect=yes
12419 else
12420   echo "$as_me: failed program was:" >&5
12421 cat conftest.$ac_ext >&5
12422 ac_cv_lib_socket_connect=no
12423 fi
12424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12425 LIBS=$ac_check_lib_save_LIBS
12426 fi
12427 echo "$as_me:12427: result: $ac_cv_lib_socket_connect" >&5
12428 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12429 if test $ac_cv_lib_socket_connect = yes; then
12430   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12431 fi
12432
12433     fi
12434
12435     # Guillermo Gomez says -lposix is necessary on A/UX.
12436     echo "$as_me:12436: checking for remove" >&5
12437 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12438 if test "${ac_cv_func_remove+set}" = set; then
12439   echo $ECHO_N "(cached) $ECHO_C" >&6
12440 else
12441   cat >conftest.$ac_ext <<_ACEOF
12442 #line 12442 "configure"
12443 #include "confdefs.h"
12444 #define remove autoconf_temporary
12445 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12446 #undef remove
12447
12448 #ifdef __cplusplus
12449 extern "C"
12450 #endif
12451
12452 /* We use char because int might match the return type of a gcc2
12453    builtin and then its argument prototype would still apply.  */
12454 char remove (void);
12455
12456 int
12457 main (void)
12458 {
12459
12460 /* The GNU C library defines stubs for functions which it implements
12461     to always fail with ENOSYS.  Some functions are actually named
12462     something starting with __ and the normal name is an alias.  */
12463 #if defined (__stub_remove) || defined (__stub___remove)
12464 #error found stub for remove
12465 #endif
12466
12467         return 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_func_remove=yes
12485 else
12486   echo "$as_me: failed program was:" >&5
12487 cat conftest.$ac_ext >&5
12488 ac_cv_func_remove=no
12489 fi
12490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12491 fi
12492 echo "$as_me:12492: result: $ac_cv_func_remove" >&5
12493 echo "${ECHO_T}$ac_cv_func_remove" >&6
12494
12495     if test $ac_cv_func_remove = no; then
12496       echo "$as_me:12496: checking for remove in -lposix" >&5
12497 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12498 if test "${ac_cv_lib_posix_remove+set}" = set; then
12499   echo $ECHO_N "(cached) $ECHO_C" >&6
12500 else
12501   ac_check_lib_save_LIBS=$LIBS
12502 LIBS="-lposix  $LIBS"
12503 cat >conftest.$ac_ext <<_ACEOF
12504 #line 12504 "configure"
12505 #include "confdefs.h"
12506
12507 /* Override any gcc2 internal prototype to avoid an error.  */
12508 #ifdef __cplusplus
12509 extern "C"
12510 #endif
12511 /* We use char because int might match the return type of a gcc2
12512    builtin and then its argument prototype would still apply.  */
12513 char remove ();
12514 int
12515 main (void)
12516 {
12517 remove ();
12518   ;
12519   return 0;
12520 }
12521 _ACEOF
12522 rm -f conftest.$ac_objext conftest$ac_exeext
12523 if { (eval echo "$as_me:12523: \"$ac_link\"") >&5
12524   (eval $ac_link) 2>&5
12525   ac_status=$?
12526   echo "$as_me:12526: \$? = $ac_status" >&5
12527   (exit $ac_status); } &&
12528          { ac_try='test -s conftest$ac_exeext'
12529   { (eval echo "$as_me:12529: \"$ac_try\"") >&5
12530   (eval $ac_try) 2>&5
12531   ac_status=$?
12532   echo "$as_me:12532: \$? = $ac_status" >&5
12533   (exit $ac_status); }; }; then
12534   ac_cv_lib_posix_remove=yes
12535 else
12536   echo "$as_me: failed program was:" >&5
12537 cat conftest.$ac_ext >&5
12538 ac_cv_lib_posix_remove=no
12539 fi
12540 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12541 LIBS=$ac_check_lib_save_LIBS
12542 fi
12543 echo "$as_me:12543: result: $ac_cv_lib_posix_remove" >&5
12544 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12545 if test $ac_cv_lib_posix_remove = yes; then
12546   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12547 fi
12548
12549     fi
12550
12551     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12552     echo "$as_me:12552: checking for shmat" >&5
12553 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12554 if test "${ac_cv_func_shmat+set}" = set; then
12555   echo $ECHO_N "(cached) $ECHO_C" >&6
12556 else
12557   cat >conftest.$ac_ext <<_ACEOF
12558 #line 12558 "configure"
12559 #include "confdefs.h"
12560 #define shmat autoconf_temporary
12561 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12562 #undef shmat
12563
12564 #ifdef __cplusplus
12565 extern "C"
12566 #endif
12567
12568 /* We use char because int might match the return type of a gcc2
12569    builtin and then its argument prototype would still apply.  */
12570 char shmat (void);
12571
12572 int
12573 main (void)
12574 {
12575
12576 /* The GNU C library defines stubs for functions which it implements
12577     to always fail with ENOSYS.  Some functions are actually named
12578     something starting with __ and the normal name is an alias.  */
12579 #if defined (__stub_shmat) || defined (__stub___shmat)
12580 #error found stub for shmat
12581 #endif
12582
12583         return 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_func_shmat=yes
12601 else
12602   echo "$as_me: failed program was:" >&5
12603 cat conftest.$ac_ext >&5
12604 ac_cv_func_shmat=no
12605 fi
12606 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12607 fi
12608 echo "$as_me:12608: result: $ac_cv_func_shmat" >&5
12609 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12610
12611     if test $ac_cv_func_shmat = no; then
12612       echo "$as_me:12612: checking for shmat in -lipc" >&5
12613 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12614 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12615   echo $ECHO_N "(cached) $ECHO_C" >&6
12616 else
12617   ac_check_lib_save_LIBS=$LIBS
12618 LIBS="-lipc  $LIBS"
12619 cat >conftest.$ac_ext <<_ACEOF
12620 #line 12620 "configure"
12621 #include "confdefs.h"
12622
12623 /* Override any gcc2 internal prototype to avoid an error.  */
12624 #ifdef __cplusplus
12625 extern "C"
12626 #endif
12627 /* We use char because int might match the return type of a gcc2
12628    builtin and then its argument prototype would still apply.  */
12629 char shmat ();
12630 int
12631 main (void)
12632 {
12633 shmat ();
12634   ;
12635   return 0;
12636 }
12637 _ACEOF
12638 rm -f conftest.$ac_objext conftest$ac_exeext
12639 if { (eval echo "$as_me:12639: \"$ac_link\"") >&5
12640   (eval $ac_link) 2>&5
12641   ac_status=$?
12642   echo "$as_me:12642: \$? = $ac_status" >&5
12643   (exit $ac_status); } &&
12644          { ac_try='test -s conftest$ac_exeext'
12645   { (eval echo "$as_me:12645: \"$ac_try\"") >&5
12646   (eval $ac_try) 2>&5
12647   ac_status=$?
12648   echo "$as_me:12648: \$? = $ac_status" >&5
12649   (exit $ac_status); }; }; then
12650   ac_cv_lib_ipc_shmat=yes
12651 else
12652   echo "$as_me: failed program was:" >&5
12653 cat conftest.$ac_ext >&5
12654 ac_cv_lib_ipc_shmat=no
12655 fi
12656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12657 LIBS=$ac_check_lib_save_LIBS
12658 fi
12659 echo "$as_me:12659: result: $ac_cv_lib_ipc_shmat" >&5
12660 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12661 if test $ac_cv_lib_ipc_shmat = yes; then
12662   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12663 fi
12664
12665     fi
12666   fi
12667
12668   # Check for libraries that X11R6 Xt/Xaw programs need.
12669   ac_save_LDFLAGS=$LDFLAGS
12670   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12671   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12672   # check for ICE first), but we must link in the order -lSM -lICE or
12673   # we get undefined symbols.  So assume we have SM if we have ICE.
12674   # These have to be linked with before -lX11, unlike the other
12675   # libraries we check for below, so use a different variable.
12676   # John Interrante, Karl Berry
12677   echo "$as_me:12677: checking for IceConnectionNumber in -lICE" >&5
12678 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12679 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12680   echo $ECHO_N "(cached) $ECHO_C" >&6
12681 else
12682   ac_check_lib_save_LIBS=$LIBS
12683 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12684 cat >conftest.$ac_ext <<_ACEOF
12685 #line 12685 "configure"
12686 #include "confdefs.h"
12687
12688 /* Override any gcc2 internal prototype to avoid an error.  */
12689 #ifdef __cplusplus
12690 extern "C"
12691 #endif
12692 /* We use char because int might match the return type of a gcc2
12693    builtin and then its argument prototype would still apply.  */
12694 char IceConnectionNumber ();
12695 int
12696 main (void)
12697 {
12698 IceConnectionNumber ();
12699   ;
12700   return 0;
12701 }
12702 _ACEOF
12703 rm -f conftest.$ac_objext conftest$ac_exeext
12704 if { (eval echo "$as_me:12704: \"$ac_link\"") >&5
12705   (eval $ac_link) 2>&5
12706   ac_status=$?
12707   echo "$as_me:12707: \$? = $ac_status" >&5
12708   (exit $ac_status); } &&
12709          { ac_try='test -s conftest$ac_exeext'
12710   { (eval echo "$as_me:12710: \"$ac_try\"") >&5
12711   (eval $ac_try) 2>&5
12712   ac_status=$?
12713   echo "$as_me:12713: \$? = $ac_status" >&5
12714   (exit $ac_status); }; }; then
12715   ac_cv_lib_ICE_IceConnectionNumber=yes
12716 else
12717   echo "$as_me: failed program was:" >&5
12718 cat conftest.$ac_ext >&5
12719 ac_cv_lib_ICE_IceConnectionNumber=no
12720 fi
12721 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12722 LIBS=$ac_check_lib_save_LIBS
12723 fi
12724 echo "$as_me:12724: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12725 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12726 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12727   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12728 fi
12729
12730   LDFLAGS=$ac_save_LDFLAGS
12731
12732 fi
12733
12734 cf_x_athena=${cf_x_athena:-Xaw}
12735
12736 echo "$as_me:12736: checking if you want to link with Xaw 3d library" >&5
12737 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12738 withval=
12739
12740 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12741 if test "${with_Xaw3d+set}" = set; then
12742   withval="$with_Xaw3d"
12743
12744 fi;
12745 if test "$withval" = yes ; then
12746         cf_x_athena=Xaw3d
12747         echo "$as_me:12747: result: yes" >&5
12748 echo "${ECHO_T}yes" >&6
12749 else
12750         echo "$as_me:12750: result: no" >&5
12751 echo "${ECHO_T}no" >&6
12752 fi
12753
12754 echo "$as_me:12754: checking if you want to link with Xaw 3d xft library" >&5
12755 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12756 withval=
12757
12758 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12759 if test "${with_Xaw3dxft+set}" = set; then
12760   withval="$with_Xaw3dxft"
12761
12762 fi;
12763 if test "$withval" = yes ; then
12764         cf_x_athena=Xaw3dxft
12765         echo "$as_me:12765: result: yes" >&5
12766 echo "${ECHO_T}yes" >&6
12767 else
12768         echo "$as_me:12768: result: no" >&5
12769 echo "${ECHO_T}no" >&6
12770 fi
12771
12772 echo "$as_me:12772: checking if you want to link with neXT Athena library" >&5
12773 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12774 withval=
12775
12776 # Check whether --with-neXtaw or --without-neXtaw was given.
12777 if test "${with_neXtaw+set}" = set; then
12778   withval="$with_neXtaw"
12779
12780 fi;
12781 if test "$withval" = yes ; then
12782         cf_x_athena=neXtaw
12783         echo "$as_me:12783: result: yes" >&5
12784 echo "${ECHO_T}yes" >&6
12785 else
12786         echo "$as_me:12786: result: no" >&5
12787 echo "${ECHO_T}no" >&6
12788 fi
12789
12790 echo "$as_me:12790: checking if you want to link with Athena-Plus library" >&5
12791 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12792 withval=
12793
12794 # Check whether --with-XawPlus or --without-XawPlus was given.
12795 if test "${with_XawPlus+set}" = set; then
12796   withval="$with_XawPlus"
12797
12798 fi;
12799 if test "$withval" = yes ; then
12800         cf_x_athena=XawPlus
12801         echo "$as_me:12801: result: yes" >&5
12802 echo "${ECHO_T}yes" >&6
12803 else
12804         echo "$as_me:12804: result: no" >&5
12805 echo "${ECHO_T}no" >&6
12806 fi
12807
12808 cf_x_athena_lib=""
12809
12810 if test "$PKG_CONFIG" != none ; then
12811         cf_athena_list=
12812         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12813         for cf_athena_pkg in \
12814                 $cf_athena_list \
12815                 ${cf_x_athena} \
12816                 ${cf_x_athena}-devel \
12817                 lib${cf_x_athena} \
12818                 lib${cf_x_athena}-devel
12819         do
12820
12821 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12822         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12823
12824 echo "${as_me:-configure}:12824: testing found package $cf_athena_pkg ..." 1>&5
12825
12826         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12827         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12828         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12829
12830 echo "${as_me:-configure}:12830: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12831
12832         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12833
12834 echo "${as_me:-configure}:12834: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12835
12836 cf_fix_cppflags=no
12837 cf_new_cflags=
12838 cf_new_cppflags=
12839 cf_new_extra_cppflags=
12840
12841 for cf_add_cflags in $cf_pkgconfig_incs
12842 do
12843 case $cf_fix_cppflags in
12844 (no)
12845         case $cf_add_cflags in
12846         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12847                 case $cf_add_cflags in
12848                 (-D*)
12849                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12850
12851                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12852                                 && test -z "${cf_tst_cflags}" \
12853                                 && cf_fix_cppflags=yes
12854
12855                         if test $cf_fix_cppflags = yes ; then
12856
12857         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12858         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12859
12860                                 continue
12861                         elif test "${cf_tst_cflags}" = "\"'" ; then
12862
12863         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12864         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12865
12866                                 continue
12867                         fi
12868                         ;;
12869                 esac
12870                 case "$CPPFLAGS" in
12871                 (*$cf_add_cflags)
12872                         ;;
12873                 (*)
12874                         case $cf_add_cflags in
12875                         (-D*)
12876                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12877
12878 CPPFLAGS=`echo "$CPPFLAGS" | \
12879         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12880                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12881
12882                                 ;;
12883                         esac
12884
12885         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12886         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12887
12888                         ;;
12889                 esac
12890                 ;;
12891         (*)
12892
12893         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12894         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12895
12896                 ;;
12897         esac
12898         ;;
12899 (yes)
12900
12901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12903
12904         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12905
12906         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12907                 && test -z "${cf_tst_cflags}" \
12908                 && cf_fix_cppflags=no
12909         ;;
12910 esac
12911 done
12912
12913 if test -n "$cf_new_cflags" ; then
12914
12915         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12916         CFLAGS="${CFLAGS}$cf_new_cflags"
12917
12918 fi
12919
12920 if test -n "$cf_new_cppflags" ; then
12921
12922         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12923         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12924
12925 fi
12926
12927 if test -n "$cf_new_extra_cppflags" ; then
12928
12929         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12930         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12931
12932 fi
12933
12934 cf_add_libs="$LIBS"
12935 # reverse order
12936 cf_add_0lib=
12937 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12938 # filter duplicates
12939 for cf_add_1lib in $cf_add_0lib; do
12940         for cf_add_2lib in $cf_add_libs; do
12941                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12942                         cf_add_1lib=
12943                         break
12944                 fi
12945         done
12946         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12947 done
12948 LIBS="$cf_add_libs"
12949
12950                         cf_x_athena_lib="$cf_pkgconfig_libs"
12951
12952 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12953
12954                         cat >>confdefs.h <<EOF
12955 #define $cf_x_athena_LIBS 1
12956 EOF
12957
12958         for cf_trim_lib in Xmu Xt X11
12959         do
12960                 case "$LIBS" in
12961                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12962                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12963                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12964
12965 echo "${as_me:-configure}:12965: testing ..trimmed $LIBS ..." 1>&5
12966
12967                         ;;
12968                 esac
12969         done
12970
12971 echo "$as_me:12971: checking for usable $cf_x_athena/Xmu package" >&5
12972 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12973 if test "${cf_cv_xaw_compat+set}" = set; then
12974   echo $ECHO_N "(cached) $ECHO_C" >&6
12975 else
12976
12977 cat >conftest.$ac_ext <<_ACEOF
12978 #line 12978 "configure"
12979 #include "confdefs.h"
12980
12981 #include <X11/Xmu/CharSet.h>
12982
12983 int
12984 main (void)
12985 {
12986
12987 int check = XmuCompareISOLatin1("big", "small");
12988 (void)check;
12989
12990   ;
12991   return 0;
12992 }
12993 _ACEOF
12994 rm -f conftest.$ac_objext conftest$ac_exeext
12995 if { (eval echo "$as_me:12995: \"$ac_link\"") >&5
12996   (eval $ac_link) 2>&5
12997   ac_status=$?
12998   echo "$as_me:12998: \$? = $ac_status" >&5
12999   (exit $ac_status); } &&
13000          { ac_try='test -s conftest$ac_exeext'
13001   { (eval echo "$as_me:13001: \"$ac_try\"") >&5
13002   (eval $ac_try) 2>&5
13003   ac_status=$?
13004   echo "$as_me:13004: \$? = $ac_status" >&5
13005   (exit $ac_status); }; }; then
13006   cf_cv_xaw_compat=yes
13007 else
13008   echo "$as_me: failed program was:" >&5
13009 cat conftest.$ac_ext >&5
13010 cf_cv_xaw_compat=no
13011 fi
13012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13013 fi
13014 echo "$as_me:13014: result: $cf_cv_xaw_compat" >&5
13015 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13016
13017                         if test "$cf_cv_xaw_compat" = no
13018                         then
13019                                 # workaround for broken ".pc" files...
13020                                 case "$cf_x_athena_lib" in
13021                                 (*-lXmu*)
13022                                         ;;
13023                                 (*)
13024                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13025
13026 echo "${as_me:-configure}:13026: testing work around broken package ..." 1>&5
13027
13028                                         cf_save_xmu="$LIBS"
13029                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13030
13031 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
13032         test -n "$verbose" && echo "    found package xmu" 1>&6
13033
13034 echo "${as_me:-configure}:13034: testing found package xmu ..." 1>&5
13035
13036         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
13037         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
13038         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13039
13040 echo "${as_me:-configure}:13040: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13041
13042         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13043
13044 echo "${as_me:-configure}:13044: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13045
13046 cf_fix_cppflags=no
13047 cf_new_cflags=
13048 cf_new_cppflags=
13049 cf_new_extra_cppflags=
13050
13051 for cf_add_cflags in $cf_pkgconfig_incs
13052 do
13053 case $cf_fix_cppflags in
13054 (no)
13055         case $cf_add_cflags in
13056         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13057                 case $cf_add_cflags in
13058                 (-D*)
13059                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13060
13061                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13062                                 && test -z "${cf_tst_cflags}" \
13063                                 && cf_fix_cppflags=yes
13064
13065                         if test $cf_fix_cppflags = yes ; then
13066
13067         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13068         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13069
13070                                 continue
13071                         elif test "${cf_tst_cflags}" = "\"'" ; then
13072
13073         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13074         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13075
13076                                 continue
13077                         fi
13078                         ;;
13079                 esac
13080                 case "$CPPFLAGS" in
13081                 (*$cf_add_cflags)
13082                         ;;
13083                 (*)
13084                         case $cf_add_cflags in
13085                         (-D*)
13086                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13087
13088 CPPFLAGS=`echo "$CPPFLAGS" | \
13089         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13090                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13091
13092                                 ;;
13093                         esac
13094
13095         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13096         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13097
13098                         ;;
13099                 esac
13100                 ;;
13101         (*)
13102
13103         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13104         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13105
13106                 ;;
13107         esac
13108         ;;
13109 (yes)
13110
13111         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13112         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13113
13114         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13115
13116         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13117                 && test -z "${cf_tst_cflags}" \
13118                 && cf_fix_cppflags=no
13119         ;;
13120 esac
13121 done
13122
13123 if test -n "$cf_new_cflags" ; then
13124
13125         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13126         CFLAGS="${CFLAGS}$cf_new_cflags"
13127
13128 fi
13129
13130 if test -n "$cf_new_cppflags" ; then
13131
13132         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13133         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13134
13135 fi
13136
13137 if test -n "$cf_new_extra_cppflags" ; then
13138
13139         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13140         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13141
13142 fi
13143
13144 cf_add_libs="$LIBS"
13145 # reverse order
13146 cf_add_0lib=
13147 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13148 # filter duplicates
13149 for cf_add_1lib in $cf_add_0lib; do
13150         for cf_add_2lib in $cf_add_libs; do
13151                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13152                         cf_add_1lib=
13153                         break
13154                 fi
13155         done
13156         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13157 done
13158 LIBS="$cf_add_libs"
13159
13160                                                         LIBS="$cf_save_xmu"
13161
13162 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13163
13164 echo "${as_me:-configure}:13164: testing ...before $LIBS ..." 1>&5
13165
13166 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13167 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13168
13169 echo "${as_me:-configure}:13169: testing ...after  $LIBS ..." 1>&5
13170
13171 else
13172         cf_pkgconfig_incs=
13173         cf_pkgconfig_libs=
13174
13175 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13176
13177 echo "${as_me:-configure}:13177: testing ...before $LIBS ..." 1>&5
13178
13179 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13180 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13181
13182 echo "${as_me:-configure}:13182: testing ...after  $LIBS ..." 1>&5
13183
13184 fi
13185
13186         for cf_trim_lib in Xmu Xt X11
13187         do
13188                 case "$LIBS" in
13189                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13190                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13191                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13192
13193 echo "${as_me:-configure}:13193: testing ..trimmed $LIBS ..." 1>&5
13194
13195                         ;;
13196                 esac
13197         done
13198
13199                                         ;;
13200                                 esac
13201                         fi
13202
13203                         break
13204 else
13205         cf_pkgconfig_incs=
13206         cf_pkgconfig_libs=
13207         :
13208 fi
13209
13210         done
13211 fi
13212
13213 if test -z "$cf_x_athena_lib" ; then
13214
13215 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13216         test -n "$verbose" && echo "    found package Xext" 1>&6
13217
13218 echo "${as_me:-configure}:13218: testing found package Xext ..." 1>&5
13219
13220         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13221         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13222         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13223
13224 echo "${as_me:-configure}:13224: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13225
13226         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13227
13228 echo "${as_me:-configure}:13228: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13229
13230 cf_fix_cppflags=no
13231 cf_new_cflags=
13232 cf_new_cppflags=
13233 cf_new_extra_cppflags=
13234
13235 for cf_add_cflags in $cf_pkgconfig_incs
13236 do
13237 case $cf_fix_cppflags in
13238 (no)
13239         case $cf_add_cflags in
13240         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13241                 case $cf_add_cflags in
13242                 (-D*)
13243                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13244
13245                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13246                                 && test -z "${cf_tst_cflags}" \
13247                                 && cf_fix_cppflags=yes
13248
13249                         if test $cf_fix_cppflags = yes ; then
13250
13251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13253
13254                                 continue
13255                         elif test "${cf_tst_cflags}" = "\"'" ; then
13256
13257         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13258         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13259
13260                                 continue
13261                         fi
13262                         ;;
13263                 esac
13264                 case "$CPPFLAGS" in
13265                 (*$cf_add_cflags)
13266                         ;;
13267                 (*)
13268                         case $cf_add_cflags in
13269                         (-D*)
13270                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13271
13272 CPPFLAGS=`echo "$CPPFLAGS" | \
13273         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13274                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13275
13276                                 ;;
13277                         esac
13278
13279         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13280         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13281
13282                         ;;
13283                 esac
13284                 ;;
13285         (*)
13286
13287         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13288         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13289
13290                 ;;
13291         esac
13292         ;;
13293 (yes)
13294
13295         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13296         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13297
13298         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13299
13300         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13301                 && test -z "${cf_tst_cflags}" \
13302                 && cf_fix_cppflags=no
13303         ;;
13304 esac
13305 done
13306
13307 if test -n "$cf_new_cflags" ; then
13308
13309         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13310         CFLAGS="${CFLAGS}$cf_new_cflags"
13311
13312 fi
13313
13314 if test -n "$cf_new_cppflags" ; then
13315
13316         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13317         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13318
13319 fi
13320
13321 if test -n "$cf_new_extra_cppflags" ; then
13322
13323         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13324         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13325
13326 fi
13327
13328 cf_add_libs="$LIBS"
13329 # reverse order
13330 cf_add_0lib=
13331 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13332 # filter duplicates
13333 for cf_add_1lib in $cf_add_0lib; do
13334         for cf_add_2lib in $cf_add_libs; do
13335                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13336                         cf_add_1lib=
13337                         break
13338                 fi
13339         done
13340         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13341 done
13342 LIBS="$cf_add_libs"
13343
13344         :
13345 else
13346         cf_pkgconfig_incs=
13347         cf_pkgconfig_libs=
13348
13349         echo "$as_me:13349: checking for XextCreateExtension in -lXext" >&5
13350 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13351 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13352   echo $ECHO_N "(cached) $ECHO_C" >&6
13353 else
13354   ac_check_lib_save_LIBS=$LIBS
13355 LIBS="-lXext  $LIBS"
13356 cat >conftest.$ac_ext <<_ACEOF
13357 #line 13357 "configure"
13358 #include "confdefs.h"
13359
13360 /* Override any gcc2 internal prototype to avoid an error.  */
13361 #ifdef __cplusplus
13362 extern "C"
13363 #endif
13364 /* We use char because int might match the return type of a gcc2
13365    builtin and then its argument prototype would still apply.  */
13366 char XextCreateExtension ();
13367 int
13368 main (void)
13369 {
13370 XextCreateExtension ();
13371   ;
13372   return 0;
13373 }
13374 _ACEOF
13375 rm -f conftest.$ac_objext conftest$ac_exeext
13376 if { (eval echo "$as_me:13376: \"$ac_link\"") >&5
13377   (eval $ac_link) 2>&5
13378   ac_status=$?
13379   echo "$as_me:13379: \$? = $ac_status" >&5
13380   (exit $ac_status); } &&
13381          { ac_try='test -s conftest$ac_exeext'
13382   { (eval echo "$as_me:13382: \"$ac_try\"") >&5
13383   (eval $ac_try) 2>&5
13384   ac_status=$?
13385   echo "$as_me:13385: \$? = $ac_status" >&5
13386   (exit $ac_status); }; }; then
13387   ac_cv_lib_Xext_XextCreateExtension=yes
13388 else
13389   echo "$as_me: failed program was:" >&5
13390 cat conftest.$ac_ext >&5
13391 ac_cv_lib_Xext_XextCreateExtension=no
13392 fi
13393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13394 LIBS=$ac_check_lib_save_LIBS
13395 fi
13396 echo "$as_me:13396: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13397 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13398 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13399
13400 cf_add_libs="$LIBS"
13401 # reverse order
13402 cf_add_0lib=
13403 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13404 # filter duplicates
13405 for cf_add_1lib in $cf_add_0lib; do
13406         for cf_add_2lib in $cf_add_libs; do
13407                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13408                         cf_add_1lib=
13409                         break
13410                 fi
13411         done
13412         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13413 done
13414 LIBS="$cf_add_libs"
13415
13416 fi
13417
13418 fi
13419
13420 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13421 # in some cases has installed dummy files in the former, other cases replaced
13422 # it with a link to the new location).  This complicates the configure script.
13423 # Check for that pitfall, and recover using pkg-config
13424 #
13425 # If none of these are set, the configuration is almost certainly broken.
13426 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13427 then
13428
13429 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13430         test -n "$verbose" && echo "    found package x11" 1>&6
13431
13432 echo "${as_me:-configure}:13432: testing found package x11 ..." 1>&5
13433
13434         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13435         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13436         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13437
13438 echo "${as_me:-configure}:13438: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13439
13440         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13441
13442 echo "${as_me:-configure}:13442: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13443
13444 cf_fix_cppflags=no
13445 cf_new_cflags=
13446 cf_new_cppflags=
13447 cf_new_extra_cppflags=
13448
13449 for cf_add_cflags in $cf_pkgconfig_incs
13450 do
13451 case $cf_fix_cppflags in
13452 (no)
13453         case $cf_add_cflags in
13454         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13455                 case $cf_add_cflags in
13456                 (-D*)
13457                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13458
13459                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13460                                 && test -z "${cf_tst_cflags}" \
13461                                 && cf_fix_cppflags=yes
13462
13463                         if test $cf_fix_cppflags = yes ; then
13464
13465         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13466         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13467
13468                                 continue
13469                         elif test "${cf_tst_cflags}" = "\"'" ; then
13470
13471         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13472         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13473
13474                                 continue
13475                         fi
13476                         ;;
13477                 esac
13478                 case "$CPPFLAGS" in
13479                 (*$cf_add_cflags)
13480                         ;;
13481                 (*)
13482                         case $cf_add_cflags in
13483                         (-D*)
13484                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13485
13486 CPPFLAGS=`echo "$CPPFLAGS" | \
13487         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13488                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13489
13490                                 ;;
13491                         esac
13492
13493         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13494         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13495
13496                         ;;
13497                 esac
13498                 ;;
13499         (*)
13500
13501         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13502         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13503
13504                 ;;
13505         esac
13506         ;;
13507 (yes)
13508
13509         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13510         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13511
13512         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13513
13514         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13515                 && test -z "${cf_tst_cflags}" \
13516                 && cf_fix_cppflags=no
13517         ;;
13518 esac
13519 done
13520
13521 if test -n "$cf_new_cflags" ; then
13522
13523         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13524         CFLAGS="${CFLAGS}$cf_new_cflags"
13525
13526 fi
13527
13528 if test -n "$cf_new_cppflags" ; then
13529
13530         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13531         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13532
13533 fi
13534
13535 if test -n "$cf_new_extra_cppflags" ; then
13536
13537         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13538         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13539
13540 fi
13541
13542 cf_add_libs="$LIBS"
13543 # reverse order
13544 cf_add_0lib=
13545 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13546 # filter duplicates
13547 for cf_add_1lib in $cf_add_0lib; do
13548         for cf_add_2lib in $cf_add_libs; do
13549                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13550                         cf_add_1lib=
13551                         break
13552                 fi
13553         done
13554         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13555 done
13556 LIBS="$cf_add_libs"
13557
13558         :
13559 else
13560         cf_pkgconfig_incs=
13561         cf_pkgconfig_libs=
13562         { echo "$as_me:13562: WARNING: unable to find X11 library" >&5
13563 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13564 fi
13565
13566 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13567         test -n "$verbose" && echo "    found package ice" 1>&6
13568
13569 echo "${as_me:-configure}:13569: testing found package ice ..." 1>&5
13570
13571         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13572         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13573         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13574
13575 echo "${as_me:-configure}:13575: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13576
13577         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13578
13579 echo "${as_me:-configure}:13579: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13580
13581 cf_fix_cppflags=no
13582 cf_new_cflags=
13583 cf_new_cppflags=
13584 cf_new_extra_cppflags=
13585
13586 for cf_add_cflags in $cf_pkgconfig_incs
13587 do
13588 case $cf_fix_cppflags in
13589 (no)
13590         case $cf_add_cflags in
13591         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13592                 case $cf_add_cflags in
13593                 (-D*)
13594                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13595
13596                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13597                                 && test -z "${cf_tst_cflags}" \
13598                                 && cf_fix_cppflags=yes
13599
13600                         if test $cf_fix_cppflags = yes ; then
13601
13602         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13603         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13604
13605                                 continue
13606                         elif test "${cf_tst_cflags}" = "\"'" ; then
13607
13608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13610
13611                                 continue
13612                         fi
13613                         ;;
13614                 esac
13615                 case "$CPPFLAGS" in
13616                 (*$cf_add_cflags)
13617                         ;;
13618                 (*)
13619                         case $cf_add_cflags in
13620                         (-D*)
13621                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13622
13623 CPPFLAGS=`echo "$CPPFLAGS" | \
13624         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13625                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13626
13627                                 ;;
13628                         esac
13629
13630         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13631         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13632
13633                         ;;
13634                 esac
13635                 ;;
13636         (*)
13637
13638         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13639         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13640
13641                 ;;
13642         esac
13643         ;;
13644 (yes)
13645
13646         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13647         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13648
13649         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13650
13651         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13652                 && test -z "${cf_tst_cflags}" \
13653                 && cf_fix_cppflags=no
13654         ;;
13655 esac
13656 done
13657
13658 if test -n "$cf_new_cflags" ; then
13659
13660         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13661         CFLAGS="${CFLAGS}$cf_new_cflags"
13662
13663 fi
13664
13665 if test -n "$cf_new_cppflags" ; then
13666
13667         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13668         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13669
13670 fi
13671
13672 if test -n "$cf_new_extra_cppflags" ; then
13673
13674         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13675         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13676
13677 fi
13678
13679 cf_add_libs="$LIBS"
13680 # reverse order
13681 cf_add_0lib=
13682 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13683 # filter duplicates
13684 for cf_add_1lib in $cf_add_0lib; do
13685         for cf_add_2lib in $cf_add_libs; do
13686                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13687                         cf_add_1lib=
13688                         break
13689                 fi
13690         done
13691         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13692 done
13693 LIBS="$cf_add_libs"
13694
13695         :
13696 else
13697         cf_pkgconfig_incs=
13698         cf_pkgconfig_libs=
13699         { echo "$as_me:13699: WARNING: unable to find ICE library" >&5
13700 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13701 fi
13702
13703 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13704         test -n "$verbose" && echo "    found package sm" 1>&6
13705
13706 echo "${as_me:-configure}:13706: testing found package sm ..." 1>&5
13707
13708         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13709         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13710         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13711
13712 echo "${as_me:-configure}:13712: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13713
13714         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13715
13716 echo "${as_me:-configure}:13716: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13717
13718 cf_fix_cppflags=no
13719 cf_new_cflags=
13720 cf_new_cppflags=
13721 cf_new_extra_cppflags=
13722
13723 for cf_add_cflags in $cf_pkgconfig_incs
13724 do
13725 case $cf_fix_cppflags in
13726 (no)
13727         case $cf_add_cflags in
13728         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13729                 case $cf_add_cflags in
13730                 (-D*)
13731                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13732
13733                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13734                                 && test -z "${cf_tst_cflags}" \
13735                                 && cf_fix_cppflags=yes
13736
13737                         if test $cf_fix_cppflags = yes ; then
13738
13739         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13740         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13741
13742                                 continue
13743                         elif test "${cf_tst_cflags}" = "\"'" ; then
13744
13745         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13746         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13747
13748                                 continue
13749                         fi
13750                         ;;
13751                 esac
13752                 case "$CPPFLAGS" in
13753                 (*$cf_add_cflags)
13754                         ;;
13755                 (*)
13756                         case $cf_add_cflags in
13757                         (-D*)
13758                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13759
13760 CPPFLAGS=`echo "$CPPFLAGS" | \
13761         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13762                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13763
13764                                 ;;
13765                         esac
13766
13767         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13768         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13769
13770                         ;;
13771                 esac
13772                 ;;
13773         (*)
13774
13775         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13776         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13777
13778                 ;;
13779         esac
13780         ;;
13781 (yes)
13782
13783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13785
13786         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13787
13788         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13789                 && test -z "${cf_tst_cflags}" \
13790                 && cf_fix_cppflags=no
13791         ;;
13792 esac
13793 done
13794
13795 if test -n "$cf_new_cflags" ; then
13796
13797         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13798         CFLAGS="${CFLAGS}$cf_new_cflags"
13799
13800 fi
13801
13802 if test -n "$cf_new_cppflags" ; then
13803
13804         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13805         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13806
13807 fi
13808
13809 if test -n "$cf_new_extra_cppflags" ; then
13810
13811         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13812         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13813
13814 fi
13815
13816 cf_add_libs="$LIBS"
13817 # reverse order
13818 cf_add_0lib=
13819 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13820 # filter duplicates
13821 for cf_add_1lib in $cf_add_0lib; do
13822         for cf_add_2lib in $cf_add_libs; do
13823                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13824                         cf_add_1lib=
13825                         break
13826                 fi
13827         done
13828         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13829 done
13830 LIBS="$cf_add_libs"
13831
13832         :
13833 else
13834         cf_pkgconfig_incs=
13835         cf_pkgconfig_libs=
13836         { echo "$as_me:13836: WARNING: unable to find SM library" >&5
13837 echo "$as_me: WARNING: unable to find SM library" >&2;}
13838 fi
13839
13840 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13841         test -n "$verbose" && echo "    found package xt" 1>&6
13842
13843 echo "${as_me:-configure}:13843: testing found package xt ..." 1>&5
13844
13845         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13846         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13847         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13848
13849 echo "${as_me:-configure}:13849: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13850
13851         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13852
13853 echo "${as_me:-configure}:13853: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13854
13855 cf_fix_cppflags=no
13856 cf_new_cflags=
13857 cf_new_cppflags=
13858 cf_new_extra_cppflags=
13859
13860 for cf_add_cflags in $cf_pkgconfig_incs
13861 do
13862 case $cf_fix_cppflags in
13863 (no)
13864         case $cf_add_cflags in
13865         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13866                 case $cf_add_cflags in
13867                 (-D*)
13868                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13869
13870                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13871                                 && test -z "${cf_tst_cflags}" \
13872                                 && cf_fix_cppflags=yes
13873
13874                         if test $cf_fix_cppflags = yes ; then
13875
13876         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13877         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13878
13879                                 continue
13880                         elif test "${cf_tst_cflags}" = "\"'" ; then
13881
13882         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13883         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13884
13885                                 continue
13886                         fi
13887                         ;;
13888                 esac
13889                 case "$CPPFLAGS" in
13890                 (*$cf_add_cflags)
13891                         ;;
13892                 (*)
13893                         case $cf_add_cflags in
13894                         (-D*)
13895                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13896
13897 CPPFLAGS=`echo "$CPPFLAGS" | \
13898         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13899                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13900
13901                                 ;;
13902                         esac
13903
13904         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13905         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13906
13907                         ;;
13908                 esac
13909                 ;;
13910         (*)
13911
13912         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13913         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13914
13915                 ;;
13916         esac
13917         ;;
13918 (yes)
13919
13920         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13921         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13922
13923         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13924
13925         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13926                 && test -z "${cf_tst_cflags}" \
13927                 && cf_fix_cppflags=no
13928         ;;
13929 esac
13930 done
13931
13932 if test -n "$cf_new_cflags" ; then
13933
13934         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13935         CFLAGS="${CFLAGS}$cf_new_cflags"
13936
13937 fi
13938
13939 if test -n "$cf_new_cppflags" ; then
13940
13941         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13942         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13943
13944 fi
13945
13946 if test -n "$cf_new_extra_cppflags" ; then
13947
13948         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13949         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13950
13951 fi
13952
13953 cf_add_libs="$LIBS"
13954 # reverse order
13955 cf_add_0lib=
13956 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13957 # filter duplicates
13958 for cf_add_1lib in $cf_add_0lib; do
13959         for cf_add_2lib in $cf_add_libs; do
13960                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13961                         cf_add_1lib=
13962                         break
13963                 fi
13964         done
13965         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13966 done
13967 LIBS="$cf_add_libs"
13968
13969         :
13970 else
13971         cf_pkgconfig_incs=
13972         cf_pkgconfig_libs=
13973         { echo "$as_me:13973: WARNING: unable to find Xt library" >&5
13974 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13975 fi
13976
13977 else
13978         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13979 fi
13980
13981 cf_have_X_LIBS=no
13982
13983 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13984         test -n "$verbose" && echo "    found package xt" 1>&6
13985
13986 echo "${as_me:-configure}:13986: testing found package xt ..." 1>&5
13987
13988         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13989         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13990         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13991
13992 echo "${as_me:-configure}:13992: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13993
13994         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13995
13996 echo "${as_me:-configure}:13996: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13997
13998 cf_fix_cppflags=no
13999 cf_new_cflags=
14000 cf_new_cppflags=
14001 cf_new_extra_cppflags=
14002
14003 for cf_add_cflags in $cf_pkgconfig_incs
14004 do
14005 case $cf_fix_cppflags in
14006 (no)
14007         case $cf_add_cflags in
14008         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14009                 case $cf_add_cflags in
14010                 (-D*)
14011                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14012
14013                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14014                                 && test -z "${cf_tst_cflags}" \
14015                                 && cf_fix_cppflags=yes
14016
14017                         if test $cf_fix_cppflags = yes ; then
14018
14019         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14020         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14021
14022                                 continue
14023                         elif test "${cf_tst_cflags}" = "\"'" ; then
14024
14025         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14026         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14027
14028                                 continue
14029                         fi
14030                         ;;
14031                 esac
14032                 case "$CPPFLAGS" in
14033                 (*$cf_add_cflags)
14034                         ;;
14035                 (*)
14036                         case $cf_add_cflags in
14037                         (-D*)
14038                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14039
14040 CPPFLAGS=`echo "$CPPFLAGS" | \
14041         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14042                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14043
14044                                 ;;
14045                         esac
14046
14047         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14048         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14049
14050                         ;;
14051                 esac
14052                 ;;
14053         (*)
14054
14055         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14056         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14057
14058                 ;;
14059         esac
14060         ;;
14061 (yes)
14062
14063         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14064         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14065
14066         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14067
14068         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14069                 && test -z "${cf_tst_cflags}" \
14070                 && cf_fix_cppflags=no
14071         ;;
14072 esac
14073 done
14074
14075 if test -n "$cf_new_cflags" ; then
14076
14077         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14078         CFLAGS="${CFLAGS}$cf_new_cflags"
14079
14080 fi
14081
14082 if test -n "$cf_new_cppflags" ; then
14083
14084         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14085         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14086
14087 fi
14088
14089 if test -n "$cf_new_extra_cppflags" ; then
14090
14091         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14092         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14093
14094 fi
14095
14096 cf_add_libs="$LIBS"
14097 # reverse order
14098 cf_add_0lib=
14099 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14100 # filter duplicates
14101 for cf_add_1lib in $cf_add_0lib; do
14102         for cf_add_2lib in $cf_add_libs; do
14103                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14104                         cf_add_1lib=
14105                         break
14106                 fi
14107         done
14108         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14109 done
14110 LIBS="$cf_add_libs"
14111
14112         case "x$LIBS" in
14113         (*-lX11*)
14114                 ;;
14115         (*)
14116 # we have an "xt" package, but it may omit Xt's dependency on X11
14117 echo "$as_me:14117: checking for usable X dependency" >&5
14118 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14119 if test "${cf_cv_xt_x11_compat+set}" = set; then
14120   echo $ECHO_N "(cached) $ECHO_C" >&6
14121 else
14122
14123 cat >conftest.$ac_ext <<_ACEOF
14124 #line 14124 "configure"
14125 #include "confdefs.h"
14126
14127 #include <X11/Xlib.h>
14128
14129 int
14130 main (void)
14131 {
14132
14133         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14134         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14135         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14136         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14137
14138   ;
14139   return 0;
14140 }
14141 _ACEOF
14142 rm -f conftest.$ac_objext conftest$ac_exeext
14143 if { (eval echo "$as_me:14143: \"$ac_link\"") >&5
14144   (eval $ac_link) 2>&5
14145   ac_status=$?
14146   echo "$as_me:14146: \$? = $ac_status" >&5
14147   (exit $ac_status); } &&
14148          { ac_try='test -s conftest$ac_exeext'
14149   { (eval echo "$as_me:14149: \"$ac_try\"") >&5
14150   (eval $ac_try) 2>&5
14151   ac_status=$?
14152   echo "$as_me:14152: \$? = $ac_status" >&5
14153   (exit $ac_status); }; }; then
14154   cf_cv_xt_x11_compat=yes
14155 else
14156   echo "$as_me: failed program was:" >&5
14157 cat conftest.$ac_ext >&5
14158 cf_cv_xt_x11_compat=no
14159 fi
14160 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14161 fi
14162 echo "$as_me:14162: result: $cf_cv_xt_x11_compat" >&5
14163 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14164                 if test "$cf_cv_xt_x11_compat" = no
14165                 then
14166                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14167
14168 echo "${as_me:-configure}:14168: testing work around broken X11 dependency ..." 1>&5
14169
14170                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14171
14172 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14173         test -n "$verbose" && echo "    found package x11" 1>&6
14174
14175 echo "${as_me:-configure}:14175: testing found package x11 ..." 1>&5
14176
14177         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14178         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14179         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14180
14181 echo "${as_me:-configure}:14181: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14182
14183         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14184
14185 echo "${as_me:-configure}:14185: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14186
14187 cf_fix_cppflags=no
14188 cf_new_cflags=
14189 cf_new_cppflags=
14190 cf_new_extra_cppflags=
14191
14192 for cf_add_cflags in $cf_pkgconfig_incs
14193 do
14194 case $cf_fix_cppflags in
14195 (no)
14196         case $cf_add_cflags in
14197         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14198                 case $cf_add_cflags in
14199                 (-D*)
14200                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14201
14202                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14203                                 && test -z "${cf_tst_cflags}" \
14204                                 && cf_fix_cppflags=yes
14205
14206                         if test $cf_fix_cppflags = yes ; then
14207
14208         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14209         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14210
14211                                 continue
14212                         elif test "${cf_tst_cflags}" = "\"'" ; then
14213
14214         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14215         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14216
14217                                 continue
14218                         fi
14219                         ;;
14220                 esac
14221                 case "$CPPFLAGS" in
14222                 (*$cf_add_cflags)
14223                         ;;
14224                 (*)
14225                         case $cf_add_cflags in
14226                         (-D*)
14227                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14228
14229 CPPFLAGS=`echo "$CPPFLAGS" | \
14230         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14231                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14232
14233                                 ;;
14234                         esac
14235
14236         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14237         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14238
14239                         ;;
14240                 esac
14241                 ;;
14242         (*)
14243
14244         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14245         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14246
14247                 ;;
14248         esac
14249         ;;
14250 (yes)
14251
14252         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14253         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14254
14255         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14256
14257         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14258                 && test -z "${cf_tst_cflags}" \
14259                 && cf_fix_cppflags=no
14260         ;;
14261 esac
14262 done
14263
14264 if test -n "$cf_new_cflags" ; then
14265
14266         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14267         CFLAGS="${CFLAGS}$cf_new_cflags"
14268
14269 fi
14270
14271 if test -n "$cf_new_cppflags" ; then
14272
14273         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14274         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14275
14276 fi
14277
14278 if test -n "$cf_new_extra_cppflags" ; then
14279
14280         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14281         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14282
14283 fi
14284
14285 cf_add_libs="$LIBS"
14286 # reverse order
14287 cf_add_0lib=
14288 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14289 # filter duplicates
14290 for cf_add_1lib in $cf_add_0lib; do
14291         for cf_add_2lib in $cf_add_libs; do
14292                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14293                         cf_add_1lib=
14294                         break
14295                 fi
14296         done
14297         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14298 done
14299 LIBS="$cf_add_libs"
14300
14301         :
14302 else
14303         cf_pkgconfig_incs=
14304         cf_pkgconfig_libs=
14305
14306 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14307
14308 echo "${as_me:-configure}:14308: testing ...before $LIBS ..." 1>&5
14309
14310 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14311 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14312
14313 echo "${as_me:-configure}:14313: testing ...after  $LIBS ..." 1>&5
14314
14315 fi
14316
14317                 fi
14318                 ;;
14319         esac
14320
14321 echo "$as_me:14321: checking for usable X Toolkit package" >&5
14322 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14323 if test "${cf_cv_xt_ice_compat+set}" = set; then
14324   echo $ECHO_N "(cached) $ECHO_C" >&6
14325 else
14326
14327 cat >conftest.$ac_ext <<_ACEOF
14328 #line 14328 "configure"
14329 #include "confdefs.h"
14330
14331 #include <X11/Shell.h>
14332
14333 int
14334 main (void)
14335 {
14336 int num = IceConnectionNumber(0); (void) num
14337
14338   ;
14339   return 0;
14340 }
14341 _ACEOF
14342 rm -f conftest.$ac_objext conftest$ac_exeext
14343 if { (eval echo "$as_me:14343: \"$ac_link\"") >&5
14344   (eval $ac_link) 2>&5
14345   ac_status=$?
14346   echo "$as_me:14346: \$? = $ac_status" >&5
14347   (exit $ac_status); } &&
14348          { ac_try='test -s conftest$ac_exeext'
14349   { (eval echo "$as_me:14349: \"$ac_try\"") >&5
14350   (eval $ac_try) 2>&5
14351   ac_status=$?
14352   echo "$as_me:14352: \$? = $ac_status" >&5
14353   (exit $ac_status); }; }; then
14354   cf_cv_xt_ice_compat=yes
14355 else
14356   echo "$as_me: failed program was:" >&5
14357 cat conftest.$ac_ext >&5
14358 cf_cv_xt_ice_compat=no
14359 fi
14360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14361 fi
14362 echo "$as_me:14362: result: $cf_cv_xt_ice_compat" >&5
14363 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14364
14365         if test "$cf_cv_xt_ice_compat" = no
14366         then
14367                 # workaround for broken ".pc" files used for X Toolkit.
14368                 case "x$X_PRE_LIBS" in
14369                 (*-lICE*)
14370                         case "x$LIBS" in
14371                         (*-lICE*)
14372                                 ;;
14373                         (*)
14374                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14375
14376 echo "${as_me:-configure}:14376: testing work around broken ICE dependency ..." 1>&5
14377
14378 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14379         test -n "$verbose" && echo "    found package ice" 1>&6
14380
14381 echo "${as_me:-configure}:14381: testing found package ice ..." 1>&5
14382
14383         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14384         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14385         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14386
14387 echo "${as_me:-configure}:14387: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14388
14389         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14390
14391 echo "${as_me:-configure}:14391: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14392
14393 cf_fix_cppflags=no
14394 cf_new_cflags=
14395 cf_new_cppflags=
14396 cf_new_extra_cppflags=
14397
14398 for cf_add_cflags in $cf_pkgconfig_incs
14399 do
14400 case $cf_fix_cppflags in
14401 (no)
14402         case $cf_add_cflags in
14403         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14404                 case $cf_add_cflags in
14405                 (-D*)
14406                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14407
14408                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14409                                 && test -z "${cf_tst_cflags}" \
14410                                 && cf_fix_cppflags=yes
14411
14412                         if test $cf_fix_cppflags = yes ; then
14413
14414         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14415         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14416
14417                                 continue
14418                         elif test "${cf_tst_cflags}" = "\"'" ; then
14419
14420         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14421         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14422
14423                                 continue
14424                         fi
14425                         ;;
14426                 esac
14427                 case "$CPPFLAGS" in
14428                 (*$cf_add_cflags)
14429                         ;;
14430                 (*)
14431                         case $cf_add_cflags in
14432                         (-D*)
14433                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14434
14435 CPPFLAGS=`echo "$CPPFLAGS" | \
14436         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14437                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14438
14439                                 ;;
14440                         esac
14441
14442         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14443         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14444
14445                         ;;
14446                 esac
14447                 ;;
14448         (*)
14449
14450         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14451         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14452
14453                 ;;
14454         esac
14455         ;;
14456 (yes)
14457
14458         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14459         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14460
14461         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14462
14463         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14464                 && test -z "${cf_tst_cflags}" \
14465                 && cf_fix_cppflags=no
14466         ;;
14467 esac
14468 done
14469
14470 if test -n "$cf_new_cflags" ; then
14471
14472         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14473         CFLAGS="${CFLAGS}$cf_new_cflags"
14474
14475 fi
14476
14477 if test -n "$cf_new_cppflags" ; then
14478
14479         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14480         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14481
14482 fi
14483
14484 if test -n "$cf_new_extra_cppflags" ; then
14485
14486         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14487         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14488
14489 fi
14490
14491 cf_add_libs="$LIBS"
14492 # reverse order
14493 cf_add_0lib=
14494 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14495 # filter duplicates
14496 for cf_add_1lib in $cf_add_0lib; do
14497         for cf_add_2lib in $cf_add_libs; do
14498                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14499                         cf_add_1lib=
14500                         break
14501                 fi
14502         done
14503         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14504 done
14505 LIBS="$cf_add_libs"
14506
14507 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14508         test -n "$verbose" && echo "    found package sm" 1>&6
14509
14510 echo "${as_me:-configure}:14510: testing found package sm ..." 1>&5
14511
14512         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14513         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14514         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14515
14516 echo "${as_me:-configure}:14516: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14517
14518         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14519
14520 echo "${as_me:-configure}:14520: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14521
14522 cf_fix_cppflags=no
14523 cf_new_cflags=
14524 cf_new_cppflags=
14525 cf_new_extra_cppflags=
14526
14527 for cf_add_cflags in $cf_pkgconfig_incs
14528 do
14529 case $cf_fix_cppflags in
14530 (no)
14531         case $cf_add_cflags in
14532         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14533                 case $cf_add_cflags in
14534                 (-D*)
14535                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14536
14537                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14538                                 && test -z "${cf_tst_cflags}" \
14539                                 && cf_fix_cppflags=yes
14540
14541                         if test $cf_fix_cppflags = yes ; then
14542
14543         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14544         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14545
14546                                 continue
14547                         elif test "${cf_tst_cflags}" = "\"'" ; then
14548
14549         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14550         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14551
14552                                 continue
14553                         fi
14554                         ;;
14555                 esac
14556                 case "$CPPFLAGS" in
14557                 (*$cf_add_cflags)
14558                         ;;
14559                 (*)
14560                         case $cf_add_cflags in
14561                         (-D*)
14562                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14563
14564 CPPFLAGS=`echo "$CPPFLAGS" | \
14565         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14566                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14567
14568                                 ;;
14569                         esac
14570
14571         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14572         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14573
14574                         ;;
14575                 esac
14576                 ;;
14577         (*)
14578
14579         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14580         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14581
14582                 ;;
14583         esac
14584         ;;
14585 (yes)
14586
14587         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14588         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14589
14590         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14591
14592         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14593                 && test -z "${cf_tst_cflags}" \
14594                 && cf_fix_cppflags=no
14595         ;;
14596 esac
14597 done
14598
14599 if test -n "$cf_new_cflags" ; then
14600
14601         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14602         CFLAGS="${CFLAGS}$cf_new_cflags"
14603
14604 fi
14605
14606 if test -n "$cf_new_cppflags" ; then
14607
14608         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14609         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14610
14611 fi
14612
14613 if test -n "$cf_new_extra_cppflags" ; then
14614
14615         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14616         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14617
14618 fi
14619
14620 cf_add_libs="$LIBS"
14621 # reverse order
14622 cf_add_0lib=
14623 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14624 # filter duplicates
14625 for cf_add_1lib in $cf_add_0lib; do
14626         for cf_add_2lib in $cf_add_libs; do
14627                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14628                         cf_add_1lib=
14629                         break
14630                 fi
14631         done
14632         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14633 done
14634 LIBS="$cf_add_libs"
14635
14636         :
14637 else
14638         cf_pkgconfig_incs=
14639         cf_pkgconfig_libs=
14640         :
14641 fi
14642
14643 else
14644         cf_pkgconfig_incs=
14645         cf_pkgconfig_libs=
14646
14647 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14648
14649 echo "${as_me:-configure}:14649: testing ...before $LIBS ..." 1>&5
14650
14651 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14652 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14653
14654 echo "${as_me:-configure}:14654: testing ...after  $LIBS ..." 1>&5
14655
14656 fi
14657
14658                                 ;;
14659                         esac
14660                         ;;
14661                 esac
14662         fi
14663
14664         cf_have_X_LIBS=yes
14665
14666 else
14667         cf_pkgconfig_incs=
14668         cf_pkgconfig_libs=
14669
14670         LDFLAGS="$X_LIBS $LDFLAGS"
14671
14672 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14673
14674 echo "${as_me:-configure}:14674: testing checking additions to CFLAGS ..." 1>&5
14675
14676 cf_check_cflags="$CFLAGS"
14677 cf_check_cppflags="$CPPFLAGS"
14678
14679 cf_fix_cppflags=no
14680 cf_new_cflags=
14681 cf_new_cppflags=
14682 cf_new_extra_cppflags=
14683
14684 for cf_add_cflags in $X_CFLAGS
14685 do
14686 case $cf_fix_cppflags in
14687 (no)
14688         case $cf_add_cflags in
14689         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14690                 case $cf_add_cflags in
14691                 (-D*)
14692                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14693
14694                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14695                                 && test -z "${cf_tst_cflags}" \
14696                                 && cf_fix_cppflags=yes
14697
14698                         if test $cf_fix_cppflags = yes ; then
14699
14700         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14701         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14702
14703                                 continue
14704                         elif test "${cf_tst_cflags}" = "\"'" ; then
14705
14706         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14707         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14708
14709                                 continue
14710                         fi
14711                         ;;
14712                 esac
14713                 case "$CPPFLAGS" in
14714                 (*$cf_add_cflags)
14715                         ;;
14716                 (*)
14717                         case $cf_add_cflags in
14718                         (-D*)
14719                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14720
14721 CPPFLAGS=`echo "$CPPFLAGS" | \
14722         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14723                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14724
14725                                 ;;
14726                         esac
14727
14728         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14729         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14730
14731                         ;;
14732                 esac
14733                 ;;
14734         (*)
14735
14736         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14737         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14738
14739                 ;;
14740         esac
14741         ;;
14742 (yes)
14743
14744         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14745         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14746
14747         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14748
14749         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14750                 && test -z "${cf_tst_cflags}" \
14751                 && cf_fix_cppflags=no
14752         ;;
14753 esac
14754 done
14755
14756 if test -n "$cf_new_cflags" ; then
14757         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14758
14759 echo "${as_me:-configure}:14759: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14760
14761         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14762         CFLAGS="${CFLAGS}$cf_new_cflags"
14763
14764 fi
14765
14766 if test -n "$cf_new_cppflags" ; then
14767         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14768
14769 echo "${as_me:-configure}:14769: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14770
14771         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14772         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14773
14774 fi
14775
14776 if test -n "$cf_new_extra_cppflags" ; then
14777         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14778
14779 echo "${as_me:-configure}:14779: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14780
14781         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14782         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14783
14784 fi
14785
14786 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14787 cat >conftest.$ac_ext <<_ACEOF
14788 #line 14788 "configure"
14789 #include "confdefs.h"
14790 #include <stdio.h>
14791 int
14792 main (void)
14793 {
14794 printf("Hello world");
14795   ;
14796   return 0;
14797 }
14798 _ACEOF
14799 rm -f conftest.$ac_objext conftest$ac_exeext
14800 if { (eval echo "$as_me:14800: \"$ac_link\"") >&5
14801   (eval $ac_link) 2>&5
14802   ac_status=$?
14803   echo "$as_me:14803: \$? = $ac_status" >&5
14804   (exit $ac_status); } &&
14805          { ac_try='test -s conftest$ac_exeext'
14806   { (eval echo "$as_me:14806: \"$ac_try\"") >&5
14807   (eval $ac_try) 2>&5
14808   ac_status=$?
14809   echo "$as_me:14809: \$? = $ac_status" >&5
14810   (exit $ac_status); }; }; then
14811   :
14812 else
14813   echo "$as_me: failed program was:" >&5
14814 cat conftest.$ac_ext >&5
14815 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14816
14817 echo "${as_me:-configure}:14817: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14818
14819          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14820                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14821
14822 echo "${as_me:-configure}:14822: testing but keeping change to \$CPPFLAGS ..." 1>&5
14823
14824          fi
14825          CFLAGS="$cf_check_flags"
14826 fi
14827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14828 fi
14829
14830         echo "$as_me:14830: checking for XOpenDisplay" >&5
14831 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14832 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14833   echo $ECHO_N "(cached) $ECHO_C" >&6
14834 else
14835   cat >conftest.$ac_ext <<_ACEOF
14836 #line 14836 "configure"
14837 #include "confdefs.h"
14838 #define XOpenDisplay autoconf_temporary
14839 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14840 #undef XOpenDisplay
14841
14842 #ifdef __cplusplus
14843 extern "C"
14844 #endif
14845
14846 /* We use char because int might match the return type of a gcc2
14847    builtin and then its argument prototype would still apply.  */
14848 char XOpenDisplay (void);
14849
14850 int
14851 main (void)
14852 {
14853
14854 /* The GNU C library defines stubs for functions which it implements
14855     to always fail with ENOSYS.  Some functions are actually named
14856     something starting with __ and the normal name is an alias.  */
14857 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14858 #error found stub for XOpenDisplay
14859 #endif
14860
14861         return XOpenDisplay ();
14862   ;
14863   return 0;
14864 }
14865 _ACEOF
14866 rm -f conftest.$ac_objext conftest$ac_exeext
14867 if { (eval echo "$as_me:14867: \"$ac_link\"") >&5
14868   (eval $ac_link) 2>&5
14869   ac_status=$?
14870   echo "$as_me:14870: \$? = $ac_status" >&5
14871   (exit $ac_status); } &&
14872          { ac_try='test -s conftest$ac_exeext'
14873   { (eval echo "$as_me:14873: \"$ac_try\"") >&5
14874   (eval $ac_try) 2>&5
14875   ac_status=$?
14876   echo "$as_me:14876: \$? = $ac_status" >&5
14877   (exit $ac_status); }; }; then
14878   ac_cv_func_XOpenDisplay=yes
14879 else
14880   echo "$as_me: failed program was:" >&5
14881 cat conftest.$ac_ext >&5
14882 ac_cv_func_XOpenDisplay=no
14883 fi
14884 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14885 fi
14886 echo "$as_me:14886: result: $ac_cv_func_XOpenDisplay" >&5
14887 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14888 if test $ac_cv_func_XOpenDisplay = yes; then
14889   :
14890 else
14891
14892         echo "$as_me:14892: checking for XOpenDisplay in -lX11" >&5
14893 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14894 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14895   echo $ECHO_N "(cached) $ECHO_C" >&6
14896 else
14897   ac_check_lib_save_LIBS=$LIBS
14898 LIBS="-lX11  $LIBS"
14899 cat >conftest.$ac_ext <<_ACEOF
14900 #line 14900 "configure"
14901 #include "confdefs.h"
14902
14903 /* Override any gcc2 internal prototype to avoid an error.  */
14904 #ifdef __cplusplus
14905 extern "C"
14906 #endif
14907 /* We use char because int might match the return type of a gcc2
14908    builtin and then its argument prototype would still apply.  */
14909 char XOpenDisplay ();
14910 int
14911 main (void)
14912 {
14913 XOpenDisplay ();
14914   ;
14915   return 0;
14916 }
14917 _ACEOF
14918 rm -f conftest.$ac_objext conftest$ac_exeext
14919 if { (eval echo "$as_me:14919: \"$ac_link\"") >&5
14920   (eval $ac_link) 2>&5
14921   ac_status=$?
14922   echo "$as_me:14922: \$? = $ac_status" >&5
14923   (exit $ac_status); } &&
14924          { ac_try='test -s conftest$ac_exeext'
14925   { (eval echo "$as_me:14925: \"$ac_try\"") >&5
14926   (eval $ac_try) 2>&5
14927   ac_status=$?
14928   echo "$as_me:14928: \$? = $ac_status" >&5
14929   (exit $ac_status); }; }; then
14930   ac_cv_lib_X11_XOpenDisplay=yes
14931 else
14932   echo "$as_me: failed program was:" >&5
14933 cat conftest.$ac_ext >&5
14934 ac_cv_lib_X11_XOpenDisplay=no
14935 fi
14936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14937 LIBS=$ac_check_lib_save_LIBS
14938 fi
14939 echo "$as_me:14939: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14940 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14941 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14942
14943 cf_add_libs="$LIBS"
14944 # reverse order
14945 cf_add_0lib=
14946 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14947 # filter duplicates
14948 for cf_add_1lib in $cf_add_0lib; do
14949         for cf_add_2lib in $cf_add_libs; do
14950                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14951                         cf_add_1lib=
14952                         break
14953                 fi
14954         done
14955         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14956 done
14957 LIBS="$cf_add_libs"
14958
14959 fi
14960
14961 fi
14962
14963         echo "$as_me:14963: checking for XtAppInitialize" >&5
14964 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14965 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14966   echo $ECHO_N "(cached) $ECHO_C" >&6
14967 else
14968   cat >conftest.$ac_ext <<_ACEOF
14969 #line 14969 "configure"
14970 #include "confdefs.h"
14971 #define XtAppInitialize autoconf_temporary
14972 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14973 #undef XtAppInitialize
14974
14975 #ifdef __cplusplus
14976 extern "C"
14977 #endif
14978
14979 /* We use char because int might match the return type of a gcc2
14980    builtin and then its argument prototype would still apply.  */
14981 char XtAppInitialize (void);
14982
14983 int
14984 main (void)
14985 {
14986
14987 /* The GNU C library defines stubs for functions which it implements
14988     to always fail with ENOSYS.  Some functions are actually named
14989     something starting with __ and the normal name is an alias.  */
14990 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14991 #error found stub for XtAppInitialize
14992 #endif
14993
14994         return XtAppInitialize ();
14995   ;
14996   return 0;
14997 }
14998 _ACEOF
14999 rm -f conftest.$ac_objext conftest$ac_exeext
15000 if { (eval echo "$as_me:15000: \"$ac_link\"") >&5
15001   (eval $ac_link) 2>&5
15002   ac_status=$?
15003   echo "$as_me:15003: \$? = $ac_status" >&5
15004   (exit $ac_status); } &&
15005          { ac_try='test -s conftest$ac_exeext'
15006   { (eval echo "$as_me:15006: \"$ac_try\"") >&5
15007   (eval $ac_try) 2>&5
15008   ac_status=$?
15009   echo "$as_me:15009: \$? = $ac_status" >&5
15010   (exit $ac_status); }; }; then
15011   ac_cv_func_XtAppInitialize=yes
15012 else
15013   echo "$as_me: failed program was:" >&5
15014 cat conftest.$ac_ext >&5
15015 ac_cv_func_XtAppInitialize=no
15016 fi
15017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15018 fi
15019 echo "$as_me:15019: result: $ac_cv_func_XtAppInitialize" >&5
15020 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15021 if test $ac_cv_func_XtAppInitialize = yes; then
15022   :
15023 else
15024
15025         echo "$as_me:15025: checking for XtAppInitialize in -lXt" >&5
15026 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15027 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15028   echo $ECHO_N "(cached) $ECHO_C" >&6
15029 else
15030   ac_check_lib_save_LIBS=$LIBS
15031 LIBS="-lXt  $LIBS"
15032 cat >conftest.$ac_ext <<_ACEOF
15033 #line 15033 "configure"
15034 #include "confdefs.h"
15035
15036 /* Override any gcc2 internal prototype to avoid an error.  */
15037 #ifdef __cplusplus
15038 extern "C"
15039 #endif
15040 /* We use char because int might match the return type of a gcc2
15041    builtin and then its argument prototype would still apply.  */
15042 char XtAppInitialize ();
15043 int
15044 main (void)
15045 {
15046 XtAppInitialize ();
15047   ;
15048   return 0;
15049 }
15050 _ACEOF
15051 rm -f conftest.$ac_objext conftest$ac_exeext
15052 if { (eval echo "$as_me:15052: \"$ac_link\"") >&5
15053   (eval $ac_link) 2>&5
15054   ac_status=$?
15055   echo "$as_me:15055: \$? = $ac_status" >&5
15056   (exit $ac_status); } &&
15057          { ac_try='test -s conftest$ac_exeext'
15058   { (eval echo "$as_me:15058: \"$ac_try\"") >&5
15059   (eval $ac_try) 2>&5
15060   ac_status=$?
15061   echo "$as_me:15061: \$? = $ac_status" >&5
15062   (exit $ac_status); }; }; then
15063   ac_cv_lib_Xt_XtAppInitialize=yes
15064 else
15065   echo "$as_me: failed program was:" >&5
15066 cat conftest.$ac_ext >&5
15067 ac_cv_lib_Xt_XtAppInitialize=no
15068 fi
15069 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15070 LIBS=$ac_check_lib_save_LIBS
15071 fi
15072 echo "$as_me:15072: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15073 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15074 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15075
15076 cat >>confdefs.h <<\EOF
15077 #define HAVE_LIBXT 1
15078 EOF
15079
15080                  cf_have_X_LIBS=Xt
15081                  LIBS="-lXt $LIBS"
15082 fi
15083
15084 fi
15085
15086 fi
15087
15088 if test $cf_have_X_LIBS = no ; then
15089         { echo "$as_me:15089: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15090 test program.  You will have to check and add the proper libraries by hand
15091 to makefile." >&5
15092 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15093 test program.  You will have to check and add the proper libraries by hand
15094 to makefile." >&2;}
15095 fi
15096
15097 cf_x_athena_root=$cf_x_athena
15098 cf_x_athena_inc=""
15099
15100 for cf_path in default \
15101         /usr/contrib/X11R6 \
15102         /usr/contrib/X11R5 \
15103         /usr/lib/X11R5 \
15104         /usr/local
15105 do
15106         if test -z "$cf_x_athena_inc" ; then
15107
15108 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15109 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15110 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15111 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15112 for cf_X_CFLAGS in $X_CFLAGS
15113 do
15114         case "x$cf_X_CFLAGS" in
15115         x-[IUD]*)
15116                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15117                 ;;
15118         *)
15119                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15120                 ;;
15121         esac
15122 done
15123
15124                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15125                 if test $cf_path != default ; then
15126
15127         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15128         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15129
15130                         echo "$as_me:15130: checking for $cf_test in $cf_path" >&5
15131 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15132                 else
15133                         echo "$as_me:15133: checking for $cf_test" >&5
15134 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15135                 fi
15136                 cat >conftest.$ac_ext <<_ACEOF
15137 #line 15137 "configure"
15138 #include "confdefs.h"
15139
15140 #include <X11/Intrinsic.h>
15141 #include <$cf_test>
15142 int
15143 main (void)
15144 {
15145
15146   ;
15147   return 0;
15148 }
15149 _ACEOF
15150 rm -f conftest.$ac_objext
15151 if { (eval echo "$as_me:15151: \"$ac_compile\"") >&5
15152   (eval $ac_compile) 2>&5
15153   ac_status=$?
15154   echo "$as_me:15154: \$? = $ac_status" >&5
15155   (exit $ac_status); } &&
15156          { ac_try='test -s conftest.$ac_objext'
15157   { (eval echo "$as_me:15157: \"$ac_try\"") >&5
15158   (eval $ac_try) 2>&5
15159   ac_status=$?
15160   echo "$as_me:15160: \$? = $ac_status" >&5
15161   (exit $ac_status); }; }; then
15162   cf_result=yes
15163 else
15164   echo "$as_me: failed program was:" >&5
15165 cat conftest.$ac_ext >&5
15166 cf_result=no
15167 fi
15168 rm -f conftest.$ac_objext conftest.$ac_ext
15169                 echo "$as_me:15169: result: $cf_result" >&5
15170 echo "${ECHO_T}$cf_result" >&6
15171
15172 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15173 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15174 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15175
15176                 if test "$cf_result" = yes ; then
15177                         test "$cf_path"  = default && cf_x_athena_inc=default
15178                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15179                         break
15180                 fi
15181         fi
15182 done
15183
15184 if test -z "$cf_x_athena_inc" ; then
15185         { echo "$as_me:15185: WARNING: Unable to find Athena header files" >&5
15186 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15187 elif test "$cf_x_athena_inc" != default ; then
15188
15189         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15190         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15191
15192 fi
15193
15194 cf_x_athena_root=$cf_x_athena
15195 cf_x_athena_lib=""
15196
15197 for cf_path in default \
15198         /usr/contrib/X11R6 \
15199         /usr/contrib/X11R5 \
15200         /usr/lib/X11R5 \
15201         /usr/local
15202 do
15203         for cf_lib in \
15204                 ${cf_x_athena_root} \
15205                 ${cf_x_athena_root}7 \
15206                 ${cf_x_athena_root}6
15207         do
15208         for cf_libs in \
15209                 "-l$cf_lib -lXmu" \
15210                 "-l$cf_lib -lXpm -lXmu" \
15211                 "-l${cf_lib}_s -lXmu_s"
15212         do
15213                 test -n "$cf_x_athena_lib" && break
15214
15215 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15216 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15217 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15218 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15219 for cf_X_CFLAGS in $X_CFLAGS
15220 do
15221         case "x$cf_X_CFLAGS" in
15222         x-[IUD]*)
15223                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15224                 ;;
15225         *)
15226                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15227                 ;;
15228         esac
15229 done
15230
15231                 cf_test=XawSimpleMenuAddGlobalActions
15232                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15233
15234 cf_add_libs="$LIBS"
15235 # reverse order
15236 cf_add_0lib=
15237 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15238 # filter duplicates
15239 for cf_add_1lib in $cf_add_0lib; do
15240         for cf_add_2lib in $cf_add_libs; do
15241                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15242                         cf_add_1lib=
15243                         break
15244                 fi
15245         done
15246         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15247 done
15248 LIBS="$cf_add_libs"
15249
15250                 echo "$as_me:15250: checking for $cf_test in $cf_libs" >&5
15251 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15252                 cat >conftest.$ac_ext <<_ACEOF
15253 #line 15253 "configure"
15254 #include "confdefs.h"
15255
15256 #include <X11/Intrinsic.h>
15257 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15258
15259 int
15260 main (void)
15261 {
15262
15263 $cf_test((XtAppContext) 0)
15264   ;
15265   return 0;
15266 }
15267 _ACEOF
15268 rm -f conftest.$ac_objext conftest$ac_exeext
15269 if { (eval echo "$as_me:15269: \"$ac_link\"") >&5
15270   (eval $ac_link) 2>&5
15271   ac_status=$?
15272   echo "$as_me:15272: \$? = $ac_status" >&5
15273   (exit $ac_status); } &&
15274          { ac_try='test -s conftest$ac_exeext'
15275   { (eval echo "$as_me:15275: \"$ac_try\"") >&5
15276   (eval $ac_try) 2>&5
15277   ac_status=$?
15278   echo "$as_me:15278: \$? = $ac_status" >&5
15279   (exit $ac_status); }; }; then
15280   cf_result=yes
15281 else
15282   echo "$as_me: failed program was:" >&5
15283 cat conftest.$ac_ext >&5
15284 cf_result=no
15285 fi
15286 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15287                 echo "$as_me:15287: result: $cf_result" >&5
15288 echo "${ECHO_T}$cf_result" >&6
15289
15290 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15291 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15292 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15293
15294                 if test "$cf_result" = yes ; then
15295                         cf_x_athena_lib="$cf_libs"
15296                         break
15297                 fi
15298         done # cf_libs
15299                 test -n "$cf_x_athena_lib" && break
15300         done # cf_lib
15301 done
15302
15303 if test -z "$cf_x_athena_lib" ; then
15304         { { echo "$as_me:15304: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15305 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15306    { (exit 1); exit 1; }; }
15307 fi
15308
15309 cf_add_libs="$LIBS"
15310 # reverse order
15311 cf_add_0lib=
15312 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15313 # filter duplicates
15314 for cf_add_1lib in $cf_add_0lib; do
15315         for cf_add_2lib in $cf_add_libs; do
15316                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15317                         cf_add_1lib=
15318                         break
15319                 fi
15320         done
15321         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15322 done
15323 LIBS="$cf_add_libs"
15324
15325 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15326
15327 cat >>confdefs.h <<EOF
15328 #define $cf_x_athena_LIBS 1
15329 EOF
15330
15331 fi
15332
15333 if test -n "$ac_tool_prefix"; then
15334   for ac_prog in xcurses-config
15335   do
15336     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15337 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15338 echo "$as_me:15338: checking for $ac_word" >&5
15339 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15340 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15341   echo $ECHO_N "(cached) $ECHO_C" >&6
15342 else
15343   if test -n "$XCURSES_CONFIG"; then
15344   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15345 else
15346   ac_save_IFS=$IFS; IFS=$ac_path_separator
15347 ac_dummy="$PATH"
15348 for ac_dir in $ac_dummy; do
15349   IFS=$ac_save_IFS
15350   test -z "$ac_dir" && ac_dir=.
15351   $as_executable_p "$ac_dir/$ac_word" || continue
15352 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15353 echo "$as_me:15353: found $ac_dir/$ac_word" >&5
15354 break
15355 done
15356
15357 fi
15358 fi
15359 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15360 if test -n "$XCURSES_CONFIG"; then
15361   echo "$as_me:15361: result: $XCURSES_CONFIG" >&5
15362 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15363 else
15364   echo "$as_me:15364: result: no" >&5
15365 echo "${ECHO_T}no" >&6
15366 fi
15367
15368     test -n "$XCURSES_CONFIG" && break
15369   done
15370 fi
15371 if test -z "$XCURSES_CONFIG"; then
15372   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15373   for ac_prog in xcurses-config
15374 do
15375   # Extract the first word of "$ac_prog", so it can be a program name with args.
15376 set dummy $ac_prog; ac_word=$2
15377 echo "$as_me:15377: checking for $ac_word" >&5
15378 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15379 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15380   echo $ECHO_N "(cached) $ECHO_C" >&6
15381 else
15382   if test -n "$ac_ct_XCURSES_CONFIG"; then
15383   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15384 else
15385   ac_save_IFS=$IFS; IFS=$ac_path_separator
15386 ac_dummy="$PATH"
15387 for ac_dir in $ac_dummy; do
15388   IFS=$ac_save_IFS
15389   test -z "$ac_dir" && ac_dir=.
15390   $as_executable_p "$ac_dir/$ac_word" || continue
15391 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15392 echo "$as_me:15392: found $ac_dir/$ac_word" >&5
15393 break
15394 done
15395
15396 fi
15397 fi
15398 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15399 if test -n "$ac_ct_XCURSES_CONFIG"; then
15400   echo "$as_me:15400: result: $ac_ct_XCURSES_CONFIG" >&5
15401 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15402 else
15403   echo "$as_me:15403: result: no" >&5
15404 echo "${ECHO_T}no" >&6
15405 fi
15406
15407   test -n "$ac_ct_XCURSES_CONFIG" && break
15408 done
15409 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15410
15411   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15412 fi
15413
15414 if test "$XCURSES_CONFIG" != none ; then
15415
15416 cf_fix_cppflags=no
15417 cf_new_cflags=
15418 cf_new_cppflags=
15419 cf_new_extra_cppflags=
15420
15421 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15422 do
15423 case $cf_fix_cppflags in
15424 (no)
15425         case $cf_add_cflags in
15426         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15427                 case $cf_add_cflags in
15428                 (-D*)
15429                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15430
15431                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15432                                 && test -z "${cf_tst_cflags}" \
15433                                 && cf_fix_cppflags=yes
15434
15435                         if test $cf_fix_cppflags = yes ; then
15436
15437         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15438         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15439
15440                                 continue
15441                         elif test "${cf_tst_cflags}" = "\"'" ; then
15442
15443         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15444         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15445
15446                                 continue
15447                         fi
15448                         ;;
15449                 esac
15450                 case "$CPPFLAGS" in
15451                 (*$cf_add_cflags)
15452                         ;;
15453                 (*)
15454                         case $cf_add_cflags in
15455                         (-D*)
15456                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15457
15458 CPPFLAGS=`echo "$CPPFLAGS" | \
15459         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15460                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15461
15462                                 ;;
15463                         esac
15464
15465         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15466         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15467
15468                         ;;
15469                 esac
15470                 ;;
15471         (*)
15472
15473         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15474         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15475
15476                 ;;
15477         esac
15478         ;;
15479 (yes)
15480
15481         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15482         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15483
15484         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15485
15486         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15487                 && test -z "${cf_tst_cflags}" \
15488                 && cf_fix_cppflags=no
15489         ;;
15490 esac
15491 done
15492
15493 if test -n "$cf_new_cflags" ; then
15494
15495         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15496         CFLAGS="${CFLAGS}$cf_new_cflags"
15497
15498 fi
15499
15500 if test -n "$cf_new_cppflags" ; then
15501
15502         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15503         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15504
15505 fi
15506
15507 if test -n "$cf_new_extra_cppflags" ; then
15508
15509         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15510         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15511
15512 fi
15513
15514 cf_add_libs="$LIBS"
15515 # reverse order
15516 cf_add_0lib=
15517 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15518 # filter duplicates
15519 for cf_add_1lib in $cf_add_0lib; do
15520         for cf_add_2lib in $cf_add_libs; do
15521                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15522                         cf_add_1lib=
15523                         break
15524                 fi
15525         done
15526         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15527 done
15528 LIBS="$cf_add_libs"
15529
15530 cf_cv_lib_XCurses=yes
15531
15532 else
15533
15534 LDFLAGS="$LDFLAGS $X_LIBS"
15535
15536 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15537
15538 echo "${as_me:-configure}:15538: testing checking additions to CFLAGS ..." 1>&5
15539
15540 cf_check_cflags="$CFLAGS"
15541 cf_check_cppflags="$CPPFLAGS"
15542
15543 cf_fix_cppflags=no
15544 cf_new_cflags=
15545 cf_new_cppflags=
15546 cf_new_extra_cppflags=
15547
15548 for cf_add_cflags in $X_CFLAGS
15549 do
15550 case $cf_fix_cppflags in
15551 (no)
15552         case $cf_add_cflags in
15553         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15554                 case $cf_add_cflags in
15555                 (-D*)
15556                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15557
15558                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15559                                 && test -z "${cf_tst_cflags}" \
15560                                 && cf_fix_cppflags=yes
15561
15562                         if test $cf_fix_cppflags = yes ; then
15563
15564         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15565         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15566
15567                                 continue
15568                         elif test "${cf_tst_cflags}" = "\"'" ; then
15569
15570         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15571         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15572
15573                                 continue
15574                         fi
15575                         ;;
15576                 esac
15577                 case "$CPPFLAGS" in
15578                 (*$cf_add_cflags)
15579                         ;;
15580                 (*)
15581                         case $cf_add_cflags in
15582                         (-D*)
15583                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15584
15585 CPPFLAGS=`echo "$CPPFLAGS" | \
15586         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15587                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15588
15589                                 ;;
15590                         esac
15591
15592         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15593         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15594
15595                         ;;
15596                 esac
15597                 ;;
15598         (*)
15599
15600         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15601         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15602
15603                 ;;
15604         esac
15605         ;;
15606 (yes)
15607
15608         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15609         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15610
15611         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15612
15613         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15614                 && test -z "${cf_tst_cflags}" \
15615                 && cf_fix_cppflags=no
15616         ;;
15617 esac
15618 done
15619
15620 if test -n "$cf_new_cflags" ; then
15621         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15622
15623 echo "${as_me:-configure}:15623: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15624
15625         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15626         CFLAGS="${CFLAGS}$cf_new_cflags"
15627
15628 fi
15629
15630 if test -n "$cf_new_cppflags" ; then
15631         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15632
15633 echo "${as_me:-configure}:15633: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15634
15635         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15636         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15637
15638 fi
15639
15640 if test -n "$cf_new_extra_cppflags" ; then
15641         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15642
15643 echo "${as_me:-configure}:15643: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15644
15645         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15646         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15647
15648 fi
15649
15650 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15651 cat >conftest.$ac_ext <<_ACEOF
15652 #line 15652 "configure"
15653 #include "confdefs.h"
15654 #include <stdio.h>
15655 int
15656 main (void)
15657 {
15658 printf("Hello world");
15659   ;
15660   return 0;
15661 }
15662 _ACEOF
15663 rm -f conftest.$ac_objext conftest$ac_exeext
15664 if { (eval echo "$as_me:15664: \"$ac_link\"") >&5
15665   (eval $ac_link) 2>&5
15666   ac_status=$?
15667   echo "$as_me:15667: \$? = $ac_status" >&5
15668   (exit $ac_status); } &&
15669          { ac_try='test -s conftest$ac_exeext'
15670   { (eval echo "$as_me:15670: \"$ac_try\"") >&5
15671   (eval $ac_try) 2>&5
15672   ac_status=$?
15673   echo "$as_me:15673: \$? = $ac_status" >&5
15674   (exit $ac_status); }; }; then
15675   :
15676 else
15677   echo "$as_me: failed program was:" >&5
15678 cat conftest.$ac_ext >&5
15679 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15680
15681 echo "${as_me:-configure}:15681: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15682
15683          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15684                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15685
15686 echo "${as_me:-configure}:15686: testing but keeping change to \$CPPFLAGS ..." 1>&5
15687
15688          fi
15689          CFLAGS="$cf_check_flags"
15690 fi
15691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15692 fi
15693
15694 echo "$as_me:15694: checking for XOpenDisplay in -lX11" >&5
15695 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15696 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15697   echo $ECHO_N "(cached) $ECHO_C" >&6
15698 else
15699   ac_check_lib_save_LIBS=$LIBS
15700 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15701 cat >conftest.$ac_ext <<_ACEOF
15702 #line 15702 "configure"
15703 #include "confdefs.h"
15704
15705 /* Override any gcc2 internal prototype to avoid an error.  */
15706 #ifdef __cplusplus
15707 extern "C"
15708 #endif
15709 /* We use char because int might match the return type of a gcc2
15710    builtin and then its argument prototype would still apply.  */
15711 char XOpenDisplay ();
15712 int
15713 main (void)
15714 {
15715 XOpenDisplay ();
15716   ;
15717   return 0;
15718 }
15719 _ACEOF
15720 rm -f conftest.$ac_objext conftest$ac_exeext
15721 if { (eval echo "$as_me:15721: \"$ac_link\"") >&5
15722   (eval $ac_link) 2>&5
15723   ac_status=$?
15724   echo "$as_me:15724: \$? = $ac_status" >&5
15725   (exit $ac_status); } &&
15726          { ac_try='test -s conftest$ac_exeext'
15727   { (eval echo "$as_me:15727: \"$ac_try\"") >&5
15728   (eval $ac_try) 2>&5
15729   ac_status=$?
15730   echo "$as_me:15730: \$? = $ac_status" >&5
15731   (exit $ac_status); }; }; then
15732   ac_cv_lib_X11_XOpenDisplay=yes
15733 else
15734   echo "$as_me: failed program was:" >&5
15735 cat conftest.$ac_ext >&5
15736 ac_cv_lib_X11_XOpenDisplay=no
15737 fi
15738 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15739 LIBS=$ac_check_lib_save_LIBS
15740 fi
15741 echo "$as_me:15741: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15742 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15743 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15744
15745 cf_add_libs="$LIBS"
15746 # reverse order
15747 cf_add_0lib=
15748 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15749 # filter duplicates
15750 for cf_add_1lib in $cf_add_0lib; do
15751         for cf_add_2lib in $cf_add_libs; do
15752                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15753                         cf_add_1lib=
15754                         break
15755                 fi
15756         done
15757         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15758 done
15759 LIBS="$cf_add_libs"
15760
15761 fi
15762
15763 echo "$as_me:15763: checking for XCurses library" >&5
15764 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15765 if test "${cf_cv_lib_XCurses+set}" = set; then
15766   echo $ECHO_N "(cached) $ECHO_C" >&6
15767 else
15768
15769 cf_add_libs="$LIBS"
15770 # reverse order
15771 cf_add_0lib=
15772 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15773 # filter duplicates
15774 for cf_add_1lib in $cf_add_0lib; do
15775         for cf_add_2lib in $cf_add_libs; do
15776                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15777                         cf_add_1lib=
15778                         break
15779                 fi
15780         done
15781         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15782 done
15783 LIBS="$cf_add_libs"
15784
15785 cat >conftest.$ac_ext <<_ACEOF
15786 #line 15786 "configure"
15787 #include "confdefs.h"
15788
15789 #include <xcurses.h>
15790 char *XCursesProgramName = "test";
15791
15792 int
15793 main (void)
15794 {
15795 XCursesExit();
15796   ;
15797   return 0;
15798 }
15799 _ACEOF
15800 rm -f conftest.$ac_objext conftest$ac_exeext
15801 if { (eval echo "$as_me:15801: \"$ac_link\"") >&5
15802   (eval $ac_link) 2>&5
15803   ac_status=$?
15804   echo "$as_me:15804: \$? = $ac_status" >&5
15805   (exit $ac_status); } &&
15806          { ac_try='test -s conftest$ac_exeext'
15807   { (eval echo "$as_me:15807: \"$ac_try\"") >&5
15808   (eval $ac_try) 2>&5
15809   ac_status=$?
15810   echo "$as_me:15810: \$? = $ac_status" >&5
15811   (exit $ac_status); }; }; then
15812   cf_cv_lib_XCurses=yes
15813 else
15814   echo "$as_me: failed program was:" >&5
15815 cat conftest.$ac_ext >&5
15816 cf_cv_lib_XCurses=no
15817 fi
15818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15819
15820 fi
15821 echo "$as_me:15821: result: $cf_cv_lib_XCurses" >&5
15822 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15823
15824 fi
15825
15826 if test $cf_cv_lib_XCurses = yes ; then
15827
15828 cat >>confdefs.h <<\EOF
15829 #define UNIX 1
15830 EOF
15831
15832 cat >>confdefs.h <<\EOF
15833 #define XCURSES 1
15834 EOF
15835
15836         echo "$as_me:15836: checking for xcurses.h" >&5
15837 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15838 if test "${ac_cv_header_xcurses_h+set}" = set; then
15839   echo $ECHO_N "(cached) $ECHO_C" >&6
15840 else
15841   cat >conftest.$ac_ext <<_ACEOF
15842 #line 15842 "configure"
15843 #include "confdefs.h"
15844 #include <xcurses.h>
15845 _ACEOF
15846 if { (eval echo "$as_me:15846: \"$ac_cpp conftest.$ac_ext\"") >&5
15847   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15848   ac_status=$?
15849   egrep -v '^ *\+' conftest.er1 >conftest.err
15850   rm -f conftest.er1
15851   cat conftest.err >&5
15852   echo "$as_me:15852: \$? = $ac_status" >&5
15853   (exit $ac_status); } >/dev/null; then
15854   if test -s conftest.err; then
15855     ac_cpp_err=$ac_c_preproc_warn_flag
15856   else
15857     ac_cpp_err=
15858   fi
15859 else
15860   ac_cpp_err=yes
15861 fi
15862 if test -z "$ac_cpp_err"; then
15863   ac_cv_header_xcurses_h=yes
15864 else
15865   echo "$as_me: failed program was:" >&5
15866   cat conftest.$ac_ext >&5
15867   ac_cv_header_xcurses_h=no
15868 fi
15869 rm -f conftest.err conftest.$ac_ext
15870 fi
15871 echo "$as_me:15871: result: $ac_cv_header_xcurses_h" >&5
15872 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15873 if test $ac_cv_header_xcurses_h = yes; then
15874
15875 cat >>confdefs.h <<\EOF
15876 #define HAVE_XCURSES 1
15877 EOF
15878
15879 fi
15880
15881 else
15882         { { echo "$as_me:15882: error: Cannot link with XCurses" >&5
15883 echo "$as_me: error: Cannot link with XCurses" >&2;}
15884    { (exit 1); exit 1; }; }
15885 fi
15886
15887         ;;
15888 (*)
15889         { { echo "$as_me:15889: error: unexpected screen-value: $cf_cv_screen" >&5
15890 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15891    { (exit 1); exit 1; }; }
15892         ;;
15893 esac
15894
15895 : ${cf_nculib_root:=$cf_cv_screen}
15896 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15897 echo "$as_me:15897: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15898 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15899 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15900   echo $ECHO_N "(cached) $ECHO_C" >&6
15901 else
15902   ac_check_lib_save_LIBS=$LIBS
15903 LIBS="-l$cf_nculib_root  $LIBS"
15904 cat >conftest.$ac_ext <<_ACEOF
15905 #line 15905 "configure"
15906 #include "confdefs.h"
15907
15908 /* Override any gcc2 internal prototype to avoid an error.  */
15909 #ifdef __cplusplus
15910 extern "C"
15911 #endif
15912 /* We use char because int might match the return type of a gcc2
15913    builtin and then its argument prototype would still apply.  */
15914 char _nc_init_pthreads ();
15915 int
15916 main (void)
15917 {
15918 _nc_init_pthreads ();
15919   ;
15920   return 0;
15921 }
15922 _ACEOF
15923 rm -f conftest.$ac_objext conftest$ac_exeext
15924 if { (eval echo "$as_me:15924: \"$ac_link\"") >&5
15925   (eval $ac_link) 2>&5
15926   ac_status=$?
15927   echo "$as_me:15927: \$? = $ac_status" >&5
15928   (exit $ac_status); } &&
15929          { ac_try='test -s conftest$ac_exeext'
15930   { (eval echo "$as_me:15930: \"$ac_try\"") >&5
15931   (eval $ac_try) 2>&5
15932   ac_status=$?
15933   echo "$as_me:15933: \$? = $ac_status" >&5
15934   (exit $ac_status); }; }; then
15935   eval "$as_ac_Lib=yes"
15936 else
15937   echo "$as_me: failed program was:" >&5
15938 cat conftest.$ac_ext >&5
15939 eval "$as_ac_Lib=no"
15940 fi
15941 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15942 LIBS=$ac_check_lib_save_LIBS
15943 fi
15944 echo "$as_me:15944: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15945 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15946 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15947   cf_cv_ncurses_pthreads=yes
15948 else
15949   cf_cv_ncurses_pthreads=no
15950 fi
15951
15952 if test "$cf_cv_ncurses_pthreads" = yes
15953 then
15954
15955 cf_add_libs="$LIBS"
15956 # reverse order
15957 cf_add_0lib=
15958 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15959 # filter duplicates
15960 for cf_add_1lib in $cf_add_0lib; do
15961         for cf_add_2lib in $cf_add_libs; do
15962                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15963                         cf_add_1lib=
15964                         break
15965                 fi
15966         done
15967         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15968 done
15969 LIBS="$cf_add_libs"
15970
15971 fi
15972
15973 case $cf_cv_screen in
15974 (ncurses*)
15975         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15976         ;;
15977 esac
15978
15979 echo "$as_me:15979: checking for X11 rgb file" >&5
15980 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15981
15982 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15983 if test "${with_x11_rgb+set}" = set; then
15984   withval="$with_x11_rgb"
15985   RGB_PATH=$withval
15986 else
15987   RGB_PATH=auto
15988 fi;
15989
15990 if test "x$RGB_PATH" = xauto
15991 then
15992         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15993         for cf_path in \
15994                 /opt/local/share/X11/rgb.txt \
15995                 /opt/X11/share/X11/rgb.txt \
15996                 /usr/share/X11/rgb.txt \
15997                 /usr/X11/share/X11/rgb.txt \
15998                 /usr/X11/lib/X11/rgb.txt \
15999                 /usr/lib/X11/rgb.txt \
16000                 /etc/X11/rgb.txt \
16001                 /usr/pkg/lib/X11/rgb.txt \
16002                 /usr/X11R7/lib/X11/rgb.txt \
16003                 /usr/X11R6/lib/X11/rgb.txt \
16004                 /usr/X11R5/lib/X11/rgb.txt \
16005                 /usr/X11R4/lib/X11/rgb.txt \
16006                 /usr/local/lib/X11/rgb.txt \
16007                 /usr/local/share/X11/rgb.txt \
16008                 /usr/lib64/X11/rgb.txt
16009         do
16010                 if test -f "$cf_path" ; then
16011                         RGB_PATH="$cf_path"
16012                         break
16013                 fi
16014         done
16015 else
16016         cf_path=$RGB_PATH
16017
16018 if test "x$prefix" != xNONE; then
16019         cf_path_syntax="$prefix"
16020 else
16021         cf_path_syntax="$ac_default_prefix"
16022 fi
16023
16024 case ".$cf_path" in
16025 (.\$\(*\)*|.\'*\'*)
16026         ;;
16027 (..|./*|.\\*)
16028         ;;
16029 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16030         ;;
16031 (.\${*prefix}*|.\${*dir}*)
16032         eval cf_path="$cf_path"
16033         case ".$cf_path" in
16034         (.NONE/*)
16035                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16036                 ;;
16037         esac
16038         ;;
16039 (.no|.NONE/*)
16040         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16041         ;;
16042 (*)
16043         { { echo "$as_me:16043: error: expected a pathname, not \"$cf_path\"" >&5
16044 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16045    { (exit 1); exit 1; }; }
16046         ;;
16047 esac
16048
16049 fi
16050
16051 echo "$as_me:16051: result: $RGB_PATH" >&5
16052 echo "${ECHO_T}$RGB_PATH" >&6
16053
16054 cat >>confdefs.h <<EOF
16055 #define RGB_PATH "$cf_path"
16056 EOF
16057
16058 no_x11_rgb=
16059 if test "$RGB_PATH" = no
16060 then
16061         no_x11_rgb="#"
16062 fi
16063
16064 cf_curses_headers=
16065
16066 case $cf_cv_screen in
16067 (pdcurses)
16068         cf_default_panel=no
16069         cf_default_form=no
16070         cf_default_menu=no
16071         cf_default_tinfo=no
16072         ;;
16073 (xcurses|bsdcurses)
16074         cf_default_panel=no
16075         cf_default_form=no
16076         cf_default_menu=no
16077         cf_default_tinfo=yes
16078         ;;
16079 (*)
16080         cf_default_panel=yes
16081         cf_default_form=yes
16082         cf_default_menu=yes
16083         cf_default_tinfo=yes
16084         case $cf_cv_screen in
16085         (ncurses*)
16086                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16087                 ;;
16088         esac
16089         ;;
16090 esac
16091
16092 echo "$as_me:16092: checking for desired basename for form library" >&5
16093 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16094
16095 # Check whether --with-form-libname or --without-form-libname was given.
16096 if test "${with_form_libname+set}" = set; then
16097   withval="$with_form_libname"
16098   with_lib_basename=$withval
16099 else
16100   with_lib_basename=form
16101 fi;
16102 FORM_NAME="$with_lib_basename"
16103
16104 case "x$FORM_NAME" in
16105 (x|xno|xnone|xyes)
16106         FORM_NAME=form
16107         ;;
16108 (*)
16109         ;;
16110 esac
16111
16112 echo "$as_me:16112: result: $FORM_NAME" >&5
16113 echo "${ECHO_T}$FORM_NAME" >&6
16114
16115 echo "$as_me:16115: checking for desired basename for menu library" >&5
16116 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16117
16118 # Check whether --with-menu-libname or --without-menu-libname was given.
16119 if test "${with_menu_libname+set}" = set; then
16120   withval="$with_menu_libname"
16121   with_lib_basename=$withval
16122 else
16123   with_lib_basename=menu
16124 fi;
16125 MENU_NAME="$with_lib_basename"
16126
16127 case "x$MENU_NAME" in
16128 (x|xno|xnone|xyes)
16129         MENU_NAME=menu
16130         ;;
16131 (*)
16132         ;;
16133 esac
16134
16135 echo "$as_me:16135: result: $MENU_NAME" >&5
16136 echo "${ECHO_T}$MENU_NAME" >&6
16137
16138 echo "$as_me:16138: checking for desired basename for panel library" >&5
16139 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16140
16141 # Check whether --with-panel-libname or --without-panel-libname was given.
16142 if test "${with_panel_libname+set}" = set; then
16143   withval="$with_panel_libname"
16144   with_lib_basename=$withval
16145 else
16146   with_lib_basename=panel
16147 fi;
16148 PANEL_NAME="$with_lib_basename"
16149
16150 case "x$PANEL_NAME" in
16151 (x|xno|xnone|xyes)
16152         PANEL_NAME=panel
16153         ;;
16154 (*)
16155         ;;
16156 esac
16157
16158 echo "$as_me:16158: result: $PANEL_NAME" >&5
16159 echo "${ECHO_T}$PANEL_NAME" >&6
16160
16161 echo "$as_me:16161: checking if you want to check for panel functions" >&5
16162 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16163
16164 # Check whether --enable-panel or --disable-panel was given.
16165 if test "${enable_panel+set}" = set; then
16166   enableval="$enable_panel"
16167   test "$enableval" != no && enableval=yes
16168         if test "$enableval" != "yes" ; then
16169     cf_enable_panel=no
16170         else
16171                 cf_enable_panel=$cf_default_panel
16172         fi
16173 else
16174   enableval=yes
16175         cf_enable_panel=$cf_default_panel
16176
16177 fi;
16178 echo "$as_me:16178: result: $cf_enable_panel" >&5
16179 echo "${ECHO_T}$cf_enable_panel" >&6
16180 if test $cf_enable_panel = yes
16181 then
16182
16183 cf_have_curses_lib=no
16184
16185 : ${NCURSES_CONFIG_PKG:=none}
16186 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16187         :
16188 elif test "x${PKG_CONFIG:=none}" != xnone; then
16189         echo "$as_me:16189: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16190 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16191         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16192                 echo "$as_me:16192: result: yes" >&5
16193 echo "${ECHO_T}yes" >&6
16194
16195                 echo "$as_me:16195: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16196 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16197
16198                 cf_save_CPPFLAGS="$CPPFLAGS"
16199                 cf_save_LIBS="$LIBS"
16200
16201 cf_fix_cppflags=no
16202 cf_new_cflags=
16203 cf_new_cppflags=
16204 cf_new_extra_cppflags=
16205
16206 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16207 do
16208 case $cf_fix_cppflags in
16209 (no)
16210         case $cf_add_cflags in
16211         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16212                 case $cf_add_cflags in
16213                 (-D*)
16214                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16215
16216                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16217                                 && test -z "${cf_tst_cflags}" \
16218                                 && cf_fix_cppflags=yes
16219
16220                         if test $cf_fix_cppflags = yes ; then
16221
16222         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16223         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16224
16225                                 continue
16226                         elif test "${cf_tst_cflags}" = "\"'" ; then
16227
16228         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16229         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16230
16231                                 continue
16232                         fi
16233                         ;;
16234                 esac
16235                 case "$CPPFLAGS" in
16236                 (*$cf_add_cflags)
16237                         ;;
16238                 (*)
16239                         case $cf_add_cflags in
16240                         (-D*)
16241                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16242
16243 CPPFLAGS=`echo "$CPPFLAGS" | \
16244         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16245                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16246
16247                                 ;;
16248                         esac
16249
16250         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16251         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16252
16253                         ;;
16254                 esac
16255                 ;;
16256         (*)
16257
16258         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16259         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16260
16261                 ;;
16262         esac
16263         ;;
16264 (yes)
16265
16266         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16267         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16268
16269         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16270
16271         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16272                 && test -z "${cf_tst_cflags}" \
16273                 && cf_fix_cppflags=no
16274         ;;
16275 esac
16276 done
16277
16278 if test -n "$cf_new_cflags" ; then
16279
16280         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16281         CFLAGS="${CFLAGS}$cf_new_cflags"
16282
16283 fi
16284
16285 if test -n "$cf_new_cppflags" ; then
16286
16287         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16288         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16289
16290 fi
16291
16292 if test -n "$cf_new_extra_cppflags" ; then
16293
16294         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16295         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16296
16297 fi
16298
16299 cf_add_libs="$LIBS"
16300 # reverse order
16301 cf_add_0lib=
16302 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16303 # filter duplicates
16304 for cf_add_1lib in $cf_add_0lib; do
16305         for cf_add_2lib in $cf_add_libs; do
16306                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16307                         cf_add_1lib=
16308                         break
16309                 fi
16310         done
16311         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16312 done
16313 LIBS="$cf_add_libs"
16314
16315                 cat >conftest.$ac_ext <<_ACEOF
16316 #line 16316 "configure"
16317 #include "confdefs.h"
16318 #include <$PANEL_NAME.h>
16319 int
16320 main (void)
16321 {
16322 (void) new_panel ( 0 );
16323   ;
16324   return 0;
16325 }
16326 _ACEOF
16327 rm -f conftest.$ac_objext conftest$ac_exeext
16328 if { (eval echo "$as_me:16328: \"$ac_link\"") >&5
16329   (eval $ac_link) 2>&5
16330   ac_status=$?
16331   echo "$as_me:16331: \$? = $ac_status" >&5
16332   (exit $ac_status); } &&
16333          { ac_try='test -s conftest$ac_exeext'
16334   { (eval echo "$as_me:16334: \"$ac_try\"") >&5
16335   (eval $ac_try) 2>&5
16336   ac_status=$?
16337   echo "$as_me:16337: \$? = $ac_status" >&5
16338   (exit $ac_status); }; }; then
16339   if test "$cross_compiling" = yes; then
16340   cf_have_curses_lib=maybe
16341 else
16342   cat >conftest.$ac_ext <<_ACEOF
16343 #line 16343 "configure"
16344 #include "confdefs.h"
16345 #include <$PANEL_NAME.h>
16346                                 int main(void)
16347                                 { (void) new_panel ( 0 ); return 0; }
16348 _ACEOF
16349 rm -f conftest$ac_exeext
16350 if { (eval echo "$as_me:16350: \"$ac_link\"") >&5
16351   (eval $ac_link) 2>&5
16352   ac_status=$?
16353   echo "$as_me:16353: \$? = $ac_status" >&5
16354   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16355   { (eval echo "$as_me:16355: \"$ac_try\"") >&5
16356   (eval $ac_try) 2>&5
16357   ac_status=$?
16358   echo "$as_me:16358: \$? = $ac_status" >&5
16359   (exit $ac_status); }; }; then
16360   cf_have_curses_lib=yes
16361 else
16362   echo "$as_me: program exited with status $ac_status" >&5
16363 echo "$as_me: failed program was:" >&5
16364 cat conftest.$ac_ext >&5
16365 cf_have_curses_lib=no
16366 fi
16367 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16368 fi
16369 else
16370   echo "$as_me: failed program was:" >&5
16371 cat conftest.$ac_ext >&5
16372 cf_have_curses_lib=no
16373 fi
16374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16375                 echo "$as_me:16375: result: $cf_have_curses_lib" >&5
16376 echo "${ECHO_T}$cf_have_curses_lib" >&6
16377                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16378                 if test "$cf_have_curses_lib" != "yes"
16379                 then
16380                         CPPFLAGS="$cf_save_CPPFLAGS"
16381                         LIBS="$cf_save_LIBS"
16382                 else
16383
16384 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16385
16386                         cat >>confdefs.h <<EOF
16387 #define $cf_upper 1
16388 EOF
16389
16390                 fi
16391         fi
16392 fi
16393 if test "$cf_have_curses_lib" = no; then
16394         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16395 echo "$as_me:16395: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16396 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16397 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16398   echo $ECHO_N "(cached) $ECHO_C" >&6
16399 else
16400   ac_check_lib_save_LIBS=$LIBS
16401 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16402 cat >conftest.$ac_ext <<_ACEOF
16403 #line 16403 "configure"
16404 #include "confdefs.h"
16405
16406 /* Override any gcc2 internal prototype to avoid an error.  */
16407 #ifdef __cplusplus
16408 extern "C"
16409 #endif
16410 /* We use char because int might match the return type of a gcc2
16411    builtin and then its argument prototype would still apply.  */
16412 char new_panel ();
16413 int
16414 main (void)
16415 {
16416 new_panel ();
16417   ;
16418   return 0;
16419 }
16420 _ACEOF
16421 rm -f conftest.$ac_objext conftest$ac_exeext
16422 if { (eval echo "$as_me:16422: \"$ac_link\"") >&5
16423   (eval $ac_link) 2>&5
16424   ac_status=$?
16425   echo "$as_me:16425: \$? = $ac_status" >&5
16426   (exit $ac_status); } &&
16427          { ac_try='test -s conftest$ac_exeext'
16428   { (eval echo "$as_me:16428: \"$ac_try\"") >&5
16429   (eval $ac_try) 2>&5
16430   ac_status=$?
16431   echo "$as_me:16431: \$? = $ac_status" >&5
16432   (exit $ac_status); }; }; then
16433   eval "$as_ac_Lib=yes"
16434 else
16435   echo "$as_me: failed program was:" >&5
16436 cat conftest.$ac_ext >&5
16437 eval "$as_ac_Lib=no"
16438 fi
16439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16440 LIBS=$ac_check_lib_save_LIBS
16441 fi
16442 echo "$as_me:16442: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16443 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16444 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16445
16446 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16447
16448 cf_add_libs="$LIBS"
16449 # reverse order
16450 cf_add_0lib=
16451 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16452 # filter duplicates
16453 for cf_add_1lib in $cf_add_0lib; do
16454         for cf_add_2lib in $cf_add_libs; do
16455                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16456                         cf_add_1lib=
16457                         break
16458                 fi
16459         done
16460         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16461 done
16462 LIBS="$cf_add_libs"
16463
16464                 cat >>confdefs.h <<EOF
16465 #define $cf_upper 1
16466 EOF
16467
16468 fi
16469
16470 fi
16471
16472         cf_curses_headers="$cf_curses_headers panel.h"
16473 fi
16474
16475 echo "$as_me:16475: checking if you want to check for menu functions" >&5
16476 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16477
16478 # Check whether --enable-menu or --disable-menu was given.
16479 if test "${enable_menu+set}" = set; then
16480   enableval="$enable_menu"
16481   test "$enableval" != no && enableval=yes
16482         if test "$enableval" != "yes" ; then
16483     cf_enable_menu=no
16484         else
16485                 cf_enable_menu=$cf_default_menu
16486         fi
16487 else
16488   enableval=yes
16489         cf_enable_menu=$cf_default_menu
16490
16491 fi;
16492 echo "$as_me:16492: result: $cf_enable_menu" >&5
16493 echo "${ECHO_T}$cf_enable_menu" >&6
16494 if test $cf_enable_menu = yes
16495 then
16496         case $cf_cv_screen in
16497         (ncurses*)
16498                 ;;
16499         (curses*)
16500
16501 echo "$as_me:16501: checking for NetBSD menu.h" >&5
16502 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16503 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16504   echo $ECHO_N "(cached) $ECHO_C" >&6
16505 else
16506
16507 cat >conftest.$ac_ext <<_ACEOF
16508 #line 16508 "configure"
16509 #include "confdefs.h"
16510
16511 #include <${cf_cv_ncurses_header:-curses.h}>
16512 #include <menu.h>
16513
16514 int
16515 main (void)
16516 {
16517
16518         MENU *menu;
16519         int y = menu->max_item_width;
16520
16521   ;
16522   return 0;
16523 }
16524 _ACEOF
16525 rm -f conftest.$ac_objext
16526 if { (eval echo "$as_me:16526: \"$ac_compile\"") >&5
16527   (eval $ac_compile) 2>&5
16528   ac_status=$?
16529   echo "$as_me:16529: \$? = $ac_status" >&5
16530   (exit $ac_status); } &&
16531          { ac_try='test -s conftest.$ac_objext'
16532   { (eval echo "$as_me:16532: \"$ac_try\"") >&5
16533   (eval $ac_try) 2>&5
16534   ac_status=$?
16535   echo "$as_me:16535: \$? = $ac_status" >&5
16536   (exit $ac_status); }; }; then
16537   cf_cv_netbsd_menu_h=yes
16538
16539 else
16540   echo "$as_me: failed program was:" >&5
16541 cat conftest.$ac_ext >&5
16542 cf_cv_netbsd_menu_h=no
16543 fi
16544 rm -f conftest.$ac_objext conftest.$ac_ext
16545
16546 fi
16547 echo "$as_me:16547: result: $cf_cv_netbsd_menu_h" >&5
16548 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16549
16550 test "$cf_cv_netbsd_menu_h" = yes &&
16551 cat >>confdefs.h <<\EOF
16552 #define HAVE_NETBSD_MENU_H 1
16553 EOF
16554
16555                 ;;
16556         esac
16557
16558 cf_have_curses_lib=no
16559
16560 : ${NCURSES_CONFIG_PKG:=none}
16561 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16562         :
16563 elif test "x${PKG_CONFIG:=none}" != xnone; then
16564         echo "$as_me:16564: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16565 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16566         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16567                 echo "$as_me:16567: result: yes" >&5
16568 echo "${ECHO_T}yes" >&6
16569
16570                 echo "$as_me:16570: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16571 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16572
16573                 cf_save_CPPFLAGS="$CPPFLAGS"
16574                 cf_save_LIBS="$LIBS"
16575
16576 cf_fix_cppflags=no
16577 cf_new_cflags=
16578 cf_new_cppflags=
16579 cf_new_extra_cppflags=
16580
16581 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16582 do
16583 case $cf_fix_cppflags in
16584 (no)
16585         case $cf_add_cflags in
16586         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16587                 case $cf_add_cflags in
16588                 (-D*)
16589                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16590
16591                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16592                                 && test -z "${cf_tst_cflags}" \
16593                                 && cf_fix_cppflags=yes
16594
16595                         if test $cf_fix_cppflags = yes ; then
16596
16597         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16598         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16599
16600                                 continue
16601                         elif test "${cf_tst_cflags}" = "\"'" ; then
16602
16603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16605
16606                                 continue
16607                         fi
16608                         ;;
16609                 esac
16610                 case "$CPPFLAGS" in
16611                 (*$cf_add_cflags)
16612                         ;;
16613                 (*)
16614                         case $cf_add_cflags in
16615                         (-D*)
16616                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16617
16618 CPPFLAGS=`echo "$CPPFLAGS" | \
16619         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16620                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16621
16622                                 ;;
16623                         esac
16624
16625         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16626         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16627
16628                         ;;
16629                 esac
16630                 ;;
16631         (*)
16632
16633         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16634         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16635
16636                 ;;
16637         esac
16638         ;;
16639 (yes)
16640
16641         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16642         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16643
16644         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16645
16646         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16647                 && test -z "${cf_tst_cflags}" \
16648                 && cf_fix_cppflags=no
16649         ;;
16650 esac
16651 done
16652
16653 if test -n "$cf_new_cflags" ; then
16654
16655         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16656         CFLAGS="${CFLAGS}$cf_new_cflags"
16657
16658 fi
16659
16660 if test -n "$cf_new_cppflags" ; then
16661
16662         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16663         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16664
16665 fi
16666
16667 if test -n "$cf_new_extra_cppflags" ; then
16668
16669         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16670         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16671
16672 fi
16673
16674 cf_add_libs="$LIBS"
16675 # reverse order
16676 cf_add_0lib=
16677 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16678 # filter duplicates
16679 for cf_add_1lib in $cf_add_0lib; do
16680         for cf_add_2lib in $cf_add_libs; do
16681                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16682                         cf_add_1lib=
16683                         break
16684                 fi
16685         done
16686         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16687 done
16688 LIBS="$cf_add_libs"
16689
16690                 cat >conftest.$ac_ext <<_ACEOF
16691 #line 16691 "configure"
16692 #include "confdefs.h"
16693 #include <$MENU_NAME.h>
16694 int
16695 main (void)
16696 {
16697 (void) menu_driver ( 0,0 );
16698   ;
16699   return 0;
16700 }
16701 _ACEOF
16702 rm -f conftest.$ac_objext conftest$ac_exeext
16703 if { (eval echo "$as_me:16703: \"$ac_link\"") >&5
16704   (eval $ac_link) 2>&5
16705   ac_status=$?
16706   echo "$as_me:16706: \$? = $ac_status" >&5
16707   (exit $ac_status); } &&
16708          { ac_try='test -s conftest$ac_exeext'
16709   { (eval echo "$as_me:16709: \"$ac_try\"") >&5
16710   (eval $ac_try) 2>&5
16711   ac_status=$?
16712   echo "$as_me:16712: \$? = $ac_status" >&5
16713   (exit $ac_status); }; }; then
16714   if test "$cross_compiling" = yes; then
16715   cf_have_curses_lib=maybe
16716 else
16717   cat >conftest.$ac_ext <<_ACEOF
16718 #line 16718 "configure"
16719 #include "confdefs.h"
16720 #include <$MENU_NAME.h>
16721                                 int main(void)
16722                                 { (void) menu_driver ( 0,0 ); return 0; }
16723 _ACEOF
16724 rm -f conftest$ac_exeext
16725 if { (eval echo "$as_me:16725: \"$ac_link\"") >&5
16726   (eval $ac_link) 2>&5
16727   ac_status=$?
16728   echo "$as_me:16728: \$? = $ac_status" >&5
16729   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16730   { (eval echo "$as_me:16730: \"$ac_try\"") >&5
16731   (eval $ac_try) 2>&5
16732   ac_status=$?
16733   echo "$as_me:16733: \$? = $ac_status" >&5
16734   (exit $ac_status); }; }; then
16735   cf_have_curses_lib=yes
16736 else
16737   echo "$as_me: program exited with status $ac_status" >&5
16738 echo "$as_me: failed program was:" >&5
16739 cat conftest.$ac_ext >&5
16740 cf_have_curses_lib=no
16741 fi
16742 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16743 fi
16744 else
16745   echo "$as_me: failed program was:" >&5
16746 cat conftest.$ac_ext >&5
16747 cf_have_curses_lib=no
16748 fi
16749 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16750                 echo "$as_me:16750: result: $cf_have_curses_lib" >&5
16751 echo "${ECHO_T}$cf_have_curses_lib" >&6
16752                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16753                 if test "$cf_have_curses_lib" != "yes"
16754                 then
16755                         CPPFLAGS="$cf_save_CPPFLAGS"
16756                         LIBS="$cf_save_LIBS"
16757                 else
16758
16759 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16760
16761                         cat >>confdefs.h <<EOF
16762 #define $cf_upper 1
16763 EOF
16764
16765                 fi
16766         fi
16767 fi
16768 if test "$cf_have_curses_lib" = no; then
16769         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16770 echo "$as_me:16770: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16771 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16772 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16773   echo $ECHO_N "(cached) $ECHO_C" >&6
16774 else
16775   ac_check_lib_save_LIBS=$LIBS
16776 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16777 cat >conftest.$ac_ext <<_ACEOF
16778 #line 16778 "configure"
16779 #include "confdefs.h"
16780
16781 /* Override any gcc2 internal prototype to avoid an error.  */
16782 #ifdef __cplusplus
16783 extern "C"
16784 #endif
16785 /* We use char because int might match the return type of a gcc2
16786    builtin and then its argument prototype would still apply.  */
16787 char menu_driver ();
16788 int
16789 main (void)
16790 {
16791 menu_driver ();
16792   ;
16793   return 0;
16794 }
16795 _ACEOF
16796 rm -f conftest.$ac_objext conftest$ac_exeext
16797 if { (eval echo "$as_me:16797: \"$ac_link\"") >&5
16798   (eval $ac_link) 2>&5
16799   ac_status=$?
16800   echo "$as_me:16800: \$? = $ac_status" >&5
16801   (exit $ac_status); } &&
16802          { ac_try='test -s conftest$ac_exeext'
16803   { (eval echo "$as_me:16803: \"$ac_try\"") >&5
16804   (eval $ac_try) 2>&5
16805   ac_status=$?
16806   echo "$as_me:16806: \$? = $ac_status" >&5
16807   (exit $ac_status); }; }; then
16808   eval "$as_ac_Lib=yes"
16809 else
16810   echo "$as_me: failed program was:" >&5
16811 cat conftest.$ac_ext >&5
16812 eval "$as_ac_Lib=no"
16813 fi
16814 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16815 LIBS=$ac_check_lib_save_LIBS
16816 fi
16817 echo "$as_me:16817: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16818 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16819 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16820
16821 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16822
16823 cf_add_libs="$LIBS"
16824 # reverse order
16825 cf_add_0lib=
16826 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16827 # filter duplicates
16828 for cf_add_1lib in $cf_add_0lib; do
16829         for cf_add_2lib in $cf_add_libs; do
16830                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16831                         cf_add_1lib=
16832                         break
16833                 fi
16834         done
16835         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16836 done
16837 LIBS="$cf_add_libs"
16838
16839                 cat >>confdefs.h <<EOF
16840 #define $cf_upper 1
16841 EOF
16842
16843 fi
16844
16845 fi
16846
16847         cf_curses_headers="$cf_curses_headers menu.h"
16848 fi
16849
16850 echo "$as_me:16850: checking if you want to check for form functions" >&5
16851 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16852
16853 # Check whether --enable-form or --disable-form was given.
16854 if test "${enable_form+set}" = set; then
16855   enableval="$enable_form"
16856   test "$enableval" != no && enableval=yes
16857         if test "$enableval" != "yes" ; then
16858     cf_enable_form=no
16859         else
16860                 cf_enable_form=$cf_default_form
16861         fi
16862 else
16863   enableval=yes
16864         cf_enable_form=$cf_default_form
16865
16866 fi;
16867 echo "$as_me:16867: result: $cf_enable_form" >&5
16868 echo "${ECHO_T}$cf_enable_form" >&6
16869 if test $cf_enable_form = yes
16870 then
16871         case $cf_cv_screen in
16872         (ncurses*)
16873                 ;;
16874         (curses*)
16875
16876 echo "$as_me:16876: checking for NetBSD form.h" >&5
16877 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16878 if test "${cf_cv_netbsd_form_h+set}" = set; then
16879   echo $ECHO_N "(cached) $ECHO_C" >&6
16880 else
16881
16882 cat >conftest.$ac_ext <<_ACEOF
16883 #line 16883 "configure"
16884 #include "confdefs.h"
16885
16886 #include <${cf_cv_ncurses_header:-curses.h}>
16887 #include <form.h>
16888
16889 int
16890 main (void)
16891 {
16892
16893         FORM *form;
16894         int y = current_field(form)->cursor_ypos;
16895         int x = current_field(form)->cursor_xpos;
16896
16897   ;
16898   return 0;
16899 }
16900 _ACEOF
16901 rm -f conftest.$ac_objext
16902 if { (eval echo "$as_me:16902: \"$ac_compile\"") >&5
16903   (eval $ac_compile) 2>&5
16904   ac_status=$?
16905   echo "$as_me:16905: \$? = $ac_status" >&5
16906   (exit $ac_status); } &&
16907          { ac_try='test -s conftest.$ac_objext'
16908   { (eval echo "$as_me:16908: \"$ac_try\"") >&5
16909   (eval $ac_try) 2>&5
16910   ac_status=$?
16911   echo "$as_me:16911: \$? = $ac_status" >&5
16912   (exit $ac_status); }; }; then
16913   cf_cv_netbsd_form_h=yes
16914
16915 else
16916   echo "$as_me: failed program was:" >&5
16917 cat conftest.$ac_ext >&5
16918 cf_cv_netbsd_form_h=no
16919 fi
16920 rm -f conftest.$ac_objext conftest.$ac_ext
16921
16922 fi
16923 echo "$as_me:16923: result: $cf_cv_netbsd_form_h" >&5
16924 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16925
16926 test "$cf_cv_netbsd_form_h" = yes &&
16927 cat >>confdefs.h <<\EOF
16928 #define HAVE_NETBSD_FORM_H 1
16929 EOF
16930
16931                 ;;
16932         esac
16933
16934 cf_have_curses_lib=no
16935
16936 : ${NCURSES_CONFIG_PKG:=none}
16937 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16938         :
16939 elif test "x${PKG_CONFIG:=none}" != xnone; then
16940         echo "$as_me:16940: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16941 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16942         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16943                 echo "$as_me:16943: result: yes" >&5
16944 echo "${ECHO_T}yes" >&6
16945
16946                 echo "$as_me:16946: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16947 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16948
16949                 cf_save_CPPFLAGS="$CPPFLAGS"
16950                 cf_save_LIBS="$LIBS"
16951
16952 cf_fix_cppflags=no
16953 cf_new_cflags=
16954 cf_new_cppflags=
16955 cf_new_extra_cppflags=
16956
16957 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16958 do
16959 case $cf_fix_cppflags in
16960 (no)
16961         case $cf_add_cflags in
16962         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16963                 case $cf_add_cflags in
16964                 (-D*)
16965                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16966
16967                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16968                                 && test -z "${cf_tst_cflags}" \
16969                                 && cf_fix_cppflags=yes
16970
16971                         if test $cf_fix_cppflags = yes ; then
16972
16973         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16974         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16975
16976                                 continue
16977                         elif test "${cf_tst_cflags}" = "\"'" ; then
16978
16979         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16980         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16981
16982                                 continue
16983                         fi
16984                         ;;
16985                 esac
16986                 case "$CPPFLAGS" in
16987                 (*$cf_add_cflags)
16988                         ;;
16989                 (*)
16990                         case $cf_add_cflags in
16991                         (-D*)
16992                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16993
16994 CPPFLAGS=`echo "$CPPFLAGS" | \
16995         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16996                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16997
16998                                 ;;
16999                         esac
17000
17001         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
17002         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17003
17004                         ;;
17005                 esac
17006                 ;;
17007         (*)
17008
17009         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17010         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17011
17012                 ;;
17013         esac
17014         ;;
17015 (yes)
17016
17017         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17018         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17019
17020         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17021
17022         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17023                 && test -z "${cf_tst_cflags}" \
17024                 && cf_fix_cppflags=no
17025         ;;
17026 esac
17027 done
17028
17029 if test -n "$cf_new_cflags" ; then
17030
17031         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17032         CFLAGS="${CFLAGS}$cf_new_cflags"
17033
17034 fi
17035
17036 if test -n "$cf_new_cppflags" ; then
17037
17038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17039         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17040
17041 fi
17042
17043 if test -n "$cf_new_extra_cppflags" ; then
17044
17045         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17046         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17047
17048 fi
17049
17050 cf_add_libs="$LIBS"
17051 # reverse order
17052 cf_add_0lib=
17053 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17054 # filter duplicates
17055 for cf_add_1lib in $cf_add_0lib; do
17056         for cf_add_2lib in $cf_add_libs; do
17057                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17058                         cf_add_1lib=
17059                         break
17060                 fi
17061         done
17062         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17063 done
17064 LIBS="$cf_add_libs"
17065
17066                 cat >conftest.$ac_ext <<_ACEOF
17067 #line 17067 "configure"
17068 #include "confdefs.h"
17069 #include <$FORM_NAME.h>
17070 int
17071 main (void)
17072 {
17073 (void) form_driver ( 0,0 );
17074   ;
17075   return 0;
17076 }
17077 _ACEOF
17078 rm -f conftest.$ac_objext conftest$ac_exeext
17079 if { (eval echo "$as_me:17079: \"$ac_link\"") >&5
17080   (eval $ac_link) 2>&5
17081   ac_status=$?
17082   echo "$as_me:17082: \$? = $ac_status" >&5
17083   (exit $ac_status); } &&
17084          { ac_try='test -s conftest$ac_exeext'
17085   { (eval echo "$as_me:17085: \"$ac_try\"") >&5
17086   (eval $ac_try) 2>&5
17087   ac_status=$?
17088   echo "$as_me:17088: \$? = $ac_status" >&5
17089   (exit $ac_status); }; }; then
17090   if test "$cross_compiling" = yes; then
17091   cf_have_curses_lib=maybe
17092 else
17093   cat >conftest.$ac_ext <<_ACEOF
17094 #line 17094 "configure"
17095 #include "confdefs.h"
17096 #include <$FORM_NAME.h>
17097                                 int main(void)
17098                                 { (void) form_driver ( 0,0 ); return 0; }
17099 _ACEOF
17100 rm -f conftest$ac_exeext
17101 if { (eval echo "$as_me:17101: \"$ac_link\"") >&5
17102   (eval $ac_link) 2>&5
17103   ac_status=$?
17104   echo "$as_me:17104: \$? = $ac_status" >&5
17105   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17106   { (eval echo "$as_me:17106: \"$ac_try\"") >&5
17107   (eval $ac_try) 2>&5
17108   ac_status=$?
17109   echo "$as_me:17109: \$? = $ac_status" >&5
17110   (exit $ac_status); }; }; then
17111   cf_have_curses_lib=yes
17112 else
17113   echo "$as_me: program exited with status $ac_status" >&5
17114 echo "$as_me: failed program was:" >&5
17115 cat conftest.$ac_ext >&5
17116 cf_have_curses_lib=no
17117 fi
17118 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17119 fi
17120 else
17121   echo "$as_me: failed program was:" >&5
17122 cat conftest.$ac_ext >&5
17123 cf_have_curses_lib=no
17124 fi
17125 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17126                 echo "$as_me:17126: result: $cf_have_curses_lib" >&5
17127 echo "${ECHO_T}$cf_have_curses_lib" >&6
17128                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17129                 if test "$cf_have_curses_lib" != "yes"
17130                 then
17131                         CPPFLAGS="$cf_save_CPPFLAGS"
17132                         LIBS="$cf_save_LIBS"
17133                 else
17134
17135 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17136
17137                         cat >>confdefs.h <<EOF
17138 #define $cf_upper 1
17139 EOF
17140
17141                 fi
17142         fi
17143 fi
17144 if test "$cf_have_curses_lib" = no; then
17145         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17146 echo "$as_me:17146: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17147 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17148 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17149   echo $ECHO_N "(cached) $ECHO_C" >&6
17150 else
17151   ac_check_lib_save_LIBS=$LIBS
17152 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17153 cat >conftest.$ac_ext <<_ACEOF
17154 #line 17154 "configure"
17155 #include "confdefs.h"
17156
17157 /* Override any gcc2 internal prototype to avoid an error.  */
17158 #ifdef __cplusplus
17159 extern "C"
17160 #endif
17161 /* We use char because int might match the return type of a gcc2
17162    builtin and then its argument prototype would still apply.  */
17163 char form_driver ();
17164 int
17165 main (void)
17166 {
17167 form_driver ();
17168   ;
17169   return 0;
17170 }
17171 _ACEOF
17172 rm -f conftest.$ac_objext conftest$ac_exeext
17173 if { (eval echo "$as_me:17173: \"$ac_link\"") >&5
17174   (eval $ac_link) 2>&5
17175   ac_status=$?
17176   echo "$as_me:17176: \$? = $ac_status" >&5
17177   (exit $ac_status); } &&
17178          { ac_try='test -s conftest$ac_exeext'
17179   { (eval echo "$as_me:17179: \"$ac_try\"") >&5
17180   (eval $ac_try) 2>&5
17181   ac_status=$?
17182   echo "$as_me:17182: \$? = $ac_status" >&5
17183   (exit $ac_status); }; }; then
17184   eval "$as_ac_Lib=yes"
17185 else
17186   echo "$as_me: failed program was:" >&5
17187 cat conftest.$ac_ext >&5
17188 eval "$as_ac_Lib=no"
17189 fi
17190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17191 LIBS=$ac_check_lib_save_LIBS
17192 fi
17193 echo "$as_me:17193: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17194 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17195 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17196
17197 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17198
17199 cf_add_libs="$LIBS"
17200 # reverse order
17201 cf_add_0lib=
17202 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17203 # filter duplicates
17204 for cf_add_1lib in $cf_add_0lib; do
17205         for cf_add_2lib in $cf_add_libs; do
17206                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17207                         cf_add_1lib=
17208                         break
17209                 fi
17210         done
17211         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17212 done
17213 LIBS="$cf_add_libs"
17214
17215                 cat >>confdefs.h <<EOF
17216 #define $cf_upper 1
17217 EOF
17218
17219 fi
17220
17221 fi
17222
17223         cf_curses_headers="$cf_curses_headers form.h"
17224 fi
17225
17226 # look for curses-related headers
17227
17228 for ac_header in $cf_curses_headers
17229 do
17230 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17231 echo "$as_me:17231: checking for $ac_header" >&5
17232 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17233 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17234   echo $ECHO_N "(cached) $ECHO_C" >&6
17235 else
17236   cat >conftest.$ac_ext <<_ACEOF
17237 #line 17237 "configure"
17238 #include "confdefs.h"
17239 #include <$ac_header>
17240 _ACEOF
17241 if { (eval echo "$as_me:17241: \"$ac_cpp conftest.$ac_ext\"") >&5
17242   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17243   ac_status=$?
17244   egrep -v '^ *\+' conftest.er1 >conftest.err
17245   rm -f conftest.er1
17246   cat conftest.err >&5
17247   echo "$as_me:17247: \$? = $ac_status" >&5
17248   (exit $ac_status); } >/dev/null; then
17249   if test -s conftest.err; then
17250     ac_cpp_err=$ac_c_preproc_warn_flag
17251   else
17252     ac_cpp_err=
17253   fi
17254 else
17255   ac_cpp_err=yes
17256 fi
17257 if test -z "$ac_cpp_err"; then
17258   eval "$as_ac_Header=yes"
17259 else
17260   echo "$as_me: failed program was:" >&5
17261   cat conftest.$ac_ext >&5
17262   eval "$as_ac_Header=no"
17263 fi
17264 rm -f conftest.err conftest.$ac_ext
17265 fi
17266 echo "$as_me:17266: result: `eval echo '${'$as_ac_Header'}'`" >&5
17267 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17268 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17269   cat >>confdefs.h <<EOF
17270 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17271 EOF
17272
17273 fi
17274 done
17275
17276 echo "$as_me:17276: checking for ANSI C header files" >&5
17277 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17278 if test "${ac_cv_header_stdc+set}" = set; then
17279   echo $ECHO_N "(cached) $ECHO_C" >&6
17280 else
17281   cat >conftest.$ac_ext <<_ACEOF
17282 #line 17282 "configure"
17283 #include "confdefs.h"
17284 #include <stdlib.h>
17285 #include <stdarg.h>
17286 #include <string.h>
17287 #include <float.h>
17288
17289 _ACEOF
17290 if { (eval echo "$as_me:17290: \"$ac_cpp conftest.$ac_ext\"") >&5
17291   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17292   ac_status=$?
17293   egrep -v '^ *\+' conftest.er1 >conftest.err
17294   rm -f conftest.er1
17295   cat conftest.err >&5
17296   echo "$as_me:17296: \$? = $ac_status" >&5
17297   (exit $ac_status); } >/dev/null; then
17298   if test -s conftest.err; then
17299     ac_cpp_err=$ac_c_preproc_warn_flag
17300   else
17301     ac_cpp_err=
17302   fi
17303 else
17304   ac_cpp_err=yes
17305 fi
17306 if test -z "$ac_cpp_err"; then
17307   ac_cv_header_stdc=yes
17308 else
17309   echo "$as_me: failed program was:" >&5
17310   cat conftest.$ac_ext >&5
17311   ac_cv_header_stdc=no
17312 fi
17313 rm -f conftest.err conftest.$ac_ext
17314
17315 if test $ac_cv_header_stdc = yes; then
17316   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17317   cat >conftest.$ac_ext <<_ACEOF
17318 #line 17318 "configure"
17319 #include "confdefs.h"
17320 #include <string.h>
17321
17322 _ACEOF
17323 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17324   egrep "memchr" >/dev/null 2>&1; then
17325   :
17326 else
17327   ac_cv_header_stdc=no
17328 fi
17329 rm -rf conftest*
17330
17331 fi
17332
17333 if test $ac_cv_header_stdc = yes; then
17334   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17335   cat >conftest.$ac_ext <<_ACEOF
17336 #line 17336 "configure"
17337 #include "confdefs.h"
17338 #include <stdlib.h>
17339
17340 _ACEOF
17341 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17342   egrep "free" >/dev/null 2>&1; then
17343   :
17344 else
17345   ac_cv_header_stdc=no
17346 fi
17347 rm -rf conftest*
17348
17349 fi
17350
17351 if test $ac_cv_header_stdc = yes; then
17352   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17353   if test "$cross_compiling" = yes; then
17354   :
17355 else
17356   cat >conftest.$ac_ext <<_ACEOF
17357 #line 17357 "configure"
17358 #include "confdefs.h"
17359 #include <ctype.h>
17360 #if ((' ' & 0x0FF) == 0x020)
17361 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17362 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17363 #else
17364 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17365                      || ('j' <= (c) && (c) <= 'r') \
17366                      || ('s' <= (c) && (c) <= 'z'))
17367 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17368 #endif
17369
17370 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17371 int
17372 main (void)
17373 {
17374   int i;
17375   for (i = 0; i < 256; i++)
17376     if (XOR (islower (i), ISLOWER (i))
17377         || toupper (i) != TOUPPER (i))
17378       $ac_main_return(2);
17379   $ac_main_return (0);
17380 }
17381 _ACEOF
17382 rm -f conftest$ac_exeext
17383 if { (eval echo "$as_me:17383: \"$ac_link\"") >&5
17384   (eval $ac_link) 2>&5
17385   ac_status=$?
17386   echo "$as_me:17386: \$? = $ac_status" >&5
17387   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17388   { (eval echo "$as_me:17388: \"$ac_try\"") >&5
17389   (eval $ac_try) 2>&5
17390   ac_status=$?
17391   echo "$as_me:17391: \$? = $ac_status" >&5
17392   (exit $ac_status); }; }; then
17393   :
17394 else
17395   echo "$as_me: program exited with status $ac_status" >&5
17396 echo "$as_me: failed program was:" >&5
17397 cat conftest.$ac_ext >&5
17398 ac_cv_header_stdc=no
17399 fi
17400 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17401 fi
17402 fi
17403 fi
17404 echo "$as_me:17404: result: $ac_cv_header_stdc" >&5
17405 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17406 if test $ac_cv_header_stdc = yes; then
17407
17408 cat >>confdefs.h <<\EOF
17409 #define STDC_HEADERS 1
17410 EOF
17411
17412 fi
17413
17414 echo "$as_me:17414: checking whether time.h and sys/time.h may both be included" >&5
17415 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17416 if test "${ac_cv_header_time+set}" = set; then
17417   echo $ECHO_N "(cached) $ECHO_C" >&6
17418 else
17419   cat >conftest.$ac_ext <<_ACEOF
17420 #line 17420 "configure"
17421 #include "confdefs.h"
17422 #include <sys/types.h>
17423 #include <sys/time.h>
17424 #include <time.h>
17425
17426 int
17427 main (void)
17428 {
17429 if ((struct tm *) 0)
17430 return 0;
17431   ;
17432   return 0;
17433 }
17434 _ACEOF
17435 rm -f conftest.$ac_objext
17436 if { (eval echo "$as_me:17436: \"$ac_compile\"") >&5
17437   (eval $ac_compile) 2>&5
17438   ac_status=$?
17439   echo "$as_me:17439: \$? = $ac_status" >&5
17440   (exit $ac_status); } &&
17441          { ac_try='test -s conftest.$ac_objext'
17442   { (eval echo "$as_me:17442: \"$ac_try\"") >&5
17443   (eval $ac_try) 2>&5
17444   ac_status=$?
17445   echo "$as_me:17445: \$? = $ac_status" >&5
17446   (exit $ac_status); }; }; then
17447   ac_cv_header_time=yes
17448 else
17449   echo "$as_me: failed program was:" >&5
17450 cat conftest.$ac_ext >&5
17451 ac_cv_header_time=no
17452 fi
17453 rm -f conftest.$ac_objext conftest.$ac_ext
17454 fi
17455 echo "$as_me:17455: result: $ac_cv_header_time" >&5
17456 echo "${ECHO_T}$ac_cv_header_time" >&6
17457 if test $ac_cv_header_time = yes; then
17458
17459 cat >>confdefs.h <<\EOF
17460 #define TIME_WITH_SYS_TIME 1
17461 EOF
17462
17463 fi
17464
17465 for ac_header in \
17466 getopt.h \
17467 locale.h \
17468 math.h \
17469 stdarg.h \
17470 stdint.h \
17471 sys/ioctl.h \
17472 sys/select.h \
17473 sys/time.h \
17474 termios.h \
17475 unistd.h \
17476
17477 do
17478 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17479 echo "$as_me:17479: checking for $ac_header" >&5
17480 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17481 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17482   echo $ECHO_N "(cached) $ECHO_C" >&6
17483 else
17484   cat >conftest.$ac_ext <<_ACEOF
17485 #line 17485 "configure"
17486 #include "confdefs.h"
17487 #include <$ac_header>
17488 _ACEOF
17489 if { (eval echo "$as_me:17489: \"$ac_cpp conftest.$ac_ext\"") >&5
17490   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17491   ac_status=$?
17492   egrep -v '^ *\+' conftest.er1 >conftest.err
17493   rm -f conftest.er1
17494   cat conftest.err >&5
17495   echo "$as_me:17495: \$? = $ac_status" >&5
17496   (exit $ac_status); } >/dev/null; then
17497   if test -s conftest.err; then
17498     ac_cpp_err=$ac_c_preproc_warn_flag
17499   else
17500     ac_cpp_err=
17501   fi
17502 else
17503   ac_cpp_err=yes
17504 fi
17505 if test -z "$ac_cpp_err"; then
17506   eval "$as_ac_Header=yes"
17507 else
17508   echo "$as_me: failed program was:" >&5
17509   cat conftest.$ac_ext >&5
17510   eval "$as_ac_Header=no"
17511 fi
17512 rm -f conftest.err conftest.$ac_ext
17513 fi
17514 echo "$as_me:17514: result: `eval echo '${'$as_ac_Header'}'`" >&5
17515 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17516 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17517   cat >>confdefs.h <<EOF
17518 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17519 EOF
17520
17521 fi
17522 done
17523
17524 for ac_header in unistd.h getopt.h
17525 do
17526 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17527 echo "$as_me:17527: checking for $ac_header" >&5
17528 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17529 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17530   echo $ECHO_N "(cached) $ECHO_C" >&6
17531 else
17532   cat >conftest.$ac_ext <<_ACEOF
17533 #line 17533 "configure"
17534 #include "confdefs.h"
17535 #include <$ac_header>
17536 _ACEOF
17537 if { (eval echo "$as_me:17537: \"$ac_cpp conftest.$ac_ext\"") >&5
17538   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17539   ac_status=$?
17540   egrep -v '^ *\+' conftest.er1 >conftest.err
17541   rm -f conftest.er1
17542   cat conftest.err >&5
17543   echo "$as_me:17543: \$? = $ac_status" >&5
17544   (exit $ac_status); } >/dev/null; then
17545   if test -s conftest.err; then
17546     ac_cpp_err=$ac_c_preproc_warn_flag
17547   else
17548     ac_cpp_err=
17549   fi
17550 else
17551   ac_cpp_err=yes
17552 fi
17553 if test -z "$ac_cpp_err"; then
17554   eval "$as_ac_Header=yes"
17555 else
17556   echo "$as_me: failed program was:" >&5
17557   cat conftest.$ac_ext >&5
17558   eval "$as_ac_Header=no"
17559 fi
17560 rm -f conftest.err conftest.$ac_ext
17561 fi
17562 echo "$as_me:17562: result: `eval echo '${'$as_ac_Header'}'`" >&5
17563 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17564 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17565   cat >>confdefs.h <<EOF
17566 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17567 EOF
17568
17569 fi
17570 done
17571
17572 echo "$as_me:17572: checking for header declaring getopt variables" >&5
17573 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17574 if test "${cf_cv_getopt_header+set}" = set; then
17575   echo $ECHO_N "(cached) $ECHO_C" >&6
17576 else
17577
17578 cf_cv_getopt_header=none
17579 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17580 do
17581 cat >conftest.$ac_ext <<_ACEOF
17582 #line 17582 "configure"
17583 #include "confdefs.h"
17584
17585 #include <$cf_header>
17586 int
17587 main (void)
17588 {
17589 int x = optind; char *y = optarg
17590   ;
17591   return 0;
17592 }
17593 _ACEOF
17594 rm -f conftest.$ac_objext
17595 if { (eval echo "$as_me:17595: \"$ac_compile\"") >&5
17596   (eval $ac_compile) 2>&5
17597   ac_status=$?
17598   echo "$as_me:17598: \$? = $ac_status" >&5
17599   (exit $ac_status); } &&
17600          { ac_try='test -s conftest.$ac_objext'
17601   { (eval echo "$as_me:17601: \"$ac_try\"") >&5
17602   (eval $ac_try) 2>&5
17603   ac_status=$?
17604   echo "$as_me:17604: \$? = $ac_status" >&5
17605   (exit $ac_status); }; }; then
17606   cf_cv_getopt_header=$cf_header
17607  break
17608 else
17609   echo "$as_me: failed program was:" >&5
17610 cat conftest.$ac_ext >&5
17611 fi
17612 rm -f conftest.$ac_objext conftest.$ac_ext
17613 done
17614
17615 fi
17616 echo "$as_me:17616: result: $cf_cv_getopt_header" >&5
17617 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17618 if test $cf_cv_getopt_header != none ; then
17619
17620 cat >>confdefs.h <<\EOF
17621 #define HAVE_GETOPT_HEADER 1
17622 EOF
17623
17624 fi
17625 if test $cf_cv_getopt_header = getopt.h ; then
17626
17627 cat >>confdefs.h <<\EOF
17628 #define NEED_GETOPT_H 1
17629 EOF
17630
17631 fi
17632
17633 for ac_func in \
17634 getopt \
17635 gettimeofday \
17636 snprintf \
17637 strdup \
17638 strstr \
17639 tsearch \
17640
17641 do
17642 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17643 echo "$as_me:17643: checking for $ac_func" >&5
17644 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17645 if eval "test \"\${$as_ac_var+set}\" = set"; then
17646   echo $ECHO_N "(cached) $ECHO_C" >&6
17647 else
17648   cat >conftest.$ac_ext <<_ACEOF
17649 #line 17649 "configure"
17650 #include "confdefs.h"
17651 #define $ac_func autoconf_temporary
17652 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17653 #undef $ac_func
17654
17655 #ifdef __cplusplus
17656 extern "C"
17657 #endif
17658
17659 /* We use char because int might match the return type of a gcc2
17660    builtin and then its argument prototype would still apply.  */
17661 char $ac_func (void);
17662
17663 int
17664 main (void)
17665 {
17666
17667 /* The GNU C library defines stubs for functions which it implements
17668     to always fail with ENOSYS.  Some functions are actually named
17669     something starting with __ and the normal name is an alias.  */
17670 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17671 #error found stub for $ac_func
17672 #endif
17673
17674         return $ac_func ();
17675   ;
17676   return 0;
17677 }
17678 _ACEOF
17679 rm -f conftest.$ac_objext conftest$ac_exeext
17680 if { (eval echo "$as_me:17680: \"$ac_link\"") >&5
17681   (eval $ac_link) 2>&5
17682   ac_status=$?
17683   echo "$as_me:17683: \$? = $ac_status" >&5
17684   (exit $ac_status); } &&
17685          { ac_try='test -s conftest$ac_exeext'
17686   { (eval echo "$as_me:17686: \"$ac_try\"") >&5
17687   (eval $ac_try) 2>&5
17688   ac_status=$?
17689   echo "$as_me:17689: \$? = $ac_status" >&5
17690   (exit $ac_status); }; }; then
17691   eval "$as_ac_var=yes"
17692 else
17693   echo "$as_me: failed program was:" >&5
17694 cat conftest.$ac_ext >&5
17695 eval "$as_ac_var=no"
17696 fi
17697 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17698 fi
17699 echo "$as_me:17699: result: `eval echo '${'$as_ac_var'}'`" >&5
17700 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17701 if test `eval echo '${'$as_ac_var'}'` = yes; then
17702   cat >>confdefs.h <<EOF
17703 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17704 EOF
17705
17706 fi
17707 done
17708
17709 # use a compile-check to work with ncurses*-config and subdirectory includes
17710 echo "$as_me:17710: checking if we can use termcap.h" >&5
17711 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17712 if test "${cf_cv_have_termcap_h+set}" = set; then
17713   echo $ECHO_N "(cached) $ECHO_C" >&6
17714 else
17715
17716         cat >conftest.$ac_ext <<_ACEOF
17717 #line 17717 "configure"
17718 #include "confdefs.h"
17719
17720 #include <curses.h>
17721 #ifdef NCURSES_VERSION
17722 #undef NCURSES_VERSION
17723 #endif
17724 #include <termcap.h>
17725 #ifndef NCURSES_VERSION
17726 #error wrong header
17727 #endif
17728
17729 int
17730 main (void)
17731 {
17732 return 0;
17733   ;
17734   return 0;
17735 }
17736 _ACEOF
17737 rm -f conftest.$ac_objext
17738 if { (eval echo "$as_me:17738: \"$ac_compile\"") >&5
17739   (eval $ac_compile) 2>&5
17740   ac_status=$?
17741   echo "$as_me:17741: \$? = $ac_status" >&5
17742   (exit $ac_status); } &&
17743          { ac_try='test -s conftest.$ac_objext'
17744   { (eval echo "$as_me:17744: \"$ac_try\"") >&5
17745   (eval $ac_try) 2>&5
17746   ac_status=$?
17747   echo "$as_me:17747: \$? = $ac_status" >&5
17748   (exit $ac_status); }; }; then
17749   cf_cv_have_termcap_h=yes
17750 else
17751   echo "$as_me: failed program was:" >&5
17752 cat conftest.$ac_ext >&5
17753 cf_cv_have_termcap_h=no
17754 fi
17755 rm -f conftest.$ac_objext conftest.$ac_ext
17756 fi
17757 echo "$as_me:17757: result: $cf_cv_have_termcap_h" >&5
17758 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17759 if test "x$cf_cv_have_termcap_h" = xyes
17760 then
17761
17762 cat >>confdefs.h <<\EOF
17763 #define HAVE_TERMCAP_H 1
17764 EOF
17765
17766 else
17767 echo "$as_me:17767: checking if we can use ncurses/termcap.h" >&5
17768 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17769 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17770   echo $ECHO_N "(cached) $ECHO_C" >&6
17771 else
17772
17773         cat >conftest.$ac_ext <<_ACEOF
17774 #line 17774 "configure"
17775 #include "confdefs.h"
17776
17777 #include <ncurses/curses.h>
17778 #ifdef NCURSES_VERSION
17779 #undef NCURSES_VERSION
17780 #endif
17781 #include <ncurses/termcap.h>
17782 #ifndef NCURSES_VERSION
17783 #error wrong header
17784 #endif
17785
17786 int
17787 main (void)
17788 {
17789 return 0;
17790   ;
17791   return 0;
17792 }
17793 _ACEOF
17794 rm -f conftest.$ac_objext
17795 if { (eval echo "$as_me:17795: \"$ac_compile\"") >&5
17796   (eval $ac_compile) 2>&5
17797   ac_status=$?
17798   echo "$as_me:17798: \$? = $ac_status" >&5
17799   (exit $ac_status); } &&
17800          { ac_try='test -s conftest.$ac_objext'
17801   { (eval echo "$as_me:17801: \"$ac_try\"") >&5
17802   (eval $ac_try) 2>&5
17803   ac_status=$?
17804   echo "$as_me:17804: \$? = $ac_status" >&5
17805   (exit $ac_status); }; }; then
17806   cf_cv_have_ncurses_termcap_h=yes
17807 else
17808   echo "$as_me: failed program was:" >&5
17809 cat conftest.$ac_ext >&5
17810 cf_cv_have_ncurses_termcap_h=no
17811 fi
17812 rm -f conftest.$ac_objext conftest.$ac_ext
17813 fi
17814 echo "$as_me:17814: result: $cf_cv_have_ncurses_termcap_h" >&5
17815 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17816 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17817 cat >>confdefs.h <<\EOF
17818 #define HAVE_NCURSES_TERMCAP_H 1
17819 EOF
17820
17821 fi
17822
17823 if test "x$ac_cv_func_getopt" = xno; then
17824         { { echo "$as_me:17824: error: getopt is required for building programs" >&5
17825 echo "$as_me: error: getopt is required for building programs" >&2;}
17826    { (exit 1); exit 1; }; }
17827 fi
17828
17829 if test "$cf_enable_widec" = yes; then
17830
17831 for ac_func in \
17832 mblen \
17833 mbrlen \
17834 mbrtowc \
17835 mbsrtowcs \
17836 mbstowcs \
17837 mbtowc \
17838 wcsrtombs \
17839 wcstombs \
17840
17841 do
17842 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17843 echo "$as_me:17843: checking for $ac_func" >&5
17844 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17845 if eval "test \"\${$as_ac_var+set}\" = set"; then
17846   echo $ECHO_N "(cached) $ECHO_C" >&6
17847 else
17848   cat >conftest.$ac_ext <<_ACEOF
17849 #line 17849 "configure"
17850 #include "confdefs.h"
17851 #define $ac_func autoconf_temporary
17852 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17853 #undef $ac_func
17854
17855 #ifdef __cplusplus
17856 extern "C"
17857 #endif
17858
17859 /* We use char because int might match the return type of a gcc2
17860    builtin and then its argument prototype would still apply.  */
17861 char $ac_func (void);
17862
17863 int
17864 main (void)
17865 {
17866
17867 /* The GNU C library defines stubs for functions which it implements
17868     to always fail with ENOSYS.  Some functions are actually named
17869     something starting with __ and the normal name is an alias.  */
17870 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17871 #error found stub for $ac_func
17872 #endif
17873
17874         return $ac_func ();
17875   ;
17876   return 0;
17877 }
17878 _ACEOF
17879 rm -f conftest.$ac_objext conftest$ac_exeext
17880 if { (eval echo "$as_me:17880: \"$ac_link\"") >&5
17881   (eval $ac_link) 2>&5
17882   ac_status=$?
17883   echo "$as_me:17883: \$? = $ac_status" >&5
17884   (exit $ac_status); } &&
17885          { ac_try='test -s conftest$ac_exeext'
17886   { (eval echo "$as_me:17886: \"$ac_try\"") >&5
17887   (eval $ac_try) 2>&5
17888   ac_status=$?
17889   echo "$as_me:17889: \$? = $ac_status" >&5
17890   (exit $ac_status); }; }; then
17891   eval "$as_ac_var=yes"
17892 else
17893   echo "$as_me: failed program was:" >&5
17894 cat conftest.$ac_ext >&5
17895 eval "$as_ac_var=no"
17896 fi
17897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17898 fi
17899 echo "$as_me:17899: result: `eval echo '${'$as_ac_var'}'`" >&5
17900 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17901 if test `eval echo '${'$as_ac_var'}'` = yes; then
17902   cat >>confdefs.h <<EOF
17903 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17904 EOF
17905
17906 fi
17907 done
17908
17909 fi
17910
17911 echo "$as_me:17911: checking definition to turn on extended curses functions" >&5
17912 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17913 if test "${cf_cv_need_xopen_extension+set}" = set; then
17914   echo $ECHO_N "(cached) $ECHO_C" >&6
17915 else
17916
17917 cf_cv_need_xopen_extension=unknown
17918 cat >conftest.$ac_ext <<_ACEOF
17919 #line 17919 "configure"
17920 #include "confdefs.h"
17921
17922 #include <stdlib.h>
17923 #include <${cf_cv_ncurses_header:-curses.h}>
17924 int
17925 main (void)
17926 {
17927
17928 #if defined(NCURSES_VERSION_PATCH)
17929 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17930         make an error
17931 #endif
17932 #endif
17933 #ifdef NCURSES_VERSION
17934         cchar_t check;
17935         int check2 = curs_set((int)sizeof(check));
17936 #endif
17937         long x = winnstr(stdscr, "", 0);
17938         int x1, y1;
17939 #ifdef NCURSES_VERSION
17940         (void)check2;
17941 #endif
17942         getbegyx(stdscr, y1, x1);
17943         (void)x;
17944         (void)y1;
17945         (void)x1;
17946
17947   ;
17948   return 0;
17949 }
17950 _ACEOF
17951 rm -f conftest.$ac_objext conftest$ac_exeext
17952 if { (eval echo "$as_me:17952: \"$ac_link\"") >&5
17953   (eval $ac_link) 2>&5
17954   ac_status=$?
17955   echo "$as_me:17955: \$? = $ac_status" >&5
17956   (exit $ac_status); } &&
17957          { ac_try='test -s conftest$ac_exeext'
17958   { (eval echo "$as_me:17958: \"$ac_try\"") >&5
17959   (eval $ac_try) 2>&5
17960   ac_status=$?
17961   echo "$as_me:17961: \$? = $ac_status" >&5
17962   (exit $ac_status); }; }; then
17963   cf_cv_need_xopen_extension=none
17964 else
17965   echo "$as_me: failed program was:" >&5
17966 cat conftest.$ac_ext >&5
17967
17968         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17969         do
17970                 cat >conftest.$ac_ext <<_ACEOF
17971 #line 17971 "configure"
17972 #include "confdefs.h"
17973
17974 #define $cf_try_xopen_extension 1
17975 #include <stdlib.h>
17976 #include <${cf_cv_ncurses_header:-curses.h}>
17977 int
17978 main (void)
17979 {
17980
17981 #ifdef NCURSES_VERSION
17982                 cchar_t check;
17983                 int check2 = curs_set((int)sizeof(check));
17984 #endif
17985                 long x = winnstr(stdscr, "", 0);
17986                 int x1, y1;
17987                 getbegyx(stdscr, y1, x1);
17988 #ifdef NCURSES_VERSION
17989                 (void)check2;
17990 #endif
17991                 (void)x;
17992                 (void)y1;
17993                 (void)x1;
17994
17995   ;
17996   return 0;
17997 }
17998 _ACEOF
17999 rm -f conftest.$ac_objext conftest$ac_exeext
18000 if { (eval echo "$as_me:18000: \"$ac_link\"") >&5
18001   (eval $ac_link) 2>&5
18002   ac_status=$?
18003   echo "$as_me:18003: \$? = $ac_status" >&5
18004   (exit $ac_status); } &&
18005          { ac_try='test -s conftest$ac_exeext'
18006   { (eval echo "$as_me:18006: \"$ac_try\"") >&5
18007   (eval $ac_try) 2>&5
18008   ac_status=$?
18009   echo "$as_me:18009: \$? = $ac_status" >&5
18010   (exit $ac_status); }; }; then
18011   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18012 else
18013   echo "$as_me: failed program was:" >&5
18014 cat conftest.$ac_ext >&5
18015 fi
18016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18017         done
18018
18019 fi
18020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18021
18022 fi
18023 echo "$as_me:18023: result: $cf_cv_need_xopen_extension" >&5
18024 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18025
18026 case $cf_cv_need_xopen_extension in
18027 (*_*)
18028
18029         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18030         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18031
18032         ;;
18033 esac
18034
18035 echo "$as_me:18035: checking for term.h" >&5
18036 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18037 if test "${cf_cv_term_header+set}" = set; then
18038   echo $ECHO_N "(cached) $ECHO_C" >&6
18039 else
18040
18041 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18042 # for <term.h> if we do not find the variant.
18043
18044 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18045
18046 case ${cf_cv_ncurses_header:-curses.h} in
18047 (*/*)
18048         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18049         cf_header_list="$cf_header_item $cf_header_list"
18050         ;;
18051 esac
18052
18053 for cf_header in $cf_header_list
18054 do
18055         cat >conftest.$ac_ext <<_ACEOF
18056 #line 18056 "configure"
18057 #include "confdefs.h"
18058
18059 #include <${cf_cv_ncurses_header:-curses.h}>
18060 #include <${cf_header}>
18061 int
18062 main (void)
18063 {
18064 WINDOW *x; (void)x
18065   ;
18066   return 0;
18067 }
18068 _ACEOF
18069 rm -f conftest.$ac_objext
18070 if { (eval echo "$as_me:18070: \"$ac_compile\"") >&5
18071   (eval $ac_compile) 2>&5
18072   ac_status=$?
18073   echo "$as_me:18073: \$? = $ac_status" >&5
18074   (exit $ac_status); } &&
18075          { ac_try='test -s conftest.$ac_objext'
18076   { (eval echo "$as_me:18076: \"$ac_try\"") >&5
18077   (eval $ac_try) 2>&5
18078   ac_status=$?
18079   echo "$as_me:18079: \$? = $ac_status" >&5
18080   (exit $ac_status); }; }; then
18081   cf_cv_term_header=$cf_header
18082          break
18083 else
18084   echo "$as_me: failed program was:" >&5
18085 cat conftest.$ac_ext >&5
18086 cf_cv_term_header=no
18087 fi
18088 rm -f conftest.$ac_objext conftest.$ac_ext
18089 done
18090
18091 case $cf_cv_term_header in
18092 (no)
18093         # If curses is ncurses, some packagers still mess it up by trying to make
18094         # us use GNU termcap.  This handles the most common case.
18095         for cf_header in ncurses/term.h ncursesw/term.h
18096         do
18097                 cat >conftest.$ac_ext <<_ACEOF
18098 #line 18098 "configure"
18099 #include "confdefs.h"
18100
18101 #include <${cf_cv_ncurses_header:-curses.h}>
18102 #ifdef NCURSES_VERSION
18103 #include <${cf_header}>
18104 #else
18105 make an error
18106 #endif
18107 int
18108 main (void)
18109 {
18110 WINDOW *x; (void)x
18111   ;
18112   return 0;
18113 }
18114 _ACEOF
18115 rm -f conftest.$ac_objext
18116 if { (eval echo "$as_me:18116: \"$ac_compile\"") >&5
18117   (eval $ac_compile) 2>&5
18118   ac_status=$?
18119   echo "$as_me:18119: \$? = $ac_status" >&5
18120   (exit $ac_status); } &&
18121          { ac_try='test -s conftest.$ac_objext'
18122   { (eval echo "$as_me:18122: \"$ac_try\"") >&5
18123   (eval $ac_try) 2>&5
18124   ac_status=$?
18125   echo "$as_me:18125: \$? = $ac_status" >&5
18126   (exit $ac_status); }; }; then
18127   cf_cv_term_header=$cf_header
18128                          break
18129 else
18130   echo "$as_me: failed program was:" >&5
18131 cat conftest.$ac_ext >&5
18132 cf_cv_term_header=no
18133 fi
18134 rm -f conftest.$ac_objext conftest.$ac_ext
18135         done
18136         ;;
18137 esac
18138
18139 fi
18140 echo "$as_me:18140: result: $cf_cv_term_header" >&5
18141 echo "${ECHO_T}$cf_cv_term_header" >&6
18142
18143 case $cf_cv_term_header in
18144 (term.h)
18145
18146 cat >>confdefs.h <<\EOF
18147 #define HAVE_TERM_H 1
18148 EOF
18149
18150         ;;
18151 (ncurses/term.h)
18152
18153 cat >>confdefs.h <<\EOF
18154 #define HAVE_NCURSES_TERM_H 1
18155 EOF
18156
18157         ;;
18158 (ncursesw/term.h)
18159
18160 cat >>confdefs.h <<\EOF
18161 #define HAVE_NCURSESW_TERM_H 1
18162 EOF
18163
18164         ;;
18165 esac
18166
18167 echo "$as_me:18167: checking for unctrl.h" >&5
18168 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18169 if test "${cf_cv_unctrl_header+set}" = set; then
18170   echo $ECHO_N "(cached) $ECHO_C" >&6
18171 else
18172
18173 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18174 # for <unctrl.h> if we do not find the variant.
18175
18176 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18177
18178 case ${cf_cv_ncurses_header:-curses.h} in
18179 (*/*)
18180         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18181         cf_header_list="$cf_header_item $cf_header_list"
18182         ;;
18183 esac
18184
18185 for cf_header in $cf_header_list
18186 do
18187         cat >conftest.$ac_ext <<_ACEOF
18188 #line 18188 "configure"
18189 #include "confdefs.h"
18190
18191 #include <${cf_cv_ncurses_header:-curses.h}>
18192 #include <${cf_header}>
18193 int
18194 main (void)
18195 {
18196 WINDOW *x; (void)x
18197   ;
18198   return 0;
18199 }
18200 _ACEOF
18201 rm -f conftest.$ac_objext
18202 if { (eval echo "$as_me:18202: \"$ac_compile\"") >&5
18203   (eval $ac_compile) 2>&5
18204   ac_status=$?
18205   echo "$as_me:18205: \$? = $ac_status" >&5
18206   (exit $ac_status); } &&
18207          { ac_try='test -s conftest.$ac_objext'
18208   { (eval echo "$as_me:18208: \"$ac_try\"") >&5
18209   (eval $ac_try) 2>&5
18210   ac_status=$?
18211   echo "$as_me:18211: \$? = $ac_status" >&5
18212   (exit $ac_status); }; }; then
18213   cf_cv_unctrl_header=$cf_header
18214          break
18215 else
18216   echo "$as_me: failed program was:" >&5
18217 cat conftest.$ac_ext >&5
18218 cf_cv_unctrl_header=no
18219 fi
18220 rm -f conftest.$ac_objext conftest.$ac_ext
18221 done
18222
18223 fi
18224 echo "$as_me:18224: result: $cf_cv_unctrl_header" >&5
18225 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18226
18227 case $cf_cv_unctrl_header in
18228 (no)
18229         { echo "$as_me:18229: WARNING: unctrl.h header not found" >&5
18230 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18231         ;;
18232 esac
18233
18234 case $cf_cv_unctrl_header in
18235 (unctrl.h)
18236
18237 cat >>confdefs.h <<\EOF
18238 #define HAVE_UNCTRL_H 1
18239 EOF
18240
18241         ;;
18242 (ncurses/unctrl.h)
18243
18244 cat >>confdefs.h <<\EOF
18245 #define HAVE_NCURSES_UNCTRL_H 1
18246 EOF
18247
18248         ;;
18249 (ncursesw/unctrl.h)
18250
18251 cat >>confdefs.h <<\EOF
18252 #define HAVE_NCURSESW_UNCTRL_H 1
18253 EOF
18254
18255         ;;
18256 esac
18257
18258 for cf_func in \
18259 alloc_pair \
18260 assume_default_colors \
18261 chgat \
18262 color_content \
18263 color_set \
18264 copywin \
18265 delscreen \
18266 dupwin \
18267 exit_curses \
18268 exit_terminfo \
18269 filter \
18270 getbegx \
18271 getcurx \
18272 getmaxx \
18273 getnstr \
18274 getparx \
18275 getwin \
18276 halfdelay \
18277 init_extended_color \
18278 mvderwin \
18279 mvvline \
18280 mvwin \
18281 mvwvline \
18282 napms \
18283 newpad \
18284 putwin \
18285 reset_color_pairs \
18286 resize_term \
18287 resizeterm \
18288 restartterm \
18289 ripoffline \
18290 scr_dump \
18291 setupterm \
18292 slk_color \
18293 slk_init \
18294 termattrs \
18295 termname \
18296 tgetent \
18297 tigetnum \
18298 tigetstr \
18299 tputs_sp \
18300 typeahead \
18301 use_default_colors \
18302 use_env \
18303 use_extended_names \
18304 use_screen \
18305 use_window \
18306 vid_puts \
18307 vidputs \
18308 vsscanf \
18309 vw_printw \
18310 wchgat \
18311 winsdelln \
18312 winsstr \
18313 wresize \
18314 wsyncdown \
18315 _tracef \
18316
18317 do
18318
18319 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18320
18321         echo "$as_me:18321: checking for ${cf_func}" >&5
18322 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18323
18324 echo "${as_me:-configure}:18324: testing ${cf_func} ..." 1>&5
18325
18326         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18327   echo $ECHO_N "(cached) $ECHO_C" >&6
18328 else
18329
18330                 eval cf_result='$ac_cv_func_'$cf_func
18331                 if test ".$cf_result" != ".no"; then
18332                         cat >conftest.$ac_ext <<_ACEOF
18333 #line 18333 "configure"
18334 #include "confdefs.h"
18335
18336 #ifdef HAVE_XCURSES
18337 #include <xcurses.h>
18338 char * XCursesProgramName = "test";
18339 #else
18340 #include <${cf_cv_ncurses_header:-curses.h}>
18341 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18342 #include <ncursesw/term.h>
18343 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18344 #include <ncurses/term.h>
18345 #elif defined(HAVE_TERM_H)
18346 #include <term.h>
18347 #endif
18348 #endif
18349
18350 int
18351 main (void)
18352 {
18353
18354 #ifndef ${cf_func}
18355 long foo = (long)(&${cf_func});
18356 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18357 if (foo + 1234L > 5678L)
18358         ${cf_cv_main_return:-return}(foo != 0);
18359 #endif
18360
18361   ;
18362   return 0;
18363 }
18364 _ACEOF
18365 rm -f conftest.$ac_objext conftest$ac_exeext
18366 if { (eval echo "$as_me:18366: \"$ac_link\"") >&5
18367   (eval $ac_link) 2>&5
18368   ac_status=$?
18369   echo "$as_me:18369: \$? = $ac_status" >&5
18370   (exit $ac_status); } &&
18371          { ac_try='test -s conftest$ac_exeext'
18372   { (eval echo "$as_me:18372: \"$ac_try\"") >&5
18373   (eval $ac_try) 2>&5
18374   ac_status=$?
18375   echo "$as_me:18375: \$? = $ac_status" >&5
18376   (exit $ac_status); }; }; then
18377   cf_result=yes
18378 else
18379   echo "$as_me: failed program was:" >&5
18380 cat conftest.$ac_ext >&5
18381 cf_result=no
18382 fi
18383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18384                 fi
18385                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18386
18387 fi
18388
18389         # use the computed/retrieved cache-value:
18390         eval 'cf_result=$cf_cv_func_'$cf_func
18391         echo "$as_me:18391: result: $cf_result" >&5
18392 echo "${ECHO_T}$cf_result" >&6
18393         if test $cf_result != no; then
18394                 cat >>confdefs.h <<EOF
18395 #define HAVE_${cf_tr_func} 1
18396 EOF
18397
18398         fi
18399 done
18400
18401 for cf_func in tputs
18402 do
18403
18404 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18405
18406         echo "$as_me:18406: checking for ${cf_func}" >&5
18407 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18408
18409 echo "${as_me:-configure}:18409: testing ${cf_func} ..." 1>&5
18410
18411         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18412   echo $ECHO_N "(cached) $ECHO_C" >&6
18413 else
18414
18415                 eval cf_result='$ac_cv_func_'$cf_func
18416                 if test ".$cf_result" != ".no"; then
18417                         cat >conftest.$ac_ext <<_ACEOF
18418 #line 18418 "configure"
18419 #include "confdefs.h"
18420
18421 #ifdef HAVE_XCURSES
18422 #include <xcurses.h>
18423 char * XCursesProgramName = "test";
18424 #else
18425 #include <${cf_cv_ncurses_header:-curses.h}>
18426 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18427 #include <ncursesw/term.h>
18428 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18429 #include <ncurses/term.h>
18430 #elif defined(HAVE_TERM_H)
18431 #include <term.h>
18432 #endif
18433 #endif
18434
18435 int
18436 main (void)
18437 {
18438
18439 #ifndef ${cf_func}
18440 long foo = (long)(&${cf_func});
18441 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18442 if (foo + 1234L > 5678L)
18443         ${cf_cv_main_return:-return}(foo != 0);
18444 #endif
18445
18446   ;
18447   return 0;
18448 }
18449 _ACEOF
18450 rm -f conftest.$ac_objext conftest$ac_exeext
18451 if { (eval echo "$as_me:18451: \"$ac_link\"") >&5
18452   (eval $ac_link) 2>&5
18453   ac_status=$?
18454   echo "$as_me:18454: \$? = $ac_status" >&5
18455   (exit $ac_status); } &&
18456          { ac_try='test -s conftest$ac_exeext'
18457   { (eval echo "$as_me:18457: \"$ac_try\"") >&5
18458   (eval $ac_try) 2>&5
18459   ac_status=$?
18460   echo "$as_me:18460: \$? = $ac_status" >&5
18461   (exit $ac_status); }; }; then
18462   cf_result=yes
18463 else
18464   echo "$as_me: failed program was:" >&5
18465 cat conftest.$ac_ext >&5
18466 cf_result=no
18467 fi
18468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18469                 fi
18470                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18471
18472 fi
18473
18474         # use the computed/retrieved cache-value:
18475         eval 'cf_result=$cf_cv_func_'$cf_func
18476         echo "$as_me:18476: result: $cf_result" >&5
18477 echo "${ECHO_T}$cf_result" >&6
18478         if test $cf_result != no; then
18479                 cat >>confdefs.h <<EOF
18480 #define HAVE_${cf_tr_func} 1
18481 EOF
18482
18483         fi
18484 done
18485
18486 if test x$cf_cv_func_tputs = xyes
18487 then
18488         cf_done=no
18489         for cf_arg in int char
18490         do
18491                 for cf_ret in int void
18492                 do
18493                         if test $cf_ret = void
18494                         then
18495                                 cf_return="/* nothing */"
18496                         else
18497                                 cf_return="return value"
18498                         fi
18499                         cat >conftest.$ac_ext <<_ACEOF
18500 #line 18500 "configure"
18501 #include "confdefs.h"
18502
18503 #include <${cf_cv_ncurses_header:-curses.h}>
18504 #include <$cf_cv_term_header>
18505
18506 static $cf_ret outc($cf_arg value) { $cf_return; }
18507
18508 int
18509 main (void)
18510 {
18511
18512         tputs("hello", 0, outc);
18513         ${cf_cv_main_return:-return}(0);
18514
18515   ;
18516   return 0;
18517 }
18518 _ACEOF
18519 rm -f conftest.$ac_objext
18520 if { (eval echo "$as_me:18520: \"$ac_compile\"") >&5
18521   (eval $ac_compile) 2>&5
18522   ac_status=$?
18523   echo "$as_me:18523: \$? = $ac_status" >&5
18524   (exit $ac_status); } &&
18525          { ac_try='test -s conftest.$ac_objext'
18526   { (eval echo "$as_me:18526: \"$ac_try\"") >&5
18527   (eval $ac_try) 2>&5
18528   ac_status=$?
18529   echo "$as_me:18529: \$? = $ac_status" >&5
18530   (exit $ac_status); }; }; then
18531
18532                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18533
18534 echo "${as_me:-configure}:18534: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18535
18536                 cat >>confdefs.h <<EOF
18537 #define TPUTS_ARG               $cf_arg
18538 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18539 #define TPUTS_RETURN(value)     $cf_return
18540 EOF
18541                 cf_done=yes
18542                 break
18543
18544 else
18545   echo "$as_me: failed program was:" >&5
18546 cat conftest.$ac_ext >&5
18547 fi
18548 rm -f conftest.$ac_objext conftest.$ac_ext
18549                 done
18550                 test $cf_done = yes && break
18551         done
18552 fi
18553
18554 echo "$as_me:18554: checking for ncurses extended functions" >&5
18555 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18556 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18557   echo $ECHO_N "(cached) $ECHO_C" >&6
18558 else
18559
18560 cat >conftest.$ac_ext <<_ACEOF
18561 #line 18561 "configure"
18562 #include "confdefs.h"
18563
18564 #include <${cf_cv_ncurses_header:-curses.h}>
18565 int
18566 main (void)
18567 {
18568
18569 int x = NCURSES_EXT_FUNCS
18570
18571   ;
18572   return 0;
18573 }
18574 _ACEOF
18575 rm -f conftest.$ac_objext
18576 if { (eval echo "$as_me:18576: \"$ac_compile\"") >&5
18577   (eval $ac_compile) 2>&5
18578   ac_status=$?
18579   echo "$as_me:18579: \$? = $ac_status" >&5
18580   (exit $ac_status); } &&
18581          { ac_try='test -s conftest.$ac_objext'
18582   { (eval echo "$as_me:18582: \"$ac_try\"") >&5
18583   (eval $ac_try) 2>&5
18584   ac_status=$?
18585   echo "$as_me:18585: \$? = $ac_status" >&5
18586   (exit $ac_status); }; }; then
18587   cf_cv_ncurses_ext_funcs=defined
18588 else
18589   echo "$as_me: failed program was:" >&5
18590 cat conftest.$ac_ext >&5
18591
18592 cat >conftest.$ac_ext <<_ACEOF
18593 #line 18593 "configure"
18594 #include "confdefs.h"
18595
18596 #include <${cf_cv_ncurses_header:-curses.h}>
18597 int
18598 main (void)
18599 {
18600
18601         (void) assume_default_colors (0, 0);
18602         (void) curses_version ();
18603         (void) define_key (0, 0);
18604         (void) is_term_resized (0, 0);
18605         (void) key_defined (0);
18606         (void) keybound (0, 0);
18607         (void) keyok (0, 0);
18608         (void) resize_term (0, 0);
18609         (void) resizeterm (0, 0);
18610         (void) use_default_colors ();
18611         (void) use_extended_names (0);
18612         (void) wresize (0, 0, 0);
18613   ;
18614   return 0;
18615 }
18616 _ACEOF
18617 rm -f conftest.$ac_objext conftest$ac_exeext
18618 if { (eval echo "$as_me:18618: \"$ac_link\"") >&5
18619   (eval $ac_link) 2>&5
18620   ac_status=$?
18621   echo "$as_me:18621: \$? = $ac_status" >&5
18622   (exit $ac_status); } &&
18623          { ac_try='test -s conftest$ac_exeext'
18624   { (eval echo "$as_me:18624: \"$ac_try\"") >&5
18625   (eval $ac_try) 2>&5
18626   ac_status=$?
18627   echo "$as_me:18627: \$? = $ac_status" >&5
18628   (exit $ac_status); }; }; then
18629   cf_cv_ncurses_ext_funcs=yes
18630 else
18631   echo "$as_me: failed program was:" >&5
18632 cat conftest.$ac_ext >&5
18633 cf_cv_ncurses_ext_funcs=no
18634 fi
18635 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18636
18637 fi
18638 rm -f conftest.$ac_objext conftest.$ac_ext
18639
18640 fi
18641 echo "$as_me:18641: result: $cf_cv_ncurses_ext_funcs" >&5
18642 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18643 test "$cf_cv_ncurses_ext_funcs" = yes &&
18644 cat >>confdefs.h <<\EOF
18645 #define NCURSES_EXT_FUNCS 1
18646 EOF
18647
18648 if test "$cf_enable_widec" = yes
18649 then
18650         # workaround for systems with ncurses before 20111029, due to change of
18651         # feature test macro from _XPG5 to _XOPEN_SOURCE
18652         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18653         then
18654                 cf_define_xpg5=no
18655                 echo "$as_me:18655: checking if _XPG5 should be defined to enable wide-characters" >&5
18656 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18657
18658                 cat >conftest.$ac_ext <<_ACEOF
18659 #line 18659 "configure"
18660 #include "confdefs.h"
18661
18662 #include <${cf_cv_ncurses_header:-curses.h}>
18663 int
18664 main (void)
18665 {
18666 int x = _XPG5
18667   ;
18668   return 0;
18669 }
18670 _ACEOF
18671 rm -f conftest.$ac_objext
18672 if { (eval echo "$as_me:18672: \"$ac_compile\"") >&5
18673   (eval $ac_compile) 2>&5
18674   ac_status=$?
18675   echo "$as_me:18675: \$? = $ac_status" >&5
18676   (exit $ac_status); } &&
18677          { ac_try='test -s conftest.$ac_objext'
18678   { (eval echo "$as_me:18678: \"$ac_try\"") >&5
18679   (eval $ac_try) 2>&5
18680   ac_status=$?
18681   echo "$as_me:18681: \$? = $ac_status" >&5
18682   (exit $ac_status); }; }; then
18683   :
18684 else
18685   echo "$as_me: failed program was:" >&5
18686 cat conftest.$ac_ext >&5
18687 cf_save_cppflags="$CPPFLAGS"
18688                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18689                          cat >conftest.$ac_ext <<_ACEOF
18690 #line 18690 "configure"
18691 #include "confdefs.h"
18692
18693 #include <${cf_cv_ncurses_header:-curses.h}>
18694 int
18695 main (void)
18696 {
18697 int x = _XPG5
18698   ;
18699   return 0;
18700 }
18701 _ACEOF
18702 rm -f conftest.$ac_objext
18703 if { (eval echo "$as_me:18703: \"$ac_compile\"") >&5
18704   (eval $ac_compile) 2>&5
18705   ac_status=$?
18706   echo "$as_me:18706: \$? = $ac_status" >&5
18707   (exit $ac_status); } &&
18708          { ac_try='test -s conftest.$ac_objext'
18709   { (eval echo "$as_me:18709: \"$ac_try\"") >&5
18710   (eval $ac_try) 2>&5
18711   ac_status=$?
18712   echo "$as_me:18712: \$? = $ac_status" >&5
18713   (exit $ac_status); }; }; then
18714   cf_define_xpg5=yes
18715 else
18716   echo "$as_me: failed program was:" >&5
18717 cat conftest.$ac_ext >&5
18718 fi
18719 rm -f conftest.$ac_objext conftest.$ac_ext
18720                          CPPFLAGS="$cf_save_cppflags"
18721 fi
18722 rm -f conftest.$ac_objext conftest.$ac_ext
18723                 echo "$as_me:18723: result: $cf_define_xpg5" >&5
18724 echo "${ECHO_T}$cf_define_xpg5" >&6
18725
18726                 if test "$cf_define_xpg5" = yes
18727                 then
18728                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18729                 fi
18730         fi
18731
18732         echo "$as_me:18732: checking for wide-character functions" >&5
18733 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18734 if test "${cf_cv_widechar_funcs+set}" = set; then
18735   echo $ECHO_N "(cached) $ECHO_C" >&6
18736 else
18737
18738         cat >conftest.$ac_ext <<_ACEOF
18739 #line 18739 "configure"
18740 #include "confdefs.h"
18741
18742 #include <${cf_cv_ncurses_header:-curses.h}>
18743 int
18744 main (void)
18745 {
18746
18747                 static wchar_t src_wchar[2];
18748                 static cchar_t dst_cchar;
18749                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18750
18751   ;
18752   return 0;
18753 }
18754 _ACEOF
18755 rm -f conftest.$ac_objext conftest$ac_exeext
18756 if { (eval echo "$as_me:18756: \"$ac_link\"") >&5
18757   (eval $ac_link) 2>&5
18758   ac_status=$?
18759   echo "$as_me:18759: \$? = $ac_status" >&5
18760   (exit $ac_status); } &&
18761          { ac_try='test -s conftest$ac_exeext'
18762   { (eval echo "$as_me:18762: \"$ac_try\"") >&5
18763   (eval $ac_try) 2>&5
18764   ac_status=$?
18765   echo "$as_me:18765: \$? = $ac_status" >&5
18766   (exit $ac_status); }; }; then
18767   cf_cv_widechar_funcs=yes
18768 else
18769   echo "$as_me: failed program was:" >&5
18770 cat conftest.$ac_ext >&5
18771 cf_cv_widechar_funcs=no
18772 fi
18773 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18774
18775 fi
18776 echo "$as_me:18776: result: $cf_cv_widechar_funcs" >&5
18777 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18778         if test "$cf_cv_widechar_funcs" != no ; then
18779
18780 cat >>confdefs.h <<\EOF
18781 #define USE_WIDEC_SUPPORT 1
18782 EOF
18783
18784         else
18785                 cat >>confdefs.h <<\EOF
18786 #define USE_WIDEC_SUPPORT 0
18787 EOF
18788
18789         fi
18790 else
18791         cat >>confdefs.h <<\EOF
18792 #define USE_WIDEC_SUPPORT 0
18793 EOF
18794
18795 fi
18796
18797 echo "$as_me:18797: checking if $cf_cv_screen library uses pthreads" >&5
18798 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18799 if test "${cf_cv_use_pthreads+set}" = set; then
18800   echo $ECHO_N "(cached) $ECHO_C" >&6
18801 else
18802
18803 cat >conftest.$ac_ext <<_ACEOF
18804 #line 18804 "configure"
18805 #include "confdefs.h"
18806
18807 #include <${cf_cv_ncurses_header:-curses.h}>
18808 extern void _nc_init_pthreads(void);
18809
18810 int
18811 main (void)
18812 {
18813
18814         initscr();
18815         _nc_init_pthreads();
18816
18817   ;
18818   return 0;
18819 }
18820 _ACEOF
18821 rm -f conftest.$ac_objext conftest$ac_exeext
18822 if { (eval echo "$as_me:18822: \"$ac_link\"") >&5
18823   (eval $ac_link) 2>&5
18824   ac_status=$?
18825   echo "$as_me:18825: \$? = $ac_status" >&5
18826   (exit $ac_status); } &&
18827          { ac_try='test -s conftest$ac_exeext'
18828   { (eval echo "$as_me:18828: \"$ac_try\"") >&5
18829   (eval $ac_try) 2>&5
18830   ac_status=$?
18831   echo "$as_me:18831: \$? = $ac_status" >&5
18832   (exit $ac_status); }; }; then
18833   cf_cv_use_pthreads=yes
18834 else
18835   echo "$as_me: failed program was:" >&5
18836 cat conftest.$ac_ext >&5
18837 cf_cv_use_pthreads=no
18838 fi
18839 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18840
18841 fi
18842 echo "$as_me:18842: result: $cf_cv_use_pthreads" >&5
18843 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18844 test $cf_cv_use_pthreads = yes &&
18845 cat >>confdefs.h <<\EOF
18846 #define USE_PTHREADS 1
18847 EOF
18848
18849 echo "$as_me:18849: checking if sys/time.h works with sys/select.h" >&5
18850 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18851 if test "${cf_cv_sys_time_select+set}" = set; then
18852   echo $ECHO_N "(cached) $ECHO_C" >&6
18853 else
18854
18855 cat >conftest.$ac_ext <<_ACEOF
18856 #line 18856 "configure"
18857 #include "confdefs.h"
18858
18859 #include <sys/types.h>
18860 #ifdef HAVE_SYS_TIME_H
18861 #include <sys/time.h>
18862 #endif
18863 #ifdef HAVE_SYS_SELECT_H
18864 #include <sys/select.h>
18865 #endif
18866
18867 int
18868 main (void)
18869 {
18870
18871   ;
18872   return 0;
18873 }
18874 _ACEOF
18875 rm -f conftest.$ac_objext
18876 if { (eval echo "$as_me:18876: \"$ac_compile\"") >&5
18877   (eval $ac_compile) 2>&5
18878   ac_status=$?
18879   echo "$as_me:18879: \$? = $ac_status" >&5
18880   (exit $ac_status); } &&
18881          { ac_try='test -s conftest.$ac_objext'
18882   { (eval echo "$as_me:18882: \"$ac_try\"") >&5
18883   (eval $ac_try) 2>&5
18884   ac_status=$?
18885   echo "$as_me:18885: \$? = $ac_status" >&5
18886   (exit $ac_status); }; }; then
18887   cf_cv_sys_time_select=yes
18888 else
18889   echo "$as_me: failed program was:" >&5
18890 cat conftest.$ac_ext >&5
18891 cf_cv_sys_time_select=no
18892 fi
18893 rm -f conftest.$ac_objext conftest.$ac_ext
18894
18895 fi
18896
18897 echo "$as_me:18897: result: $cf_cv_sys_time_select" >&5
18898 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18899 test "$cf_cv_sys_time_select" = yes &&
18900 cat >>confdefs.h <<\EOF
18901 #define HAVE_SYS_TIME_SELECT 1
18902 EOF
18903
18904 # special check for test/ditto.c
18905
18906 echo "$as_me:18906: checking for openpty in -lutil" >&5
18907 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18908 if test "${ac_cv_lib_util_openpty+set}" = set; then
18909   echo $ECHO_N "(cached) $ECHO_C" >&6
18910 else
18911   ac_check_lib_save_LIBS=$LIBS
18912 LIBS="-lutil  $LIBS"
18913 cat >conftest.$ac_ext <<_ACEOF
18914 #line 18914 "configure"
18915 #include "confdefs.h"
18916
18917 /* Override any gcc2 internal prototype to avoid an error.  */
18918 #ifdef __cplusplus
18919 extern "C"
18920 #endif
18921 /* We use char because int might match the return type of a gcc2
18922    builtin and then its argument prototype would still apply.  */
18923 char openpty ();
18924 int
18925 main (void)
18926 {
18927 openpty ();
18928   ;
18929   return 0;
18930 }
18931 _ACEOF
18932 rm -f conftest.$ac_objext conftest$ac_exeext
18933 if { (eval echo "$as_me:18933: \"$ac_link\"") >&5
18934   (eval $ac_link) 2>&5
18935   ac_status=$?
18936   echo "$as_me:18936: \$? = $ac_status" >&5
18937   (exit $ac_status); } &&
18938          { ac_try='test -s conftest$ac_exeext'
18939   { (eval echo "$as_me:18939: \"$ac_try\"") >&5
18940   (eval $ac_try) 2>&5
18941   ac_status=$?
18942   echo "$as_me:18942: \$? = $ac_status" >&5
18943   (exit $ac_status); }; }; then
18944   ac_cv_lib_util_openpty=yes
18945 else
18946   echo "$as_me: failed program was:" >&5
18947 cat conftest.$ac_ext >&5
18948 ac_cv_lib_util_openpty=no
18949 fi
18950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18951 LIBS=$ac_check_lib_save_LIBS
18952 fi
18953 echo "$as_me:18953: result: $ac_cv_lib_util_openpty" >&5
18954 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18955 if test $ac_cv_lib_util_openpty = yes; then
18956   cf_cv_lib_util=yes
18957 else
18958   cf_cv_lib_util=no
18959 fi
18960
18961 echo "$as_me:18961: checking for openpty header" >&5
18962 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18963 if test "${cf_cv_func_openpty+set}" = set; then
18964   echo $ECHO_N "(cached) $ECHO_C" >&6
18965 else
18966
18967         cf_save_LIBS="$LIBS"
18968         test $cf_cv_lib_util = yes && {
18969 cf_add_libs="$LIBS"
18970 # reverse order
18971 cf_add_0lib=
18972 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18973 # filter duplicates
18974 for cf_add_1lib in $cf_add_0lib; do
18975         for cf_add_2lib in $cf_add_libs; do
18976                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18977                         cf_add_1lib=
18978                         break
18979                 fi
18980         done
18981         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18982 done
18983 LIBS="$cf_add_libs"
18984  }
18985         for cf_header in pty.h libutil.h util.h
18986         do
18987         cat >conftest.$ac_ext <<_ACEOF
18988 #line 18988 "configure"
18989 #include "confdefs.h"
18990
18991 #include <$cf_header>
18992
18993 int
18994 main (void)
18995 {
18996
18997         int x = openpty((int *)0, (int *)0, (char *)0,
18998                                    (struct termios *)0, (struct winsize *)0);
18999
19000   ;
19001   return 0;
19002 }
19003 _ACEOF
19004 rm -f conftest.$ac_objext conftest$ac_exeext
19005 if { (eval echo "$as_me:19005: \"$ac_link\"") >&5
19006   (eval $ac_link) 2>&5
19007   ac_status=$?
19008   echo "$as_me:19008: \$? = $ac_status" >&5
19009   (exit $ac_status); } &&
19010          { ac_try='test -s conftest$ac_exeext'
19011   { (eval echo "$as_me:19011: \"$ac_try\"") >&5
19012   (eval $ac_try) 2>&5
19013   ac_status=$?
19014   echo "$as_me:19014: \$? = $ac_status" >&5
19015   (exit $ac_status); }; }; then
19016
19017                 cf_cv_func_openpty=$cf_header
19018                 break
19019
19020 else
19021   echo "$as_me: failed program was:" >&5
19022 cat conftest.$ac_ext >&5
19023
19024                 cf_cv_func_openpty=no
19025
19026 fi
19027 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19028         done
19029         LIBS="$cf_save_LIBS"
19030
19031 fi
19032 echo "$as_me:19032: result: $cf_cv_func_openpty" >&5
19033 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19034
19035 if test "$cf_cv_func_openpty" != no ; then
19036
19037 cat >>confdefs.h <<EOF
19038 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19039 EOF
19040
19041 cat >>confdefs.h <<\EOF
19042 #define USE_XTERM_PTY 1
19043 EOF
19044
19045         if test "x$cf_cv_lib_util" = xyes ; then
19046
19047 cf_add_libs="$TEST_LIBS"
19048 # reverse order
19049 cf_add_0lib=
19050 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19051 # filter duplicates
19052 for cf_add_1lib in $cf_add_0lib; do
19053         for cf_add_2lib in $cf_add_libs; do
19054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19055                         cf_add_1lib=
19056                         break
19057                 fi
19058         done
19059         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19060 done
19061 TEST_LIBS="$cf_add_libs"
19062
19063         fi
19064 fi
19065
19066 echo "$as_me:19066: checking for function curses_version" >&5
19067 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19068 if test "${cf_cv_func_curses_version+set}" = set; then
19069   echo $ECHO_N "(cached) $ECHO_C" >&6
19070 else
19071
19072 if test "$cross_compiling" = yes; then
19073   cf_cv_func_curses_version=unknown
19074 else
19075   cat >conftest.$ac_ext <<_ACEOF
19076 #line 19076 "configure"
19077 #include "confdefs.h"
19078
19079 #include <${cf_cv_ncurses_header:-curses.h}>
19080 int main(void)
19081 {
19082         char temp[1024];
19083         sprintf(temp, "%s\n", curses_version());
19084         ${cf_cv_main_return:-return}(0);
19085 }
19086
19087 _ACEOF
19088 rm -f conftest$ac_exeext
19089 if { (eval echo "$as_me:19089: \"$ac_link\"") >&5
19090   (eval $ac_link) 2>&5
19091   ac_status=$?
19092   echo "$as_me:19092: \$? = $ac_status" >&5
19093   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19094   { (eval echo "$as_me:19094: \"$ac_try\"") >&5
19095   (eval $ac_try) 2>&5
19096   ac_status=$?
19097   echo "$as_me:19097: \$? = $ac_status" >&5
19098   (exit $ac_status); }; }; then
19099   cf_cv_func_curses_version=yes
19100
19101 else
19102   echo "$as_me: program exited with status $ac_status" >&5
19103 echo "$as_me: failed program was:" >&5
19104 cat conftest.$ac_ext >&5
19105 cf_cv_func_curses_version=no
19106
19107 fi
19108 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19109 fi
19110 rm -f core
19111 fi
19112 echo "$as_me:19112: result: $cf_cv_func_curses_version" >&5
19113 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19114 test "$cf_cv_func_curses_version" = yes &&
19115 cat >>confdefs.h <<\EOF
19116 #define HAVE_CURSES_VERSION 1
19117 EOF
19118
19119 echo "$as_me:19119: checking for alternate character set array" >&5
19120 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19121 if test "${cf_cv_curses_acs_map+set}" = set; then
19122   echo $ECHO_N "(cached) $ECHO_C" >&6
19123 else
19124
19125 cf_cv_curses_acs_map=unknown
19126 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19127 do
19128 cat >conftest.$ac_ext <<_ACEOF
19129 #line 19129 "configure"
19130 #include "confdefs.h"
19131
19132 #include <${cf_cv_ncurses_header:-curses.h}>
19133
19134 int
19135 main (void)
19136 {
19137
19138 $name['k'] = ACS_PLUS
19139
19140   ;
19141   return 0;
19142 }
19143 _ACEOF
19144 rm -f conftest.$ac_objext conftest$ac_exeext
19145 if { (eval echo "$as_me:19145: \"$ac_link\"") >&5
19146   (eval $ac_link) 2>&5
19147   ac_status=$?
19148   echo "$as_me:19148: \$? = $ac_status" >&5
19149   (exit $ac_status); } &&
19150          { ac_try='test -s conftest$ac_exeext'
19151   { (eval echo "$as_me:19151: \"$ac_try\"") >&5
19152   (eval $ac_try) 2>&5
19153   ac_status=$?
19154   echo "$as_me:19154: \$? = $ac_status" >&5
19155   (exit $ac_status); }; }; then
19156   cf_cv_curses_acs_map=$name; break
19157 else
19158   echo "$as_me: failed program was:" >&5
19159 cat conftest.$ac_ext >&5
19160 fi
19161 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19162 done
19163
19164 fi
19165 echo "$as_me:19165: result: $cf_cv_curses_acs_map" >&5
19166 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19167
19168 test "$cf_cv_curses_acs_map" != unknown &&
19169 cat >>confdefs.h <<EOF
19170 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19171 EOF
19172
19173 if test "$cf_enable_widec" = yes; then
19174
19175 echo "$as_me:19175: checking for wide alternate character set array" >&5
19176 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19177 if test "${cf_cv_curses_wacs_map+set}" = set; then
19178   echo $ECHO_N "(cached) $ECHO_C" >&6
19179 else
19180
19181         cf_cv_curses_wacs_map=unknown
19182         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19183         do
19184         cat >conftest.$ac_ext <<_ACEOF
19185 #line 19185 "configure"
19186 #include "confdefs.h"
19187
19188 #ifndef _XOPEN_SOURCE_EXTENDED
19189 #define _XOPEN_SOURCE_EXTENDED
19190 #endif
19191 #include <${cf_cv_ncurses_header:-curses.h}>
19192 int
19193 main (void)
19194 {
19195 void *foo = &($name['k']); (void)foo
19196   ;
19197   return 0;
19198 }
19199 _ACEOF
19200 rm -f conftest.$ac_objext conftest$ac_exeext
19201 if { (eval echo "$as_me:19201: \"$ac_link\"") >&5
19202   (eval $ac_link) 2>&5
19203   ac_status=$?
19204   echo "$as_me:19204: \$? = $ac_status" >&5
19205   (exit $ac_status); } &&
19206          { ac_try='test -s conftest$ac_exeext'
19207   { (eval echo "$as_me:19207: \"$ac_try\"") >&5
19208   (eval $ac_try) 2>&5
19209   ac_status=$?
19210   echo "$as_me:19210: \$? = $ac_status" >&5
19211   (exit $ac_status); }; }; then
19212   cf_cv_curses_wacs_map=$name
19213          break
19214 else
19215   echo "$as_me: failed program was:" >&5
19216 cat conftest.$ac_ext >&5
19217 fi
19218 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19219         done
19220 fi
19221 echo "$as_me:19221: result: $cf_cv_curses_wacs_map" >&5
19222 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19223
19224 test "$cf_cv_curses_wacs_map" != unknown &&
19225 cat >>confdefs.h <<EOF
19226 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19227 EOF
19228
19229 echo "$as_me:19229: checking for wide alternate character constants" >&5
19230 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19231 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19232   echo $ECHO_N "(cached) $ECHO_C" >&6
19233 else
19234
19235 cf_cv_curses_wacs_symbols=no
19236 if test "$cf_cv_curses_wacs_map" != unknown
19237 then
19238         cat >conftest.$ac_ext <<_ACEOF
19239 #line 19239 "configure"
19240 #include "confdefs.h"
19241
19242 #ifndef _XOPEN_SOURCE_EXTENDED
19243 #define _XOPEN_SOURCE_EXTENDED
19244 #endif
19245 #include <${cf_cv_ncurses_header:-curses.h}>
19246 int
19247 main (void)
19248 {
19249 cchar_t *foo = WACS_PLUS;
19250          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS; (void)foo
19251   ;
19252   return 0;
19253 }
19254 _ACEOF
19255 rm -f conftest.$ac_objext conftest$ac_exeext
19256 if { (eval echo "$as_me:19256: \"$ac_link\"") >&5
19257   (eval $ac_link) 2>&5
19258   ac_status=$?
19259   echo "$as_me:19259: \$? = $ac_status" >&5
19260   (exit $ac_status); } &&
19261          { ac_try='test -s conftest$ac_exeext'
19262   { (eval echo "$as_me:19262: \"$ac_try\"") >&5
19263   (eval $ac_try) 2>&5
19264   ac_status=$?
19265   echo "$as_me:19265: \$? = $ac_status" >&5
19266   (exit $ac_status); }; }; then
19267   cf_cv_curses_wacs_symbols=yes
19268 else
19269   echo "$as_me: failed program was:" >&5
19270 cat conftest.$ac_ext >&5
19271 fi
19272 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19273 else
19274         cat >conftest.$ac_ext <<_ACEOF
19275 #line 19275 "configure"
19276 #include "confdefs.h"
19277
19278 #ifndef _XOPEN_SOURCE_EXTENDED
19279 #define _XOPEN_SOURCE_EXTENDED
19280 #endif
19281 #include <${cf_cv_ncurses_header:-curses.h}>
19282 int
19283 main (void)
19284 {
19285 cchar_t *foo = WACS_PLUS; (void)foo
19286   ;
19287   return 0;
19288 }
19289 _ACEOF
19290 rm -f conftest.$ac_objext conftest$ac_exeext
19291 if { (eval echo "$as_me:19291: \"$ac_link\"") >&5
19292   (eval $ac_link) 2>&5
19293   ac_status=$?
19294   echo "$as_me:19294: \$? = $ac_status" >&5
19295   (exit $ac_status); } &&
19296          { ac_try='test -s conftest$ac_exeext'
19297   { (eval echo "$as_me:19297: \"$ac_try\"") >&5
19298   (eval $ac_try) 2>&5
19299   ac_status=$?
19300   echo "$as_me:19300: \$? = $ac_status" >&5
19301   (exit $ac_status); }; }; then
19302   cf_cv_curses_wacs_symbols=yes
19303 else
19304   echo "$as_me: failed program was:" >&5
19305 cat conftest.$ac_ext >&5
19306 fi
19307 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19308 fi
19309
19310 fi
19311 echo "$as_me:19311: result: $cf_cv_curses_wacs_symbols" >&5
19312 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19313
19314 test "$cf_cv_curses_wacs_symbols" != no &&
19315 cat >>confdefs.h <<\EOF
19316 #define CURSES_WACS_SYMBOLS 1
19317 EOF
19318
19319 fi
19320
19321 echo "$as_me:19321: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19322 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19323 cat >conftest.$ac_ext <<_ACEOF
19324 #line 19324 "configure"
19325 #include "confdefs.h"
19326
19327 #ifndef _XOPEN_SOURCE_EXTENDED
19328 #define _XOPEN_SOURCE_EXTENDED
19329 #endif
19330 #include <${cf_cv_ncurses_header:-curses.h}>
19331 int
19332 main (void)
19333 {
19334
19335 attr_t foo
19336
19337   ;
19338   return 0;
19339 }
19340 _ACEOF
19341 rm -f conftest.$ac_objext
19342 if { (eval echo "$as_me:19342: \"$ac_compile\"") >&5
19343   (eval $ac_compile) 2>&5
19344   ac_status=$?
19345   echo "$as_me:19345: \$? = $ac_status" >&5
19346   (exit $ac_status); } &&
19347          { ac_try='test -s conftest.$ac_objext'
19348   { (eval echo "$as_me:19348: \"$ac_try\"") >&5
19349   (eval $ac_try) 2>&5
19350   ac_status=$?
19351   echo "$as_me:19351: \$? = $ac_status" >&5
19352   (exit $ac_status); }; }; then
19353   cf_result=yes
19354 else
19355   echo "$as_me: failed program was:" >&5
19356 cat conftest.$ac_ext >&5
19357 cf_result=no
19358 fi
19359 rm -f conftest.$ac_objext conftest.$ac_ext
19360 echo "$as_me:19360: result: $cf_result" >&5
19361 echo "${ECHO_T}$cf_result" >&6
19362 if test $cf_result = yes ; then
19363
19364 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19365
19366 cat >>confdefs.h <<EOF
19367 #define $cf_result 1
19368 EOF
19369
19370 else
19371
19372 cat >>confdefs.h <<EOF
19373 #define attr_t long
19374 EOF
19375
19376 fi
19377
19378 if test "$cf_enable_widec" = yes; then
19379
19380 # This is needed on Tru64 5.0 to declare mbstate_t
19381 echo "$as_me:19381: checking if we must include wchar.h to declare mbstate_t" >&5
19382 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19383 if test "${cf_cv_mbstate_t+set}" = set; then
19384   echo $ECHO_N "(cached) $ECHO_C" >&6
19385 else
19386
19387 cat >conftest.$ac_ext <<_ACEOF
19388 #line 19388 "configure"
19389 #include "confdefs.h"
19390
19391 #include <stdlib.h>
19392 #include <stdarg.h>
19393 #include <stdio.h>
19394 #ifdef HAVE_LIBUTF8_H
19395 #include <libutf8.h>
19396 #endif
19397 int
19398 main (void)
19399 {
19400 mbstate_t state
19401   ;
19402   return 0;
19403 }
19404 _ACEOF
19405 rm -f conftest.$ac_objext
19406 if { (eval echo "$as_me:19406: \"$ac_compile\"") >&5
19407   (eval $ac_compile) 2>&5
19408   ac_status=$?
19409   echo "$as_me:19409: \$? = $ac_status" >&5
19410   (exit $ac_status); } &&
19411          { ac_try='test -s conftest.$ac_objext'
19412   { (eval echo "$as_me:19412: \"$ac_try\"") >&5
19413   (eval $ac_try) 2>&5
19414   ac_status=$?
19415   echo "$as_me:19415: \$? = $ac_status" >&5
19416   (exit $ac_status); }; }; then
19417   cf_cv_mbstate_t=no
19418 else
19419   echo "$as_me: failed program was:" >&5
19420 cat conftest.$ac_ext >&5
19421 cat >conftest.$ac_ext <<_ACEOF
19422 #line 19422 "configure"
19423 #include "confdefs.h"
19424
19425 #include <stdlib.h>
19426 #include <stdarg.h>
19427 #include <stdio.h>
19428 #include <wchar.h>
19429 #ifdef HAVE_LIBUTF8_H
19430 #include <libutf8.h>
19431 #endif
19432 int
19433 main (void)
19434 {
19435 mbstate_t value
19436   ;
19437   return 0;
19438 }
19439 _ACEOF
19440 rm -f conftest.$ac_objext
19441 if { (eval echo "$as_me:19441: \"$ac_compile\"") >&5
19442   (eval $ac_compile) 2>&5
19443   ac_status=$?
19444   echo "$as_me:19444: \$? = $ac_status" >&5
19445   (exit $ac_status); } &&
19446          { ac_try='test -s conftest.$ac_objext'
19447   { (eval echo "$as_me:19447: \"$ac_try\"") >&5
19448   (eval $ac_try) 2>&5
19449   ac_status=$?
19450   echo "$as_me:19450: \$? = $ac_status" >&5
19451   (exit $ac_status); }; }; then
19452   cf_cv_mbstate_t=yes
19453 else
19454   echo "$as_me: failed program was:" >&5
19455 cat conftest.$ac_ext >&5
19456 cf_cv_mbstate_t=unknown
19457 fi
19458 rm -f conftest.$ac_objext conftest.$ac_ext
19459 fi
19460 rm -f conftest.$ac_objext conftest.$ac_ext
19461 fi
19462 echo "$as_me:19462: result: $cf_cv_mbstate_t" >&5
19463 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19464
19465 if test "$cf_cv_mbstate_t" = yes ; then
19466
19467 cat >>confdefs.h <<\EOF
19468 #define NEED_WCHAR_H 1
19469 EOF
19470
19471         NEED_WCHAR_H=1
19472 fi
19473
19474 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19475 if test "$cf_cv_mbstate_t" = unknown ; then
19476         NCURSES_MBSTATE_T=1
19477 fi
19478
19479 # if we find mbstate_t in either place, use substitution to provide a fallback.
19480 if test "$cf_cv_mbstate_t" != unknown ; then
19481         NCURSES_OK_MBSTATE_T=1
19482 fi
19483
19484 # This is needed on Tru64 5.0 to declare wchar_t
19485 echo "$as_me:19485: checking if we must include wchar.h to declare wchar_t" >&5
19486 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19487 if test "${cf_cv_wchar_t+set}" = set; then
19488   echo $ECHO_N "(cached) $ECHO_C" >&6
19489 else
19490
19491 cat >conftest.$ac_ext <<_ACEOF
19492 #line 19492 "configure"
19493 #include "confdefs.h"
19494
19495 #include <stdlib.h>
19496 #include <stdarg.h>
19497 #include <stdio.h>
19498 #ifdef HAVE_LIBUTF8_H
19499 #include <libutf8.h>
19500 #endif
19501 int
19502 main (void)
19503 {
19504 wchar_t state
19505   ;
19506   return 0;
19507 }
19508 _ACEOF
19509 rm -f conftest.$ac_objext
19510 if { (eval echo "$as_me:19510: \"$ac_compile\"") >&5
19511   (eval $ac_compile) 2>&5
19512   ac_status=$?
19513   echo "$as_me:19513: \$? = $ac_status" >&5
19514   (exit $ac_status); } &&
19515          { ac_try='test -s conftest.$ac_objext'
19516   { (eval echo "$as_me:19516: \"$ac_try\"") >&5
19517   (eval $ac_try) 2>&5
19518   ac_status=$?
19519   echo "$as_me:19519: \$? = $ac_status" >&5
19520   (exit $ac_status); }; }; then
19521   cf_cv_wchar_t=no
19522 else
19523   echo "$as_me: failed program was:" >&5
19524 cat conftest.$ac_ext >&5
19525 cat >conftest.$ac_ext <<_ACEOF
19526 #line 19526 "configure"
19527 #include "confdefs.h"
19528
19529 #include <stdlib.h>
19530 #include <stdarg.h>
19531 #include <stdio.h>
19532 #include <wchar.h>
19533 #ifdef HAVE_LIBUTF8_H
19534 #include <libutf8.h>
19535 #endif
19536 int
19537 main (void)
19538 {
19539 wchar_t value
19540   ;
19541   return 0;
19542 }
19543 _ACEOF
19544 rm -f conftest.$ac_objext
19545 if { (eval echo "$as_me:19545: \"$ac_compile\"") >&5
19546   (eval $ac_compile) 2>&5
19547   ac_status=$?
19548   echo "$as_me:19548: \$? = $ac_status" >&5
19549   (exit $ac_status); } &&
19550          { ac_try='test -s conftest.$ac_objext'
19551   { (eval echo "$as_me:19551: \"$ac_try\"") >&5
19552   (eval $ac_try) 2>&5
19553   ac_status=$?
19554   echo "$as_me:19554: \$? = $ac_status" >&5
19555   (exit $ac_status); }; }; then
19556   cf_cv_wchar_t=yes
19557 else
19558   echo "$as_me: failed program was:" >&5
19559 cat conftest.$ac_ext >&5
19560 cf_cv_wchar_t=unknown
19561 fi
19562 rm -f conftest.$ac_objext conftest.$ac_ext
19563 fi
19564 rm -f conftest.$ac_objext conftest.$ac_ext
19565 fi
19566 echo "$as_me:19566: result: $cf_cv_wchar_t" >&5
19567 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19568
19569 if test "$cf_cv_wchar_t" = yes ; then
19570
19571 cat >>confdefs.h <<\EOF
19572 #define NEED_WCHAR_H 1
19573 EOF
19574
19575         NEED_WCHAR_H=1
19576 fi
19577
19578 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19579 if test "$cf_cv_wchar_t" = unknown ; then
19580         NCURSES_WCHAR_T=1
19581 fi
19582
19583 # if we find wchar_t in either place, use substitution to provide a fallback.
19584 if test "$cf_cv_wchar_t" != unknown ; then
19585         NCURSES_OK_WCHAR_T=1
19586 fi
19587
19588 # This is needed on Tru64 5.0 to declare wint_t
19589 echo "$as_me:19589: checking if we must include wchar.h to declare wint_t" >&5
19590 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19591 if test "${cf_cv_wint_t+set}" = set; then
19592   echo $ECHO_N "(cached) $ECHO_C" >&6
19593 else
19594
19595 cat >conftest.$ac_ext <<_ACEOF
19596 #line 19596 "configure"
19597 #include "confdefs.h"
19598
19599 #include <stdlib.h>
19600 #include <stdarg.h>
19601 #include <stdio.h>
19602 #ifdef HAVE_LIBUTF8_H
19603 #include <libutf8.h>
19604 #endif
19605 int
19606 main (void)
19607 {
19608 wint_t state
19609   ;
19610   return 0;
19611 }
19612 _ACEOF
19613 rm -f conftest.$ac_objext
19614 if { (eval echo "$as_me:19614: \"$ac_compile\"") >&5
19615   (eval $ac_compile) 2>&5
19616   ac_status=$?
19617   echo "$as_me:19617: \$? = $ac_status" >&5
19618   (exit $ac_status); } &&
19619          { ac_try='test -s conftest.$ac_objext'
19620   { (eval echo "$as_me:19620: \"$ac_try\"") >&5
19621   (eval $ac_try) 2>&5
19622   ac_status=$?
19623   echo "$as_me:19623: \$? = $ac_status" >&5
19624   (exit $ac_status); }; }; then
19625   cf_cv_wint_t=no
19626 else
19627   echo "$as_me: failed program was:" >&5
19628 cat conftest.$ac_ext >&5
19629 cat >conftest.$ac_ext <<_ACEOF
19630 #line 19630 "configure"
19631 #include "confdefs.h"
19632
19633 #include <stdlib.h>
19634 #include <stdarg.h>
19635 #include <stdio.h>
19636 #include <wchar.h>
19637 #ifdef HAVE_LIBUTF8_H
19638 #include <libutf8.h>
19639 #endif
19640 int
19641 main (void)
19642 {
19643 wint_t value
19644   ;
19645   return 0;
19646 }
19647 _ACEOF
19648 rm -f conftest.$ac_objext
19649 if { (eval echo "$as_me:19649: \"$ac_compile\"") >&5
19650   (eval $ac_compile) 2>&5
19651   ac_status=$?
19652   echo "$as_me:19652: \$? = $ac_status" >&5
19653   (exit $ac_status); } &&
19654          { ac_try='test -s conftest.$ac_objext'
19655   { (eval echo "$as_me:19655: \"$ac_try\"") >&5
19656   (eval $ac_try) 2>&5
19657   ac_status=$?
19658   echo "$as_me:19658: \$? = $ac_status" >&5
19659   (exit $ac_status); }; }; then
19660   cf_cv_wint_t=yes
19661 else
19662   echo "$as_me: failed program was:" >&5
19663 cat conftest.$ac_ext >&5
19664 cf_cv_wint_t=unknown
19665 fi
19666 rm -f conftest.$ac_objext conftest.$ac_ext
19667 fi
19668 rm -f conftest.$ac_objext conftest.$ac_ext
19669 fi
19670 echo "$as_me:19670: result: $cf_cv_wint_t" >&5
19671 echo "${ECHO_T}$cf_cv_wint_t" >&6
19672
19673 if test "$cf_cv_wint_t" = yes ; then
19674
19675 cat >>confdefs.h <<\EOF
19676 #define NEED_WCHAR_H 1
19677 EOF
19678
19679         NEED_WCHAR_H=1
19680 fi
19681
19682 # if we do not find wint_t in either place, use substitution to provide a fallback.
19683 if test "$cf_cv_wint_t" = unknown ; then
19684         NCURSES_WINT_T=1
19685 fi
19686
19687 # if we find wint_t in either place, use substitution to provide a fallback.
19688 if test "$cf_cv_wint_t" != unknown ; then
19689         NCURSES_OK_WINT_T=1
19690 fi
19691
19692         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19693
19694 echo "$as_me:19694: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19695 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19696 cat >conftest.$ac_ext <<_ACEOF
19697 #line 19697 "configure"
19698 #include "confdefs.h"
19699
19700 #ifndef _XOPEN_SOURCE_EXTENDED
19701 #define _XOPEN_SOURCE_EXTENDED
19702 #endif
19703 #include <${cf_cv_ncurses_header:-curses.h}>
19704 int
19705 main (void)
19706 {
19707
19708 mbstate_t foo
19709
19710   ;
19711   return 0;
19712 }
19713 _ACEOF
19714 rm -f conftest.$ac_objext
19715 if { (eval echo "$as_me:19715: \"$ac_compile\"") >&5
19716   (eval $ac_compile) 2>&5
19717   ac_status=$?
19718   echo "$as_me:19718: \$? = $ac_status" >&5
19719   (exit $ac_status); } &&
19720          { ac_try='test -s conftest.$ac_objext'
19721   { (eval echo "$as_me:19721: \"$ac_try\"") >&5
19722   (eval $ac_try) 2>&5
19723   ac_status=$?
19724   echo "$as_me:19724: \$? = $ac_status" >&5
19725   (exit $ac_status); }; }; then
19726   cf_result=yes
19727 else
19728   echo "$as_me: failed program was:" >&5
19729 cat conftest.$ac_ext >&5
19730 cf_result=no
19731 fi
19732 rm -f conftest.$ac_objext conftest.$ac_ext
19733 echo "$as_me:19733: result: $cf_result" >&5
19734 echo "${ECHO_T}$cf_result" >&6
19735 if test $cf_result = yes ; then
19736
19737 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19738
19739 cat >>confdefs.h <<EOF
19740 #define $cf_result 1
19741 EOF
19742
19743 else
19744
19745 cat >>confdefs.h <<EOF
19746 #define mbstate_t long
19747 EOF
19748
19749 fi
19750
19751         fi
19752
19753         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19754
19755 echo "$as_me:19755: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19756 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19757 cat >conftest.$ac_ext <<_ACEOF
19758 #line 19758 "configure"
19759 #include "confdefs.h"
19760
19761 #ifndef _XOPEN_SOURCE_EXTENDED
19762 #define _XOPEN_SOURCE_EXTENDED
19763 #endif
19764 #include <${cf_cv_ncurses_header:-curses.h}>
19765 int
19766 main (void)
19767 {
19768
19769 wchar_t foo
19770
19771   ;
19772   return 0;
19773 }
19774 _ACEOF
19775 rm -f conftest.$ac_objext
19776 if { (eval echo "$as_me:19776: \"$ac_compile\"") >&5
19777   (eval $ac_compile) 2>&5
19778   ac_status=$?
19779   echo "$as_me:19779: \$? = $ac_status" >&5
19780   (exit $ac_status); } &&
19781          { ac_try='test -s conftest.$ac_objext'
19782   { (eval echo "$as_me:19782: \"$ac_try\"") >&5
19783   (eval $ac_try) 2>&5
19784   ac_status=$?
19785   echo "$as_me:19785: \$? = $ac_status" >&5
19786   (exit $ac_status); }; }; then
19787   cf_result=yes
19788 else
19789   echo "$as_me: failed program was:" >&5
19790 cat conftest.$ac_ext >&5
19791 cf_result=no
19792 fi
19793 rm -f conftest.$ac_objext conftest.$ac_ext
19794 echo "$as_me:19794: result: $cf_result" >&5
19795 echo "${ECHO_T}$cf_result" >&6
19796 if test $cf_result = yes ; then
19797
19798 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19799
19800 cat >>confdefs.h <<EOF
19801 #define $cf_result 1
19802 EOF
19803
19804 else
19805
19806 cat >>confdefs.h <<EOF
19807 #define wchar_t long
19808 EOF
19809
19810 fi
19811
19812         fi
19813
19814         if test "$NCURSES_OK_WINT_T" = 0 ; then
19815
19816 echo "$as_me:19816: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19817 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19818 cat >conftest.$ac_ext <<_ACEOF
19819 #line 19819 "configure"
19820 #include "confdefs.h"
19821
19822 #ifndef _XOPEN_SOURCE_EXTENDED
19823 #define _XOPEN_SOURCE_EXTENDED
19824 #endif
19825 #include <${cf_cv_ncurses_header:-curses.h}>
19826 int
19827 main (void)
19828 {
19829
19830 wint_t foo
19831
19832   ;
19833   return 0;
19834 }
19835 _ACEOF
19836 rm -f conftest.$ac_objext
19837 if { (eval echo "$as_me:19837: \"$ac_compile\"") >&5
19838   (eval $ac_compile) 2>&5
19839   ac_status=$?
19840   echo "$as_me:19840: \$? = $ac_status" >&5
19841   (exit $ac_status); } &&
19842          { ac_try='test -s conftest.$ac_objext'
19843   { (eval echo "$as_me:19843: \"$ac_try\"") >&5
19844   (eval $ac_try) 2>&5
19845   ac_status=$?
19846   echo "$as_me:19846: \$? = $ac_status" >&5
19847   (exit $ac_status); }; }; then
19848   cf_result=yes
19849 else
19850   echo "$as_me: failed program was:" >&5
19851 cat conftest.$ac_ext >&5
19852 cf_result=no
19853 fi
19854 rm -f conftest.$ac_objext conftest.$ac_ext
19855 echo "$as_me:19855: result: $cf_result" >&5
19856 echo "${ECHO_T}$cf_result" >&6
19857 if test $cf_result = yes ; then
19858
19859 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19860
19861 cat >>confdefs.h <<EOF
19862 #define $cf_result 1
19863 EOF
19864
19865 else
19866
19867 cat >>confdefs.h <<EOF
19868 #define wint_t long
19869 EOF
19870
19871 fi
19872
19873         fi
19874 fi
19875
19876 for cf_data in \
19877 TABSIZE \
19878 curscr \
19879 ospeed \
19880 boolnames \
19881 boolfnames \
19882 ttytype
19883 do
19884 echo "$as_me:19884: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19885 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19886
19887 cat >conftest.$ac_ext <<_ACEOF
19888 #line 19888 "configure"
19889 #include "confdefs.h"
19890
19891 #ifdef HAVE_XCURSES
19892 #include <xcurses.h>
19893 char * XCursesProgramName = "test";
19894 #else
19895 #include <${cf_cv_ncurses_header:-curses.h}>
19896 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19897 #include <ncursesw/term.h>
19898 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19899 #include <ncurses/term.h>
19900 #elif defined(HAVE_TERM_H)
19901 #include <term.h>
19902 #endif
19903 #endif
19904
19905 int
19906 main (void)
19907 {
19908
19909 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19910         const void *foo = (const void *)($cf_data);
19911 #else
19912         const void *foo = &($cf_data);
19913 #endif
19914         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19915
19916   ;
19917   return 0;
19918 }
19919 _ACEOF
19920 rm -f conftest.$ac_objext
19921 if { (eval echo "$as_me:19921: \"$ac_compile\"") >&5
19922   (eval $ac_compile) 2>&5
19923   ac_status=$?
19924   echo "$as_me:19924: \$? = $ac_status" >&5
19925   (exit $ac_status); } &&
19926          { ac_try='test -s conftest.$ac_objext'
19927   { (eval echo "$as_me:19927: \"$ac_try\"") >&5
19928   (eval $ac_try) 2>&5
19929   ac_status=$?
19930   echo "$as_me:19930: \$? = $ac_status" >&5
19931   (exit $ac_status); }; }; then
19932   cf_result=yes
19933
19934 else
19935   echo "$as_me: failed program was:" >&5
19936 cat conftest.$ac_ext >&5
19937 cf_result=no
19938 fi
19939 rm -f conftest.$ac_objext conftest.$ac_ext
19940 echo "$as_me:19940: result: $cf_result" >&5
19941 echo "${ECHO_T}$cf_result" >&6
19942
19943 if test $cf_result = yes ; then
19944
19945 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19946
19947         cat >>confdefs.h <<EOF
19948 #define $cf_result 1
19949 EOF
19950
19951 else
19952         echo "$as_me:19952: checking for data $cf_data in library" >&5
19953 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19954         # BSD linkers insist on making weak linkage, but resolve at runtime.
19955         if test "$cross_compiling" = yes; then
19956
19957         # cross-compiling
19958         cat >conftest.$ac_ext <<_ACEOF
19959 #line 19959 "configure"
19960 #include "confdefs.h"
19961
19962 #ifdef HAVE_XCURSES
19963 #include <xcurses.h>
19964 char * XCursesProgramName = "test";
19965 #else
19966 #include <${cf_cv_ncurses_header:-curses.h}>
19967 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19968 #include <ncursesw/term.h>
19969 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19970 #include <ncurses/term.h>
19971 #elif defined(HAVE_TERM_H)
19972 #include <term.h>
19973 #endif
19974 #endif
19975
19976 extern char $cf_data;
19977 int
19978 main (void)
19979 {
19980
19981         do {
19982
19983 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19984         const void *foo = (const void *)($cf_data);
19985 #else
19986         const void *foo = &($cf_data);
19987 #endif
19988         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19989
19990                 ${cf_cv_main_return:-return}(foo == 0);
19991         } while (0)
19992
19993   ;
19994   return 0;
19995 }
19996 _ACEOF
19997 rm -f conftest.$ac_objext conftest$ac_exeext
19998 if { (eval echo "$as_me:19998: \"$ac_link\"") >&5
19999   (eval $ac_link) 2>&5
20000   ac_status=$?
20001   echo "$as_me:20001: \$? = $ac_status" >&5
20002   (exit $ac_status); } &&
20003          { ac_try='test -s conftest$ac_exeext'
20004   { (eval echo "$as_me:20004: \"$ac_try\"") >&5
20005   (eval $ac_try) 2>&5
20006   ac_status=$?
20007   echo "$as_me:20007: \$? = $ac_status" >&5
20008   (exit $ac_status); }; }; then
20009   cf_result=yes
20010 else
20011   echo "$as_me: failed program was:" >&5
20012 cat conftest.$ac_ext >&5
20013 cf_result=no
20014 fi
20015 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20016
20017 else
20018   cat >conftest.$ac_ext <<_ACEOF
20019 #line 20019 "configure"
20020 #include "confdefs.h"
20021
20022 #ifdef HAVE_XCURSES
20023 #include <xcurses.h>
20024 char * XCursesProgramName = "test";
20025 #else
20026 #include <${cf_cv_ncurses_header:-curses.h}>
20027 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20028 #include <ncursesw/term.h>
20029 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20030 #include <ncurses/term.h>
20031 #elif defined(HAVE_TERM_H)
20032 #include <term.h>
20033 #endif
20034 #endif
20035
20036 extern char $cf_data;
20037 int main(void)
20038 {
20039
20040 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20041         const void *foo = (const void *)($cf_data);
20042 #else
20043         const void *foo = &($cf_data);
20044 #endif
20045         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
20046
20047         ${cf_cv_main_return:-return}(foo == 0);
20048 }
20049 _ACEOF
20050 rm -f conftest$ac_exeext
20051 if { (eval echo "$as_me:20051: \"$ac_link\"") >&5
20052   (eval $ac_link) 2>&5
20053   ac_status=$?
20054   echo "$as_me:20054: \$? = $ac_status" >&5
20055   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20056   { (eval echo "$as_me:20056: \"$ac_try\"") >&5
20057   (eval $ac_try) 2>&5
20058   ac_status=$?
20059   echo "$as_me:20059: \$? = $ac_status" >&5
20060   (exit $ac_status); }; }; then
20061   cf_result=yes
20062
20063 else
20064   echo "$as_me: program exited with status $ac_status" >&5
20065 echo "$as_me: failed program was:" >&5
20066 cat conftest.$ac_ext >&5
20067 cf_result=no
20068 fi
20069 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20070 fi
20071         echo "$as_me:20071: result: $cf_result" >&5
20072 echo "${ECHO_T}$cf_result" >&6
20073         if test $cf_result = yes ; then
20074
20075 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20076
20077                 cat >>confdefs.h <<EOF
20078 #define $cf_result 1
20079 EOF
20080
20081                 # do not exit loop here, since we prefer system's declarations
20082         fi
20083 fi
20084 done
20085
20086 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20087 then
20088         echo "$as_me:20088: checking for X" >&5
20089 echo $ECHO_N "checking for X... $ECHO_C" >&6
20090
20091 # Check whether --with-x or --without-x was given.
20092 if test "${with_x+set}" = set; then
20093   withval="$with_x"
20094
20095 fi;
20096 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20097 if test "x$with_x" = xno; then
20098   # The user explicitly disabled X.
20099   have_x=disabled
20100 else
20101   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20102     # Both variables are already set.
20103     have_x=yes
20104   else
20105     if test "${ac_cv_have_x+set}" = set; then
20106   echo $ECHO_N "(cached) $ECHO_C" >&6
20107 else
20108   # One or both of the vars are not set, and there is no cached value.
20109 ac_x_includes=no ac_x_libraries=no
20110 rm -fr conftest.dir
20111 if mkdir conftest.dir; then
20112   cd conftest.dir
20113   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20114   cat >Imakefile <<'EOF'
20115 acfindx:
20116         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20117 EOF
20118   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20119     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20120     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
20121     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20122     for ac_extension in a so sl dylib dll; do
20123       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
20124          test -f $ac_im_libdir/libX11.$ac_extension; then
20125         ac_im_usrlibdir=$ac_im_libdir; break
20126       fi
20127     done
20128     # Screen out bogus values from the imake configuration.  They are
20129     # bogus both because they are the default anyway, and because
20130     # using them would break gcc on systems where it needs fixed includes.
20131     case $ac_im_incroot in
20132         /usr/include) ;;
20133         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20134     esac
20135     case $ac_im_usrlibdir in
20136         /usr/lib | /lib) ;;
20137         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20138     esac
20139   fi
20140   cd ..
20141   rm -fr conftest.dir
20142 fi
20143
20144 # Standard set of common directories for X headers.
20145 # Check X11 before X11Rn because it is often a symlink to the current release.
20146 ac_x_header_dirs='
20147 /usr/X11/include
20148 /usr/X11R7/include
20149 /usr/X11R6/include
20150 /usr/X11R5/include
20151 /usr/X11R4/include
20152
20153 /opt/local/include
20154 /opt/X11/include
20155
20156 /usr/include/X11
20157 /usr/include/X11R7
20158 /usr/include/X11R6
20159 /usr/include/X11R5
20160 /usr/include/X11R4
20161
20162 /usr/local/X11/include
20163 /usr/local/X11R7/include
20164 /usr/local/X11R6/include
20165 /usr/local/X11R5/include
20166 /usr/local/X11R4/include
20167
20168 /usr/local/include/X11
20169 /usr/local/include/X11R7
20170 /usr/local/include/X11R6
20171 /usr/local/include/X11R5
20172 /usr/local/include/X11R4
20173
20174 /usr/X386/include
20175 /usr/x386/include
20176 /usr/XFree86/include/X11
20177
20178 /usr/include
20179 /usr/local/include
20180 /usr/unsupported/include
20181 /usr/athena/include
20182 /usr/local/x11r5/include
20183 /usr/lpp/Xamples/include
20184
20185 /usr/openwin/include
20186 /usr/openwin/share/include'
20187
20188 if test "$ac_x_includes" = no; then
20189   # Guess where to find include files, by looking for Intrinsic.h.
20190   # First, try using that file with no special directory specified.
20191   cat >conftest.$ac_ext <<_ACEOF
20192 #line 20192 "configure"
20193 #include "confdefs.h"
20194 #include <X11/Intrinsic.h>
20195 _ACEOF
20196 if { (eval echo "$as_me:20196: \"$ac_cpp conftest.$ac_ext\"") >&5
20197   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20198   ac_status=$?
20199   egrep -v '^ *\+' conftest.er1 >conftest.err
20200   rm -f conftest.er1
20201   cat conftest.err >&5
20202   echo "$as_me:20202: \$? = $ac_status" >&5
20203   (exit $ac_status); } >/dev/null; then
20204   if test -s conftest.err; then
20205     ac_cpp_err=$ac_c_preproc_warn_flag
20206   else
20207     ac_cpp_err=
20208   fi
20209 else
20210   ac_cpp_err=yes
20211 fi
20212 if test -z "$ac_cpp_err"; then
20213   # We can compile using X headers with no special include directory.
20214 ac_x_includes=
20215 else
20216   echo "$as_me: failed program was:" >&5
20217   cat conftest.$ac_ext >&5
20218   for ac_dir in $ac_x_header_dirs; do
20219   if test -r "$ac_dir/X11/Intrinsic.h"; then
20220     ac_x_includes=$ac_dir
20221     break
20222   fi
20223 done
20224 fi
20225 rm -f conftest.err conftest.$ac_ext
20226 fi # $ac_x_includes = no
20227
20228 if test "$ac_x_libraries" = no; then
20229   # Check for the libraries.
20230   # See if we find them without any special options.
20231   # Don't add to $LIBS permanently.
20232   ac_save_LIBS=$LIBS
20233   LIBS="-lXt $LIBS"
20234   cat >conftest.$ac_ext <<_ACEOF
20235 #line 20235 "configure"
20236 #include "confdefs.h"
20237 #include <X11/Intrinsic.h>
20238 int
20239 main (void)
20240 {
20241 XtMalloc (0)
20242   ;
20243   return 0;
20244 }
20245 _ACEOF
20246 rm -f conftest.$ac_objext conftest$ac_exeext
20247 if { (eval echo "$as_me:20247: \"$ac_link\"") >&5
20248   (eval $ac_link) 2>&5
20249   ac_status=$?
20250   echo "$as_me:20250: \$? = $ac_status" >&5
20251   (exit $ac_status); } &&
20252          { ac_try='test -s conftest$ac_exeext'
20253   { (eval echo "$as_me:20253: \"$ac_try\"") >&5
20254   (eval $ac_try) 2>&5
20255   ac_status=$?
20256   echo "$as_me:20256: \$? = $ac_status" >&5
20257   (exit $ac_status); }; }; then
20258   LIBS=$ac_save_LIBS
20259 # We can link X programs with no special library path.
20260 ac_x_libraries=
20261 else
20262   echo "$as_me: failed program was:" >&5
20263 cat conftest.$ac_ext >&5
20264 LIBS=$ac_save_LIBS
20265 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20266 do
20267   # Don't even attempt the hair of trying to link an X program!
20268   for ac_extension in a so sl dylib dll; do
20269     if test -r $ac_dir/libXt.$ac_extension; then
20270       ac_x_libraries=$ac_dir
20271       break 2
20272     fi
20273   done
20274 done
20275 fi
20276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20277 fi # $ac_x_libraries = no
20278
20279 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20280   # Didn't find X anywhere.  Cache the known absence of X.
20281   ac_cv_have_x="have_x=no"
20282 else
20283   # Record where we found X for the cache.
20284   ac_cv_have_x="have_x=yes \
20285                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20286 fi
20287 fi
20288
20289   fi
20290   eval "$ac_cv_have_x"
20291 fi # $with_x != no
20292
20293 if test "$have_x" != yes; then
20294   echo "$as_me:20294: result: $have_x" >&5
20295 echo "${ECHO_T}$have_x" >&6
20296   no_x=yes
20297 else
20298   # If each of the values was on the command line, it overrides each guess.
20299   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20300   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20301   # Update the cache value to reflect the command line values.
20302   ac_cv_have_x="have_x=yes \
20303                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20304   echo "$as_me:20304: result: libraries $x_libraries, headers $x_includes" >&5
20305 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20306 fi
20307
20308         if test "$no_x" = yes; then
20309   # Not all programs may use this symbol, but it does not hurt to define it.
20310
20311 cat >>confdefs.h <<\EOF
20312 #define X_DISPLAY_MISSING 1
20313 EOF
20314
20315   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
20316 else
20317   if test -n "$x_includes"; then
20318     X_CFLAGS="$X_CFLAGS -I$x_includes"
20319   fi
20320
20321   # It would also be nice to do this for all -L options, not just this one.
20322   if test -n "$x_libraries"; then
20323     X_LIBS="$X_LIBS -L$x_libraries"
20324     # For Solaris; some versions of Sun CC require a space after -R and
20325     # others require no space.  Words are not sufficient . . . .
20326     case `(uname -sr) 2>/dev/null` in
20327     "SunOS 5"*)
20328       echo "$as_me:20328: checking whether -R must be followed by a space" >&5
20329 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20330       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20331       cat >conftest.$ac_ext <<_ACEOF
20332 #line 20332 "configure"
20333 #include "confdefs.h"
20334
20335 int
20336 main (void)
20337 {
20338
20339   ;
20340   return 0;
20341 }
20342 _ACEOF
20343 rm -f conftest.$ac_objext conftest$ac_exeext
20344 if { (eval echo "$as_me:20344: \"$ac_link\"") >&5
20345   (eval $ac_link) 2>&5
20346   ac_status=$?
20347   echo "$as_me:20347: \$? = $ac_status" >&5
20348   (exit $ac_status); } &&
20349          { ac_try='test -s conftest$ac_exeext'
20350   { (eval echo "$as_me:20350: \"$ac_try\"") >&5
20351   (eval $ac_try) 2>&5
20352   ac_status=$?
20353   echo "$as_me:20353: \$? = $ac_status" >&5
20354   (exit $ac_status); }; }; then
20355   ac_R_nospace=yes
20356 else
20357   echo "$as_me: failed program was:" >&5
20358 cat conftest.$ac_ext >&5
20359 ac_R_nospace=no
20360 fi
20361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20362       if test $ac_R_nospace = yes; then
20363         echo "$as_me:20363: result: no" >&5
20364 echo "${ECHO_T}no" >&6
20365         X_LIBS="$X_LIBS -R$x_libraries"
20366       else
20367         LIBS="$ac_xsave_LIBS -R $x_libraries"
20368         cat >conftest.$ac_ext <<_ACEOF
20369 #line 20369 "configure"
20370 #include "confdefs.h"
20371
20372 int
20373 main (void)
20374 {
20375
20376   ;
20377   return 0;
20378 }
20379 _ACEOF
20380 rm -f conftest.$ac_objext conftest$ac_exeext
20381 if { (eval echo "$as_me:20381: \"$ac_link\"") >&5
20382   (eval $ac_link) 2>&5
20383   ac_status=$?
20384   echo "$as_me:20384: \$? = $ac_status" >&5
20385   (exit $ac_status); } &&
20386          { ac_try='test -s conftest$ac_exeext'
20387   { (eval echo "$as_me:20387: \"$ac_try\"") >&5
20388   (eval $ac_try) 2>&5
20389   ac_status=$?
20390   echo "$as_me:20390: \$? = $ac_status" >&5
20391   (exit $ac_status); }; }; then
20392   ac_R_space=yes
20393 else
20394   echo "$as_me: failed program was:" >&5
20395 cat conftest.$ac_ext >&5
20396 ac_R_space=no
20397 fi
20398 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20399         if test $ac_R_space = yes; then
20400           echo "$as_me:20400: result: yes" >&5
20401 echo "${ECHO_T}yes" >&6
20402           X_LIBS="$X_LIBS -R $x_libraries"
20403         else
20404           echo "$as_me:20404: result: neither works" >&5
20405 echo "${ECHO_T}neither works" >&6
20406         fi
20407       fi
20408       LIBS=$ac_xsave_LIBS
20409     esac
20410   fi
20411
20412   # Check for system-dependent libraries X programs must link with.
20413   # Do this before checking for the system-independent R6 libraries
20414   # (-lICE), since we may need -lsocket or whatever for X linking.
20415
20416   if test "$ISC" = yes; then
20417     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20418   else
20419     # Martyn Johnson says this is needed for Ultrix, if the X
20420     # libraries were built with DECnet support.  And Karl Berry says
20421     # the Alpha needs dnet_stub (dnet does not exist).
20422     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20423     cat >conftest.$ac_ext <<_ACEOF
20424 #line 20424 "configure"
20425 #include "confdefs.h"
20426
20427 /* Override any gcc2 internal prototype to avoid an error.  */
20428 #ifdef __cplusplus
20429 extern "C"
20430 #endif
20431 /* We use char because int might match the return type of a gcc2
20432    builtin and then its argument prototype would still apply.  */
20433 char XOpenDisplay ();
20434 int
20435 main (void)
20436 {
20437 XOpenDisplay ();
20438   ;
20439   return 0;
20440 }
20441 _ACEOF
20442 rm -f conftest.$ac_objext conftest$ac_exeext
20443 if { (eval echo "$as_me:20443: \"$ac_link\"") >&5
20444   (eval $ac_link) 2>&5
20445   ac_status=$?
20446   echo "$as_me:20446: \$? = $ac_status" >&5
20447   (exit $ac_status); } &&
20448          { ac_try='test -s conftest$ac_exeext'
20449   { (eval echo "$as_me:20449: \"$ac_try\"") >&5
20450   (eval $ac_try) 2>&5
20451   ac_status=$?
20452   echo "$as_me:20452: \$? = $ac_status" >&5
20453   (exit $ac_status); }; }; then
20454   :
20455 else
20456   echo "$as_me: failed program was:" >&5
20457 cat conftest.$ac_ext >&5
20458 echo "$as_me:20458: checking for dnet_ntoa in -ldnet" >&5
20459 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20460 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20461   echo $ECHO_N "(cached) $ECHO_C" >&6
20462 else
20463   ac_check_lib_save_LIBS=$LIBS
20464 LIBS="-ldnet  $LIBS"
20465 cat >conftest.$ac_ext <<_ACEOF
20466 #line 20466 "configure"
20467 #include "confdefs.h"
20468
20469 /* Override any gcc2 internal prototype to avoid an error.  */
20470 #ifdef __cplusplus
20471 extern "C"
20472 #endif
20473 /* We use char because int might match the return type of a gcc2
20474    builtin and then its argument prototype would still apply.  */
20475 char dnet_ntoa ();
20476 int
20477 main (void)
20478 {
20479 dnet_ntoa ();
20480   ;
20481   return 0;
20482 }
20483 _ACEOF
20484 rm -f conftest.$ac_objext conftest$ac_exeext
20485 if { (eval echo "$as_me:20485: \"$ac_link\"") >&5
20486   (eval $ac_link) 2>&5
20487   ac_status=$?
20488   echo "$as_me:20488: \$? = $ac_status" >&5
20489   (exit $ac_status); } &&
20490          { ac_try='test -s conftest$ac_exeext'
20491   { (eval echo "$as_me:20491: \"$ac_try\"") >&5
20492   (eval $ac_try) 2>&5
20493   ac_status=$?
20494   echo "$as_me:20494: \$? = $ac_status" >&5
20495   (exit $ac_status); }; }; then
20496   ac_cv_lib_dnet_dnet_ntoa=yes
20497 else
20498   echo "$as_me: failed program was:" >&5
20499 cat conftest.$ac_ext >&5
20500 ac_cv_lib_dnet_dnet_ntoa=no
20501 fi
20502 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20503 LIBS=$ac_check_lib_save_LIBS
20504 fi
20505 echo "$as_me:20505: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20506 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20507 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
20508   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20509 fi
20510
20511     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20512       echo "$as_me:20512: checking for dnet_ntoa in -ldnet_stub" >&5
20513 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20514 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20515   echo $ECHO_N "(cached) $ECHO_C" >&6
20516 else
20517   ac_check_lib_save_LIBS=$LIBS
20518 LIBS="-ldnet_stub  $LIBS"
20519 cat >conftest.$ac_ext <<_ACEOF
20520 #line 20520 "configure"
20521 #include "confdefs.h"
20522
20523 /* Override any gcc2 internal prototype to avoid an error.  */
20524 #ifdef __cplusplus
20525 extern "C"
20526 #endif
20527 /* We use char because int might match the return type of a gcc2
20528    builtin and then its argument prototype would still apply.  */
20529 char dnet_ntoa ();
20530 int
20531 main (void)
20532 {
20533 dnet_ntoa ();
20534   ;
20535   return 0;
20536 }
20537 _ACEOF
20538 rm -f conftest.$ac_objext conftest$ac_exeext
20539 if { (eval echo "$as_me:20539: \"$ac_link\"") >&5
20540   (eval $ac_link) 2>&5
20541   ac_status=$?
20542   echo "$as_me:20542: \$? = $ac_status" >&5
20543   (exit $ac_status); } &&
20544          { ac_try='test -s conftest$ac_exeext'
20545   { (eval echo "$as_me:20545: \"$ac_try\"") >&5
20546   (eval $ac_try) 2>&5
20547   ac_status=$?
20548   echo "$as_me:20548: \$? = $ac_status" >&5
20549   (exit $ac_status); }; }; then
20550   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20551 else
20552   echo "$as_me: failed program was:" >&5
20553 cat conftest.$ac_ext >&5
20554 ac_cv_lib_dnet_stub_dnet_ntoa=no
20555 fi
20556 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20557 LIBS=$ac_check_lib_save_LIBS
20558 fi
20559 echo "$as_me:20559: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20560 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20561 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
20562   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20563 fi
20564
20565     fi
20566 fi
20567 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20568     LIBS="$ac_xsave_LIBS"
20569
20570     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20571     # to get the SysV transport functions.
20572     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20573     # needs -lnsl.
20574     # The nsl library prevents programs from opening the X display
20575     # on Irix 5.2, according to T.E. Dickey.
20576     # The functions gethostbyname, getservbyname, and inet_addr are
20577     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20578     echo "$as_me:20578: checking for gethostbyname" >&5
20579 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20580 if test "${ac_cv_func_gethostbyname+set}" = set; then
20581   echo $ECHO_N "(cached) $ECHO_C" >&6
20582 else
20583   cat >conftest.$ac_ext <<_ACEOF
20584 #line 20584 "configure"
20585 #include "confdefs.h"
20586 #define gethostbyname autoconf_temporary
20587 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20588 #undef gethostbyname
20589
20590 #ifdef __cplusplus
20591 extern "C"
20592 #endif
20593
20594 /* We use char because int might match the return type of a gcc2
20595    builtin and then its argument prototype would still apply.  */
20596 char gethostbyname (void);
20597
20598 int
20599 main (void)
20600 {
20601
20602 /* The GNU C library defines stubs for functions which it implements
20603     to always fail with ENOSYS.  Some functions are actually named
20604     something starting with __ and the normal name is an alias.  */
20605 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20606 #error found stub for gethostbyname
20607 #endif
20608
20609         return 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_func_gethostbyname=yes
20627 else
20628   echo "$as_me: failed program was:" >&5
20629 cat conftest.$ac_ext >&5
20630 ac_cv_func_gethostbyname=no
20631 fi
20632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20633 fi
20634 echo "$as_me:20634: result: $ac_cv_func_gethostbyname" >&5
20635 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20636
20637     if test $ac_cv_func_gethostbyname = no; then
20638       echo "$as_me:20638: checking for gethostbyname in -lnsl" >&5
20639 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20640 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20641   echo $ECHO_N "(cached) $ECHO_C" >&6
20642 else
20643   ac_check_lib_save_LIBS=$LIBS
20644 LIBS="-lnsl  $LIBS"
20645 cat >conftest.$ac_ext <<_ACEOF
20646 #line 20646 "configure"
20647 #include "confdefs.h"
20648
20649 /* Override any gcc2 internal prototype to avoid an error.  */
20650 #ifdef __cplusplus
20651 extern "C"
20652 #endif
20653 /* We use char because int might match the return type of a gcc2
20654    builtin and then its argument prototype would still apply.  */
20655 char gethostbyname ();
20656 int
20657 main (void)
20658 {
20659 gethostbyname ();
20660   ;
20661   return 0;
20662 }
20663 _ACEOF
20664 rm -f conftest.$ac_objext conftest$ac_exeext
20665 if { (eval echo "$as_me:20665: \"$ac_link\"") >&5
20666   (eval $ac_link) 2>&5
20667   ac_status=$?
20668   echo "$as_me:20668: \$? = $ac_status" >&5
20669   (exit $ac_status); } &&
20670          { ac_try='test -s conftest$ac_exeext'
20671   { (eval echo "$as_me:20671: \"$ac_try\"") >&5
20672   (eval $ac_try) 2>&5
20673   ac_status=$?
20674   echo "$as_me:20674: \$? = $ac_status" >&5
20675   (exit $ac_status); }; }; then
20676   ac_cv_lib_nsl_gethostbyname=yes
20677 else
20678   echo "$as_me: failed program was:" >&5
20679 cat conftest.$ac_ext >&5
20680 ac_cv_lib_nsl_gethostbyname=no
20681 fi
20682 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20683 LIBS=$ac_check_lib_save_LIBS
20684 fi
20685 echo "$as_me:20685: result: $ac_cv_lib_nsl_gethostbyname" >&5
20686 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20687 if test $ac_cv_lib_nsl_gethostbyname = yes; then
20688   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20689 fi
20690
20691       if test $ac_cv_lib_nsl_gethostbyname = no; then
20692         echo "$as_me:20692: checking for gethostbyname in -lbsd" >&5
20693 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20694 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20695   echo $ECHO_N "(cached) $ECHO_C" >&6
20696 else
20697   ac_check_lib_save_LIBS=$LIBS
20698 LIBS="-lbsd  $LIBS"
20699 cat >conftest.$ac_ext <<_ACEOF
20700 #line 20700 "configure"
20701 #include "confdefs.h"
20702
20703 /* Override any gcc2 internal prototype to avoid an error.  */
20704 #ifdef __cplusplus
20705 extern "C"
20706 #endif
20707 /* We use char because int might match the return type of a gcc2
20708    builtin and then its argument prototype would still apply.  */
20709 char gethostbyname ();
20710 int
20711 main (void)
20712 {
20713 gethostbyname ();
20714   ;
20715   return 0;
20716 }
20717 _ACEOF
20718 rm -f conftest.$ac_objext conftest$ac_exeext
20719 if { (eval echo "$as_me:20719: \"$ac_link\"") >&5
20720   (eval $ac_link) 2>&5
20721   ac_status=$?
20722   echo "$as_me:20722: \$? = $ac_status" >&5
20723   (exit $ac_status); } &&
20724          { ac_try='test -s conftest$ac_exeext'
20725   { (eval echo "$as_me:20725: \"$ac_try\"") >&5
20726   (eval $ac_try) 2>&5
20727   ac_status=$?
20728   echo "$as_me:20728: \$? = $ac_status" >&5
20729   (exit $ac_status); }; }; then
20730   ac_cv_lib_bsd_gethostbyname=yes
20731 else
20732   echo "$as_me: failed program was:" >&5
20733 cat conftest.$ac_ext >&5
20734 ac_cv_lib_bsd_gethostbyname=no
20735 fi
20736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20737 LIBS=$ac_check_lib_save_LIBS
20738 fi
20739 echo "$as_me:20739: result: $ac_cv_lib_bsd_gethostbyname" >&5
20740 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20741 if test $ac_cv_lib_bsd_gethostbyname = yes; then
20742   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20743 fi
20744
20745       fi
20746     fi
20747
20748     # lieder@skyler.mavd.honeywell.com says without -lsocket,
20749     # socket/setsockopt and other routines are undefined under SCO ODT
20750     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
20751     # on later versions), says Simon Leinen: it contains gethostby*
20752     # variants that don't use the nameserver (or something).  -lsocket
20753     # must be given before -lnsl if both are needed.  We assume that
20754     # if connect needs -lnsl, so does gethostbyname.
20755     echo "$as_me:20755: checking for connect" >&5
20756 echo $ECHO_N "checking for connect... $ECHO_C" >&6
20757 if test "${ac_cv_func_connect+set}" = set; then
20758   echo $ECHO_N "(cached) $ECHO_C" >&6
20759 else
20760   cat >conftest.$ac_ext <<_ACEOF
20761 #line 20761 "configure"
20762 #include "confdefs.h"
20763 #define connect autoconf_temporary
20764 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20765 #undef connect
20766
20767 #ifdef __cplusplus
20768 extern "C"
20769 #endif
20770
20771 /* We use char because int might match the return type of a gcc2
20772    builtin and then its argument prototype would still apply.  */
20773 char connect (void);
20774
20775 int
20776 main (void)
20777 {
20778
20779 /* The GNU C library defines stubs for functions which it implements
20780     to always fail with ENOSYS.  Some functions are actually named
20781     something starting with __ and the normal name is an alias.  */
20782 #if defined (__stub_connect) || defined (__stub___connect)
20783 #error found stub for connect
20784 #endif
20785
20786         return 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_func_connect=yes
20804 else
20805   echo "$as_me: failed program was:" >&5
20806 cat conftest.$ac_ext >&5
20807 ac_cv_func_connect=no
20808 fi
20809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20810 fi
20811 echo "$as_me:20811: result: $ac_cv_func_connect" >&5
20812 echo "${ECHO_T}$ac_cv_func_connect" >&6
20813
20814     if test $ac_cv_func_connect = no; then
20815       echo "$as_me:20815: checking for connect in -lsocket" >&5
20816 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
20817 if test "${ac_cv_lib_socket_connect+set}" = set; then
20818   echo $ECHO_N "(cached) $ECHO_C" >&6
20819 else
20820   ac_check_lib_save_LIBS=$LIBS
20821 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
20822 cat >conftest.$ac_ext <<_ACEOF
20823 #line 20823 "configure"
20824 #include "confdefs.h"
20825
20826 /* Override any gcc2 internal prototype to avoid an error.  */
20827 #ifdef __cplusplus
20828 extern "C"
20829 #endif
20830 /* We use char because int might match the return type of a gcc2
20831    builtin and then its argument prototype would still apply.  */
20832 char connect ();
20833 int
20834 main (void)
20835 {
20836 connect ();
20837   ;
20838   return 0;
20839 }
20840 _ACEOF
20841 rm -f conftest.$ac_objext conftest$ac_exeext
20842 if { (eval echo "$as_me:20842: \"$ac_link\"") >&5
20843   (eval $ac_link) 2>&5
20844   ac_status=$?
20845   echo "$as_me:20845: \$? = $ac_status" >&5
20846   (exit $ac_status); } &&
20847          { ac_try='test -s conftest$ac_exeext'
20848   { (eval echo "$as_me:20848: \"$ac_try\"") >&5
20849   (eval $ac_try) 2>&5
20850   ac_status=$?
20851   echo "$as_me:20851: \$? = $ac_status" >&5
20852   (exit $ac_status); }; }; then
20853   ac_cv_lib_socket_connect=yes
20854 else
20855   echo "$as_me: failed program was:" >&5
20856 cat conftest.$ac_ext >&5
20857 ac_cv_lib_socket_connect=no
20858 fi
20859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20860 LIBS=$ac_check_lib_save_LIBS
20861 fi
20862 echo "$as_me:20862: result: $ac_cv_lib_socket_connect" >&5
20863 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
20864 if test $ac_cv_lib_socket_connect = yes; then
20865   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
20866 fi
20867
20868     fi
20869
20870     # Guillermo Gomez says -lposix is necessary on A/UX.
20871     echo "$as_me:20871: checking for remove" >&5
20872 echo $ECHO_N "checking for remove... $ECHO_C" >&6
20873 if test "${ac_cv_func_remove+set}" = set; then
20874   echo $ECHO_N "(cached) $ECHO_C" >&6
20875 else
20876   cat >conftest.$ac_ext <<_ACEOF
20877 #line 20877 "configure"
20878 #include "confdefs.h"
20879 #define remove autoconf_temporary
20880 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20881 #undef remove
20882
20883 #ifdef __cplusplus
20884 extern "C"
20885 #endif
20886
20887 /* We use char because int might match the return type of a gcc2
20888    builtin and then its argument prototype would still apply.  */
20889 char remove (void);
20890
20891 int
20892 main (void)
20893 {
20894
20895 /* The GNU C library defines stubs for functions which it implements
20896     to always fail with ENOSYS.  Some functions are actually named
20897     something starting with __ and the normal name is an alias.  */
20898 #if defined (__stub_remove) || defined (__stub___remove)
20899 #error found stub for remove
20900 #endif
20901
20902         return 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_func_remove=yes
20920 else
20921   echo "$as_me: failed program was:" >&5
20922 cat conftest.$ac_ext >&5
20923 ac_cv_func_remove=no
20924 fi
20925 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20926 fi
20927 echo "$as_me:20927: result: $ac_cv_func_remove" >&5
20928 echo "${ECHO_T}$ac_cv_func_remove" >&6
20929
20930     if test $ac_cv_func_remove = no; then
20931       echo "$as_me:20931: checking for remove in -lposix" >&5
20932 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
20933 if test "${ac_cv_lib_posix_remove+set}" = set; then
20934   echo $ECHO_N "(cached) $ECHO_C" >&6
20935 else
20936   ac_check_lib_save_LIBS=$LIBS
20937 LIBS="-lposix  $LIBS"
20938 cat >conftest.$ac_ext <<_ACEOF
20939 #line 20939 "configure"
20940 #include "confdefs.h"
20941
20942 /* Override any gcc2 internal prototype to avoid an error.  */
20943 #ifdef __cplusplus
20944 extern "C"
20945 #endif
20946 /* We use char because int might match the return type of a gcc2
20947    builtin and then its argument prototype would still apply.  */
20948 char remove ();
20949 int
20950 main (void)
20951 {
20952 remove ();
20953   ;
20954   return 0;
20955 }
20956 _ACEOF
20957 rm -f conftest.$ac_objext conftest$ac_exeext
20958 if { (eval echo "$as_me:20958: \"$ac_link\"") >&5
20959   (eval $ac_link) 2>&5
20960   ac_status=$?
20961   echo "$as_me:20961: \$? = $ac_status" >&5
20962   (exit $ac_status); } &&
20963          { ac_try='test -s conftest$ac_exeext'
20964   { (eval echo "$as_me:20964: \"$ac_try\"") >&5
20965   (eval $ac_try) 2>&5
20966   ac_status=$?
20967   echo "$as_me:20967: \$? = $ac_status" >&5
20968   (exit $ac_status); }; }; then
20969   ac_cv_lib_posix_remove=yes
20970 else
20971   echo "$as_me: failed program was:" >&5
20972 cat conftest.$ac_ext >&5
20973 ac_cv_lib_posix_remove=no
20974 fi
20975 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20976 LIBS=$ac_check_lib_save_LIBS
20977 fi
20978 echo "$as_me:20978: result: $ac_cv_lib_posix_remove" >&5
20979 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
20980 if test $ac_cv_lib_posix_remove = yes; then
20981   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
20982 fi
20983
20984     fi
20985
20986     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
20987     echo "$as_me:20987: checking for shmat" >&5
20988 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
20989 if test "${ac_cv_func_shmat+set}" = set; then
20990   echo $ECHO_N "(cached) $ECHO_C" >&6
20991 else
20992   cat >conftest.$ac_ext <<_ACEOF
20993 #line 20993 "configure"
20994 #include "confdefs.h"
20995 #define shmat autoconf_temporary
20996 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20997 #undef shmat
20998
20999 #ifdef __cplusplus
21000 extern "C"
21001 #endif
21002
21003 /* We use char because int might match the return type of a gcc2
21004    builtin and then its argument prototype would still apply.  */
21005 char shmat (void);
21006
21007 int
21008 main (void)
21009 {
21010
21011 /* The GNU C library defines stubs for functions which it implements
21012     to always fail with ENOSYS.  Some functions are actually named
21013     something starting with __ and the normal name is an alias.  */
21014 #if defined (__stub_shmat) || defined (__stub___shmat)
21015 #error found stub for shmat
21016 #endif
21017
21018         return 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_func_shmat=yes
21036 else
21037   echo "$as_me: failed program was:" >&5
21038 cat conftest.$ac_ext >&5
21039 ac_cv_func_shmat=no
21040 fi
21041 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21042 fi
21043 echo "$as_me:21043: result: $ac_cv_func_shmat" >&5
21044 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21045
21046     if test $ac_cv_func_shmat = no; then
21047       echo "$as_me:21047: checking for shmat in -lipc" >&5
21048 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21049 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21050   echo $ECHO_N "(cached) $ECHO_C" >&6
21051 else
21052   ac_check_lib_save_LIBS=$LIBS
21053 LIBS="-lipc  $LIBS"
21054 cat >conftest.$ac_ext <<_ACEOF
21055 #line 21055 "configure"
21056 #include "confdefs.h"
21057
21058 /* Override any gcc2 internal prototype to avoid an error.  */
21059 #ifdef __cplusplus
21060 extern "C"
21061 #endif
21062 /* We use char because int might match the return type of a gcc2
21063    builtin and then its argument prototype would still apply.  */
21064 char shmat ();
21065 int
21066 main (void)
21067 {
21068 shmat ();
21069   ;
21070   return 0;
21071 }
21072 _ACEOF
21073 rm -f conftest.$ac_objext conftest$ac_exeext
21074 if { (eval echo "$as_me:21074: \"$ac_link\"") >&5
21075   (eval $ac_link) 2>&5
21076   ac_status=$?
21077   echo "$as_me:21077: \$? = $ac_status" >&5
21078   (exit $ac_status); } &&
21079          { ac_try='test -s conftest$ac_exeext'
21080   { (eval echo "$as_me:21080: \"$ac_try\"") >&5
21081   (eval $ac_try) 2>&5
21082   ac_status=$?
21083   echo "$as_me:21083: \$? = $ac_status" >&5
21084   (exit $ac_status); }; }; then
21085   ac_cv_lib_ipc_shmat=yes
21086 else
21087   echo "$as_me: failed program was:" >&5
21088 cat conftest.$ac_ext >&5
21089 ac_cv_lib_ipc_shmat=no
21090 fi
21091 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21092 LIBS=$ac_check_lib_save_LIBS
21093 fi
21094 echo "$as_me:21094: result: $ac_cv_lib_ipc_shmat" >&5
21095 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21096 if test $ac_cv_lib_ipc_shmat = yes; then
21097   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21098 fi
21099
21100     fi
21101   fi
21102
21103   # Check for libraries that X11R6 Xt/Xaw programs need.
21104   ac_save_LDFLAGS=$LDFLAGS
21105   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21106   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21107   # check for ICE first), but we must link in the order -lSM -lICE or
21108   # we get undefined symbols.  So assume we have SM if we have ICE.
21109   # These have to be linked with before -lX11, unlike the other
21110   # libraries we check for below, so use a different variable.
21111   # John Interrante, Karl Berry
21112   echo "$as_me:21112: checking for IceConnectionNumber in -lICE" >&5
21113 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21114 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21115   echo $ECHO_N "(cached) $ECHO_C" >&6
21116 else
21117   ac_check_lib_save_LIBS=$LIBS
21118 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21119 cat >conftest.$ac_ext <<_ACEOF
21120 #line 21120 "configure"
21121 #include "confdefs.h"
21122
21123 /* Override any gcc2 internal prototype to avoid an error.  */
21124 #ifdef __cplusplus
21125 extern "C"
21126 #endif
21127 /* We use char because int might match the return type of a gcc2
21128    builtin and then its argument prototype would still apply.  */
21129 char IceConnectionNumber ();
21130 int
21131 main (void)
21132 {
21133 IceConnectionNumber ();
21134   ;
21135   return 0;
21136 }
21137 _ACEOF
21138 rm -f conftest.$ac_objext conftest$ac_exeext
21139 if { (eval echo "$as_me:21139: \"$ac_link\"") >&5
21140   (eval $ac_link) 2>&5
21141   ac_status=$?
21142   echo "$as_me:21142: \$? = $ac_status" >&5
21143   (exit $ac_status); } &&
21144          { ac_try='test -s conftest$ac_exeext'
21145   { (eval echo "$as_me:21145: \"$ac_try\"") >&5
21146   (eval $ac_try) 2>&5
21147   ac_status=$?
21148   echo "$as_me:21148: \$? = $ac_status" >&5
21149   (exit $ac_status); }; }; then
21150   ac_cv_lib_ICE_IceConnectionNumber=yes
21151 else
21152   echo "$as_me: failed program was:" >&5
21153 cat conftest.$ac_ext >&5
21154 ac_cv_lib_ICE_IceConnectionNumber=no
21155 fi
21156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21157 LIBS=$ac_check_lib_save_LIBS
21158 fi
21159 echo "$as_me:21159: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21160 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21161 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
21162   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21163 fi
21164
21165   LDFLAGS=$ac_save_LDFLAGS
21166
21167 fi
21168
21169 fi
21170
21171 if ( test "$GCC" = yes || test "$GXX" = yes )
21172 then
21173
21174 if ( test "$GCC" = yes || test "$GXX" = yes )
21175 then
21176         case $CFLAGS in
21177         (*-Werror=*)
21178                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21179
21180 echo "${as_me:-configure}:21180: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21181
21182                 cf_temp_flags=
21183                 for cf_temp_scan in $CFLAGS
21184                 do
21185                         case "x$cf_temp_scan" in
21186                         (x-Werror=*)
21187
21188         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21189         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21190
21191                                 ;;
21192                         (*)
21193
21194         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21195         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21196
21197                                 ;;
21198                         esac
21199                 done
21200                 CFLAGS="$cf_temp_flags"
21201                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21202
21203 echo "${as_me:-configure}:21203: testing ... fixed $CFLAGS ..." 1>&5
21204
21205                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21206
21207 echo "${as_me:-configure}:21207: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21208
21209                 ;;
21210         esac
21211 fi
21212
21213 if ( test "$GCC" = yes || test "$GXX" = yes )
21214 then
21215         case $CPPFLAGS in
21216         (*-Werror=*)
21217                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21218
21219 echo "${as_me:-configure}:21219: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21220
21221                 cf_temp_flags=
21222                 for cf_temp_scan in $CPPFLAGS
21223                 do
21224                         case "x$cf_temp_scan" in
21225                         (x-Werror=*)
21226
21227         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21228         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21229
21230                                 ;;
21231                         (*)
21232
21233         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21234         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21235
21236                                 ;;
21237                         esac
21238                 done
21239                 CPPFLAGS="$cf_temp_flags"
21240                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21241
21242 echo "${as_me:-configure}:21242: testing ... fixed $CPPFLAGS ..." 1>&5
21243
21244                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21245
21246 echo "${as_me:-configure}:21246: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21247
21248                 ;;
21249         esac
21250 fi
21251
21252 if ( test "$GCC" = yes || test "$GXX" = yes )
21253 then
21254         case $LDFLAGS in
21255         (*-Werror=*)
21256                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21257
21258 echo "${as_me:-configure}:21258: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21259
21260                 cf_temp_flags=
21261                 for cf_temp_scan in $LDFLAGS
21262                 do
21263                         case "x$cf_temp_scan" in
21264                         (x-Werror=*)
21265
21266         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21267         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21268
21269                                 ;;
21270                         (*)
21271
21272         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21273         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21274
21275                                 ;;
21276                         esac
21277                 done
21278                 LDFLAGS="$cf_temp_flags"
21279                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21280
21281 echo "${as_me:-configure}:21281: testing ... fixed $LDFLAGS ..." 1>&5
21282
21283                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21284
21285 echo "${as_me:-configure}:21285: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21286
21287                 ;;
21288         esac
21289 fi
21290
21291 echo "$as_me:21291: checking if you want to turn on gcc warnings" >&5
21292 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21293
21294 # Check whether --enable-warnings or --disable-warnings was given.
21295 if test "${enable_warnings+set}" = set; then
21296   enableval="$enable_warnings"
21297   test "$enableval" != yes && enableval=no
21298         if test "$enableval" != "no" ; then
21299     with_warnings=yes
21300         else
21301                 with_warnings=no
21302         fi
21303 else
21304   enableval=no
21305         with_warnings=no
21306
21307 fi;
21308 echo "$as_me:21308: result: $with_warnings" >&5
21309 echo "${ECHO_T}$with_warnings" >&6
21310 if test "$with_warnings" = "yes"
21311 then
21312
21313 if ( test "$GCC" = yes || test "$GXX" = yes )
21314 then
21315 cat > conftest.i <<EOF
21316 #ifndef GCC_PRINTF
21317 #define GCC_PRINTF 0
21318 #endif
21319 #ifndef GCC_SCANF
21320 #define GCC_SCANF 0
21321 #endif
21322 #ifndef GCC_NORETURN
21323 #define GCC_NORETURN /* nothing */
21324 #endif
21325 #ifndef GCC_UNUSED
21326 #define GCC_UNUSED /* nothing */
21327 #endif
21328 EOF
21329 if test "$GCC" = yes
21330 then
21331         { echo "$as_me:21331: checking for $CC __attribute__ directives..." >&5
21332 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21333 cat > conftest.$ac_ext <<EOF
21334 #line 21334 "${as_me:-configure}"
21335 #include "confdefs.h"
21336 #include "conftest.h"
21337 #include "conftest.i"
21338 #if     GCC_PRINTF
21339 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21340 #else
21341 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21342 #endif
21343 #if     GCC_SCANF
21344 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21345 #else
21346 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21347 #endif
21348 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21349 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
21350 extern void foo(void) GCC_NORETURN;
21351 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21352 EOF
21353         cf_printf_attribute=no
21354         cf_scanf_attribute=no
21355         for cf_attribute in scanf printf unused noreturn
21356         do
21357
21358 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21359
21360                 cf_directive="__attribute__(($cf_attribute))"
21361                 echo "checking for $CC $cf_directive" 1>&5
21362
21363                 case $cf_attribute in
21364                 (printf)
21365                         cf_printf_attribute=yes
21366                         cat >conftest.h <<EOF
21367 #define GCC_$cf_ATTRIBUTE 1
21368 EOF
21369                         ;;
21370                 (scanf)
21371                         cf_scanf_attribute=yes
21372                         cat >conftest.h <<EOF
21373 #define GCC_$cf_ATTRIBUTE 1
21374 EOF
21375                         ;;
21376                 (*)
21377                         cat >conftest.h <<EOF
21378 #define GCC_$cf_ATTRIBUTE $cf_directive
21379 EOF
21380                         ;;
21381                 esac
21382
21383                 if { (eval echo "$as_me:21383: \"$ac_compile\"") >&5
21384   (eval $ac_compile) 2>&5
21385   ac_status=$?
21386   echo "$as_me:21386: \$? = $ac_status" >&5
21387   (exit $ac_status); }; then
21388                         test -n "$verbose" && echo "$as_me:21388: result: ... $cf_attribute" >&5
21389 echo "${ECHO_T}... $cf_attribute" >&6
21390                         cat conftest.h >>confdefs.h
21391                         case $cf_attribute in
21392                         (noreturn)
21393
21394 cat >>confdefs.h <<EOF
21395 #define GCC_NORETURN $cf_directive
21396 EOF
21397
21398                                 ;;
21399                         (printf)
21400                                 cf_value='/* nothing */'
21401                                 if test "$cf_printf_attribute" != no ; then
21402                                         cf_value='__attribute__((format(printf,fmt,var)))'
21403
21404 cat >>confdefs.h <<\EOF
21405 #define GCC_PRINTF 1
21406 EOF
21407
21408                                 fi
21409
21410 cat >>confdefs.h <<EOF
21411 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21412 EOF
21413
21414                                 ;;
21415                         (scanf)
21416                                 cf_value='/* nothing */'
21417                                 if test "$cf_scanf_attribute" != no ; then
21418                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21419
21420 cat >>confdefs.h <<\EOF
21421 #define GCC_SCANF 1
21422 EOF
21423
21424                                 fi
21425
21426 cat >>confdefs.h <<EOF
21427 #define GCC_SCANFLIKE(fmt,var) $cf_value
21428 EOF
21429
21430                                 ;;
21431                         (unused)
21432
21433 cat >>confdefs.h <<EOF
21434 #define GCC_UNUSED $cf_directive
21435 EOF
21436
21437                                 ;;
21438                         esac
21439                 fi
21440         done
21441 else
21442         fgrep define conftest.i >>confdefs.h
21443 fi
21444 rm -rf conftest*
21445 fi
21446
21447 if test "x$have_x" = xyes; then
21448
21449 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21450 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21451 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21452 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21453 for cf_X_CFLAGS in $X_CFLAGS
21454 do
21455         case "x$cf_X_CFLAGS" in
21456         x-[IUD]*)
21457                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21458                 ;;
21459         *)
21460                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21461                 ;;
21462         esac
21463 done
21464
21465 cat >conftest.$ac_ext <<_ACEOF
21466 #line 21466 "configure"
21467 #include "confdefs.h"
21468
21469 #include <stdlib.h>
21470 #include <X11/Intrinsic.h>
21471
21472 int
21473 main (void)
21474 {
21475 String foo = malloc(1); (void)foo
21476   ;
21477   return 0;
21478 }
21479 _ACEOF
21480 rm -f conftest.$ac_objext
21481 if { (eval echo "$as_me:21481: \"$ac_compile\"") >&5
21482   (eval $ac_compile) 2>&5
21483   ac_status=$?
21484   echo "$as_me:21484: \$? = $ac_status" >&5
21485   (exit $ac_status); } &&
21486          { ac_try='test -s conftest.$ac_objext'
21487   { (eval echo "$as_me:21487: \"$ac_try\"") >&5
21488   (eval $ac_try) 2>&5
21489   ac_status=$?
21490   echo "$as_me:21490: \$? = $ac_status" >&5
21491   (exit $ac_status); }; }; then
21492
21493 echo "$as_me:21493: checking for X11/Xt const-feature" >&5
21494 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21495 if test "${cf_cv_const_x_string+set}" = set; then
21496   echo $ECHO_N "(cached) $ECHO_C" >&6
21497 else
21498
21499         cat >conftest.$ac_ext <<_ACEOF
21500 #line 21500 "configure"
21501 #include "confdefs.h"
21502
21503 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21504 #undef  XTSTRINGDEFINES /* X11R5 and later */
21505 #include <stdlib.h>
21506 #include <X11/Intrinsic.h>
21507
21508 int
21509 main (void)
21510 {
21511 String foo = malloc(1); *foo = 0
21512   ;
21513   return 0;
21514 }
21515 _ACEOF
21516 rm -f conftest.$ac_objext
21517 if { (eval echo "$as_me:21517: \"$ac_compile\"") >&5
21518   (eval $ac_compile) 2>&5
21519   ac_status=$?
21520   echo "$as_me:21520: \$? = $ac_status" >&5
21521   (exit $ac_status); } &&
21522          { ac_try='test -s conftest.$ac_objext'
21523   { (eval echo "$as_me:21523: \"$ac_try\"") >&5
21524   (eval $ac_try) 2>&5
21525   ac_status=$?
21526   echo "$as_me:21526: \$? = $ac_status" >&5
21527   (exit $ac_status); }; }; then
21528
21529                         cf_cv_const_x_string=no
21530
21531 else
21532   echo "$as_me: failed program was:" >&5
21533 cat conftest.$ac_ext >&5
21534
21535                         cf_cv_const_x_string=yes
21536
21537 fi
21538 rm -f conftest.$ac_objext conftest.$ac_ext
21539
21540 fi
21541 echo "$as_me:21541: result: $cf_cv_const_x_string" >&5
21542 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21543
21544 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21545 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21546 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21547
21548 case $cf_cv_const_x_string in
21549 (no)
21550
21551         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21552         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21553
21554         ;;
21555 (*)
21556
21557         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21558         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21559
21560         ;;
21561 esac
21562
21563 else
21564   echo "$as_me: failed program was:" >&5
21565 cat conftest.$ac_ext >&5
21566 fi
21567 rm -f conftest.$ac_objext conftest.$ac_ext
21568  fi
21569 cat > conftest.$ac_ext <<EOF
21570 #line 21570 "${as_me:-configure}"
21571 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21572 EOF
21573 if test "$INTEL_COMPILER" = yes
21574 then
21575 # The "-wdXXX" options suppress warnings:
21576 # remark #1419: external declaration in primary source file
21577 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21578 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21579 # remark #193: zero used for undefined preprocessing identifier
21580 # remark #593: variable "curs_sb_left_arrow" was set but never used
21581 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21582 # remark #869: parameter "tw" was never referenced
21583 # remark #981: operands are evaluated in unspecified order
21584 # warning #279: controlling expression is constant
21585
21586         { echo "$as_me:21586: checking for $CC warning options..." >&5
21587 echo "$as_me: checking for $CC warning options..." >&6;}
21588         cf_save_CFLAGS="$CFLAGS"
21589         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21590         for cf_opt in \
21591                 wd1419 \
21592                 wd1683 \
21593                 wd1684 \
21594                 wd193 \
21595                 wd593 \
21596                 wd279 \
21597                 wd810 \
21598                 wd869 \
21599                 wd981
21600         do
21601                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21602                 if { (eval echo "$as_me:21602: \"$ac_compile\"") >&5
21603   (eval $ac_compile) 2>&5
21604   ac_status=$?
21605   echo "$as_me:21605: \$? = $ac_status" >&5
21606   (exit $ac_status); }; then
21607                         test -n "$verbose" && echo "$as_me:21607: result: ... -$cf_opt" >&5
21608 echo "${ECHO_T}... -$cf_opt" >&6
21609                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21610                 fi
21611         done
21612         CFLAGS="$cf_save_CFLAGS"
21613 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21614 then
21615         { echo "$as_me:21615: checking for $CC warning options..." >&5
21616 echo "$as_me: checking for $CC warning options..." >&6;}
21617         cf_save_CFLAGS="$CFLAGS"
21618         cf_warn_CONST=""
21619         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21620         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21621         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21622         for cf_opt in W Wall \
21623                 Wbad-function-cast \
21624                 Wcast-align \
21625                 Wcast-qual \
21626                 Wdeclaration-after-statement \
21627                 Wextra \
21628                 Winline \
21629                 Wmissing-declarations \
21630                 Wmissing-prototypes \
21631                 Wnested-externs \
21632                 Wpointer-arith \
21633                 Wshadow \
21634                 Wstrict-prototypes \
21635                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21636         do
21637                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21638                 if { (eval echo "$as_me:21638: \"$ac_compile\"") >&5
21639   (eval $ac_compile) 2>&5
21640   ac_status=$?
21641   echo "$as_me:21641: \$? = $ac_status" >&5
21642   (exit $ac_status); }; then
21643                         test -n "$verbose" && echo "$as_me:21643: result: ... -$cf_opt" >&5
21644 echo "${ECHO_T}... -$cf_opt" >&6
21645                         case $cf_opt in
21646                         (Winline)
21647                                 case $GCC_VERSION in
21648                                 ([34].*)
21649                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21650
21651 echo "${as_me:-configure}:21651: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21652
21653                                         continue;;
21654                                 esac
21655                                 ;;
21656                         (Wpointer-arith)
21657                                 case $GCC_VERSION in
21658                                 ([12].*)
21659                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21660
21661 echo "${as_me:-configure}:21661: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21662
21663                                         continue;;
21664                                 esac
21665                                 ;;
21666                         esac
21667                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21668                 fi
21669         done
21670         CFLAGS="$cf_save_CFLAGS"
21671 fi
21672 rm -rf conftest*
21673
21674 fi
21675
21676 fi
21677
21678 echo "$as_me:21678: checking if you want to use dmalloc for testing" >&5
21679 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21680
21681 # Check whether --with-dmalloc or --without-dmalloc was given.
21682 if test "${with_dmalloc+set}" = set; then
21683   withval="$with_dmalloc"
21684
21685 cat >>confdefs.h <<EOF
21686 #define USE_DMALLOC 1
21687 EOF
21688
21689         : ${with_cflags:=-g}
21690         : ${with_no_leaks:=yes}
21691          with_dmalloc=yes
21692 else
21693   with_dmalloc=
21694 fi;
21695 echo "$as_me:21695: result: ${with_dmalloc:-no}" >&5
21696 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21697
21698 case .$with_cflags in
21699 (.*-g*)
21700         case .$CFLAGS in
21701         (.*-g*)
21702                 ;;
21703         (*)
21704
21705 cf_fix_cppflags=no
21706 cf_new_cflags=
21707 cf_new_cppflags=
21708 cf_new_extra_cppflags=
21709
21710 for cf_add_cflags in -g
21711 do
21712 case $cf_fix_cppflags in
21713 (no)
21714         case $cf_add_cflags in
21715         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21716                 case $cf_add_cflags in
21717                 (-D*)
21718                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21719
21720                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21721                                 && test -z "${cf_tst_cflags}" \
21722                                 && cf_fix_cppflags=yes
21723
21724                         if test $cf_fix_cppflags = yes ; then
21725
21726         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21727         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21728
21729                                 continue
21730                         elif test "${cf_tst_cflags}" = "\"'" ; then
21731
21732         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21733         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21734
21735                                 continue
21736                         fi
21737                         ;;
21738                 esac
21739                 case "$CPPFLAGS" in
21740                 (*$cf_add_cflags)
21741                         ;;
21742                 (*)
21743                         case $cf_add_cflags in
21744                         (-D*)
21745                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21746
21747 CPPFLAGS=`echo "$CPPFLAGS" | \
21748         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21749                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21750
21751                                 ;;
21752                         esac
21753
21754         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21755         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21756
21757                         ;;
21758                 esac
21759                 ;;
21760         (*)
21761
21762         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21763         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21764
21765                 ;;
21766         esac
21767         ;;
21768 (yes)
21769
21770         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21771         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21772
21773         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
21774
21775         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21776                 && test -z "${cf_tst_cflags}" \
21777                 && cf_fix_cppflags=no
21778         ;;
21779 esac
21780 done
21781
21782 if test -n "$cf_new_cflags" ; then
21783
21784         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21785         CFLAGS="${CFLAGS}$cf_new_cflags"
21786
21787 fi
21788
21789 if test -n "$cf_new_cppflags" ; then
21790
21791         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21792         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21793
21794 fi
21795
21796 if test -n "$cf_new_extra_cppflags" ; then
21797
21798         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21799         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21800
21801 fi
21802
21803                 ;;
21804         esac
21805         ;;
21806 esac
21807
21808 if test "$with_dmalloc" = yes ; then
21809         echo "$as_me:21809: checking for dmalloc.h" >&5
21810 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
21811 if test "${ac_cv_header_dmalloc_h+set}" = set; then
21812   echo $ECHO_N "(cached) $ECHO_C" >&6
21813 else
21814   cat >conftest.$ac_ext <<_ACEOF
21815 #line 21815 "configure"
21816 #include "confdefs.h"
21817 #include <dmalloc.h>
21818 _ACEOF
21819 if { (eval echo "$as_me:21819: \"$ac_cpp conftest.$ac_ext\"") >&5
21820   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21821   ac_status=$?
21822   egrep -v '^ *\+' conftest.er1 >conftest.err
21823   rm -f conftest.er1
21824   cat conftest.err >&5
21825   echo "$as_me:21825: \$? = $ac_status" >&5
21826   (exit $ac_status); } >/dev/null; then
21827   if test -s conftest.err; then
21828     ac_cpp_err=$ac_c_preproc_warn_flag
21829   else
21830     ac_cpp_err=
21831   fi
21832 else
21833   ac_cpp_err=yes
21834 fi
21835 if test -z "$ac_cpp_err"; then
21836   ac_cv_header_dmalloc_h=yes
21837 else
21838   echo "$as_me: failed program was:" >&5
21839   cat conftest.$ac_ext >&5
21840   ac_cv_header_dmalloc_h=no
21841 fi
21842 rm -f conftest.err conftest.$ac_ext
21843 fi
21844 echo "$as_me:21844: result: $ac_cv_header_dmalloc_h" >&5
21845 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
21846 if test $ac_cv_header_dmalloc_h = yes; then
21847
21848 echo "$as_me:21848: checking for dmalloc_debug in -ldmalloc" >&5
21849 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
21850 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
21851   echo $ECHO_N "(cached) $ECHO_C" >&6
21852 else
21853   ac_check_lib_save_LIBS=$LIBS
21854 LIBS="-ldmalloc  $LIBS"
21855 cat >conftest.$ac_ext <<_ACEOF
21856 #line 21856 "configure"
21857 #include "confdefs.h"
21858
21859 /* Override any gcc2 internal prototype to avoid an error.  */
21860 #ifdef __cplusplus
21861 extern "C"
21862 #endif
21863 /* We use char because int might match the return type of a gcc2
21864    builtin and then its argument prototype would still apply.  */
21865 char dmalloc_debug ();
21866 int
21867 main (void)
21868 {
21869 dmalloc_debug ();
21870   ;
21871   return 0;
21872 }
21873 _ACEOF
21874 rm -f conftest.$ac_objext conftest$ac_exeext
21875 if { (eval echo "$as_me:21875: \"$ac_link\"") >&5
21876   (eval $ac_link) 2>&5
21877   ac_status=$?
21878   echo "$as_me:21878: \$? = $ac_status" >&5
21879   (exit $ac_status); } &&
21880          { ac_try='test -s conftest$ac_exeext'
21881   { (eval echo "$as_me:21881: \"$ac_try\"") >&5
21882   (eval $ac_try) 2>&5
21883   ac_status=$?
21884   echo "$as_me:21884: \$? = $ac_status" >&5
21885   (exit $ac_status); }; }; then
21886   ac_cv_lib_dmalloc_dmalloc_debug=yes
21887 else
21888   echo "$as_me: failed program was:" >&5
21889 cat conftest.$ac_ext >&5
21890 ac_cv_lib_dmalloc_dmalloc_debug=no
21891 fi
21892 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21893 LIBS=$ac_check_lib_save_LIBS
21894 fi
21895 echo "$as_me:21895: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
21896 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
21897 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
21898   cat >>confdefs.h <<EOF
21899 #define HAVE_LIBDMALLOC 1
21900 EOF
21901
21902   LIBS="-ldmalloc $LIBS"
21903
21904 fi
21905
21906 fi
21907
21908 fi
21909
21910 echo "$as_me:21910: checking if you want to use dbmalloc for testing" >&5
21911 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
21912
21913 # Check whether --with-dbmalloc or --without-dbmalloc was given.
21914 if test "${with_dbmalloc+set}" = set; then
21915   withval="$with_dbmalloc"
21916
21917 cat >>confdefs.h <<EOF
21918 #define USE_DBMALLOC 1
21919 EOF
21920
21921         : ${with_cflags:=-g}
21922         : ${with_no_leaks:=yes}
21923          with_dbmalloc=yes
21924 else
21925   with_dbmalloc=
21926 fi;
21927 echo "$as_me:21927: result: ${with_dbmalloc:-no}" >&5
21928 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
21929
21930 case .$with_cflags in
21931 (.*-g*)
21932         case .$CFLAGS in
21933         (.*-g*)
21934                 ;;
21935         (*)
21936
21937 cf_fix_cppflags=no
21938 cf_new_cflags=
21939 cf_new_cppflags=
21940 cf_new_extra_cppflags=
21941
21942 for cf_add_cflags in -g
21943 do
21944 case $cf_fix_cppflags in
21945 (no)
21946         case $cf_add_cflags in
21947         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21948                 case $cf_add_cflags in
21949                 (-D*)
21950                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21951
21952                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21953                                 && test -z "${cf_tst_cflags}" \
21954                                 && cf_fix_cppflags=yes
21955
21956                         if test $cf_fix_cppflags = yes ; then
21957
21958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21960
21961                                 continue
21962                         elif test "${cf_tst_cflags}" = "\"'" ; then
21963
21964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21966
21967                                 continue
21968                         fi
21969                         ;;
21970                 esac
21971                 case "$CPPFLAGS" in
21972                 (*$cf_add_cflags)
21973                         ;;
21974                 (*)
21975                         case $cf_add_cflags in
21976                         (-D*)
21977                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21978
21979 CPPFLAGS=`echo "$CPPFLAGS" | \
21980         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21981                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21982
21983                                 ;;
21984                         esac
21985
21986         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21987         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21988
21989                         ;;
21990                 esac
21991                 ;;
21992         (*)
21993
21994         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21995         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21996
21997                 ;;
21998         esac
21999         ;;
22000 (yes)
22001
22002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22004
22005         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22006
22007         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22008                 && test -z "${cf_tst_cflags}" \
22009                 && cf_fix_cppflags=no
22010         ;;
22011 esac
22012 done
22013
22014 if test -n "$cf_new_cflags" ; then
22015
22016         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22017         CFLAGS="${CFLAGS}$cf_new_cflags"
22018
22019 fi
22020
22021 if test -n "$cf_new_cppflags" ; then
22022
22023         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22024         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22025
22026 fi
22027
22028 if test -n "$cf_new_extra_cppflags" ; then
22029
22030         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22031         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22032
22033 fi
22034
22035                 ;;
22036         esac
22037         ;;
22038 esac
22039
22040 if test "$with_dbmalloc" = yes ; then
22041         echo "$as_me:22041: checking for dbmalloc.h" >&5
22042 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22043 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22044   echo $ECHO_N "(cached) $ECHO_C" >&6
22045 else
22046   cat >conftest.$ac_ext <<_ACEOF
22047 #line 22047 "configure"
22048 #include "confdefs.h"
22049 #include <dbmalloc.h>
22050 _ACEOF
22051 if { (eval echo "$as_me:22051: \"$ac_cpp conftest.$ac_ext\"") >&5
22052   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
22053   ac_status=$?
22054   egrep -v '^ *\+' conftest.er1 >conftest.err
22055   rm -f conftest.er1
22056   cat conftest.err >&5
22057   echo "$as_me:22057: \$? = $ac_status" >&5
22058   (exit $ac_status); } >/dev/null; then
22059   if test -s conftest.err; then
22060     ac_cpp_err=$ac_c_preproc_warn_flag
22061   else
22062     ac_cpp_err=
22063   fi
22064 else
22065   ac_cpp_err=yes
22066 fi
22067 if test -z "$ac_cpp_err"; then
22068   ac_cv_header_dbmalloc_h=yes
22069 else
22070   echo "$as_me: failed program was:" >&5
22071   cat conftest.$ac_ext >&5
22072   ac_cv_header_dbmalloc_h=no
22073 fi
22074 rm -f conftest.err conftest.$ac_ext
22075 fi
22076 echo "$as_me:22076: result: $ac_cv_header_dbmalloc_h" >&5
22077 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22078 if test $ac_cv_header_dbmalloc_h = yes; then
22079
22080 echo "$as_me:22080: checking for debug_malloc in -ldbmalloc" >&5
22081 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22082 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22083   echo $ECHO_N "(cached) $ECHO_C" >&6
22084 else
22085   ac_check_lib_save_LIBS=$LIBS
22086 LIBS="-ldbmalloc  $LIBS"
22087 cat >conftest.$ac_ext <<_ACEOF
22088 #line 22088 "configure"
22089 #include "confdefs.h"
22090
22091 /* Override any gcc2 internal prototype to avoid an error.  */
22092 #ifdef __cplusplus
22093 extern "C"
22094 #endif
22095 /* We use char because int might match the return type of a gcc2
22096    builtin and then its argument prototype would still apply.  */
22097 char debug_malloc ();
22098 int
22099 main (void)
22100 {
22101 debug_malloc ();
22102   ;
22103   return 0;
22104 }
22105 _ACEOF
22106 rm -f conftest.$ac_objext conftest$ac_exeext
22107 if { (eval echo "$as_me:22107: \"$ac_link\"") >&5
22108   (eval $ac_link) 2>&5
22109   ac_status=$?
22110   echo "$as_me:22110: \$? = $ac_status" >&5
22111   (exit $ac_status); } &&
22112          { ac_try='test -s conftest$ac_exeext'
22113   { (eval echo "$as_me:22113: \"$ac_try\"") >&5
22114   (eval $ac_try) 2>&5
22115   ac_status=$?
22116   echo "$as_me:22116: \$? = $ac_status" >&5
22117   (exit $ac_status); }; }; then
22118   ac_cv_lib_dbmalloc_debug_malloc=yes
22119 else
22120   echo "$as_me: failed program was:" >&5
22121 cat conftest.$ac_ext >&5
22122 ac_cv_lib_dbmalloc_debug_malloc=no
22123 fi
22124 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22125 LIBS=$ac_check_lib_save_LIBS
22126 fi
22127 echo "$as_me:22127: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22128 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22129 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
22130   cat >>confdefs.h <<EOF
22131 #define HAVE_LIBDBMALLOC 1
22132 EOF
22133
22134   LIBS="-ldbmalloc $LIBS"
22135
22136 fi
22137
22138 fi
22139
22140 fi
22141
22142 echo "$as_me:22142: checking if you want to use valgrind for testing" >&5
22143 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22144
22145 # Check whether --with-valgrind or --without-valgrind was given.
22146 if test "${with_valgrind+set}" = set; then
22147   withval="$with_valgrind"
22148
22149 cat >>confdefs.h <<EOF
22150 #define USE_VALGRIND 1
22151 EOF
22152
22153         : ${with_cflags:=-g}
22154         : ${with_no_leaks:=yes}
22155          with_valgrind=yes
22156 else
22157   with_valgrind=
22158 fi;
22159 echo "$as_me:22159: result: ${with_valgrind:-no}" >&5
22160 echo "${ECHO_T}${with_valgrind:-no}" >&6
22161
22162 case .$with_cflags in
22163 (.*-g*)
22164         case .$CFLAGS in
22165         (.*-g*)
22166                 ;;
22167         (*)
22168
22169 cf_fix_cppflags=no
22170 cf_new_cflags=
22171 cf_new_cppflags=
22172 cf_new_extra_cppflags=
22173
22174 for cf_add_cflags in -g
22175 do
22176 case $cf_fix_cppflags in
22177 (no)
22178         case $cf_add_cflags in
22179         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22180                 case $cf_add_cflags in
22181                 (-D*)
22182                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22183
22184                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22185                                 && test -z "${cf_tst_cflags}" \
22186                                 && cf_fix_cppflags=yes
22187
22188                         if test $cf_fix_cppflags = yes ; then
22189
22190         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22191         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22192
22193                                 continue
22194                         elif test "${cf_tst_cflags}" = "\"'" ; then
22195
22196         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22197         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22198
22199                                 continue
22200                         fi
22201                         ;;
22202                 esac
22203                 case "$CPPFLAGS" in
22204                 (*$cf_add_cflags)
22205                         ;;
22206                 (*)
22207                         case $cf_add_cflags in
22208                         (-D*)
22209                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22210
22211 CPPFLAGS=`echo "$CPPFLAGS" | \
22212         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22213                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22214
22215                                 ;;
22216                         esac
22217
22218         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22219         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22220
22221                         ;;
22222                 esac
22223                 ;;
22224         (*)
22225
22226         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22227         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22228
22229                 ;;
22230         esac
22231         ;;
22232 (yes)
22233
22234         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22235         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22236
22237         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22238
22239         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22240                 && test -z "${cf_tst_cflags}" \
22241                 && cf_fix_cppflags=no
22242         ;;
22243 esac
22244 done
22245
22246 if test -n "$cf_new_cflags" ; then
22247
22248         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22249         CFLAGS="${CFLAGS}$cf_new_cflags"
22250
22251 fi
22252
22253 if test -n "$cf_new_cppflags" ; then
22254
22255         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22256         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22257
22258 fi
22259
22260 if test -n "$cf_new_extra_cppflags" ; then
22261
22262         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22263         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22264
22265 fi
22266
22267                 ;;
22268         esac
22269         ;;
22270 esac
22271
22272 echo "$as_me:22272: checking if you want to perform memory-leak testing" >&5
22273 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22274
22275 # Check whether --enable-leaks or --disable-leaks was given.
22276 if test "${enable_leaks+set}" = set; then
22277   enableval="$enable_leaks"
22278   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22279 else
22280   : ${with_no_leaks:=no}
22281 fi;
22282 echo "$as_me:22282: result: $with_no_leaks" >&5
22283 echo "${ECHO_T}$with_no_leaks" >&6
22284
22285 if test "$with_no_leaks" = yes ; then
22286
22287 cat >>confdefs.h <<\EOF
22288 #define NO_LEAKS 1
22289 EOF
22290
22291 cat >>confdefs.h <<\EOF
22292 #define YY_NO_LEAKS 1
22293 EOF
22294
22295 fi
22296
22297 LD_RPATH_OPT=
22298 if test "x$cf_cv_enable_rpath" != xno
22299 then
22300         echo "$as_me:22300: checking for an rpath option" >&5
22301 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22302         case $cf_cv_system_name in
22303         (irix*)
22304                 if test "$GCC" = yes; then
22305                         LD_RPATH_OPT="-Wl,-rpath,"
22306                 else
22307                         LD_RPATH_OPT="-rpath "
22308                 fi
22309                 ;;
22310         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22311                 LD_RPATH_OPT="-Wl,-rpath,"
22312                 ;;
22313         (openbsd[2-9].*|mirbsd*)
22314                 LD_RPATH_OPT="-Wl,-rpath,"
22315                 ;;
22316         (dragonfly*)
22317                 LD_RPATH_OPT="-rpath "
22318                 ;;
22319         (netbsd*)
22320                 LD_RPATH_OPT="-Wl,-rpath,"
22321                 ;;
22322         (osf*|mls+*)
22323                 LD_RPATH_OPT="-rpath "
22324                 ;;
22325         (solaris2*)
22326                 LD_RPATH_OPT="-R"
22327                 ;;
22328         (*)
22329                 ;;
22330         esac
22331         echo "$as_me:22331: result: $LD_RPATH_OPT" >&5
22332 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22333
22334         case "x$LD_RPATH_OPT" in
22335         (x-R*)
22336                 echo "$as_me:22336: checking if we need a space after rpath option" >&5
22337 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22338                 cf_save_LIBS="$LIBS"
22339
22340 cf_add_libs="$LIBS"
22341 # reverse order
22342 cf_add_0lib=
22343 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22344 # filter duplicates
22345 for cf_add_1lib in $cf_add_0lib; do
22346         for cf_add_2lib in $cf_add_libs; do
22347                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22348                         cf_add_1lib=
22349                         break
22350                 fi
22351         done
22352         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22353 done
22354 LIBS="$cf_add_libs"
22355
22356                 cat >conftest.$ac_ext <<_ACEOF
22357 #line 22357 "configure"
22358 #include "confdefs.h"
22359
22360 int
22361 main (void)
22362 {
22363
22364   ;
22365   return 0;
22366 }
22367 _ACEOF
22368 rm -f conftest.$ac_objext conftest$ac_exeext
22369 if { (eval echo "$as_me:22369: \"$ac_link\"") >&5
22370   (eval $ac_link) 2>&5
22371   ac_status=$?
22372   echo "$as_me:22372: \$? = $ac_status" >&5
22373   (exit $ac_status); } &&
22374          { ac_try='test -s conftest$ac_exeext'
22375   { (eval echo "$as_me:22375: \"$ac_try\"") >&5
22376   (eval $ac_try) 2>&5
22377   ac_status=$?
22378   echo "$as_me:22378: \$? = $ac_status" >&5
22379   (exit $ac_status); }; }; then
22380   cf_rpath_space=no
22381 else
22382   echo "$as_me: failed program was:" >&5
22383 cat conftest.$ac_ext >&5
22384 cf_rpath_space=yes
22385 fi
22386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22387                 LIBS="$cf_save_LIBS"
22388                 echo "$as_me:22388: result: $cf_rpath_space" >&5
22389 echo "${ECHO_T}$cf_rpath_space" >&6
22390                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22391                 ;;
22392         esac
22393 fi
22394
22395 echo "$as_me:22395: checking if rpath-hack should be disabled" >&5
22396 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22397
22398 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22399 if test "${enable_rpath_hack+set}" = set; then
22400   enableval="$enable_rpath_hack"
22401   test "$enableval" != no && enableval=yes
22402         if test "$enableval" != "yes" ; then
22403     cf_disable_rpath_hack=yes
22404         else
22405                 cf_disable_rpath_hack=no
22406         fi
22407 else
22408   enableval=yes
22409         cf_disable_rpath_hack=no
22410
22411 fi;
22412 echo "$as_me:22412: result: $cf_disable_rpath_hack" >&5
22413 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22414 if test "$cf_disable_rpath_hack" = no ; then
22415
22416 echo "$as_me:22416: checking for updated LDFLAGS" >&5
22417 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22418 if test -n "$LD_RPATH_OPT" ; then
22419         echo "$as_me:22419: result: maybe" >&5
22420 echo "${ECHO_T}maybe" >&6
22421
22422         for ac_prog in ldd
22423 do
22424   # Extract the first word of "$ac_prog", so it can be a program name with args.
22425 set dummy $ac_prog; ac_word=$2
22426 echo "$as_me:22426: checking for $ac_word" >&5
22427 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22428 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22429   echo $ECHO_N "(cached) $ECHO_C" >&6
22430 else
22431   if test -n "$cf_ldd_prog"; then
22432   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22433 else
22434   ac_save_IFS=$IFS; IFS=$ac_path_separator
22435 ac_dummy="$PATH"
22436 for ac_dir in $ac_dummy; do
22437   IFS=$ac_save_IFS
22438   test -z "$ac_dir" && ac_dir=.
22439   $as_executable_p "$ac_dir/$ac_word" || continue
22440 ac_cv_prog_cf_ldd_prog="$ac_prog"
22441 echo "$as_me:22441: found $ac_dir/$ac_word" >&5
22442 break
22443 done
22444
22445 fi
22446 fi
22447 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22448 if test -n "$cf_ldd_prog"; then
22449   echo "$as_me:22449: result: $cf_ldd_prog" >&5
22450 echo "${ECHO_T}$cf_ldd_prog" >&6
22451 else
22452   echo "$as_me:22452: result: no" >&5
22453 echo "${ECHO_T}no" >&6
22454 fi
22455
22456   test -n "$cf_ldd_prog" && break
22457 done
22458 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22459
22460         cf_rpath_list="/usr/lib /lib"
22461         if test "$cf_ldd_prog" != no
22462         then
22463                 cf_rpath_oops=
22464
22465 cat >conftest.$ac_ext <<_ACEOF
22466 #line 22466 "configure"
22467 #include "confdefs.h"
22468 #include <stdio.h>
22469 int
22470 main (void)
22471 {
22472 printf("Hello");
22473   ;
22474   return 0;
22475 }
22476 _ACEOF
22477 rm -f conftest.$ac_objext conftest$ac_exeext
22478 if { (eval echo "$as_me:22478: \"$ac_link\"") >&5
22479   (eval $ac_link) 2>&5
22480   ac_status=$?
22481   echo "$as_me:22481: \$? = $ac_status" >&5
22482   (exit $ac_status); } &&
22483          { ac_try='test -s conftest$ac_exeext'
22484   { (eval echo "$as_me:22484: \"$ac_try\"") >&5
22485   (eval $ac_try) 2>&5
22486   ac_status=$?
22487   echo "$as_me:22487: \$? = $ac_status" >&5
22488   (exit $ac_status); }; }; then
22489   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22490                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22491 else
22492   echo "$as_me: failed program was:" >&5
22493 cat conftest.$ac_ext >&5
22494 fi
22495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22496
22497                 # If we passed the link-test, but get a "not found" on a given library,
22498                 # this could be due to inept reconfiguration of gcc to make it only
22499                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22500                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22501                 # /usr/local libraries.
22502                 if test -n "$cf_rpath_oops"
22503                 then
22504                         for cf_rpath_src in $cf_rpath_oops
22505                         do
22506                                 for cf_rpath_dir in \
22507                                         /usr/local \
22508                                         /usr/pkg \
22509                                         /opt/sfw
22510                                 do
22511                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
22512                                         then
22513                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22514
22515 echo "${as_me:-configure}:22515: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22516
22517                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22518                                                 break
22519                                         fi
22520                                 done
22521                         done
22522                 fi
22523         fi
22524
22525         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22526
22527 echo "${as_me:-configure}:22527: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22528
22529 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22530
22531 echo "${as_me:-configure}:22531: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22532
22533 cf_rpath_dst=
22534 for cf_rpath_src in $LDFLAGS
22535 do
22536         case $cf_rpath_src in
22537         (-L*)
22538
22539                 # check if this refers to a directory which we will ignore
22540                 cf_rpath_skip=no
22541                 if test -n "$cf_rpath_list"
22542                 then
22543                         for cf_rpath_item in $cf_rpath_list
22544                         do
22545                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22546                                 then
22547                                         cf_rpath_skip=yes
22548                                         break
22549                                 fi
22550                         done
22551                 fi
22552
22553                 if test "$cf_rpath_skip" = no
22554                 then
22555                         # transform the option
22556                         if test "$LD_RPATH_OPT" = "-R " ; then
22557                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22558                         else
22559                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22560                         fi
22561
22562                         # if we have not already added this, add it now
22563                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22564                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22565                         then
22566                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22567
22568 echo "${as_me:-configure}:22568: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22569
22570                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22571                         fi
22572                 fi
22573                 ;;
22574         esac
22575         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22576 done
22577 LDFLAGS=$cf_rpath_dst
22578
22579 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22580
22581 echo "${as_me:-configure}:22581: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22582
22583 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22584
22585 echo "${as_me:-configure}:22585: testing ...checking LIBS $LIBS ..." 1>&5
22586
22587 cf_rpath_dst=
22588 for cf_rpath_src in $LIBS
22589 do
22590         case $cf_rpath_src in
22591         (-L*)
22592
22593                 # check if this refers to a directory which we will ignore
22594                 cf_rpath_skip=no
22595                 if test -n "$cf_rpath_list"
22596                 then
22597                         for cf_rpath_item in $cf_rpath_list
22598                         do
22599                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22600                                 then
22601                                         cf_rpath_skip=yes
22602                                         break
22603                                 fi
22604                         done
22605                 fi
22606
22607                 if test "$cf_rpath_skip" = no
22608                 then
22609                         # transform the option
22610                         if test "$LD_RPATH_OPT" = "-R " ; then
22611                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22612                         else
22613                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22614                         fi
22615
22616                         # if we have not already added this, add it now
22617                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22618                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22619                         then
22620                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22621
22622 echo "${as_me:-configure}:22622: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22623
22624                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22625                         fi
22626                 fi
22627                 ;;
22628         esac
22629         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22630 done
22631 LIBS=$cf_rpath_dst
22632
22633 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22634
22635 echo "${as_me:-configure}:22635: testing ...checked LIBS $LIBS ..." 1>&5
22636
22637         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22638
22639 echo "${as_me:-configure}:22639: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22640
22641 else
22642         echo "$as_me:22642: result: no" >&5
22643 echo "${ECHO_T}no" >&6
22644 fi
22645
22646 fi
22647
22648 TEST_ARGS="$LIBS"
22649 LIBS=
22650
22651 ac_config_files="$ac_config_files Makefile"
22652 ac_config_commands="$ac_config_commands default"
22653 cat >confcache <<\_ACEOF
22654 # This file is a shell script that caches the results of configure
22655 # tests run on this system so they can be shared between configure
22656 # scripts and configure runs, see configure's option --config-cache.
22657 # It is not useful on other systems.  If it contains results you don't
22658 # want to keep, you may remove or edit it.
22659 #
22660 # config.status only pays attention to the cache file if you give it
22661 # the --recheck option to rerun configure.
22662 #
22663 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22664 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22665 # following values.
22666
22667 _ACEOF
22668
22669 # The following way of writing the cache mishandles newlines in values,
22670 # but we know of no workaround that is simple, portable, and efficient.
22671 # So, don't put newlines in cache variables' values.
22672 # Ultrix sh set writes to stderr and can't be redirected directly,
22673 # and sets the high bit in the cache file unless we assign to the vars.
22674 {
22675   (set) 2>&1 |
22676     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22677     *ac_space=\ *)
22678       # `set' does not quote correctly, so add quotes (double-quote
22679       # substitution turns \\\\ into \\, and sed turns \\ into \).
22680       sed -n \
22681         "s/'/'\\\\''/g;
22682           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22683       ;;
22684     *)
22685       # `set' quotes correctly as required by POSIX, so do not add quotes.
22686       sed -n \
22687         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22688       ;;
22689     esac;
22690 } |
22691   sed '
22692      t clear
22693      : clear
22694      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22695      t end
22696      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22697      : end' >>confcache
22698 if cmp -s $cache_file confcache; then :; else
22699   if test -w $cache_file; then
22700     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22701     cat confcache >$cache_file
22702   else
22703     echo "not updating unwritable cache $cache_file"
22704   fi
22705 fi
22706 rm -f confcache
22707
22708 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22709 # Let make expand exec_prefix.
22710 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22711
22712 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22713 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22714 # trailing colons and then remove the whole line if VPATH becomes empty
22715 # (actually we leave an empty line to preserve line numbers).
22716 if test "x$srcdir" = x.; then
22717   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22718 s/:*\$(srcdir):*/:/;
22719 s/:*\${srcdir}:*/:/;
22720 s/:*@srcdir@:*/:/;
22721 s/^\([^=]*=[    ]*\):*/\1/;
22722 s/:*$//;
22723 s/^[^=]*=[      ]*$//;
22724 }'
22725 fi
22726
22727 DEFS=-DHAVE_CONFIG_H
22728
22729 : ${CONFIG_STATUS=./config.status}
22730 ac_clean_files_save=$ac_clean_files
22731 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22732 { echo "$as_me:22732: creating $CONFIG_STATUS" >&5
22733 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22734 cat >$CONFIG_STATUS <<_ACEOF
22735 #! $SHELL
22736 # Generated automatically by configure.
22737 # Run this file to recreate the current configuration.
22738 # Compiler output produced by configure, useful for debugging
22739 # configure, is in config.log if it exists.
22740
22741 debug=false
22742 SHELL=\${CONFIG_SHELL-$SHELL}
22743 ac_cs_invocation="\$0 \$@"
22744
22745 CLICOLOR_FORCE= GREP_OPTIONS=
22746 unset CLICOLOR_FORCE GREP_OPTIONS
22747 _ACEOF
22748
22749 cat >>$CONFIG_STATUS <<\_ACEOF
22750 # Be Bourne compatible
22751 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22752   emulate sh
22753   NULLCMD=:
22754 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22755   set -o posix
22756 fi
22757
22758 # Name of the executable.
22759 as_me=`echo "$0" |sed 's,.*[\\/],,'`
22760
22761 if expr a : '\(a\)' >/dev/null 2>&1; then
22762   as_expr=expr
22763 else
22764   as_expr=false
22765 fi
22766
22767 rm -f conf$$ conf$$.exe conf$$.file
22768 echo >conf$$.file
22769 if ln -s conf$$.file conf$$ 2>/dev/null; then
22770   # We could just check for DJGPP; but this test a) works b) is more generic
22771   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
22772   if test -f conf$$.exe; then
22773     # Don't use ln at all; we don't have any links
22774     as_ln_s='cp -p'
22775   else
22776     as_ln_s='ln -s'
22777   fi
22778 elif ln conf$$.file conf$$ 2>/dev/null; then
22779   as_ln_s=ln
22780 else
22781   as_ln_s='cp -p'
22782 fi
22783 rm -f conf$$ conf$$.exe conf$$.file
22784
22785 as_executable_p="test -f"
22786
22787 # Support unset when possible.
22788 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
22789   as_unset=unset
22790 else
22791   as_unset=false
22792 fi
22793
22794 # NLS nuisances.
22795 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
22796 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
22797 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
22798 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
22799 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
22800 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
22801 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
22802 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
22803
22804 # IFS
22805 # We need space, tab and new line, in precisely that order.
22806 as_nl='
22807 '
22808 IFS="   $as_nl"
22809
22810 # CDPATH.
22811 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
22812
22813 exec 6>&1
22814
22815 _ACEOF
22816
22817 # Files that config.status was made for.
22818 if test -n "$ac_config_files"; then
22819   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
22820 fi
22821
22822 if test -n "$ac_config_headers"; then
22823   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
22824 fi
22825
22826 if test -n "$ac_config_links"; then
22827   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
22828 fi
22829
22830 if test -n "$ac_config_commands"; then
22831   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
22832 fi
22833
22834 cat >>$CONFIG_STATUS <<\EOF
22835
22836 ac_cs_usage="\
22837 \`$as_me' instantiates files from templates according to the
22838 current configuration.
22839
22840 Usage: $0 [OPTIONS] [FILE]...
22841
22842   -h, --help       print this help, then exit
22843   -V, --version    print version number, then exit
22844   -d, --debug      don't remove temporary files
22845       --recheck    update $as_me by reconfiguring in the same conditions
22846   --file=FILE[:TEMPLATE]
22847                    instantiate the configuration file FILE
22848   --header=FILE[:TEMPLATE]
22849                    instantiate the configuration header FILE
22850
22851 Configuration files:
22852 $config_files
22853
22854 Configuration headers:
22855 $config_headers
22856
22857 Configuration commands:
22858 $config_commands
22859
22860 Report bugs to <dickey@invisible-island.net>."
22861 EOF
22862
22863 cat >>$CONFIG_STATUS <<EOF
22864 ac_cs_version="\\
22865 config.status
22866 configured by $0, generated by GNU Autoconf 2.52.20200802,
22867   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
22868
22869 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
22870 Free Software Foundation, Inc.
22871 This config.status script is free software; the Free Software Foundation
22872 gives unlimited permission to copy, distribute and modify it."
22873 srcdir=$srcdir
22874 INSTALL="$INSTALL"
22875 EOF
22876
22877 cat >>$CONFIG_STATUS <<\EOF
22878 # If no file are specified by the user, then we need to provide default
22879 # value.  By we need to know if files were specified by the user.
22880 ac_need_defaults=:
22881 while test $# != 0
22882 do
22883   case $1 in
22884   --*=*)
22885     ac_option=`expr "x$1" : 'x\([^=]*\)='`
22886     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
22887     shift
22888     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
22889     shift
22890     ;;
22891   -*);;
22892   *) # This is not an option, so the user has probably given explicit
22893      # arguments.
22894      ac_need_defaults=false;;
22895   esac
22896
22897   case $1 in
22898   # Handling of the options.
22899 EOF
22900 cat >>$CONFIG_STATUS <<EOF
22901   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22902     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
22903     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
22904 EOF
22905 cat >>$CONFIG_STATUS <<\EOF
22906   --version | --vers* | -V )
22907     echo "$ac_cs_version"; exit 0 ;;
22908   --he | --h)
22909     # Conflict between --help and --header
22910     { { echo "$as_me:22910: error: ambiguous option: $1
22911 Try \`$0 --help' for more information." >&5
22912 echo "$as_me: error: ambiguous option: $1
22913 Try \`$0 --help' for more information." >&2;}
22914    { (exit 1); exit 1; }; };;
22915   --help | --hel | -h )
22916     echo "$ac_cs_usage"; exit 0 ;;
22917   --debug | --d* | -d )
22918     debug=: ;;
22919   --file | --fil | --fi | --f )
22920     shift
22921     CONFIG_FILES="$CONFIG_FILES $1"
22922     ac_need_defaults=false;;
22923   --header | --heade | --head | --hea )
22924     shift
22925     CONFIG_HEADERS="$CONFIG_HEADERS $1"
22926     ac_need_defaults=false;;
22927
22928   # This is an error.
22929   -*) { { echo "$as_me:22929: error: unrecognized option: $1
22930 Try \`$0 --help' for more information." >&5
22931 echo "$as_me: error: unrecognized option: $1
22932 Try \`$0 --help' for more information." >&2;}
22933    { (exit 1); exit 1; }; } ;;
22934
22935   *) ac_config_targets="$ac_config_targets $1" ;;
22936
22937   esac
22938   shift
22939 done
22940
22941 exec 5>>config.log
22942 cat >&5 << _ACEOF
22943
22944 ## ----------------------- ##
22945 ## Running config.status.  ##
22946 ## ----------------------- ##
22947
22948 This file was extended by $as_me 2.52.20200802, executed with
22949   CONFIG_FILES    = $CONFIG_FILES
22950   CONFIG_HEADERS  = $CONFIG_HEADERS
22951   CONFIG_LINKS    = $CONFIG_LINKS
22952   CONFIG_COMMANDS = $CONFIG_COMMANDS
22953   > $ac_cs_invocation
22954 on `(hostname || uname -n) 2>/dev/null | sed 1q`
22955
22956 _ACEOF
22957 EOF
22958
22959 cat >>$CONFIG_STATUS <<EOF
22960 #
22961 # INIT-COMMANDS section.
22962 #
22963
22964 AWK="$AWK"
22965 ECHO_CC="$ECHO_CC"
22966 ECHO_LD="$ECHO_LD"
22967 SHOW_CC="$SHOW_LD"
22968
22969 EOF
22970
22971 cat >>$CONFIG_STATUS <<\EOF
22972 for ac_config_target in $ac_config_targets
22973 do
22974   case "$ac_config_target" in
22975   # Handling of arguments.
22976   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
22977   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
22978   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
22979   *) { { echo "$as_me:22979: error: invalid argument: $ac_config_target" >&5
22980 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
22981    { (exit 1); exit 1; }; };;
22982   esac
22983 done
22984
22985 # If the user did not use the arguments to specify the items to instantiate,
22986 # then the envvar interface is used.  Set only those that are not.
22987 # We use the long form for the default assignment because of an extremely
22988 # bizarre bug on SunOS 4.1.3.
22989 if $ac_need_defaults; then
22990   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
22991   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
22992   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
22993 fi
22994
22995 # Create a temporary directory, and hook for its removal unless debugging.
22996 $debug ||
22997 {
22998   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
22999   trap '{ (exit 1); exit 1; }' 1 2 13 15
23000 }
23001
23002 # Create a (secure) tmp directory for tmp files.
23003 : ${TMPDIR=/tmp}
23004 {
23005   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23006   test -n "$tmp" && test -d "$tmp"
23007 }  ||
23008 {
23009   tmp=$TMPDIR/cs$$-$RANDOM
23010   (umask 077 && mkdir $tmp)
23011 } ||
23012 {
23013    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23014    { (exit 1); exit 1; }
23015 }
23016
23017 EOF
23018
23019 cat >>$CONFIG_STATUS <<EOF
23020
23021 #
23022 # CONFIG_FILES section.
23023 #
23024
23025 # No need to generate the scripts if there are no CONFIG_FILES.
23026 # This happens for instance when ./config.status config.h
23027 if test -n "\$CONFIG_FILES"; then
23028   # Protect against being on the right side of a sed subst in config.status.
23029   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23030    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23031 s,@SHELL@,$SHELL,;t t
23032 s,@exec_prefix@,$exec_prefix,;t t
23033 s,@prefix@,$prefix,;t t
23034 s,@program_transform_name@,$program_transform_name,;t t
23035 s,@bindir@,$bindir,;t t
23036 s,@sbindir@,$sbindir,;t t
23037 s,@libexecdir@,$libexecdir,;t t
23038 s,@datarootdir@,$datarootdir,;t t
23039 s,@datadir@,$datadir,;t t
23040 s,@sysconfdir@,$sysconfdir,;t t
23041 s,@sharedstatedir@,$sharedstatedir,;t t
23042 s,@localstatedir@,$localstatedir,;t t
23043 s,@runstatedir@,$runstatedir,;t t
23044 s,@libdir@,$libdir,;t t
23045 s,@includedir@,$includedir,;t t
23046 s,@oldincludedir@,$oldincludedir,;t t
23047 s,@infodir@,$infodir,;t t
23048 s,@mandir@,$mandir,;t t
23049 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23050 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23051 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23052 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23053 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23054 s,@build_alias@,$build_alias,;t t
23055 s,@host_alias@,$host_alias,;t t
23056 s,@target_alias@,$target_alias,;t t
23057 s,@ECHO_C@,$ECHO_C,;t t
23058 s,@ECHO_N@,$ECHO_N,;t t
23059 s,@ECHO_T@,$ECHO_T,;t t
23060 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23061 s,@DEFS@,$DEFS,;t t
23062 s,@LIBS@,$LIBS,;t t
23063 s,@build@,$build,;t t
23064 s,@build_cpu@,$build_cpu,;t t
23065 s,@build_vendor@,$build_vendor,;t t
23066 s,@build_os@,$build_os,;t t
23067 s,@host@,$host,;t t
23068 s,@host_cpu@,$host_cpu,;t t
23069 s,@host_vendor@,$host_vendor,;t t
23070 s,@host_os@,$host_os,;t t
23071 s,@SET_MAKE@,$SET_MAKE,;t t
23072 s,@CC@,$CC,;t t
23073 s,@CFLAGS@,$CFLAGS,;t t
23074 s,@LDFLAGS@,$LDFLAGS,;t t
23075 s,@CPPFLAGS@,$CPPFLAGS,;t t
23076 s,@ac_ct_CC@,$ac_ct_CC,;t t
23077 s,@EXEEXT@,$EXEEXT,;t t
23078 s,@OBJEXT@,$OBJEXT,;t t
23079 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23080 s,@CPP@,$CPP,;t t
23081 s,@AWK@,$AWK,;t t
23082 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23083 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23084 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23085 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23086 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23087 s,@LINT@,$LINT,;t t
23088 s,@LINT_OPTS@,$LINT_OPTS,;t t
23089 s,@CTAGS@,$CTAGS,;t t
23090 s,@ETAGS@,$ETAGS,;t t
23091 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23092 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23093 s,@MATH_LIB@,$MATH_LIB,;t t
23094 s,@top_builddir@,$top_builddir,;t t
23095 s,@CC_G_OPT@,$CC_G_OPT,;t t
23096 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23097 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23098 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23099 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23100 s,@LD@,$LD,;t t
23101 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23102 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23103 s,@LD_MODEL@,$LD_MODEL,;t t
23104 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23105 s,@LIBTOOL@,$LIBTOOL,;t t
23106 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23107 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23108 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23109 s,@LIB_LINK@,$LIB_LINK,;t t
23110 s,@LINK_TESTS@,$LINK_TESTS,;t t
23111 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23112 s,@PACKAGE@,$PACKAGE,;t t
23113 s,@PTHREAD@,$PTHREAD,;t t
23114 s,@TEST_ARGS@,$TEST_ARGS,;t t
23115 s,@TEST_DEPS@,$TEST_DEPS,;t t
23116 s,@TEST_LIBS@,$TEST_LIBS,;t t
23117 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23118 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23119 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23120 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23121 s,@includesubdir@,$includesubdir,;t t
23122 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23123 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23124 s,@ECHO_LT@,$ECHO_LT,;t t
23125 s,@ECHO_LD@,$ECHO_LD,;t t
23126 s,@RULE_CC@,$RULE_CC,;t t
23127 s,@SHOW_CC@,$SHOW_CC,;t t
23128 s,@ECHO_CC@,$ECHO_CC,;t t
23129 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23130 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23131 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23132 s,@X_CFLAGS@,$X_CFLAGS,;t t
23133 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23134 s,@X_LIBS@,$X_LIBS,;t t
23135 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23136 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23137 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23138 s,@RGB_PATH@,$RGB_PATH,;t t
23139 s,@no_x11_rgb@,$no_x11_rgb,;t t
23140 s,@FORM_NAME@,$FORM_NAME,;t t
23141 s,@MENU_NAME@,$MENU_NAME,;t t
23142 s,@PANEL_NAME@,$PANEL_NAME,;t t
23143 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23144 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23145 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23146 CEOF
23147
23148 EOF
23149
23150   cat >>$CONFIG_STATUS <<\EOF
23151   # Split the substitutions into bite-sized pieces for seds with
23152   # small command number limits, like on Digital OSF/1 and HP-UX.
23153   ac_max_sed_lines=48
23154   ac_sed_frag=1 # Number of current file.
23155   ac_beg=1 # First line for current file.
23156   ac_end=$ac_max_sed_lines # Line after last line for current file.
23157   ac_more_lines=:
23158   ac_sed_cmds=
23159   while $ac_more_lines; do
23160     if test $ac_beg -gt 1; then
23161       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23162     else
23163       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23164     fi
23165     if test ! -s $tmp/subs.frag; then
23166       ac_more_lines=false
23167     else
23168       # The purpose of the label and of the branching condition is to
23169       # speed up the sed processing (if there are no `@' at all, there
23170       # is no need to browse any of the substitutions).
23171       # These are the two extra sed commands mentioned above.
23172       (echo ':t
23173   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23174       # It is possible to make a multiline substitution using escaped newlines.
23175       # Ensure that we do not split the substitution between script fragments.
23176       ac_BEG=$ac_end
23177       ac_END=`expr $ac_end + $ac_max_sed_lines`
23178       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23179       if test -s $tmp/subs.next; then
23180         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23181         if test ! -s $tmp/subs.edit; then
23182           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23183           if test ! -s $tmp/subs.edit; then
23184             if test $ac_beg -gt 1; then
23185               ac_end=`expr $ac_end - 1`
23186               continue
23187             fi
23188           fi
23189         fi
23190       fi
23191
23192       if test -z "$ac_sed_cmds"; then
23193         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23194       else
23195         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23196       fi
23197       ac_sed_frag=`expr $ac_sed_frag + 1`
23198       ac_beg=$ac_end
23199       ac_end=`expr $ac_end + $ac_max_sed_lines`
23200     fi
23201   done
23202   if test -z "$ac_sed_cmds"; then
23203     ac_sed_cmds=cat
23204   fi
23205 fi # test -n "$CONFIG_FILES"
23206
23207 EOF
23208 cat >>$CONFIG_STATUS <<\EOF
23209 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23210   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23211   case $ac_file in
23212   - | *:- | *:-:* ) # input from stdin
23213         cat >$tmp/stdin
23214         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23215         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23216   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23217         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23218   * )   ac_file_in=$ac_file.in ;;
23219   esac
23220
23221   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23222   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23223          X"$ac_file" : 'X\(//\)[^/]' \| \
23224          X"$ac_file" : 'X\(//\)$' \| \
23225          X"$ac_file" : 'X\(/\)' \| \
23226          .     : '\(.\)' 2>/dev/null ||
23227 echo X"$ac_file" |
23228     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23229           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23230           /^X\(\/\/\)$/{ s//\1/; q; }
23231           /^X\(\/\).*/{ s//\1/; q; }
23232           s/.*/./; q'`
23233   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23234     { case "$ac_dir" in
23235   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23236   *)                      as_incr_dir=.;;
23237 esac
23238 as_dummy="$ac_dir"
23239 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23240   case $as_mkdir_dir in
23241     # Skip DOS drivespec
23242     ?:) as_incr_dir=$as_mkdir_dir ;;
23243     *)
23244       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23245       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23246     ;;
23247   esac
23248 done; }
23249
23250     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23251     # A "../" for each directory in $ac_dir_suffix.
23252     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23253   else
23254     ac_dir_suffix= ac_dots=
23255   fi
23256
23257   case $srcdir in
23258   .)  ac_srcdir=.
23259       if test -z "$ac_dots"; then
23260          ac_top_srcdir=.
23261       else
23262          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
23263       fi ;;
23264   [\\/]* | ?:[\\/]* )
23265       ac_srcdir=$srcdir$ac_dir_suffix;
23266       ac_top_srcdir=$srcdir ;;
23267   *) # Relative path.
23268     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
23269     ac_top_srcdir=$ac_dots$srcdir ;;
23270   esac
23271
23272   case $INSTALL in
23273   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23274   *) ac_INSTALL=$ac_dots$INSTALL ;;
23275   esac
23276
23277   if test x"$ac_file" != x-; then
23278     { echo "$as_me:23278: creating $ac_file" >&5
23279 echo "$as_me: creating $ac_file" >&6;}
23280     rm -f "$ac_file"
23281   fi
23282   # Let's still pretend it is `configure' which instantiates (i.e., don't
23283   # use $as_me), people would be surprised to read:
23284   #    /* config.h.  Generated automatically by config.status.  */
23285   configure_input="Generated automatically from `echo $ac_file_in |
23286                                                  sed 's,.*/,,'` by configure."
23287
23288   # First look for the input files in the build tree, otherwise in the
23289   # src tree.
23290   ac_file_inputs=`IFS=:
23291     for f in $ac_file_in; do
23292       case $f in
23293       -) echo $tmp/stdin ;;
23294       [\\/$]*)
23295          # Absolute (can't be DOS-style, as IFS=:)
23296          test -f "$f" || { { echo "$as_me:23296: error: cannot find input file: $f" >&5
23297 echo "$as_me: error: cannot find input file: $f" >&2;}
23298    { (exit 1); exit 1; }; }
23299          echo $f;;
23300       *) # Relative
23301          if test -f "$f"; then
23302            # Build tree
23303            echo $f
23304          elif test -f "$srcdir/$f"; then
23305            # Source tree
23306            echo $srcdir/$f
23307          else
23308            # /dev/null tree
23309            { { echo "$as_me:23309: error: cannot find input file: $f" >&5
23310 echo "$as_me: error: cannot find input file: $f" >&2;}
23311    { (exit 1); exit 1; }; }
23312          fi;;
23313       esac
23314     done` || { (exit 1); exit 1; }
23315 EOF
23316 cat >>$CONFIG_STATUS <<\EOF
23317   ac_warn_datarootdir=no
23318   if test x"$ac_file" != x-; then
23319     for ac_item in $ac_file_inputs
23320     do
23321       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
23322       if test -n "$ac_seen"; then
23323         ac_used=`grep '@datarootdir@' $ac_item`
23324         if test -z "$ac_used"; then
23325           { echo "$as_me:23325: WARNING: datarootdir was used implicitly but not set:
23326 $ac_seen" >&5
23327 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23328 $ac_seen" >&2;}
23329           ac_warn_datarootdir=yes
23330         fi
23331       fi
23332       ac_seen=`grep '${datarootdir}' $ac_item`
23333       if test -n "$ac_seen"; then
23334         { echo "$as_me:23334: WARNING: datarootdir was used explicitly but not set:
23335 $ac_seen" >&5
23336 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23337 $ac_seen" >&2;}
23338         ac_warn_datarootdir=yes
23339       fi
23340     done
23341   fi
23342
23343 if test "x$ac_warn_datarootdir" = xyes; then
23344   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23345 fi
23346
23347 EOF
23348 cat >>$CONFIG_STATUS <<EOF
23349   sed "$ac_vpsub
23350 $extrasub
23351 EOF
23352 cat >>$CONFIG_STATUS <<\EOF
23353 :t
23354 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23355 s,@configure_input@,$configure_input,;t t
23356 s,@srcdir@,$ac_srcdir,;t t
23357 s,@top_srcdir@,$ac_top_srcdir,;t t
23358 s,@INSTALL@,$ac_INSTALL,;t t
23359 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23360   rm -f $tmp/stdin
23361   if test x"$ac_file" != x-; then
23362     cp $tmp/out $ac_file
23363
23364     for ac_name in prefix exec_prefix datarootdir
23365     do
23366         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
23367         if test -n "$ac_seen"; then
23368             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
23369             if test -z "$ac_init"; then
23370               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23371               { echo "$as_me:23371: WARNING: Variable $ac_name is used but was not set:
23372 $ac_seen" >&5
23373 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23374 $ac_seen" >&2;}
23375             fi
23376         fi
23377     done
23378     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
23379     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
23380     if test -s $tmp/out; then
23381       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23382       { echo "$as_me:23382: WARNING: Some variables may not be substituted:
23383 $ac_seen" >&5
23384 echo "$as_me: WARNING: Some variables may not be substituted:
23385 $ac_seen" >&2;}
23386     fi
23387   else
23388     cat $tmp/out
23389   fi
23390   rm -f $tmp/out
23391
23392 done
23393 EOF
23394 cat >>$CONFIG_STATUS <<\EOF
23395
23396 #
23397 # CONFIG_HEADER section.
23398 #
23399
23400 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23401 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23402 #
23403 # ac_d sets the value in "#define NAME VALUE" lines.
23404 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23405 ac_dB='[        ].*$,\1#\2'
23406 ac_dC=' '
23407 ac_dD=',;t'
23408 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23409 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23410 ac_iB='\([      ]\),\1#\2define\3'
23411 ac_iC=' '
23412 ac_iD='\4,;t'
23413 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23414 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23415 ac_uB='$,\1#\2define\3'
23416 ac_uC=' '
23417 ac_uD=',;t'
23418
23419 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23420   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23421   case $ac_file in
23422   - | *:- | *:-:* ) # input from stdin
23423         cat >$tmp/stdin
23424         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23425         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23426   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23427         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23428   * )   ac_file_in=$ac_file.in ;;
23429   esac
23430
23431   test x"$ac_file" != x- && { echo "$as_me:23431: creating $ac_file" >&5
23432 echo "$as_me: creating $ac_file" >&6;}
23433
23434   # First look for the input files in the build tree, otherwise in the
23435   # src tree.
23436   ac_file_inputs=`IFS=:
23437     for f in $ac_file_in; do
23438       case $f in
23439       -) echo $tmp/stdin ;;
23440       [\\/$]*)
23441          # Absolute (can't be DOS-style, as IFS=:)
23442          test -f "$f" || { { echo "$as_me:23442: error: cannot find input file: $f" >&5
23443 echo "$as_me: error: cannot find input file: $f" >&2;}
23444    { (exit 1); exit 1; }; }
23445          echo $f;;
23446       *) # Relative
23447          if test -f "$f"; then
23448            # Build tree
23449            echo $f
23450          elif test -f "$srcdir/$f"; then
23451            # Source tree
23452            echo $srcdir/$f
23453          else
23454            # /dev/null tree
23455            { { echo "$as_me:23455: error: cannot find input file: $f" >&5
23456 echo "$as_me: error: cannot find input file: $f" >&2;}
23457    { (exit 1); exit 1; }; }
23458          fi;;
23459       esac
23460     done` || { (exit 1); exit 1; }
23461   # Remove the trailing spaces.
23462   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23463
23464 EOF
23465
23466 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23467 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23468 # be either 'cat' or 'sort'.
23469 cat confdefs.h | uniq >conftest.vals
23470
23471 # Break up conftest.vals because some shells have a limit on
23472 # the size of here documents, and old seds have small limits too.
23473
23474 rm -f conftest.tail
23475 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
23476 while grep . conftest.vals >/dev/null
23477 do
23478   # Write chunks of a limited-size here document to conftest.frag.
23479   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
23480   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
23481   echo 'CEOF' >> $CONFIG_STATUS
23482   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23483   rm -f conftest.vals
23484   mv conftest.tail conftest.vals
23485 done
23486 rm -f conftest.vals
23487
23488 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23489 # marker @DEFS@.
23490 echo '  cat >> conftest.edit <<CEOF
23491 /@DEFS@/r conftest.frag
23492 /@DEFS@/d
23493 CEOF
23494 sed -f conftest.edit $tmp/in > $tmp/out
23495 rm -f $tmp/in
23496 mv $tmp/out $tmp/in
23497 rm -f conftest.edit conftest.frag
23498 ' >> $CONFIG_STATUS
23499
23500 cat >>$CONFIG_STATUS <<\EOF
23501   # Let's still pretend it is `configure' which instantiates (i.e., don't
23502   # use $as_me), people would be surprised to read:
23503   #    /* config.h.  Generated automatically by config.status.  */
23504   if test x"$ac_file" = x-; then
23505     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23506   else
23507     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23508   fi
23509   cat $tmp/in >>$tmp/config.h
23510   rm -f $tmp/in
23511   if test x"$ac_file" != x-; then
23512     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
23513       { echo "$as_me:23513: $ac_file is unchanged" >&5
23514 echo "$as_me: $ac_file is unchanged" >&6;}
23515     else
23516       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23517          X"$ac_file" : 'X\(//\)[^/]' \| \
23518          X"$ac_file" : 'X\(//\)$' \| \
23519          X"$ac_file" : 'X\(/\)' \| \
23520          .     : '\(.\)' 2>/dev/null ||
23521 echo X"$ac_file" |
23522     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23523           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23524           /^X\(\/\/\)$/{ s//\1/; q; }
23525           /^X\(\/\).*/{ s//\1/; q; }
23526           s/.*/./; q'`
23527       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23528         { case "$ac_dir" in
23529   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23530   *)                      as_incr_dir=.;;
23531 esac
23532 as_dummy="$ac_dir"
23533 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23534   case $as_mkdir_dir in
23535     # Skip DOS drivespec
23536     ?:) as_incr_dir=$as_mkdir_dir ;;
23537     *)
23538       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23539       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23540     ;;
23541   esac
23542 done; }
23543
23544       fi
23545       rm -f $ac_file
23546       mv $tmp/config.h $ac_file
23547     fi
23548   else
23549     cat $tmp/config.h
23550     rm -f $tmp/config.h
23551   fi
23552 done
23553 EOF
23554 cat >>$CONFIG_STATUS <<\EOF
23555 #
23556 # CONFIG_COMMANDS section.
23557 #
23558 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23559   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23560   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23561
23562   case $ac_dest in
23563     default )
23564
23565 for cf_dir in .
23566 do
23567         if test ! -d $srcdir/$cf_dir; then
23568                 continue
23569         elif test -f $srcdir/$cf_dir/programs; then
23570                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
23571         fi
23572 done
23573
23574         cat >>Makefile <<TEST_EOF
23575
23576 # These rules are generated so we do not rely on suffix rules, which do not
23577 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23578 # some, and the '\$x' confuses others).
23579 TEST_EOF
23580
23581 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23582 for N in $LIST
23583 do
23584         cat >>Makefile <<TEST_EOF
23585
23586 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23587         \$(srcdir)/test.priv.h \\
23588         ncurses_cfg.h
23589         $SHOW_CC
23590         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23591 TEST_EOF
23592 done
23593
23594 if test -f ../config.guess && test -f ../config.sub
23595 then
23596         cat >>Makefile <<TEST_EOF
23597
23598 # if we used CF_INHERIT for getting these files, we can remove them
23599 distclean::
23600         rm -f config.guess config.sub
23601 TEST_EOF
23602 fi
23603  ;;
23604   esac
23605 done
23606 EOF
23607
23608 cat >>$CONFIG_STATUS <<\EOF
23609
23610 { (exit 0); exit 0; }
23611 EOF
23612 chmod +x $CONFIG_STATUS
23613 ac_clean_files=$ac_clean_files_save
23614
23615 # configure is writing to config.log, and then calls config.status.
23616 # config.status does its own redirection, appending to config.log.
23617 # Unfortunately, on DOS this fails, as config.log is still kept open
23618 # by configure, so config.status won't be able to write to it; its
23619 # output is simply discarded.  So we exec the FD to /dev/null,
23620 # effectively closing config.log, so it can be properly (re)opened and
23621 # appended to by config.status.  When coming back to configure, we
23622 # need to make the FD available again.
23623 if test "$no_create" != yes; then
23624   ac_cs_success=:
23625   exec 5>/dev/null
23626   $SHELL $CONFIG_STATUS || ac_cs_success=false
23627   exec 5>>config.log
23628   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23629   # would make configure fail if this is the last instruction.
23630   $ac_cs_success || { (exit 1); exit 1; }
23631 fi
23632