]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.2 - patch 20201107
[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                 cat >conftest.$ac_ext <<_ACEOF
1970 #line 1970 "configure"
1971 #include "confdefs.h"
1972
1973                         #include <stdio.h>
1974 int
1975 main (void)
1976 {
1977
1978                         printf("hello!\n");
1979   ;
1980   return 0;
1981 }
1982 _ACEOF
1983 rm -f conftest.$ac_objext conftest$ac_exeext
1984 if { (eval echo "$as_me:1984: \"$ac_link\"") >&5
1985   (eval $ac_link) 2>&5
1986   ac_status=$?
1987   echo "$as_me:1987: \$? = $ac_status" >&5
1988   (exit $ac_status); } &&
1989          { ac_try='test -s conftest$ac_exeext'
1990   { (eval echo "$as_me:1990: \"$ac_try\"") >&5
1991   (eval $ac_try) 2>&5
1992   ac_status=$?
1993   echo "$as_me:1993: \$? = $ac_status" >&5
1994   (exit $ac_status); }; }; then
1995
1996                         cf_clang_optok=yes
1997 else
1998   echo "$as_me: failed program was:" >&5
1999 cat conftest.$ac_ext >&5
2000
2001                         cf_clang_optok=no
2002 fi
2003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2004                 echo "$as_me:2004: result: $cf_clang_optok" >&5
2005 echo "${ECHO_T}$cf_clang_optok" >&6
2006                 if test $cf_clang_optok = yes; then
2007                         test -n "$verbose" && echo "    adding option $cf_clang_opt" 1>&6
2008
2009 echo "${as_me:-configure}:2009: testing adding option $cf_clang_opt ..." 1>&5
2010
2011         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2012         CFLAGS="${CFLAGS}$cf_clang_opt"
2013
2014                 fi
2015         done
2016 fi
2017
2018 echo "$as_me:2018: checking for $CC option to accept ANSI C" >&5
2019 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
2020 if test "${ac_cv_prog_cc_stdc+set}" = set; then
2021   echo $ECHO_N "(cached) $ECHO_C" >&6
2022 else
2023   ac_cv_prog_cc_stdc=no
2024 ac_save_CC=$CC
2025 cat >conftest.$ac_ext <<_ACEOF
2026 #line 2026 "configure"
2027 #include "confdefs.h"
2028 #include <stdarg.h>
2029 #include <stdio.h>
2030 #include <sys/types.h>
2031 #include <sys/stat.h>
2032 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
2033 struct buf { int x; };
2034 FILE * (*rcsopen) (struct buf *, struct stat *, int);
2035 static char *e (p, i)
2036      char **p;
2037      int i;
2038 {
2039   return p[i];
2040 }
2041 static char *f (char * (*g) (char **, int), char **p, ...)
2042 {
2043   char *s;
2044   va_list v;
2045   va_start (v,p);
2046   s = g (p, va_arg (v,int));
2047   va_end (v);
2048   return s;
2049 }
2050 int test (int i, double x);
2051 struct s1 {int (*f) (int a);};
2052 struct s2 {int (*f) (double a);};
2053 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
2054 int argc;
2055 char **argv;
2056 int
2057 main (void)
2058 {
2059 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
2060   ;
2061   return 0;
2062 }
2063 _ACEOF
2064 # Don't try gcc -ansi; that turns off useful extensions and
2065 # breaks some systems' header files.
2066 # AIX                   -qlanglvl=ansi
2067 # Ultrix and OSF/1      -std1
2068 # HP-UX 10.20 and later -Ae
2069 # HP-UX older versions  -Aa -D_HPUX_SOURCE
2070 # SVR4                  -Xc -D__EXTENSIONS__
2071 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
2072 do
2073   CC="$ac_save_CC $ac_arg"
2074   rm -f conftest.$ac_objext
2075 if { (eval echo "$as_me:2075: \"$ac_compile\"") >&5
2076   (eval $ac_compile) 2>&5
2077   ac_status=$?
2078   echo "$as_me:2078: \$? = $ac_status" >&5
2079   (exit $ac_status); } &&
2080          { ac_try='test -s conftest.$ac_objext'
2081   { (eval echo "$as_me:2081: \"$ac_try\"") >&5
2082   (eval $ac_try) 2>&5
2083   ac_status=$?
2084   echo "$as_me:2084: \$? = $ac_status" >&5
2085   (exit $ac_status); }; }; then
2086   ac_cv_prog_cc_stdc=$ac_arg
2087 break
2088 else
2089   echo "$as_me: failed program was:" >&5
2090 cat conftest.$ac_ext >&5
2091 fi
2092 rm -f conftest.$ac_objext
2093 done
2094 rm -f conftest.$ac_ext conftest.$ac_objext
2095 CC=$ac_save_CC
2096
2097 fi
2098
2099 case "x$ac_cv_prog_cc_stdc" in
2100   x|xno)
2101     echo "$as_me:2101: result: none needed" >&5
2102 echo "${ECHO_T}none needed" >&6 ;;
2103   *)
2104     echo "$as_me:2104: result: $ac_cv_prog_cc_stdc" >&5
2105 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
2106     CC="$CC $ac_cv_prog_cc_stdc" ;;
2107 esac
2108
2109 # This should have been defined by AC_PROG_CC
2110 : ${CC:=cc}
2111
2112 echo "$as_me:2112: checking \$CFLAGS variable" >&5
2113 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
2114 case "x$CFLAGS" in
2115 (*-[IUD]*)
2116         echo "$as_me:2116: result: broken" >&5
2117 echo "${ECHO_T}broken" >&6
2118         { echo "$as_me:2118: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
2119 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
2120         cf_flags="$CFLAGS"
2121         CFLAGS=
2122         for cf_arg in $cf_flags
2123         do
2124
2125 cf_fix_cppflags=no
2126 cf_new_cflags=
2127 cf_new_cppflags=
2128 cf_new_extra_cppflags=
2129
2130 for cf_add_cflags in $cf_arg
2131 do
2132 case $cf_fix_cppflags in
2133 (no)
2134         case $cf_add_cflags in
2135         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2136                 case $cf_add_cflags in
2137                 (-D*)
2138                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2139
2140                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2141                                 && test -z "${cf_tst_cflags}" \
2142                                 && cf_fix_cppflags=yes
2143
2144                         if test $cf_fix_cppflags = yes ; then
2145
2146         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2147         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2148
2149                                 continue
2150                         elif test "${cf_tst_cflags}" = "\"'" ; then
2151
2152         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2153         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2154
2155                                 continue
2156                         fi
2157                         ;;
2158                 esac
2159                 case "$CPPFLAGS" in
2160                 (*$cf_add_cflags)
2161                         ;;
2162                 (*)
2163                         case $cf_add_cflags in
2164                         (-D*)
2165                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2166
2167 CPPFLAGS=`echo "$CPPFLAGS" | \
2168         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2169                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2170
2171                                 ;;
2172                         esac
2173
2174         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2175         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2176
2177                         ;;
2178                 esac
2179                 ;;
2180         (*)
2181
2182         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2183         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2184
2185                 ;;
2186         esac
2187         ;;
2188 (yes)
2189
2190         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2191         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2192
2193         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2194
2195         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2196                 && test -z "${cf_tst_cflags}" \
2197                 && cf_fix_cppflags=no
2198         ;;
2199 esac
2200 done
2201
2202 if test -n "$cf_new_cflags" ; then
2203
2204         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2205         CFLAGS="${CFLAGS}$cf_new_cflags"
2206
2207 fi
2208
2209 if test -n "$cf_new_cppflags" ; then
2210
2211         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2212         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2213
2214 fi
2215
2216 if test -n "$cf_new_extra_cppflags" ; then
2217
2218         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2219         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2220
2221 fi
2222
2223         done
2224         ;;
2225 (*)
2226         echo "$as_me:2226: result: ok" >&5
2227 echo "${ECHO_T}ok" >&6
2228         ;;
2229 esac
2230
2231 echo "$as_me:2231: checking \$CC variable" >&5
2232 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2233 case "$CC" in
2234 (*[\ \  ]-*)
2235         echo "$as_me:2235: result: broken" >&5
2236 echo "${ECHO_T}broken" >&6
2237         { echo "$as_me:2237: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2238 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2239         # humor him...
2240         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2241         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2242         CC="$cf_prog"
2243         for cf_arg in $cf_flags
2244         do
2245                 case "x$cf_arg" in
2246                 (x-[IUDfgOW]*)
2247
2248 cf_fix_cppflags=no
2249 cf_new_cflags=
2250 cf_new_cppflags=
2251 cf_new_extra_cppflags=
2252
2253 for cf_add_cflags in $cf_arg
2254 do
2255 case $cf_fix_cppflags in
2256 (no)
2257         case $cf_add_cflags in
2258         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2259                 case $cf_add_cflags in
2260                 (-D*)
2261                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2262
2263                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2264                                 && test -z "${cf_tst_cflags}" \
2265                                 && cf_fix_cppflags=yes
2266
2267                         if test $cf_fix_cppflags = yes ; then
2268
2269         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2270         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2271
2272                                 continue
2273                         elif test "${cf_tst_cflags}" = "\"'" ; then
2274
2275         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2276         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2277
2278                                 continue
2279                         fi
2280                         ;;
2281                 esac
2282                 case "$CPPFLAGS" in
2283                 (*$cf_add_cflags)
2284                         ;;
2285                 (*)
2286                         case $cf_add_cflags in
2287                         (-D*)
2288                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2289
2290 CPPFLAGS=`echo "$CPPFLAGS" | \
2291         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2292                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2293
2294                                 ;;
2295                         esac
2296
2297         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2298         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2299
2300                         ;;
2301                 esac
2302                 ;;
2303         (*)
2304
2305         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2306         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2307
2308                 ;;
2309         esac
2310         ;;
2311 (yes)
2312
2313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2315
2316         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2317
2318         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2319                 && test -z "${cf_tst_cflags}" \
2320                 && cf_fix_cppflags=no
2321         ;;
2322 esac
2323 done
2324
2325 if test -n "$cf_new_cflags" ; then
2326
2327         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2328         CFLAGS="${CFLAGS}$cf_new_cflags"
2329
2330 fi
2331
2332 if test -n "$cf_new_cppflags" ; then
2333
2334         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2335         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2336
2337 fi
2338
2339 if test -n "$cf_new_extra_cppflags" ; then
2340
2341         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2342         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2343
2344 fi
2345
2346                         ;;
2347                 (*)
2348                         CC="$CC $cf_arg"
2349                         ;;
2350                 esac
2351         done
2352         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2353
2354 echo "${as_me:-configure}:2354: testing resulting CC: '$CC' ..." 1>&5
2355
2356         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2357
2358 echo "${as_me:-configure}:2358: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2359
2360         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2361
2362 echo "${as_me:-configure}:2362: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2363
2364         ;;
2365 (*)
2366         echo "$as_me:2366: result: ok" >&5
2367 echo "${ECHO_T}ok" >&6
2368         ;;
2369 esac
2370
2371 echo "$as_me:2371: checking for inline" >&5
2372 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2373 if test "${ac_cv_c_inline+set}" = set; then
2374   echo $ECHO_N "(cached) $ECHO_C" >&6
2375 else
2376   ac_cv_c_inline=no
2377 for ac_kw in inline __inline__ __inline; do
2378   cat >conftest.$ac_ext <<_ACEOF
2379 #line 2379 "configure"
2380 #include "confdefs.h"
2381 #ifndef __cplusplus
2382 static $ac_kw int static_foo () {return 0; }
2383 $ac_kw int foo () {return 0; }
2384 #endif
2385
2386 _ACEOF
2387 rm -f conftest.$ac_objext
2388 if { (eval echo "$as_me:2388: \"$ac_compile\"") >&5
2389   (eval $ac_compile) 2>&5
2390   ac_status=$?
2391   echo "$as_me:2391: \$? = $ac_status" >&5
2392   (exit $ac_status); } &&
2393          { ac_try='test -s conftest.$ac_objext'
2394   { (eval echo "$as_me:2394: \"$ac_try\"") >&5
2395   (eval $ac_try) 2>&5
2396   ac_status=$?
2397   echo "$as_me:2397: \$? = $ac_status" >&5
2398   (exit $ac_status); }; }; then
2399   ac_cv_c_inline=$ac_kw; break
2400 else
2401   echo "$as_me: failed program was:" >&5
2402 cat conftest.$ac_ext >&5
2403 fi
2404 rm -f conftest.$ac_objext conftest.$ac_ext
2405 done
2406
2407 fi
2408 echo "$as_me:2408: result: $ac_cv_c_inline" >&5
2409 echo "${ECHO_T}$ac_cv_c_inline" >&6
2410 case $ac_cv_c_inline in
2411   inline | yes) ;;
2412   no)
2413 cat >>confdefs.h <<\EOF
2414 #define inline
2415 EOF
2416  ;;
2417   *)  cat >>confdefs.h <<EOF
2418 #define inline $ac_cv_c_inline
2419 EOF
2420  ;;
2421 esac
2422
2423 ac_ext=c
2424 ac_cpp='$CPP $CPPFLAGS'
2425 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2426 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2427 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2428 ac_main_return=return
2429 echo "$as_me:2429: checking how to run the C preprocessor" >&5
2430 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2431 # On Suns, sometimes $CPP names a directory.
2432 if test -n "$CPP" && test -d "$CPP"; then
2433   CPP=
2434 fi
2435 if test -z "$CPP"; then
2436   if test "${ac_cv_prog_CPP+set}" = set; then
2437   echo $ECHO_N "(cached) $ECHO_C" >&6
2438 else
2439       # Double quotes because CPP needs to be expanded
2440     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2441     do
2442       ac_preproc_ok=false
2443 for ac_c_preproc_warn_flag in '' yes
2444 do
2445   # Use a header file that comes with gcc, so configuring glibc
2446   # with a fresh cross-compiler works.
2447   # On the NeXT, cc -E runs the code through the compiler's parser,
2448   # not just through cpp. "Syntax error" is here to catch this case.
2449   cat >conftest.$ac_ext <<_ACEOF
2450 #line 2450 "configure"
2451 #include "confdefs.h"
2452 #include <assert.h>
2453                      Syntax error
2454 _ACEOF
2455 if { (eval echo "$as_me:2455: \"$ac_cpp conftest.$ac_ext\"") >&5
2456   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2457   ac_status=$?
2458   egrep -v '^ *\+' conftest.er1 >conftest.err
2459   rm -f conftest.er1
2460   cat conftest.err >&5
2461   echo "$as_me:2461: \$? = $ac_status" >&5
2462   (exit $ac_status); } >/dev/null; then
2463   if test -s conftest.err; then
2464     ac_cpp_err=$ac_c_preproc_warn_flag
2465   else
2466     ac_cpp_err=
2467   fi
2468 else
2469   ac_cpp_err=yes
2470 fi
2471 if test -z "$ac_cpp_err"; then
2472   :
2473 else
2474   echo "$as_me: failed program was:" >&5
2475   cat conftest.$ac_ext >&5
2476   # Broken: fails on valid input.
2477 continue
2478 fi
2479 rm -f conftest.err conftest.$ac_ext
2480
2481   # OK, works on sane cases.  Now check whether non-existent headers
2482   # can be detected and how.
2483   cat >conftest.$ac_ext <<_ACEOF
2484 #line 2484 "configure"
2485 #include "confdefs.h"
2486 #include <ac_nonexistent.h>
2487 _ACEOF
2488 if { (eval echo "$as_me:2488: \"$ac_cpp conftest.$ac_ext\"") >&5
2489   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2490   ac_status=$?
2491   egrep -v '^ *\+' conftest.er1 >conftest.err
2492   rm -f conftest.er1
2493   cat conftest.err >&5
2494   echo "$as_me:2494: \$? = $ac_status" >&5
2495   (exit $ac_status); } >/dev/null; then
2496   if test -s conftest.err; then
2497     ac_cpp_err=$ac_c_preproc_warn_flag
2498   else
2499     ac_cpp_err=
2500   fi
2501 else
2502   ac_cpp_err=yes
2503 fi
2504 if test -z "$ac_cpp_err"; then
2505   # Broken: success on invalid input.
2506 continue
2507 else
2508   echo "$as_me: failed program was:" >&5
2509   cat conftest.$ac_ext >&5
2510   # Passes both tests.
2511 ac_preproc_ok=:
2512 break
2513 fi
2514 rm -f conftest.err conftest.$ac_ext
2515
2516 done
2517 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2518 rm -f conftest.err conftest.$ac_ext
2519 if $ac_preproc_ok; then
2520   break
2521 fi
2522
2523     done
2524     ac_cv_prog_CPP=$CPP
2525
2526 fi
2527   CPP=$ac_cv_prog_CPP
2528 else
2529   ac_cv_prog_CPP=$CPP
2530 fi
2531 echo "$as_me:2531: result: $CPP" >&5
2532 echo "${ECHO_T}$CPP" >&6
2533 ac_preproc_ok=false
2534 for ac_c_preproc_warn_flag in '' yes
2535 do
2536   # Use a header file that comes with gcc, so configuring glibc
2537   # with a fresh cross-compiler works.
2538   # On the NeXT, cc -E runs the code through the compiler's parser,
2539   # not just through cpp. "Syntax error" is here to catch this case.
2540   cat >conftest.$ac_ext <<_ACEOF
2541 #line 2541 "configure"
2542 #include "confdefs.h"
2543 #include <assert.h>
2544                      Syntax error
2545 _ACEOF
2546 if { (eval echo "$as_me:2546: \"$ac_cpp conftest.$ac_ext\"") >&5
2547   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2548   ac_status=$?
2549   egrep -v '^ *\+' conftest.er1 >conftest.err
2550   rm -f conftest.er1
2551   cat conftest.err >&5
2552   echo "$as_me:2552: \$? = $ac_status" >&5
2553   (exit $ac_status); } >/dev/null; then
2554   if test -s conftest.err; then
2555     ac_cpp_err=$ac_c_preproc_warn_flag
2556   else
2557     ac_cpp_err=
2558   fi
2559 else
2560   ac_cpp_err=yes
2561 fi
2562 if test -z "$ac_cpp_err"; then
2563   :
2564 else
2565   echo "$as_me: failed program was:" >&5
2566   cat conftest.$ac_ext >&5
2567   # Broken: fails on valid input.
2568 continue
2569 fi
2570 rm -f conftest.err conftest.$ac_ext
2571
2572   # OK, works on sane cases.  Now check whether non-existent headers
2573   # can be detected and how.
2574   cat >conftest.$ac_ext <<_ACEOF
2575 #line 2575 "configure"
2576 #include "confdefs.h"
2577 #include <ac_nonexistent.h>
2578 _ACEOF
2579 if { (eval echo "$as_me:2579: \"$ac_cpp conftest.$ac_ext\"") >&5
2580   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2581   ac_status=$?
2582   egrep -v '^ *\+' conftest.er1 >conftest.err
2583   rm -f conftest.er1
2584   cat conftest.err >&5
2585   echo "$as_me:2585: \$? = $ac_status" >&5
2586   (exit $ac_status); } >/dev/null; then
2587   if test -s conftest.err; then
2588     ac_cpp_err=$ac_c_preproc_warn_flag
2589   else
2590     ac_cpp_err=
2591   fi
2592 else
2593   ac_cpp_err=yes
2594 fi
2595 if test -z "$ac_cpp_err"; then
2596   # Broken: success on invalid input.
2597 continue
2598 else
2599   echo "$as_me: failed program was:" >&5
2600   cat conftest.$ac_ext >&5
2601   # Passes both tests.
2602 ac_preproc_ok=:
2603 break
2604 fi
2605 rm -f conftest.err conftest.$ac_ext
2606
2607 done
2608 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2609 rm -f conftest.err conftest.$ac_ext
2610 if $ac_preproc_ok; then
2611   :
2612 else
2613   { { echo "$as_me:2613: error: C preprocessor \"$CPP\" fails sanity check" >&5
2614 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2615    { (exit 1); exit 1; }; }
2616 fi
2617
2618 ac_ext=c
2619 ac_cpp='$CPP $CPPFLAGS'
2620 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2621 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2622 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2623 ac_main_return=return
2624
2625 for ac_prog in mawk gawk nawk awk
2626 do
2627   # Extract the first word of "$ac_prog", so it can be a program name with args.
2628 set dummy $ac_prog; ac_word=$2
2629 echo "$as_me:2629: checking for $ac_word" >&5
2630 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2631 if test "${ac_cv_prog_AWK+set}" = set; then
2632   echo $ECHO_N "(cached) $ECHO_C" >&6
2633 else
2634   if test -n "$AWK"; then
2635   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2636 else
2637   ac_save_IFS=$IFS; IFS=$ac_path_separator
2638 ac_dummy="$PATH"
2639 for ac_dir in $ac_dummy; do
2640   IFS=$ac_save_IFS
2641   test -z "$ac_dir" && ac_dir=.
2642   $as_executable_p "$ac_dir/$ac_word" || continue
2643 ac_cv_prog_AWK="$ac_prog"
2644 echo "$as_me:2644: found $ac_dir/$ac_word" >&5
2645 break
2646 done
2647
2648 fi
2649 fi
2650 AWK=$ac_cv_prog_AWK
2651 if test -n "$AWK"; then
2652   echo "$as_me:2652: result: $AWK" >&5
2653 echo "${ECHO_T}$AWK" >&6
2654 else
2655   echo "$as_me:2655: result: no" >&5
2656 echo "${ECHO_T}no" >&6
2657 fi
2658
2659   test -n "$AWK" && break
2660 done
2661
2662 # Find a good install program.  We prefer a C program (faster),
2663 # so one script is as good as another.  But avoid the broken or
2664 # incompatible versions:
2665 # SysV /etc/install, /usr/sbin/install
2666 # SunOS /usr/etc/install
2667 # IRIX /sbin/install
2668 # AIX /bin/install
2669 # AmigaOS /C/install, which installs bootblocks on floppy discs
2670 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2671 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2672 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2673 # ./install, which can be erroneously created by make from ./install.sh.
2674 echo "$as_me:2674: checking for a BSD compatible install" >&5
2675 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2676 if test -z "$INSTALL"; then
2677 if test "${ac_cv_path_install+set}" = set; then
2678   echo $ECHO_N "(cached) $ECHO_C" >&6
2679 else
2680     ac_save_IFS=$IFS; IFS=$ac_path_separator
2681   for ac_dir in $PATH; do
2682     IFS=$ac_save_IFS
2683     # Account for people who put trailing slashes in PATH elements.
2684     case $ac_dir/ in
2685     / | ./ | .// | /cC/* \
2686     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2687     | /usr/ucb/* ) ;;
2688     *)
2689       # OSF1 and SCO ODT 3.0 have their own names for install.
2690       # Don't use installbsd from OSF since it installs stuff as root
2691       # by default.
2692       for ac_prog in ginstall scoinst install; do
2693         if $as_executable_p "$ac_dir/$ac_prog"; then
2694           if test $ac_prog = install &&
2695             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2696             # AIX install.  It has an incompatible calling convention.
2697             :
2698           elif test $ac_prog = install &&
2699             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2700             # program-specific install script used by HP pwplus--don't use.
2701             :
2702           else
2703             ac_cv_path_install="$ac_dir/$ac_prog -c"
2704             break 2
2705           fi
2706         fi
2707       done
2708       ;;
2709     esac
2710   done
2711
2712 fi
2713   if test "${ac_cv_path_install+set}" = set; then
2714     INSTALL=$ac_cv_path_install
2715   else
2716     # As a last resort, use the slow shell script.  We don't cache a
2717     # path for INSTALL within a source directory, because that will
2718     # break other packages using the cache if that directory is
2719     # removed, or if the path is relative.
2720     INSTALL=$ac_install_sh
2721   fi
2722 fi
2723 echo "$as_me:2723: result: $INSTALL" >&5
2724 echo "${ECHO_T}$INSTALL" >&6
2725
2726 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2727 # It thinks the first close brace ends the variable substitution.
2728 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2729
2730 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2731
2732 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2733
2734 case $INSTALL in
2735 (/*)
2736         ;;
2737 (*)
2738         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2739         test -z "$cf_dir" && cf_dir=.
2740         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2741         ;;
2742 esac
2743
2744 echo "$as_me:2744: checking if you want to install stripped executables" >&5
2745 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2746
2747 # Check whether --enable-stripping or --disable-stripping was given.
2748 if test "${enable_stripping+set}" = set; then
2749   enableval="$enable_stripping"
2750   test "$enableval" != no && enableval=yes
2751         if test "$enableval" != "yes" ; then
2752     with_stripping=no
2753         else
2754                 with_stripping=yes
2755         fi
2756 else
2757   enableval=yes
2758         with_stripping=yes
2759
2760 fi;
2761 echo "$as_me:2761: result: $with_stripping" >&5
2762 echo "${ECHO_T}$with_stripping" >&6
2763
2764 if test "$with_stripping" = yes
2765 then
2766         INSTALL_OPT_S="-s"
2767 else
2768         INSTALL_OPT_S=
2769 fi
2770
2771 : ${INSTALL:=install}
2772 echo "$as_me:2772: checking if install accepts -p option" >&5
2773 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2774 if test "${cf_cv_install_p+set}" = set; then
2775   echo $ECHO_N "(cached) $ECHO_C" >&6
2776 else
2777
2778         rm -rf conftest*
2779         date >conftest.in
2780         mkdir conftest.out
2781         sleep 3
2782         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2783         then
2784                 if test -f conftest.out/conftest.in
2785                 then
2786                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2787                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2788                         if test -s conftest.err
2789                         then
2790                                 cf_cv_install_p=no
2791                         else
2792                                 cf_cv_install_p=yes
2793                         fi
2794                 else
2795                         cf_cv_install_p=no
2796                 fi
2797         else
2798                 cf_cv_install_p=no
2799         fi
2800         rm -rf conftest*
2801
2802 fi
2803 echo "$as_me:2803: result: $cf_cv_install_p" >&5
2804 echo "${ECHO_T}$cf_cv_install_p" >&6
2805
2806 echo "$as_me:2806: checking if install needs to be told about ownership" >&5
2807 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2808 case `$ac_config_guess` in
2809 (*minix)
2810         with_install_o=yes
2811         ;;
2812 (*)
2813         with_install_o=no
2814         ;;
2815 esac
2816
2817 echo "$as_me:2817: result: $with_install_o" >&5
2818 echo "${ECHO_T}$with_install_o" >&6
2819 if test "x$with_install_o" = xyes
2820 then
2821         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'`
2822 else
2823         INSTALL_OPT_O=
2824 fi
2825
2826 for ac_prog in lint cppcheck splint
2827 do
2828   # Extract the first word of "$ac_prog", so it can be a program name with args.
2829 set dummy $ac_prog; ac_word=$2
2830 echo "$as_me:2830: checking for $ac_word" >&5
2831 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2832 if test "${ac_cv_prog_LINT+set}" = set; then
2833   echo $ECHO_N "(cached) $ECHO_C" >&6
2834 else
2835   if test -n "$LINT"; then
2836   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2837 else
2838   ac_save_IFS=$IFS; IFS=$ac_path_separator
2839 ac_dummy="$PATH"
2840 for ac_dir in $ac_dummy; do
2841   IFS=$ac_save_IFS
2842   test -z "$ac_dir" && ac_dir=.
2843   $as_executable_p "$ac_dir/$ac_word" || continue
2844 ac_cv_prog_LINT="$ac_prog"
2845 echo "$as_me:2845: found $ac_dir/$ac_word" >&5
2846 break
2847 done
2848
2849 fi
2850 fi
2851 LINT=$ac_cv_prog_LINT
2852 if test -n "$LINT"; then
2853   echo "$as_me:2853: result: $LINT" >&5
2854 echo "${ECHO_T}$LINT" >&6
2855 else
2856   echo "$as_me:2856: result: no" >&5
2857 echo "${ECHO_T}no" >&6
2858 fi
2859
2860   test -n "$LINT" && break
2861 done
2862
2863 case "x$LINT" in
2864 (xcppcheck|x*/cppcheck)
2865         test -z "$LINT_OPTS" && LINT_OPTS="--enable=all"
2866         ;;
2867 esac
2868
2869 echo "$as_me:2869: checking if filesystem supports mixed-case filenames" >&5
2870 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2871 if test "${cf_cv_mixedcase+set}" = set; then
2872   echo $ECHO_N "(cached) $ECHO_C" >&6
2873 else
2874
2875 if test "$cross_compiling" = yes ; then
2876         case $target_alias in
2877         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2878                 cf_cv_mixedcase=no
2879                 ;;
2880         (*)
2881                 cf_cv_mixedcase=yes
2882                 ;;
2883         esac
2884 else
2885         rm -f conftest CONFTEST
2886         echo test >conftest
2887         if test -f CONFTEST ; then
2888                 cf_cv_mixedcase=no
2889         else
2890                 cf_cv_mixedcase=yes
2891         fi
2892         rm -f conftest CONFTEST
2893 fi
2894
2895 fi
2896 echo "$as_me:2896: result: $cf_cv_mixedcase" >&5
2897 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2898 test "$cf_cv_mixedcase" = yes &&
2899 cat >>confdefs.h <<\EOF
2900 #define MIXEDCASE_FILENAMES 1
2901 EOF
2902
2903 for ac_prog in exctags ctags
2904 do
2905   # Extract the first word of "$ac_prog", so it can be a program name with args.
2906 set dummy $ac_prog; ac_word=$2
2907 echo "$as_me:2907: checking for $ac_word" >&5
2908 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2909 if test "${ac_cv_prog_CTAGS+set}" = set; then
2910   echo $ECHO_N "(cached) $ECHO_C" >&6
2911 else
2912   if test -n "$CTAGS"; then
2913   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2914 else
2915   ac_save_IFS=$IFS; IFS=$ac_path_separator
2916 ac_dummy="$PATH"
2917 for ac_dir in $ac_dummy; do
2918   IFS=$ac_save_IFS
2919   test -z "$ac_dir" && ac_dir=.
2920   $as_executable_p "$ac_dir/$ac_word" || continue
2921 ac_cv_prog_CTAGS="$ac_prog"
2922 echo "$as_me:2922: found $ac_dir/$ac_word" >&5
2923 break
2924 done
2925
2926 fi
2927 fi
2928 CTAGS=$ac_cv_prog_CTAGS
2929 if test -n "$CTAGS"; then
2930   echo "$as_me:2930: result: $CTAGS" >&5
2931 echo "${ECHO_T}$CTAGS" >&6
2932 else
2933   echo "$as_me:2933: result: no" >&5
2934 echo "${ECHO_T}no" >&6
2935 fi
2936
2937   test -n "$CTAGS" && break
2938 done
2939
2940 for ac_prog in exetags etags
2941 do
2942   # Extract the first word of "$ac_prog", so it can be a program name with args.
2943 set dummy $ac_prog; ac_word=$2
2944 echo "$as_me:2944: checking for $ac_word" >&5
2945 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2946 if test "${ac_cv_prog_ETAGS+set}" = set; then
2947   echo $ECHO_N "(cached) $ECHO_C" >&6
2948 else
2949   if test -n "$ETAGS"; then
2950   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2951 else
2952   ac_save_IFS=$IFS; IFS=$ac_path_separator
2953 ac_dummy="$PATH"
2954 for ac_dir in $ac_dummy; do
2955   IFS=$ac_save_IFS
2956   test -z "$ac_dir" && ac_dir=.
2957   $as_executable_p "$ac_dir/$ac_word" || continue
2958 ac_cv_prog_ETAGS="$ac_prog"
2959 echo "$as_me:2959: found $ac_dir/$ac_word" >&5
2960 break
2961 done
2962
2963 fi
2964 fi
2965 ETAGS=$ac_cv_prog_ETAGS
2966 if test -n "$ETAGS"; then
2967   echo "$as_me:2967: result: $ETAGS" >&5
2968 echo "${ECHO_T}$ETAGS" >&6
2969 else
2970   echo "$as_me:2970: result: no" >&5
2971 echo "${ECHO_T}no" >&6
2972 fi
2973
2974   test -n "$ETAGS" && break
2975 done
2976
2977 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2978 set dummy ${CTAGS:-ctags}; ac_word=$2
2979 echo "$as_me:2979: checking for $ac_word" >&5
2980 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2981 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2982   echo $ECHO_N "(cached) $ECHO_C" >&6
2983 else
2984   if test -n "$MAKE_LOWER_TAGS"; then
2985   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2986 else
2987   ac_save_IFS=$IFS; IFS=$ac_path_separator
2988 ac_dummy="$PATH"
2989 for ac_dir in $ac_dummy; do
2990   IFS=$ac_save_IFS
2991   test -z "$ac_dir" && ac_dir=.
2992   $as_executable_p "$ac_dir/$ac_word" || continue
2993 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2994 echo "$as_me:2994: found $ac_dir/$ac_word" >&5
2995 break
2996 done
2997
2998   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2999 fi
3000 fi
3001 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
3002 if test -n "$MAKE_LOWER_TAGS"; then
3003   echo "$as_me:3003: result: $MAKE_LOWER_TAGS" >&5
3004 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
3005 else
3006   echo "$as_me:3006: result: no" >&5
3007 echo "${ECHO_T}no" >&6
3008 fi
3009
3010 if test "$cf_cv_mixedcase" = yes ; then
3011         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
3012 set dummy ${ETAGS:-etags}; ac_word=$2
3013 echo "$as_me:3013: checking for $ac_word" >&5
3014 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3015 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
3016   echo $ECHO_N "(cached) $ECHO_C" >&6
3017 else
3018   if test -n "$MAKE_UPPER_TAGS"; then
3019   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
3020 else
3021   ac_save_IFS=$IFS; IFS=$ac_path_separator
3022 ac_dummy="$PATH"
3023 for ac_dir in $ac_dummy; do
3024   IFS=$ac_save_IFS
3025   test -z "$ac_dir" && ac_dir=.
3026   $as_executable_p "$ac_dir/$ac_word" || continue
3027 ac_cv_prog_MAKE_UPPER_TAGS="yes"
3028 echo "$as_me:3028: found $ac_dir/$ac_word" >&5
3029 break
3030 done
3031
3032   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
3033 fi
3034 fi
3035 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
3036 if test -n "$MAKE_UPPER_TAGS"; then
3037   echo "$as_me:3037: result: $MAKE_UPPER_TAGS" >&5
3038 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
3039 else
3040   echo "$as_me:3040: result: no" >&5
3041 echo "${ECHO_T}no" >&6
3042 fi
3043
3044 else
3045         MAKE_UPPER_TAGS=no
3046 fi
3047
3048 if test "$MAKE_UPPER_TAGS" = yes ; then
3049         MAKE_UPPER_TAGS=
3050 else
3051         MAKE_UPPER_TAGS="#"
3052 fi
3053
3054 if test "$MAKE_LOWER_TAGS" = yes ; then
3055         MAKE_LOWER_TAGS=
3056 else
3057         MAKE_LOWER_TAGS="#"
3058 fi
3059
3060 echo "$as_me:3060: checking if -lm needed for math functions" >&5
3061 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
3062 if test "${cf_cv_need_libm+set}" = set; then
3063   echo $ECHO_N "(cached) $ECHO_C" >&6
3064 else
3065
3066         cat >conftest.$ac_ext <<_ACEOF
3067 #line 3067 "configure"
3068 #include "confdefs.h"
3069
3070         #include <stdio.h>
3071         #include <stdlib.h>
3072         #include <math.h>
3073
3074 int
3075 main (void)
3076 {
3077 double x = rand(); printf("result = %g\n", pow(sin(x),x))
3078   ;
3079   return 0;
3080 }
3081 _ACEOF
3082 rm -f conftest.$ac_objext conftest$ac_exeext
3083 if { (eval echo "$as_me:3083: \"$ac_link\"") >&5
3084   (eval $ac_link) 2>&5
3085   ac_status=$?
3086   echo "$as_me:3086: \$? = $ac_status" >&5
3087   (exit $ac_status); } &&
3088          { ac_try='test -s conftest$ac_exeext'
3089   { (eval echo "$as_me:3089: \"$ac_try\"") >&5
3090   (eval $ac_try) 2>&5
3091   ac_status=$?
3092   echo "$as_me:3092: \$? = $ac_status" >&5
3093   (exit $ac_status); }; }; then
3094   cf_cv_need_libm=no
3095 else
3096   echo "$as_me: failed program was:" >&5
3097 cat conftest.$ac_ext >&5
3098 cf_cv_need_libm=yes
3099 fi
3100 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3101 fi
3102 echo "$as_me:3102: result: $cf_cv_need_libm" >&5
3103 echo "${ECHO_T}$cf_cv_need_libm" >&6
3104 if test "$cf_cv_need_libm" = yes
3105 then
3106 MATH_LIB=-lm
3107 fi
3108
3109 top_builddir=`pwd`
3110
3111 CC_G_OPT="-g"
3112 CC_SHARED_OPTS=unknown
3113 CPPFLAGS="$CPPFLAGS"
3114 DFT_DEP_SUFFIX=""
3115 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
3116 DFT_UPR_MODEL="NORMAL"
3117 LD="ld"
3118 LDFLAGS_SHARED=""
3119 LDFLAGS_STATIC=""
3120 LD_MODEL=""
3121 LD_SHARED_OPTS=""
3122 LIBTOOL=""
3123 LIBTOOL_OPTS=""
3124 LIB_CLEAN=""
3125 LIB_COMPILE=""
3126 LIB_LINK='${CC}'
3127 LINK_TESTS=""
3128 LOCAL_LDFLAGS=""
3129 PACKAGE="ncurses-examples"
3130 PTHREAD="-lm"
3131 TEST_ARGS=""
3132 TEST_DEPS=""
3133 TEST_LIBS=""
3134 TINFO_LDFLAGS=''
3135 TINFO_LIBS='$(LIBS_CURSES)'
3136 cf_cv_abi_version=""
3137 cf_cv_rel_version=""
3138 includesubdir=""
3139
3140 cf_cv_screen=curses
3141 cf_cv_libtype=
3142
3143 if ( test "$GCC" = yes || test "$GXX" = yes )
3144 then
3145 cat > conftest.i <<EOF
3146 #ifndef GCC_PRINTF
3147 #define GCC_PRINTF 0
3148 #endif
3149 #ifndef GCC_SCANF
3150 #define GCC_SCANF 0
3151 #endif
3152 #ifndef GCC_NORETURN
3153 #define GCC_NORETURN /* nothing */
3154 #endif
3155 #ifndef GCC_UNUSED
3156 #define GCC_UNUSED /* nothing */
3157 #endif
3158 EOF
3159 if test "$GCC" = yes
3160 then
3161         { echo "$as_me:3161: checking for $CC __attribute__ directives..." >&5
3162 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
3163 cat > conftest.$ac_ext <<EOF
3164 #line 3164 "${as_me:-configure}"
3165 #include "confdefs.h"
3166 #include "conftest.h"
3167 #include "conftest.i"
3168 #if     GCC_PRINTF
3169 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3170 #else
3171 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3172 #endif
3173 #if     GCC_SCANF
3174 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3175 #else
3176 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3177 #endif
3178 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3179 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3180 extern void foo(void) GCC_NORETURN;
3181 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
3182 EOF
3183         cf_printf_attribute=no
3184         cf_scanf_attribute=no
3185         for cf_attribute in scanf printf unused noreturn
3186         do
3187
3188 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3189
3190                 cf_directive="__attribute__(($cf_attribute))"
3191                 echo "checking for $CC $cf_directive" 1>&5
3192
3193                 case $cf_attribute in
3194                 (printf)
3195                         cf_printf_attribute=yes
3196                         cat >conftest.h <<EOF
3197 #define GCC_$cf_ATTRIBUTE 1
3198 EOF
3199                         ;;
3200                 (scanf)
3201                         cf_scanf_attribute=yes
3202                         cat >conftest.h <<EOF
3203 #define GCC_$cf_ATTRIBUTE 1
3204 EOF
3205                         ;;
3206                 (*)
3207                         cat >conftest.h <<EOF
3208 #define GCC_$cf_ATTRIBUTE $cf_directive
3209 EOF
3210                         ;;
3211                 esac
3212
3213                 if { (eval echo "$as_me:3213: \"$ac_compile\"") >&5
3214   (eval $ac_compile) 2>&5
3215   ac_status=$?
3216   echo "$as_me:3216: \$? = $ac_status" >&5
3217   (exit $ac_status); }; then
3218                         test -n "$verbose" && echo "$as_me:3218: result: ... $cf_attribute" >&5
3219 echo "${ECHO_T}... $cf_attribute" >&6
3220                         cat conftest.h >>confdefs.h
3221                         case $cf_attribute in
3222                         (noreturn)
3223
3224 cat >>confdefs.h <<EOF
3225 #define GCC_NORETURN $cf_directive
3226 EOF
3227
3228                                 ;;
3229                         (printf)
3230                                 cf_value='/* nothing */'
3231                                 if test "$cf_printf_attribute" != no ; then
3232                                         cf_value='__attribute__((format(printf,fmt,var)))'
3233
3234 cat >>confdefs.h <<\EOF
3235 #define GCC_PRINTF 1
3236 EOF
3237
3238                                 fi
3239
3240 cat >>confdefs.h <<EOF
3241 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3242 EOF
3243
3244                                 ;;
3245                         (scanf)
3246                                 cf_value='/* nothing */'
3247                                 if test "$cf_scanf_attribute" != no ; then
3248                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3249
3250 cat >>confdefs.h <<\EOF
3251 #define GCC_SCANF 1
3252 EOF
3253
3254                                 fi
3255
3256 cat >>confdefs.h <<EOF
3257 #define GCC_SCANFLIKE(fmt,var) $cf_value
3258 EOF
3259
3260                                 ;;
3261                         (unused)
3262
3263 cat >>confdefs.h <<EOF
3264 #define GCC_UNUSED $cf_directive
3265 EOF
3266
3267                                 ;;
3268                         esac
3269                 fi
3270         done
3271 else
3272         fgrep define conftest.i >>confdefs.h
3273 fi
3274 rm -rf conftest*
3275 fi
3276
3277 echo "$as_me:3277: checking if you want to work around bogus compiler/loader warnings" >&5
3278 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3279
3280 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3281 if test "${enable_string_hacks+set}" = set; then
3282   enableval="$enable_string_hacks"
3283   with_string_hacks=$enableval
3284 else
3285   with_string_hacks=no
3286 fi;
3287 echo "$as_me:3287: result: $with_string_hacks" >&5
3288 echo "${ECHO_T}$with_string_hacks" >&6
3289
3290 if test "x$with_string_hacks" = "xyes"; then
3291
3292 cat >>confdefs.h <<\EOF
3293 #define USE_STRING_HACKS 1
3294 EOF
3295
3296         { echo "$as_me:3296: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3297 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3298         echo "$as_me:3298: checking for strlcat" >&5
3299 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3300 if test "${ac_cv_func_strlcat+set}" = set; then
3301   echo $ECHO_N "(cached) $ECHO_C" >&6
3302 else
3303   cat >conftest.$ac_ext <<_ACEOF
3304 #line 3304 "configure"
3305 #include "confdefs.h"
3306 #define strlcat autoconf_temporary
3307 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3308 #undef strlcat
3309
3310 #ifdef __cplusplus
3311 extern "C"
3312 #endif
3313
3314 /* We use char because int might match the return type of a gcc2
3315    builtin and then its argument prototype would still apply.  */
3316 char strlcat (void);
3317
3318 int
3319 main (void)
3320 {
3321
3322 /* The GNU C library defines stubs for functions which it implements
3323     to always fail with ENOSYS.  Some functions are actually named
3324     something starting with __ and the normal name is an alias.  */
3325 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3326 #error found stub for strlcat
3327 #endif
3328
3329         return strlcat ();
3330   ;
3331   return 0;
3332 }
3333 _ACEOF
3334 rm -f conftest.$ac_objext conftest$ac_exeext
3335 if { (eval echo "$as_me:3335: \"$ac_link\"") >&5
3336   (eval $ac_link) 2>&5
3337   ac_status=$?
3338   echo "$as_me:3338: \$? = $ac_status" >&5
3339   (exit $ac_status); } &&
3340          { ac_try='test -s conftest$ac_exeext'
3341   { (eval echo "$as_me:3341: \"$ac_try\"") >&5
3342   (eval $ac_try) 2>&5
3343   ac_status=$?
3344   echo "$as_me:3344: \$? = $ac_status" >&5
3345   (exit $ac_status); }; }; then
3346   ac_cv_func_strlcat=yes
3347 else
3348   echo "$as_me: failed program was:" >&5
3349 cat conftest.$ac_ext >&5
3350 ac_cv_func_strlcat=no
3351 fi
3352 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3353 fi
3354 echo "$as_me:3354: result: $ac_cv_func_strlcat" >&5
3355 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3356 if test $ac_cv_func_strlcat = yes; then
3357
3358 cat >>confdefs.h <<\EOF
3359 #define HAVE_STRLCAT 1
3360 EOF
3361
3362 else
3363
3364                 echo "$as_me:3364: checking for strlcat in -lbsd" >&5
3365 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3366 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3367   echo $ECHO_N "(cached) $ECHO_C" >&6
3368 else
3369   ac_check_lib_save_LIBS=$LIBS
3370 LIBS="-lbsd  $LIBS"
3371 cat >conftest.$ac_ext <<_ACEOF
3372 #line 3372 "configure"
3373 #include "confdefs.h"
3374
3375 /* Override any gcc2 internal prototype to avoid an error.  */
3376 #ifdef __cplusplus
3377 extern "C"
3378 #endif
3379 /* We use char because int might match the return type of a gcc2
3380    builtin and then its argument prototype would still apply.  */
3381 char strlcat ();
3382 int
3383 main (void)
3384 {
3385 strlcat ();
3386   ;
3387   return 0;
3388 }
3389 _ACEOF
3390 rm -f conftest.$ac_objext conftest$ac_exeext
3391 if { (eval echo "$as_me:3391: \"$ac_link\"") >&5
3392   (eval $ac_link) 2>&5
3393   ac_status=$?
3394   echo "$as_me:3394: \$? = $ac_status" >&5
3395   (exit $ac_status); } &&
3396          { ac_try='test -s conftest$ac_exeext'
3397   { (eval echo "$as_me:3397: \"$ac_try\"") >&5
3398   (eval $ac_try) 2>&5
3399   ac_status=$?
3400   echo "$as_me:3400: \$? = $ac_status" >&5
3401   (exit $ac_status); }; }; then
3402   ac_cv_lib_bsd_strlcat=yes
3403 else
3404   echo "$as_me: failed program was:" >&5
3405 cat conftest.$ac_ext >&5
3406 ac_cv_lib_bsd_strlcat=no
3407 fi
3408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3409 LIBS=$ac_check_lib_save_LIBS
3410 fi
3411 echo "$as_me:3411: result: $ac_cv_lib_bsd_strlcat" >&5
3412 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3413 if test $ac_cv_lib_bsd_strlcat = yes; then
3414
3415 cf_add_libs="$LIBS"
3416 # reverse order
3417 cf_add_0lib=
3418 for cf_add_1lib in -lbsd; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
3419 # filter duplicates
3420 for cf_add_1lib in $cf_add_0lib; do
3421         for cf_add_2lib in $cf_add_libs; do
3422                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
3423                         cf_add_1lib=
3424                         break
3425                 fi
3426         done
3427         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
3428 done
3429 LIBS="$cf_add_libs"
3430
3431 for ac_header in bsd/string.h
3432 do
3433 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3434 echo "$as_me:3434: checking for $ac_header" >&5
3435 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3436 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3437   echo $ECHO_N "(cached) $ECHO_C" >&6
3438 else
3439   cat >conftest.$ac_ext <<_ACEOF
3440 #line 3440 "configure"
3441 #include "confdefs.h"
3442 #include <$ac_header>
3443 _ACEOF
3444 if { (eval echo "$as_me:3444: \"$ac_cpp conftest.$ac_ext\"") >&5
3445   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3446   ac_status=$?
3447   egrep -v '^ *\+' conftest.er1 >conftest.err
3448   rm -f conftest.er1
3449   cat conftest.err >&5
3450   echo "$as_me:3450: \$? = $ac_status" >&5
3451   (exit $ac_status); } >/dev/null; then
3452   if test -s conftest.err; then
3453     ac_cpp_err=$ac_c_preproc_warn_flag
3454   else
3455     ac_cpp_err=
3456   fi
3457 else
3458   ac_cpp_err=yes
3459 fi
3460 if test -z "$ac_cpp_err"; then
3461   eval "$as_ac_Header=yes"
3462 else
3463   echo "$as_me: failed program was:" >&5
3464   cat conftest.$ac_ext >&5
3465   eval "$as_ac_Header=no"
3466 fi
3467 rm -f conftest.err conftest.$ac_ext
3468 fi
3469 echo "$as_me:3469: result: `eval echo '${'$as_ac_Header'}'`" >&5
3470 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3471 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3472   cat >>confdefs.h <<EOF
3473 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3474 EOF
3475
3476 fi
3477 done
3478
3479 cat >>confdefs.h <<\EOF
3480 #define HAVE_STRLCAT 1
3481 EOF
3482
3483 fi
3484
3485 fi
3486
3487 for ac_func in strlcpy snprintf
3488 do
3489 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3490 echo "$as_me:3490: checking for $ac_func" >&5
3491 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3492 if eval "test \"\${$as_ac_var+set}\" = set"; then
3493   echo $ECHO_N "(cached) $ECHO_C" >&6
3494 else
3495   cat >conftest.$ac_ext <<_ACEOF
3496 #line 3496 "configure"
3497 #include "confdefs.h"
3498 #define $ac_func autoconf_temporary
3499 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
3500 #undef $ac_func
3501
3502 #ifdef __cplusplus
3503 extern "C"
3504 #endif
3505
3506 /* We use char because int might match the return type of a gcc2
3507    builtin and then its argument prototype would still apply.  */
3508 char $ac_func (void);
3509
3510 int
3511 main (void)
3512 {
3513
3514 /* The GNU C library defines stubs for functions which it implements
3515     to always fail with ENOSYS.  Some functions are actually named
3516     something starting with __ and the normal name is an alias.  */
3517 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3518 #error found stub for $ac_func
3519 #endif
3520
3521         return $ac_func ();
3522   ;
3523   return 0;
3524 }
3525 _ACEOF
3526 rm -f conftest.$ac_objext conftest$ac_exeext
3527 if { (eval echo "$as_me:3527: \"$ac_link\"") >&5
3528   (eval $ac_link) 2>&5
3529   ac_status=$?
3530   echo "$as_me:3530: \$? = $ac_status" >&5
3531   (exit $ac_status); } &&
3532          { ac_try='test -s conftest$ac_exeext'
3533   { (eval echo "$as_me:3533: \"$ac_try\"") >&5
3534   (eval $ac_try) 2>&5
3535   ac_status=$?
3536   echo "$as_me:3536: \$? = $ac_status" >&5
3537   (exit $ac_status); }; }; then
3538   eval "$as_ac_var=yes"
3539 else
3540   echo "$as_me: failed program was:" >&5
3541 cat conftest.$ac_ext >&5
3542 eval "$as_ac_var=no"
3543 fi
3544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3545 fi
3546 echo "$as_me:3546: result: `eval echo '${'$as_ac_var'}'`" >&5
3547 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3548 if test `eval echo '${'$as_ac_var'}'` = yes; then
3549   cat >>confdefs.h <<EOF
3550 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3551 EOF
3552
3553 fi
3554 done
3555
3556 fi
3557
3558 echo "$as_me:3558: checking if the POSIX test-macros are already defined" >&5
3559 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6
3560 if test "${cf_cv_posix_visible+set}" = set; then
3561   echo $ECHO_N "(cached) $ECHO_C" >&6
3562 else
3563
3564 cat >conftest.$ac_ext <<_ACEOF
3565 #line 3565 "configure"
3566 #include "confdefs.h"
3567 #include <stdio.h>
3568 int
3569 main (void)
3570 {
3571
3572 #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \
3573         && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \
3574         && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \
3575         && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0)
3576 #error conflicting symbols found
3577 #endif
3578
3579   ;
3580   return 0;
3581 }
3582 _ACEOF
3583 rm -f conftest.$ac_objext
3584 if { (eval echo "$as_me:3584: \"$ac_compile\"") >&5
3585   (eval $ac_compile) 2>&5
3586   ac_status=$?
3587   echo "$as_me:3587: \$? = $ac_status" >&5
3588   (exit $ac_status); } &&
3589          { ac_try='test -s conftest.$ac_objext'
3590   { (eval echo "$as_me:3590: \"$ac_try\"") >&5
3591   (eval $ac_try) 2>&5
3592   ac_status=$?
3593   echo "$as_me:3593: \$? = $ac_status" >&5
3594   (exit $ac_status); }; }; then
3595   cf_cv_posix_visible=no
3596 else
3597   echo "$as_me: failed program was:" >&5
3598 cat conftest.$ac_ext >&5
3599 cf_cv_posix_visible=yes
3600 fi
3601 rm -f conftest.$ac_objext conftest.$ac_ext
3602
3603 fi
3604 echo "$as_me:3604: result: $cf_cv_posix_visible" >&5
3605 echo "${ECHO_T}$cf_cv_posix_visible" >&6
3606
3607 if test "$cf_cv_posix_visible" = no; then
3608
3609 cf_XOPEN_SOURCE=600
3610 cf_POSIX_C_SOURCE=199506L
3611 cf_xopen_source=
3612
3613 case $host_os in
3614 (aix[4-7]*)
3615         cf_xopen_source="-D_ALL_SOURCE"
3616         ;;
3617 (msys)
3618         cf_XOPEN_SOURCE=600
3619         ;;
3620 (darwin[0-8].*)
3621         cf_xopen_source="-D_APPLE_C_SOURCE"
3622         ;;
3623 (darwin*)
3624         cf_xopen_source="-D_DARWIN_C_SOURCE"
3625         cf_XOPEN_SOURCE=
3626         ;;
3627 (freebsd*|dragonfly*|midnightbsd*)
3628         # 5.x headers associate
3629         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3630         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3631         cf_POSIX_C_SOURCE=200112L
3632         cf_XOPEN_SOURCE=600
3633         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3634         ;;
3635 (hpux11*)
3636         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3637         ;;
3638 (hpux*)
3639         cf_xopen_source="-D_HPUX_SOURCE"
3640         ;;
3641 (irix[56].*)
3642         cf_xopen_source="-D_SGI_SOURCE"
3643         cf_XOPEN_SOURCE=
3644         ;;
3645 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3646
3647 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3648
3649 echo "$as_me:3649: checking if this is the GNU C library" >&5
3650 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3651 if test "${cf_cv_gnu_library+set}" = set; then
3652   echo $ECHO_N "(cached) $ECHO_C" >&6
3653 else
3654
3655 cat >conftest.$ac_ext <<_ACEOF
3656 #line 3656 "configure"
3657 #include "confdefs.h"
3658 #include <sys/types.h>
3659 int
3660 main (void)
3661 {
3662
3663         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3664                 return 0;
3665         #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0
3666                 return 0;
3667         #else
3668         #       error not GNU C library
3669         #endif
3670   ;
3671   return 0;
3672 }
3673 _ACEOF
3674 rm -f conftest.$ac_objext
3675 if { (eval echo "$as_me:3675: \"$ac_compile\"") >&5
3676   (eval $ac_compile) 2>&5
3677   ac_status=$?
3678   echo "$as_me:3678: \$? = $ac_status" >&5
3679   (exit $ac_status); } &&
3680          { ac_try='test -s conftest.$ac_objext'
3681   { (eval echo "$as_me:3681: \"$ac_try\"") >&5
3682   (eval $ac_try) 2>&5
3683   ac_status=$?
3684   echo "$as_me:3684: \$? = $ac_status" >&5
3685   (exit $ac_status); }; }; then
3686   cf_cv_gnu_library=yes
3687 else
3688   echo "$as_me: failed program was:" >&5
3689 cat conftest.$ac_ext >&5
3690 cf_cv_gnu_library=no
3691 fi
3692 rm -f conftest.$ac_objext conftest.$ac_ext
3693
3694 fi
3695 echo "$as_me:3695: result: $cf_cv_gnu_library" >&5
3696 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3697
3698 if test x$cf_cv_gnu_library = xyes; then
3699
3700         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3701         # was changed to help a little.  newlib incorporated the change about 4
3702         # years later.
3703         echo "$as_me:3703: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3704 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3705 if test "${cf_cv_gnu_library_219+set}" = set; then
3706   echo $ECHO_N "(cached) $ECHO_C" >&6
3707 else
3708
3709                 cf_save="$CPPFLAGS"
3710
3711         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3712         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3713
3714                 cat >conftest.$ac_ext <<_ACEOF
3715 #line 3715 "configure"
3716 #include "confdefs.h"
3717 #include <sys/types.h>
3718 int
3719 main (void)
3720 {
3721
3722                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3723                                 return 0;
3724                         #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3)
3725                                 return 0;
3726                         #else
3727                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3728                         #endif
3729   ;
3730   return 0;
3731 }
3732 _ACEOF
3733 rm -f conftest.$ac_objext
3734 if { (eval echo "$as_me:3734: \"$ac_compile\"") >&5
3735   (eval $ac_compile) 2>&5
3736   ac_status=$?
3737   echo "$as_me:3737: \$? = $ac_status" >&5
3738   (exit $ac_status); } &&
3739          { ac_try='test -s conftest.$ac_objext'
3740   { (eval echo "$as_me:3740: \"$ac_try\"") >&5
3741   (eval $ac_try) 2>&5
3742   ac_status=$?
3743   echo "$as_me:3743: \$? = $ac_status" >&5
3744   (exit $ac_status); }; }; then
3745   cf_cv_gnu_library_219=yes
3746 else
3747   echo "$as_me: failed program was:" >&5
3748 cat conftest.$ac_ext >&5
3749 cf_cv_gnu_library_219=no
3750 fi
3751 rm -f conftest.$ac_objext conftest.$ac_ext
3752                 CPPFLAGS="$cf_save"
3753
3754 fi
3755 echo "$as_me:3755: result: $cf_cv_gnu_library_219" >&5
3756 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3757
3758         if test "x$cf_cv_gnu_library_219" = xyes; then
3759                 cf_save="$CPPFLAGS"
3760                 echo "$as_me:3760: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3761 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3762 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3763   echo $ECHO_N "(cached) $ECHO_C" >&6
3764 else
3765
3766 cf_fix_cppflags=no
3767 cf_new_cflags=
3768 cf_new_cppflags=
3769 cf_new_extra_cppflags=
3770
3771 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3772 do
3773 case $cf_fix_cppflags in
3774 (no)
3775         case $cf_add_cflags in
3776         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3777                 case $cf_add_cflags in
3778                 (-D*)
3779                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3780
3781                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3782                                 && test -z "${cf_tst_cflags}" \
3783                                 && cf_fix_cppflags=yes
3784
3785                         if test $cf_fix_cppflags = yes ; then
3786
3787         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3788         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3789
3790                                 continue
3791                         elif test "${cf_tst_cflags}" = "\"'" ; then
3792
3793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3795
3796                                 continue
3797                         fi
3798                         ;;
3799                 esac
3800                 case "$CPPFLAGS" in
3801                 (*$cf_add_cflags)
3802                         ;;
3803                 (*)
3804                         case $cf_add_cflags in
3805                         (-D*)
3806                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3807
3808 CPPFLAGS=`echo "$CPPFLAGS" | \
3809         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3810                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3811
3812                                 ;;
3813                         esac
3814
3815         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3816         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3817
3818                         ;;
3819                 esac
3820                 ;;
3821         (*)
3822
3823         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3824         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3825
3826                 ;;
3827         esac
3828         ;;
3829 (yes)
3830
3831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3833
3834         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3835
3836         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3837                 && test -z "${cf_tst_cflags}" \
3838                 && cf_fix_cppflags=no
3839         ;;
3840 esac
3841 done
3842
3843 if test -n "$cf_new_cflags" ; then
3844
3845         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3846         CFLAGS="${CFLAGS}$cf_new_cflags"
3847
3848 fi
3849
3850 if test -n "$cf_new_cppflags" ; then
3851
3852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3853         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3854
3855 fi
3856
3857 if test -n "$cf_new_extra_cppflags" ; then
3858
3859         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3860         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3861
3862 fi
3863
3864                         cat >conftest.$ac_ext <<_ACEOF
3865 #line 3865 "configure"
3866 #include "confdefs.h"
3867
3868                                 #include <limits.h>
3869                                 #include <sys/types.h>
3870
3871 int
3872 main (void)
3873 {
3874
3875                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3876                                         return 0;
3877                                 #else
3878                                 #       error GNU C library is too old
3879                                 #endif
3880   ;
3881   return 0;
3882 }
3883 _ACEOF
3884 rm -f conftest.$ac_objext
3885 if { (eval echo "$as_me:3885: \"$ac_compile\"") >&5
3886   (eval $ac_compile) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); } &&
3890          { ac_try='test -s conftest.$ac_objext'
3891   { (eval echo "$as_me:3891: \"$ac_try\"") >&5
3892   (eval $ac_try) 2>&5
3893   ac_status=$?
3894   echo "$as_me:3894: \$? = $ac_status" >&5
3895   (exit $ac_status); }; }; then
3896   cf_cv_gnu_dftsrc_219=yes
3897 else
3898   echo "$as_me: failed program was:" >&5
3899 cat conftest.$ac_ext >&5
3900 cf_cv_gnu_dftsrc_219=no
3901 fi
3902 rm -f conftest.$ac_objext conftest.$ac_ext
3903
3904 fi
3905 echo "$as_me:3905: result: $cf_cv_gnu_dftsrc_219" >&5
3906 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3907                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3908         else
3909                 cf_cv_gnu_dftsrc_219=maybe
3910         fi
3911
3912         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3913
3914                 echo "$as_me:3914: checking if we must define _GNU_SOURCE" >&5
3915 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3916 if test "${cf_cv_gnu_source+set}" = set; then
3917   echo $ECHO_N "(cached) $ECHO_C" >&6
3918 else
3919
3920                 cat >conftest.$ac_ext <<_ACEOF
3921 #line 3921 "configure"
3922 #include "confdefs.h"
3923 #include <sys/types.h>
3924 int
3925 main (void)
3926 {
3927
3928                         #ifndef _XOPEN_SOURCE
3929                         #error  expected _XOPEN_SOURCE to be defined
3930                         #endif
3931   ;
3932   return 0;
3933 }
3934 _ACEOF
3935 rm -f conftest.$ac_objext
3936 if { (eval echo "$as_me:3936: \"$ac_compile\"") >&5
3937   (eval $ac_compile) 2>&5
3938   ac_status=$?
3939   echo "$as_me:3939: \$? = $ac_status" >&5
3940   (exit $ac_status); } &&
3941          { ac_try='test -s conftest.$ac_objext'
3942   { (eval echo "$as_me:3942: \"$ac_try\"") >&5
3943   (eval $ac_try) 2>&5
3944   ac_status=$?
3945   echo "$as_me:3945: \$? = $ac_status" >&5
3946   (exit $ac_status); }; }; then
3947   cf_cv_gnu_source=no
3948 else
3949   echo "$as_me: failed program was:" >&5
3950 cat conftest.$ac_ext >&5
3951 cf_save="$CPPFLAGS"
3952
3953 cf_fix_cppflags=no
3954 cf_new_cflags=
3955 cf_new_cppflags=
3956 cf_new_extra_cppflags=
3957
3958 for cf_add_cflags in -D_GNU_SOURCE
3959 do
3960 case $cf_fix_cppflags in
3961 (no)
3962         case $cf_add_cflags in
3963         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3964                 case $cf_add_cflags in
3965                 (-D*)
3966                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3967
3968                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3969                                 && test -z "${cf_tst_cflags}" \
3970                                 && cf_fix_cppflags=yes
3971
3972                         if test $cf_fix_cppflags = yes ; then
3973
3974         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3975         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3976
3977                                 continue
3978                         elif test "${cf_tst_cflags}" = "\"'" ; then
3979
3980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3982
3983                                 continue
3984                         fi
3985                         ;;
3986                 esac
3987                 case "$CPPFLAGS" in
3988                 (*$cf_add_cflags)
3989                         ;;
3990                 (*)
3991                         case $cf_add_cflags in
3992                         (-D*)
3993                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3994
3995 CPPFLAGS=`echo "$CPPFLAGS" | \
3996         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3997                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3998
3999                                 ;;
4000                         esac
4001
4002         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4003         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4004
4005                         ;;
4006                 esac
4007                 ;;
4008         (*)
4009
4010         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4011         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4012
4013                 ;;
4014         esac
4015         ;;
4016 (yes)
4017
4018         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4019         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4020
4021         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4022
4023         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4024                 && test -z "${cf_tst_cflags}" \
4025                 && cf_fix_cppflags=no
4026         ;;
4027 esac
4028 done
4029
4030 if test -n "$cf_new_cflags" ; then
4031
4032         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4033         CFLAGS="${CFLAGS}$cf_new_cflags"
4034
4035 fi
4036
4037 if test -n "$cf_new_cppflags" ; then
4038
4039         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4040         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4041
4042 fi
4043
4044 if test -n "$cf_new_extra_cppflags" ; then
4045
4046         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4047         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4048
4049 fi
4050
4051                          cat >conftest.$ac_ext <<_ACEOF
4052 #line 4052 "configure"
4053 #include "confdefs.h"
4054 #include <sys/types.h>
4055 int
4056 main (void)
4057 {
4058
4059                                 #ifdef _XOPEN_SOURCE
4060                                 #error  expected _XOPEN_SOURCE to be undefined
4061                                 #endif
4062   ;
4063   return 0;
4064 }
4065 _ACEOF
4066 rm -f conftest.$ac_objext
4067 if { (eval echo "$as_me:4067: \"$ac_compile\"") >&5
4068   (eval $ac_compile) 2>&5
4069   ac_status=$?
4070   echo "$as_me:4070: \$? = $ac_status" >&5
4071   (exit $ac_status); } &&
4072          { ac_try='test -s conftest.$ac_objext'
4073   { (eval echo "$as_me:4073: \"$ac_try\"") >&5
4074   (eval $ac_try) 2>&5
4075   ac_status=$?
4076   echo "$as_me:4076: \$? = $ac_status" >&5
4077   (exit $ac_status); }; }; then
4078   cf_cv_gnu_source=no
4079 else
4080   echo "$as_me: failed program was:" >&5
4081 cat conftest.$ac_ext >&5
4082 cf_cv_gnu_source=yes
4083 fi
4084 rm -f conftest.$ac_objext conftest.$ac_ext
4085                         CPPFLAGS="$cf_save"
4086
4087 fi
4088 rm -f conftest.$ac_objext conftest.$ac_ext
4089
4090 fi
4091 echo "$as_me:4091: result: $cf_cv_gnu_source" >&5
4092 echo "${ECHO_T}$cf_cv_gnu_source" >&6
4093
4094                 if test "$cf_cv_gnu_source" = yes
4095                 then
4096                 echo "$as_me:4096: checking if we should also define _DEFAULT_SOURCE" >&5
4097 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
4098 if test "${cf_cv_default_source+set}" = set; then
4099   echo $ECHO_N "(cached) $ECHO_C" >&6
4100 else
4101
4102         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4103         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
4104
4105                         cat >conftest.$ac_ext <<_ACEOF
4106 #line 4106 "configure"
4107 #include "confdefs.h"
4108 #include <sys/types.h>
4109 int
4110 main (void)
4111 {
4112
4113                                 #ifdef _DEFAULT_SOURCE
4114                                 #error  expected _DEFAULT_SOURCE to be undefined
4115                                 #endif
4116   ;
4117   return 0;
4118 }
4119 _ACEOF
4120 rm -f conftest.$ac_objext
4121 if { (eval echo "$as_me:4121: \"$ac_compile\"") >&5
4122   (eval $ac_compile) 2>&5
4123   ac_status=$?
4124   echo "$as_me:4124: \$? = $ac_status" >&5
4125   (exit $ac_status); } &&
4126          { ac_try='test -s conftest.$ac_objext'
4127   { (eval echo "$as_me:4127: \"$ac_try\"") >&5
4128   (eval $ac_try) 2>&5
4129   ac_status=$?
4130   echo "$as_me:4130: \$? = $ac_status" >&5
4131   (exit $ac_status); }; }; then
4132   cf_cv_default_source=no
4133 else
4134   echo "$as_me: failed program was:" >&5
4135 cat conftest.$ac_ext >&5
4136 cf_cv_default_source=yes
4137 fi
4138 rm -f conftest.$ac_objext conftest.$ac_ext
4139
4140 fi
4141 echo "$as_me:4141: result: $cf_cv_default_source" >&5
4142 echo "${ECHO_T}$cf_cv_default_source" >&6
4143                         if test "$cf_cv_default_source" = yes
4144                         then
4145
4146         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4147         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
4148
4149                         fi
4150                 fi
4151         fi
4152
4153 fi
4154
4155         ;;
4156 (minix*)
4157         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
4158         ;;
4159 (mirbsd*)
4160         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
4161         cf_XOPEN_SOURCE=
4162
4163 if test "$cf_cv_posix_visible" = no; then
4164
4165 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4166
4167 cf_save_CFLAGS="$CFLAGS"
4168 cf_save_CPPFLAGS="$CPPFLAGS"
4169
4170 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4171         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4172                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4173
4174 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4175         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4176                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4177
4178 echo "$as_me:4178: checking if we should define _POSIX_C_SOURCE" >&5
4179 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4180 if test "${cf_cv_posix_c_source+set}" = set; then
4181   echo $ECHO_N "(cached) $ECHO_C" >&6
4182 else
4183
4184 echo "${as_me:-configure}:4184: testing if the symbol is already defined go no further ..." 1>&5
4185
4186         cat >conftest.$ac_ext <<_ACEOF
4187 #line 4187 "configure"
4188 #include "confdefs.h"
4189 #include <sys/types.h>
4190 int
4191 main (void)
4192 {
4193
4194 #ifndef _POSIX_C_SOURCE
4195 make an error
4196 #endif
4197   ;
4198   return 0;
4199 }
4200 _ACEOF
4201 rm -f conftest.$ac_objext
4202 if { (eval echo "$as_me:4202: \"$ac_compile\"") >&5
4203   (eval $ac_compile) 2>&5
4204   ac_status=$?
4205   echo "$as_me:4205: \$? = $ac_status" >&5
4206   (exit $ac_status); } &&
4207          { ac_try='test -s conftest.$ac_objext'
4208   { (eval echo "$as_me:4208: \"$ac_try\"") >&5
4209   (eval $ac_try) 2>&5
4210   ac_status=$?
4211   echo "$as_me:4211: \$? = $ac_status" >&5
4212   (exit $ac_status); }; }; then
4213   cf_cv_posix_c_source=no
4214 else
4215   echo "$as_me: failed program was:" >&5
4216 cat conftest.$ac_ext >&5
4217 cf_want_posix_source=no
4218          case .$cf_POSIX_C_SOURCE in
4219          (.[12]??*)
4220                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4221                 ;;
4222          (.2)
4223                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4224                 cf_want_posix_source=yes
4225                 ;;
4226          (.*)
4227                 cf_want_posix_source=yes
4228                 ;;
4229          esac
4230          if test "$cf_want_posix_source" = yes ; then
4231                 cat >conftest.$ac_ext <<_ACEOF
4232 #line 4232 "configure"
4233 #include "confdefs.h"
4234 #include <sys/types.h>
4235 int
4236 main (void)
4237 {
4238
4239 #ifdef _POSIX_SOURCE
4240 make an error
4241 #endif
4242   ;
4243   return 0;
4244 }
4245 _ACEOF
4246 rm -f conftest.$ac_objext
4247 if { (eval echo "$as_me:4247: \"$ac_compile\"") >&5
4248   (eval $ac_compile) 2>&5
4249   ac_status=$?
4250   echo "$as_me:4250: \$? = $ac_status" >&5
4251   (exit $ac_status); } &&
4252          { ac_try='test -s conftest.$ac_objext'
4253   { (eval echo "$as_me:4253: \"$ac_try\"") >&5
4254   (eval $ac_try) 2>&5
4255   ac_status=$?
4256   echo "$as_me:4256: \$? = $ac_status" >&5
4257   (exit $ac_status); }; }; then
4258   :
4259 else
4260   echo "$as_me: failed program was:" >&5
4261 cat conftest.$ac_ext >&5
4262 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4263 fi
4264 rm -f conftest.$ac_objext conftest.$ac_ext
4265          fi
4266
4267 echo "${as_me:-configure}:4267: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4268
4269          CFLAGS="$cf_trim_CFLAGS"
4270          CPPFLAGS="$cf_trim_CPPFLAGS"
4271
4272         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4273         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4274
4275 echo "${as_me:-configure}:4275: testing if the second compile does not leave our definition intact error ..." 1>&5
4276
4277          cat >conftest.$ac_ext <<_ACEOF
4278 #line 4278 "configure"
4279 #include "confdefs.h"
4280 #include <sys/types.h>
4281 int
4282 main (void)
4283 {
4284
4285 #ifndef _POSIX_C_SOURCE
4286 make an error
4287 #endif
4288   ;
4289   return 0;
4290 }
4291 _ACEOF
4292 rm -f conftest.$ac_objext
4293 if { (eval echo "$as_me:4293: \"$ac_compile\"") >&5
4294   (eval $ac_compile) 2>&5
4295   ac_status=$?
4296   echo "$as_me:4296: \$? = $ac_status" >&5
4297   (exit $ac_status); } &&
4298          { ac_try='test -s conftest.$ac_objext'
4299   { (eval echo "$as_me:4299: \"$ac_try\"") >&5
4300   (eval $ac_try) 2>&5
4301   ac_status=$?
4302   echo "$as_me:4302: \$? = $ac_status" >&5
4303   (exit $ac_status); }; }; then
4304   :
4305 else
4306   echo "$as_me: failed program was:" >&5
4307 cat conftest.$ac_ext >&5
4308 cf_cv_posix_c_source=no
4309 fi
4310 rm -f conftest.$ac_objext conftest.$ac_ext
4311          CFLAGS="$cf_save_CFLAGS"
4312          CPPFLAGS="$cf_save_CPPFLAGS"
4313
4314 fi
4315 rm -f conftest.$ac_objext conftest.$ac_ext
4316
4317 fi
4318 echo "$as_me:4318: result: $cf_cv_posix_c_source" >&5
4319 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4320
4321 if test "$cf_cv_posix_c_source" != no ; then
4322         CFLAGS="$cf_trim_CFLAGS"
4323         CPPFLAGS="$cf_trim_CPPFLAGS"
4324
4325 cf_fix_cppflags=no
4326 cf_new_cflags=
4327 cf_new_cppflags=
4328 cf_new_extra_cppflags=
4329
4330 for cf_add_cflags in $cf_cv_posix_c_source
4331 do
4332 case $cf_fix_cppflags in
4333 (no)
4334         case $cf_add_cflags in
4335         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4336                 case $cf_add_cflags in
4337                 (-D*)
4338                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4339
4340                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4341                                 && test -z "${cf_tst_cflags}" \
4342                                 && cf_fix_cppflags=yes
4343
4344                         if test $cf_fix_cppflags = yes ; then
4345
4346         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4347         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4348
4349                                 continue
4350                         elif test "${cf_tst_cflags}" = "\"'" ; then
4351
4352         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4353         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4354
4355                                 continue
4356                         fi
4357                         ;;
4358                 esac
4359                 case "$CPPFLAGS" in
4360                 (*$cf_add_cflags)
4361                         ;;
4362                 (*)
4363                         case $cf_add_cflags in
4364                         (-D*)
4365                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4366
4367 CPPFLAGS=`echo "$CPPFLAGS" | \
4368         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4369                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4370
4371                                 ;;
4372                         esac
4373
4374         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4375         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4376
4377                         ;;
4378                 esac
4379                 ;;
4380         (*)
4381
4382         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4383         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4384
4385                 ;;
4386         esac
4387         ;;
4388 (yes)
4389
4390         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4391         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4392
4393         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4394
4395         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4396                 && test -z "${cf_tst_cflags}" \
4397                 && cf_fix_cppflags=no
4398         ;;
4399 esac
4400 done
4401
4402 if test -n "$cf_new_cflags" ; then
4403
4404         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4405         CFLAGS="${CFLAGS}$cf_new_cflags"
4406
4407 fi
4408
4409 if test -n "$cf_new_cppflags" ; then
4410
4411         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4412         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4413
4414 fi
4415
4416 if test -n "$cf_new_extra_cppflags" ; then
4417
4418         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4419         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4420
4421 fi
4422
4423 fi
4424
4425 fi # cf_cv_posix_visible
4426
4427         ;;
4428 (netbsd*)
4429         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4430         ;;
4431 (openbsd[4-9]*)
4432         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4433         cf_xopen_source="-D_BSD_SOURCE"
4434         cf_XOPEN_SOURCE=600
4435         ;;
4436 (openbsd*)
4437         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4438         ;;
4439 (osf[45]*)
4440         cf_xopen_source="-D_OSF_SOURCE"
4441         ;;
4442 (nto-qnx*)
4443         cf_xopen_source="-D_QNX_SOURCE"
4444         ;;
4445 (sco*)
4446         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4447         ;;
4448 (solaris2.*)
4449         cf_xopen_source="-D__EXTENSIONS__"
4450         cf_cv_xopen_source=broken
4451         ;;
4452 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4453         cf_XOPEN_SOURCE=
4454         cf_POSIX_C_SOURCE=
4455         ;;
4456 (*)
4457
4458 echo "$as_me:4458: checking if we should define _XOPEN_SOURCE" >&5
4459 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4460 if test "${cf_cv_xopen_source+set}" = set; then
4461   echo $ECHO_N "(cached) $ECHO_C" >&6
4462 else
4463
4464         cat >conftest.$ac_ext <<_ACEOF
4465 #line 4465 "configure"
4466 #include "confdefs.h"
4467
4468 #include <stdlib.h>
4469 #include <string.h>
4470 #include <sys/types.h>
4471
4472 int
4473 main (void)
4474 {
4475
4476 #ifndef _XOPEN_SOURCE
4477 make an error
4478 #endif
4479   ;
4480   return 0;
4481 }
4482 _ACEOF
4483 rm -f conftest.$ac_objext
4484 if { (eval echo "$as_me:4484: \"$ac_compile\"") >&5
4485   (eval $ac_compile) 2>&5
4486   ac_status=$?
4487   echo "$as_me:4487: \$? = $ac_status" >&5
4488   (exit $ac_status); } &&
4489          { ac_try='test -s conftest.$ac_objext'
4490   { (eval echo "$as_me:4490: \"$ac_try\"") >&5
4491   (eval $ac_try) 2>&5
4492   ac_status=$?
4493   echo "$as_me:4493: \$? = $ac_status" >&5
4494   (exit $ac_status); }; }; then
4495   cf_cv_xopen_source=no
4496 else
4497   echo "$as_me: failed program was:" >&5
4498 cat conftest.$ac_ext >&5
4499 cf_save="$CPPFLAGS"
4500
4501         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4502         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4503
4504          cat >conftest.$ac_ext <<_ACEOF
4505 #line 4505 "configure"
4506 #include "confdefs.h"
4507
4508 #include <stdlib.h>
4509 #include <string.h>
4510 #include <sys/types.h>
4511
4512 int
4513 main (void)
4514 {
4515
4516 #ifdef _XOPEN_SOURCE
4517 make an error
4518 #endif
4519   ;
4520   return 0;
4521 }
4522 _ACEOF
4523 rm -f conftest.$ac_objext
4524 if { (eval echo "$as_me:4524: \"$ac_compile\"") >&5
4525   (eval $ac_compile) 2>&5
4526   ac_status=$?
4527   echo "$as_me:4527: \$? = $ac_status" >&5
4528   (exit $ac_status); } &&
4529          { ac_try='test -s conftest.$ac_objext'
4530   { (eval echo "$as_me:4530: \"$ac_try\"") >&5
4531   (eval $ac_try) 2>&5
4532   ac_status=$?
4533   echo "$as_me:4533: \$? = $ac_status" >&5
4534   (exit $ac_status); }; }; then
4535   cf_cv_xopen_source=no
4536 else
4537   echo "$as_me: failed program was:" >&5
4538 cat conftest.$ac_ext >&5
4539 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4540 fi
4541 rm -f conftest.$ac_objext conftest.$ac_ext
4542         CPPFLAGS="$cf_save"
4543
4544 fi
4545 rm -f conftest.$ac_objext conftest.$ac_ext
4546
4547 fi
4548 echo "$as_me:4548: result: $cf_cv_xopen_source" >&5
4549 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4550
4551 if test "$cf_cv_xopen_source" != no ; then
4552
4553 CFLAGS=`echo "$CFLAGS" | \
4554         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4555                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4556
4557 CPPFLAGS=`echo "$CPPFLAGS" | \
4558         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4559                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4560
4561         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4562
4563 cf_fix_cppflags=no
4564 cf_new_cflags=
4565 cf_new_cppflags=
4566 cf_new_extra_cppflags=
4567
4568 for cf_add_cflags in $cf_temp_xopen_source
4569 do
4570 case $cf_fix_cppflags in
4571 (no)
4572         case $cf_add_cflags in
4573         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4574                 case $cf_add_cflags in
4575                 (-D*)
4576                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4577
4578                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4579                                 && test -z "${cf_tst_cflags}" \
4580                                 && cf_fix_cppflags=yes
4581
4582                         if test $cf_fix_cppflags = yes ; then
4583
4584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4586
4587                                 continue
4588                         elif test "${cf_tst_cflags}" = "\"'" ; then
4589
4590         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4591         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4592
4593                                 continue
4594                         fi
4595                         ;;
4596                 esac
4597                 case "$CPPFLAGS" in
4598                 (*$cf_add_cflags)
4599                         ;;
4600                 (*)
4601                         case $cf_add_cflags in
4602                         (-D*)
4603                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4604
4605 CPPFLAGS=`echo "$CPPFLAGS" | \
4606         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4607                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4608
4609                                 ;;
4610                         esac
4611
4612         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4613         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4614
4615                         ;;
4616                 esac
4617                 ;;
4618         (*)
4619
4620         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4621         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4622
4623                 ;;
4624         esac
4625         ;;
4626 (yes)
4627
4628         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4629         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4630
4631         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4632
4633         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4634                 && test -z "${cf_tst_cflags}" \
4635                 && cf_fix_cppflags=no
4636         ;;
4637 esac
4638 done
4639
4640 if test -n "$cf_new_cflags" ; then
4641
4642         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4643         CFLAGS="${CFLAGS}$cf_new_cflags"
4644
4645 fi
4646
4647 if test -n "$cf_new_cppflags" ; then
4648
4649         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4650         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4651
4652 fi
4653
4654 if test -n "$cf_new_extra_cppflags" ; then
4655
4656         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4657         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4658
4659 fi
4660
4661 fi
4662
4663 if test "$cf_cv_posix_visible" = no; then
4664
4665 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4666
4667 cf_save_CFLAGS="$CFLAGS"
4668 cf_save_CPPFLAGS="$CPPFLAGS"
4669
4670 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4671         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4672                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4673
4674 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4675         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4676                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4677
4678 echo "$as_me:4678: checking if we should define _POSIX_C_SOURCE" >&5
4679 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4680 if test "${cf_cv_posix_c_source+set}" = set; then
4681   echo $ECHO_N "(cached) $ECHO_C" >&6
4682 else
4683
4684 echo "${as_me:-configure}:4684: testing if the symbol is already defined go no further ..." 1>&5
4685
4686         cat >conftest.$ac_ext <<_ACEOF
4687 #line 4687 "configure"
4688 #include "confdefs.h"
4689 #include <sys/types.h>
4690 int
4691 main (void)
4692 {
4693
4694 #ifndef _POSIX_C_SOURCE
4695 make an error
4696 #endif
4697   ;
4698   return 0;
4699 }
4700 _ACEOF
4701 rm -f conftest.$ac_objext
4702 if { (eval echo "$as_me:4702: \"$ac_compile\"") >&5
4703   (eval $ac_compile) 2>&5
4704   ac_status=$?
4705   echo "$as_me:4705: \$? = $ac_status" >&5
4706   (exit $ac_status); } &&
4707          { ac_try='test -s conftest.$ac_objext'
4708   { (eval echo "$as_me:4708: \"$ac_try\"") >&5
4709   (eval $ac_try) 2>&5
4710   ac_status=$?
4711   echo "$as_me:4711: \$? = $ac_status" >&5
4712   (exit $ac_status); }; }; then
4713   cf_cv_posix_c_source=no
4714 else
4715   echo "$as_me: failed program was:" >&5
4716 cat conftest.$ac_ext >&5
4717 cf_want_posix_source=no
4718          case .$cf_POSIX_C_SOURCE in
4719          (.[12]??*)
4720                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4721                 ;;
4722          (.2)
4723                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4724                 cf_want_posix_source=yes
4725                 ;;
4726          (.*)
4727                 cf_want_posix_source=yes
4728                 ;;
4729          esac
4730          if test "$cf_want_posix_source" = yes ; then
4731                 cat >conftest.$ac_ext <<_ACEOF
4732 #line 4732 "configure"
4733 #include "confdefs.h"
4734 #include <sys/types.h>
4735 int
4736 main (void)
4737 {
4738
4739 #ifdef _POSIX_SOURCE
4740 make an error
4741 #endif
4742   ;
4743   return 0;
4744 }
4745 _ACEOF
4746 rm -f conftest.$ac_objext
4747 if { (eval echo "$as_me:4747: \"$ac_compile\"") >&5
4748   (eval $ac_compile) 2>&5
4749   ac_status=$?
4750   echo "$as_me:4750: \$? = $ac_status" >&5
4751   (exit $ac_status); } &&
4752          { ac_try='test -s conftest.$ac_objext'
4753   { (eval echo "$as_me:4753: \"$ac_try\"") >&5
4754   (eval $ac_try) 2>&5
4755   ac_status=$?
4756   echo "$as_me:4756: \$? = $ac_status" >&5
4757   (exit $ac_status); }; }; then
4758   :
4759 else
4760   echo "$as_me: failed program was:" >&5
4761 cat conftest.$ac_ext >&5
4762 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4763 fi
4764 rm -f conftest.$ac_objext conftest.$ac_ext
4765          fi
4766
4767 echo "${as_me:-configure}:4767: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4768
4769          CFLAGS="$cf_trim_CFLAGS"
4770          CPPFLAGS="$cf_trim_CPPFLAGS"
4771
4772         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4773         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4774
4775 echo "${as_me:-configure}:4775: testing if the second compile does not leave our definition intact error ..." 1>&5
4776
4777          cat >conftest.$ac_ext <<_ACEOF
4778 #line 4778 "configure"
4779 #include "confdefs.h"
4780 #include <sys/types.h>
4781 int
4782 main (void)
4783 {
4784
4785 #ifndef _POSIX_C_SOURCE
4786 make an error
4787 #endif
4788   ;
4789   return 0;
4790 }
4791 _ACEOF
4792 rm -f conftest.$ac_objext
4793 if { (eval echo "$as_me:4793: \"$ac_compile\"") >&5
4794   (eval $ac_compile) 2>&5
4795   ac_status=$?
4796   echo "$as_me:4796: \$? = $ac_status" >&5
4797   (exit $ac_status); } &&
4798          { ac_try='test -s conftest.$ac_objext'
4799   { (eval echo "$as_me:4799: \"$ac_try\"") >&5
4800   (eval $ac_try) 2>&5
4801   ac_status=$?
4802   echo "$as_me:4802: \$? = $ac_status" >&5
4803   (exit $ac_status); }; }; then
4804   :
4805 else
4806   echo "$as_me: failed program was:" >&5
4807 cat conftest.$ac_ext >&5
4808 cf_cv_posix_c_source=no
4809 fi
4810 rm -f conftest.$ac_objext conftest.$ac_ext
4811          CFLAGS="$cf_save_CFLAGS"
4812          CPPFLAGS="$cf_save_CPPFLAGS"
4813
4814 fi
4815 rm -f conftest.$ac_objext conftest.$ac_ext
4816
4817 fi
4818 echo "$as_me:4818: result: $cf_cv_posix_c_source" >&5
4819 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4820
4821 if test "$cf_cv_posix_c_source" != no ; then
4822         CFLAGS="$cf_trim_CFLAGS"
4823         CPPFLAGS="$cf_trim_CPPFLAGS"
4824
4825 cf_fix_cppflags=no
4826 cf_new_cflags=
4827 cf_new_cppflags=
4828 cf_new_extra_cppflags=
4829
4830 for cf_add_cflags in $cf_cv_posix_c_source
4831 do
4832 case $cf_fix_cppflags in
4833 (no)
4834         case $cf_add_cflags in
4835         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4836                 case $cf_add_cflags in
4837                 (-D*)
4838                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4839
4840                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4841                                 && test -z "${cf_tst_cflags}" \
4842                                 && cf_fix_cppflags=yes
4843
4844                         if test $cf_fix_cppflags = yes ; then
4845
4846         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4847         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4848
4849                                 continue
4850                         elif test "${cf_tst_cflags}" = "\"'" ; then
4851
4852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4854
4855                                 continue
4856                         fi
4857                         ;;
4858                 esac
4859                 case "$CPPFLAGS" in
4860                 (*$cf_add_cflags)
4861                         ;;
4862                 (*)
4863                         case $cf_add_cflags in
4864                         (-D*)
4865                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4866
4867 CPPFLAGS=`echo "$CPPFLAGS" | \
4868         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4869                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4870
4871                                 ;;
4872                         esac
4873
4874         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4875         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4876
4877                         ;;
4878                 esac
4879                 ;;
4880         (*)
4881
4882         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4883         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4884
4885                 ;;
4886         esac
4887         ;;
4888 (yes)
4889
4890         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4891         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4892
4893         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4894
4895         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4896                 && test -z "${cf_tst_cflags}" \
4897                 && cf_fix_cppflags=no
4898         ;;
4899 esac
4900 done
4901
4902 if test -n "$cf_new_cflags" ; then
4903
4904         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4905         CFLAGS="${CFLAGS}$cf_new_cflags"
4906
4907 fi
4908
4909 if test -n "$cf_new_cppflags" ; then
4910
4911         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4912         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4913
4914 fi
4915
4916 if test -n "$cf_new_extra_cppflags" ; then
4917
4918         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4919         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4920
4921 fi
4922
4923 fi
4924
4925 fi # cf_cv_posix_visible
4926
4927         ;;
4928 esac
4929
4930 if test -n "$cf_xopen_source" ; then
4931
4932 cf_fix_cppflags=no
4933 cf_new_cflags=
4934 cf_new_cppflags=
4935 cf_new_extra_cppflags=
4936
4937 for cf_add_cflags in $cf_xopen_source
4938 do
4939 case $cf_fix_cppflags in
4940 (no)
4941         case $cf_add_cflags in
4942         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4943                 case $cf_add_cflags in
4944                 (-D*)
4945                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4946
4947                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4948                                 && test -z "${cf_tst_cflags}" \
4949                                 && cf_fix_cppflags=yes
4950
4951                         if test $cf_fix_cppflags = yes ; then
4952
4953         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4954         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4955
4956                                 continue
4957                         elif test "${cf_tst_cflags}" = "\"'" ; then
4958
4959         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4960         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4961
4962                                 continue
4963                         fi
4964                         ;;
4965                 esac
4966                 case "$CPPFLAGS" in
4967                 (*$cf_add_cflags)
4968                         ;;
4969                 (*)
4970                         case $cf_add_cflags in
4971                         (-D*)
4972                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4973
4974 CPPFLAGS=`echo "$CPPFLAGS" | \
4975         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4976                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4977
4978                                 ;;
4979                         esac
4980
4981         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4982         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4983
4984                         ;;
4985                 esac
4986                 ;;
4987         (*)
4988
4989         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4990         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4991
4992                 ;;
4993         esac
4994         ;;
4995 (yes)
4996
4997         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4998         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4999
5000         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5001
5002         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5003                 && test -z "${cf_tst_cflags}" \
5004                 && cf_fix_cppflags=no
5005         ;;
5006 esac
5007 done
5008
5009 if test -n "$cf_new_cflags" ; then
5010         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
5011
5012 echo "${as_me:-configure}:5012: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
5013
5014         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5015         CFLAGS="${CFLAGS}$cf_new_cflags"
5016
5017 fi
5018
5019 if test -n "$cf_new_cppflags" ; then
5020         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
5021
5022 echo "${as_me:-configure}:5022: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
5023
5024         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5025         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5026
5027 fi
5028
5029 if test -n "$cf_new_extra_cppflags" ; then
5030         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
5031
5032 echo "${as_me:-configure}:5032: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
5033
5034         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5035         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5036
5037 fi
5038
5039 fi
5040
5041 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5042         echo "$as_me:5042: checking if _XOPEN_SOURCE really is set" >&5
5043 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
5044         cat >conftest.$ac_ext <<_ACEOF
5045 #line 5045 "configure"
5046 #include "confdefs.h"
5047 #include <stdlib.h>
5048 int
5049 main (void)
5050 {
5051
5052 #ifndef _XOPEN_SOURCE
5053 make an error
5054 #endif
5055   ;
5056   return 0;
5057 }
5058 _ACEOF
5059 rm -f conftest.$ac_objext
5060 if { (eval echo "$as_me:5060: \"$ac_compile\"") >&5
5061   (eval $ac_compile) 2>&5
5062   ac_status=$?
5063   echo "$as_me:5063: \$? = $ac_status" >&5
5064   (exit $ac_status); } &&
5065          { ac_try='test -s conftest.$ac_objext'
5066   { (eval echo "$as_me:5066: \"$ac_try\"") >&5
5067   (eval $ac_try) 2>&5
5068   ac_status=$?
5069   echo "$as_me:5069: \$? = $ac_status" >&5
5070   (exit $ac_status); }; }; then
5071   cf_XOPEN_SOURCE_set=yes
5072 else
5073   echo "$as_me: failed program was:" >&5
5074 cat conftest.$ac_ext >&5
5075 cf_XOPEN_SOURCE_set=no
5076 fi
5077 rm -f conftest.$ac_objext conftest.$ac_ext
5078         echo "$as_me:5078: result: $cf_XOPEN_SOURCE_set" >&5
5079 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
5080         if test $cf_XOPEN_SOURCE_set = yes
5081         then
5082                 cat >conftest.$ac_ext <<_ACEOF
5083 #line 5083 "configure"
5084 #include "confdefs.h"
5085 #include <stdlib.h>
5086 int
5087 main (void)
5088 {
5089
5090 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5091 make an error
5092 #endif
5093   ;
5094   return 0;
5095 }
5096 _ACEOF
5097 rm -f conftest.$ac_objext
5098 if { (eval echo "$as_me:5098: \"$ac_compile\"") >&5
5099   (eval $ac_compile) 2>&5
5100   ac_status=$?
5101   echo "$as_me:5101: \$? = $ac_status" >&5
5102   (exit $ac_status); } &&
5103          { ac_try='test -s conftest.$ac_objext'
5104   { (eval echo "$as_me:5104: \"$ac_try\"") >&5
5105   (eval $ac_try) 2>&5
5106   ac_status=$?
5107   echo "$as_me:5107: \$? = $ac_status" >&5
5108   (exit $ac_status); }; }; then
5109   cf_XOPEN_SOURCE_set_ok=yes
5110 else
5111   echo "$as_me: failed program was:" >&5
5112 cat conftest.$ac_ext >&5
5113 cf_XOPEN_SOURCE_set_ok=no
5114 fi
5115 rm -f conftest.$ac_objext conftest.$ac_ext
5116                 if test $cf_XOPEN_SOURCE_set_ok = no
5117                 then
5118                         { echo "$as_me:5118: WARNING: _XOPEN_SOURCE is lower than requested" >&5
5119 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
5120                 fi
5121         else
5122
5123 echo "$as_me:5123: checking if we should define _XOPEN_SOURCE" >&5
5124 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
5125 if test "${cf_cv_xopen_source+set}" = set; then
5126   echo $ECHO_N "(cached) $ECHO_C" >&6
5127 else
5128
5129         cat >conftest.$ac_ext <<_ACEOF
5130 #line 5130 "configure"
5131 #include "confdefs.h"
5132
5133 #include <stdlib.h>
5134 #include <string.h>
5135 #include <sys/types.h>
5136
5137 int
5138 main (void)
5139 {
5140
5141 #ifndef _XOPEN_SOURCE
5142 make an error
5143 #endif
5144   ;
5145   return 0;
5146 }
5147 _ACEOF
5148 rm -f conftest.$ac_objext
5149 if { (eval echo "$as_me:5149: \"$ac_compile\"") >&5
5150   (eval $ac_compile) 2>&5
5151   ac_status=$?
5152   echo "$as_me:5152: \$? = $ac_status" >&5
5153   (exit $ac_status); } &&
5154          { ac_try='test -s conftest.$ac_objext'
5155   { (eval echo "$as_me:5155: \"$ac_try\"") >&5
5156   (eval $ac_try) 2>&5
5157   ac_status=$?
5158   echo "$as_me:5158: \$? = $ac_status" >&5
5159   (exit $ac_status); }; }; then
5160   cf_cv_xopen_source=no
5161 else
5162   echo "$as_me: failed program was:" >&5
5163 cat conftest.$ac_ext >&5
5164 cf_save="$CPPFLAGS"
5165
5166         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5167         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5168
5169          cat >conftest.$ac_ext <<_ACEOF
5170 #line 5170 "configure"
5171 #include "confdefs.h"
5172
5173 #include <stdlib.h>
5174 #include <string.h>
5175 #include <sys/types.h>
5176
5177 int
5178 main (void)
5179 {
5180
5181 #ifdef _XOPEN_SOURCE
5182 make an error
5183 #endif
5184   ;
5185   return 0;
5186 }
5187 _ACEOF
5188 rm -f conftest.$ac_objext
5189 if { (eval echo "$as_me:5189: \"$ac_compile\"") >&5
5190   (eval $ac_compile) 2>&5
5191   ac_status=$?
5192   echo "$as_me:5192: \$? = $ac_status" >&5
5193   (exit $ac_status); } &&
5194          { ac_try='test -s conftest.$ac_objext'
5195   { (eval echo "$as_me:5195: \"$ac_try\"") >&5
5196   (eval $ac_try) 2>&5
5197   ac_status=$?
5198   echo "$as_me:5198: \$? = $ac_status" >&5
5199   (exit $ac_status); }; }; then
5200   cf_cv_xopen_source=no
5201 else
5202   echo "$as_me: failed program was:" >&5
5203 cat conftest.$ac_ext >&5
5204 cf_cv_xopen_source=$cf_XOPEN_SOURCE
5205 fi
5206 rm -f conftest.$ac_objext conftest.$ac_ext
5207         CPPFLAGS="$cf_save"
5208
5209 fi
5210 rm -f conftest.$ac_objext conftest.$ac_ext
5211
5212 fi
5213 echo "$as_me:5213: result: $cf_cv_xopen_source" >&5
5214 echo "${ECHO_T}$cf_cv_xopen_source" >&6
5215
5216 if test "$cf_cv_xopen_source" != no ; then
5217
5218 CFLAGS=`echo "$CFLAGS" | \
5219         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5220                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5221
5222 CPPFLAGS=`echo "$CPPFLAGS" | \
5223         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
5224                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
5225
5226         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
5227
5228 cf_fix_cppflags=no
5229 cf_new_cflags=
5230 cf_new_cppflags=
5231 cf_new_extra_cppflags=
5232
5233 for cf_add_cflags in $cf_temp_xopen_source
5234 do
5235 case $cf_fix_cppflags in
5236 (no)
5237         case $cf_add_cflags in
5238         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5239                 case $cf_add_cflags in
5240                 (-D*)
5241                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5242
5243                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5244                                 && test -z "${cf_tst_cflags}" \
5245                                 && cf_fix_cppflags=yes
5246
5247                         if test $cf_fix_cppflags = yes ; then
5248
5249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5251
5252                                 continue
5253                         elif test "${cf_tst_cflags}" = "\"'" ; then
5254
5255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5257
5258                                 continue
5259                         fi
5260                         ;;
5261                 esac
5262                 case "$CPPFLAGS" in
5263                 (*$cf_add_cflags)
5264                         ;;
5265                 (*)
5266                         case $cf_add_cflags in
5267                         (-D*)
5268                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5269
5270 CPPFLAGS=`echo "$CPPFLAGS" | \
5271         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5272                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5273
5274                                 ;;
5275                         esac
5276
5277         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5278         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5279
5280                         ;;
5281                 esac
5282                 ;;
5283         (*)
5284
5285         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5286         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5287
5288                 ;;
5289         esac
5290         ;;
5291 (yes)
5292
5293         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5294         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5295
5296         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5297
5298         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5299                 && test -z "${cf_tst_cflags}" \
5300                 && cf_fix_cppflags=no
5301         ;;
5302 esac
5303 done
5304
5305 if test -n "$cf_new_cflags" ; then
5306
5307         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5308         CFLAGS="${CFLAGS}$cf_new_cflags"
5309
5310 fi
5311
5312 if test -n "$cf_new_cppflags" ; then
5313
5314         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5315         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5316
5317 fi
5318
5319 if test -n "$cf_new_extra_cppflags" ; then
5320
5321         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5322         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5323
5324 fi
5325
5326 fi
5327
5328         fi
5329 fi
5330 fi # cf_cv_posix_visible
5331
5332 echo "$as_me:5332: checking for signal global datatype" >&5
5333 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5334 if test "${cf_cv_sig_atomic_t+set}" = set; then
5335   echo $ECHO_N "(cached) $ECHO_C" >&6
5336 else
5337
5338         for cf_type in \
5339                 "volatile sig_atomic_t" \
5340                 "sig_atomic_t" \
5341                 "int"
5342         do
5343         cat >conftest.$ac_ext <<_ACEOF
5344 #line 5344 "configure"
5345 #include "confdefs.h"
5346
5347 #include <sys/types.h>
5348 #include <signal.h>
5349 #include <stdio.h>
5350
5351 extern $cf_type x;
5352 $cf_type x;
5353 static void handler(int sig)
5354 {
5355         (void)sig;
5356         x = 5;
5357 }
5358 int
5359 main (void)
5360 {
5361 signal(SIGINT, handler);
5362                  x = 1
5363   ;
5364   return 0;
5365 }
5366 _ACEOF
5367 rm -f conftest.$ac_objext
5368 if { (eval echo "$as_me:5368: \"$ac_compile\"") >&5
5369   (eval $ac_compile) 2>&5
5370   ac_status=$?
5371   echo "$as_me:5371: \$? = $ac_status" >&5
5372   (exit $ac_status); } &&
5373          { ac_try='test -s conftest.$ac_objext'
5374   { (eval echo "$as_me:5374: \"$ac_try\"") >&5
5375   (eval $ac_try) 2>&5
5376   ac_status=$?
5377   echo "$as_me:5377: \$? = $ac_status" >&5
5378   (exit $ac_status); }; }; then
5379   cf_cv_sig_atomic_t=$cf_type
5380 else
5381   echo "$as_me: failed program was:" >&5
5382 cat conftest.$ac_ext >&5
5383 cf_cv_sig_atomic_t=no
5384 fi
5385 rm -f conftest.$ac_objext conftest.$ac_ext
5386                 test "$cf_cv_sig_atomic_t" != no && break
5387         done
5388
5389 fi
5390
5391 echo "$as_me:5391: result: $cf_cv_sig_atomic_t" >&5
5392 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5393 test "$cf_cv_sig_atomic_t" != no &&
5394 cat >>confdefs.h <<EOF
5395 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5396 EOF
5397
5398 # Work around breakage on OS X
5399
5400 echo "$as_me:5400: checking if SIGWINCH is defined" >&5
5401 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5402 if test "${cf_cv_define_sigwinch+set}" = set; then
5403   echo $ECHO_N "(cached) $ECHO_C" >&6
5404 else
5405
5406         cat >conftest.$ac_ext <<_ACEOF
5407 #line 5407 "configure"
5408 #include "confdefs.h"
5409
5410 #include <sys/types.h>
5411 #include <sys/signal.h>
5412
5413 int
5414 main (void)
5415 {
5416 int x = SIGWINCH; (void)x
5417   ;
5418   return 0;
5419 }
5420 _ACEOF
5421 rm -f conftest.$ac_objext
5422 if { (eval echo "$as_me:5422: \"$ac_compile\"") >&5
5423   (eval $ac_compile) 2>&5
5424   ac_status=$?
5425   echo "$as_me:5425: \$? = $ac_status" >&5
5426   (exit $ac_status); } &&
5427          { ac_try='test -s conftest.$ac_objext'
5428   { (eval echo "$as_me:5428: \"$ac_try\"") >&5
5429   (eval $ac_try) 2>&5
5430   ac_status=$?
5431   echo "$as_me:5431: \$? = $ac_status" >&5
5432   (exit $ac_status); }; }; then
5433   cf_cv_define_sigwinch=yes
5434 else
5435   echo "$as_me: failed program was:" >&5
5436 cat conftest.$ac_ext >&5
5437 cat >conftest.$ac_ext <<_ACEOF
5438 #line 5438 "configure"
5439 #include "confdefs.h"
5440
5441 #undef _XOPEN_SOURCE
5442 #undef _POSIX_SOURCE
5443 #undef _POSIX_C_SOURCE
5444 #include <sys/types.h>
5445 #include <sys/signal.h>
5446
5447 int
5448 main (void)
5449 {
5450 int x = SIGWINCH; (void)x
5451   ;
5452   return 0;
5453 }
5454 _ACEOF
5455 rm -f conftest.$ac_objext
5456 if { (eval echo "$as_me:5456: \"$ac_compile\"") >&5
5457   (eval $ac_compile) 2>&5
5458   ac_status=$?
5459   echo "$as_me:5459: \$? = $ac_status" >&5
5460   (exit $ac_status); } &&
5461          { ac_try='test -s conftest.$ac_objext'
5462   { (eval echo "$as_me:5462: \"$ac_try\"") >&5
5463   (eval $ac_try) 2>&5
5464   ac_status=$?
5465   echo "$as_me:5465: \$? = $ac_status" >&5
5466   (exit $ac_status); }; }; then
5467   cf_cv_define_sigwinch=maybe
5468 else
5469   echo "$as_me: failed program was:" >&5
5470 cat conftest.$ac_ext >&5
5471 cf_cv_define_sigwinch=no
5472 fi
5473 rm -f conftest.$ac_objext conftest.$ac_ext
5474
5475 fi
5476 rm -f conftest.$ac_objext conftest.$ac_ext
5477
5478 fi
5479 echo "$as_me:5479: result: $cf_cv_define_sigwinch" >&5
5480 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5481
5482 if test "$cf_cv_define_sigwinch" = maybe ; then
5483 echo "$as_me:5483: checking for actual SIGWINCH definition" >&5
5484 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5485 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5486   echo $ECHO_N "(cached) $ECHO_C" >&6
5487 else
5488
5489 cf_cv_fixup_sigwinch=unknown
5490 cf_sigwinch=32
5491 while test $cf_sigwinch != 1
5492 do
5493         cat >conftest.$ac_ext <<_ACEOF
5494 #line 5494 "configure"
5495 #include "confdefs.h"
5496
5497 #undef _XOPEN_SOURCE
5498 #undef _POSIX_SOURCE
5499 #undef _POSIX_C_SOURCE
5500 #include <sys/types.h>
5501 #include <sys/signal.h>
5502
5503 int
5504 main (void)
5505 {
5506
5507 #if SIGWINCH != $cf_sigwinch
5508 make an error
5509 #endif
5510 int x = SIGWINCH; (void)x
5511   ;
5512   return 0;
5513 }
5514 _ACEOF
5515 rm -f conftest.$ac_objext
5516 if { (eval echo "$as_me:5516: \"$ac_compile\"") >&5
5517   (eval $ac_compile) 2>&5
5518   ac_status=$?
5519   echo "$as_me:5519: \$? = $ac_status" >&5
5520   (exit $ac_status); } &&
5521          { ac_try='test -s conftest.$ac_objext'
5522   { (eval echo "$as_me:5522: \"$ac_try\"") >&5
5523   (eval $ac_try) 2>&5
5524   ac_status=$?
5525   echo "$as_me:5525: \$? = $ac_status" >&5
5526   (exit $ac_status); }; }; then
5527   cf_cv_fixup_sigwinch=$cf_sigwinch
5528          break
5529 else
5530   echo "$as_me: failed program was:" >&5
5531 cat conftest.$ac_ext >&5
5532 fi
5533 rm -f conftest.$ac_objext conftest.$ac_ext
5534
5535 cf_sigwinch=`expr $cf_sigwinch - 1`
5536 done
5537
5538 fi
5539 echo "$as_me:5539: result: $cf_cv_fixup_sigwinch" >&5
5540 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5541
5542         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5543                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5544         fi
5545 fi
5546
5547 # Checks for CODESET support.
5548
5549 echo "$as_me:5549: checking for nl_langinfo and CODESET" >&5
5550 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5551 if test "${am_cv_langinfo_codeset+set}" = set; then
5552   echo $ECHO_N "(cached) $ECHO_C" >&6
5553 else
5554   cat >conftest.$ac_ext <<_ACEOF
5555 #line 5555 "configure"
5556 #include "confdefs.h"
5557 #include <langinfo.h>
5558 int
5559 main (void)
5560 {
5561 char* cs = nl_langinfo(CODESET); (void)cs
5562   ;
5563   return 0;
5564 }
5565 _ACEOF
5566 rm -f conftest.$ac_objext conftest$ac_exeext
5567 if { (eval echo "$as_me:5567: \"$ac_link\"") >&5
5568   (eval $ac_link) 2>&5
5569   ac_status=$?
5570   echo "$as_me:5570: \$? = $ac_status" >&5
5571   (exit $ac_status); } &&
5572          { ac_try='test -s conftest$ac_exeext'
5573   { (eval echo "$as_me:5573: \"$ac_try\"") >&5
5574   (eval $ac_try) 2>&5
5575   ac_status=$?
5576   echo "$as_me:5576: \$? = $ac_status" >&5
5577   (exit $ac_status); }; }; then
5578   am_cv_langinfo_codeset=yes
5579 else
5580   echo "$as_me: failed program was:" >&5
5581 cat conftest.$ac_ext >&5
5582 am_cv_langinfo_codeset=no
5583 fi
5584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5585
5586 fi
5587 echo "$as_me:5587: result: $am_cv_langinfo_codeset" >&5
5588 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5589         if test $am_cv_langinfo_codeset = yes; then
5590
5591 cat >>confdefs.h <<\EOF
5592 #define HAVE_LANGINFO_CODESET 1
5593 EOF
5594
5595         fi
5596
5597 echo "$as_me:5597: checking if you want to use pkg-config" >&5
5598 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5599
5600 # Check whether --with-pkg-config or --without-pkg-config was given.
5601 if test "${with_pkg_config+set}" = set; then
5602   withval="$with_pkg_config"
5603   cf_pkg_config=$withval
5604 else
5605   cf_pkg_config=yes
5606 fi;
5607 echo "$as_me:5607: result: $cf_pkg_config" >&5
5608 echo "${ECHO_T}$cf_pkg_config" >&6
5609
5610 case $cf_pkg_config in
5611 (no)
5612         PKG_CONFIG=none
5613         ;;
5614 (yes)
5615
5616 if test -n "$ac_tool_prefix"; then
5617   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5618 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5619 echo "$as_me:5619: checking for $ac_word" >&5
5620 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5621 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5622   echo $ECHO_N "(cached) $ECHO_C" >&6
5623 else
5624   case $PKG_CONFIG in
5625   [\\/]* | ?:[\\/]*)
5626   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5627   ;;
5628   *)
5629   ac_save_IFS=$IFS; IFS=$ac_path_separator
5630 ac_dummy="$PATH"
5631 for ac_dir in $ac_dummy; do
5632   IFS=$ac_save_IFS
5633   test -z "$ac_dir" && ac_dir=.
5634   if $as_executable_p "$ac_dir/$ac_word"; then
5635    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5636    echo "$as_me:5636: found $ac_dir/$ac_word" >&5
5637    break
5638 fi
5639 done
5640
5641   ;;
5642 esac
5643 fi
5644 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5645
5646 if test -n "$PKG_CONFIG"; then
5647   echo "$as_me:5647: result: $PKG_CONFIG" >&5
5648 echo "${ECHO_T}$PKG_CONFIG" >&6
5649 else
5650   echo "$as_me:5650: result: no" >&5
5651 echo "${ECHO_T}no" >&6
5652 fi
5653
5654 fi
5655 if test -z "$ac_cv_path_PKG_CONFIG"; then
5656   ac_pt_PKG_CONFIG=$PKG_CONFIG
5657   # Extract the first word of "pkg-config", so it can be a program name with args.
5658 set dummy pkg-config; ac_word=$2
5659 echo "$as_me:5659: checking for $ac_word" >&5
5660 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5661 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5662   echo $ECHO_N "(cached) $ECHO_C" >&6
5663 else
5664   case $ac_pt_PKG_CONFIG in
5665   [\\/]* | ?:[\\/]*)
5666   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5667   ;;
5668   *)
5669   ac_save_IFS=$IFS; IFS=$ac_path_separator
5670 ac_dummy="$PATH"
5671 for ac_dir in $ac_dummy; do
5672   IFS=$ac_save_IFS
5673   test -z "$ac_dir" && ac_dir=.
5674   if $as_executable_p "$ac_dir/$ac_word"; then
5675    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5676    echo "$as_me:5676: found $ac_dir/$ac_word" >&5
5677    break
5678 fi
5679 done
5680
5681   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5682   ;;
5683 esac
5684 fi
5685 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5686
5687 if test -n "$ac_pt_PKG_CONFIG"; then
5688   echo "$as_me:5688: result: $ac_pt_PKG_CONFIG" >&5
5689 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5690 else
5691   echo "$as_me:5691: result: no" >&5
5692 echo "${ECHO_T}no" >&6
5693 fi
5694
5695   PKG_CONFIG=$ac_pt_PKG_CONFIG
5696 else
5697   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5698 fi
5699
5700         ;;
5701 (*)
5702         PKG_CONFIG=$withval
5703         ;;
5704 esac
5705
5706 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5707 if test "$PKG_CONFIG" != none ; then
5708
5709 if test "x$prefix" != xNONE; then
5710         cf_path_syntax="$prefix"
5711 else
5712         cf_path_syntax="$ac_default_prefix"
5713 fi
5714
5715 case ".$PKG_CONFIG" in
5716 (.\$\(*\)*|.\'*\'*)
5717         ;;
5718 (..|./*|.\\*)
5719         ;;
5720 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5721         ;;
5722 (.\${*prefix}*|.\${*dir}*)
5723         eval PKG_CONFIG="$PKG_CONFIG"
5724         case ".$PKG_CONFIG" in
5725         (.NONE/*)
5726                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5727                 ;;
5728         esac
5729         ;;
5730 (.no|.NONE/*)
5731         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5732         ;;
5733 (*)
5734         { { echo "$as_me:5734: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5735 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5736    { (exit 1); exit 1; }; }
5737         ;;
5738 esac
5739
5740 elif test "x$cf_pkg_config" != xno ; then
5741         { echo "$as_me:5741: WARNING: pkg-config is not installed" >&5
5742 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5743 fi
5744
5745 echo "$as_me:5745: checking if you want to see long compiling messages" >&5
5746 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5747
5748 # Check whether --enable-echo or --disable-echo was given.
5749 if test "${enable_echo+set}" = set; then
5750   enableval="$enable_echo"
5751   test "$enableval" != no && enableval=yes
5752         if test "$enableval" != "yes" ; then
5753
5754         ECHO_LT='--silent'
5755         ECHO_LD='@echo linking $@;'
5756         RULE_CC='@echo compiling $<'
5757         SHOW_CC='@echo compiling $@'
5758         ECHO_CC='@'
5759
5760         else
5761
5762         ECHO_LT=''
5763         ECHO_LD=''
5764         RULE_CC=''
5765         SHOW_CC=''
5766         ECHO_CC=''
5767
5768         fi
5769 else
5770   enableval=yes
5771
5772         ECHO_LT=''
5773         ECHO_LD=''
5774         RULE_CC=''
5775         SHOW_CC=''
5776         ECHO_CC=''
5777
5778 fi;
5779 echo "$as_me:5779: result: $enableval" >&5
5780 echo "${ECHO_T}$enableval" >&6
5781
5782 echo "$as_me:5782: checking for ncurses wrap-prefix" >&5
5783 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5784
5785 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5786 if test "${with_ncurses_wrap_prefix+set}" = set; then
5787   withval="$with_ncurses_wrap_prefix"
5788   NCURSES_WRAP_PREFIX=$withval
5789 else
5790   NCURSES_WRAP_PREFIX=_nc_
5791 fi;
5792 echo "$as_me:5792: result: $NCURSES_WRAP_PREFIX" >&5
5793 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5794
5795 echo "$as_me:5795: checking if you want to check for wide-character functions" >&5
5796 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5797
5798 # Check whether --enable-widec or --disable-widec was given.
5799 if test "${enable_widec+set}" = set; then
5800   enableval="$enable_widec"
5801   test "$enableval" != no && enableval=yes
5802         if test "$enableval" != "yes" ; then
5803     cf_enable_widec=no
5804         else
5805                 cf_enable_widec=yes
5806         fi
5807 else
5808   enableval=yes
5809         cf_enable_widec=yes
5810
5811 fi;
5812 echo "$as_me:5812: result: $cf_enable_widec" >&5
5813 echo "${ECHO_T}$cf_enable_widec" >&6
5814
5815 echo "$as_me:5815: checking for specific curses-directory" >&5
5816 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5817
5818 # Check whether --with-curses-dir or --without-curses-dir was given.
5819 if test "${with_curses_dir+set}" = set; then
5820   withval="$with_curses_dir"
5821   cf_cv_curses_dir=$withval
5822 else
5823   cf_cv_curses_dir=no
5824 fi;
5825 echo "$as_me:5825: result: $cf_cv_curses_dir" >&5
5826 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5827
5828 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5829 then
5830
5831 if test "x$prefix" != xNONE; then
5832         cf_path_syntax="$prefix"
5833 else
5834         cf_path_syntax="$ac_default_prefix"
5835 fi
5836
5837 case ".$withval" in
5838 (.\$\(*\)*|.\'*\'*)
5839         ;;
5840 (..|./*|.\\*)
5841         ;;
5842 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5843         ;;
5844 (.\${*prefix}*|.\${*dir}*)
5845         eval withval="$withval"
5846         case ".$withval" in
5847         (.NONE/*)
5848                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5849                 ;;
5850         esac
5851         ;;
5852 (.no|.NONE/*)
5853         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5854         ;;
5855 (*)
5856         { { echo "$as_me:5856: error: expected a pathname, not \"$withval\"" >&5
5857 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5858    { (exit 1); exit 1; }; }
5859         ;;
5860 esac
5861
5862         if test -d "$cf_cv_curses_dir"
5863         then
5864
5865 if test -n "$cf_cv_curses_dir/include" ; then
5866   for cf_add_incdir in $cf_cv_curses_dir/include
5867   do
5868         while test $cf_add_incdir != /usr/include
5869         do
5870           if test -d $cf_add_incdir
5871           then
5872                 cf_have_incdir=no
5873                 if test -n "$CFLAGS$CPPFLAGS" ; then
5874                   # a loop is needed to ensure we can add subdirs of existing dirs
5875                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5876                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5877                           cf_have_incdir=yes; break
5878                         fi
5879                   done
5880                 fi
5881
5882                 if test "$cf_have_incdir" = no ; then
5883                   if test "$cf_add_incdir" = /usr/local/include ; then
5884                         if test "$GCC" = yes
5885                         then
5886                           cf_save_CPPFLAGS=$CPPFLAGS
5887
5888         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5889         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5890
5891                           cat >conftest.$ac_ext <<_ACEOF
5892 #line 5892 "configure"
5893 #include "confdefs.h"
5894 #include <stdio.h>
5895 int
5896 main (void)
5897 {
5898 printf("Hello")
5899   ;
5900   return 0;
5901 }
5902 _ACEOF
5903 rm -f conftest.$ac_objext
5904 if { (eval echo "$as_me:5904: \"$ac_compile\"") >&5
5905   (eval $ac_compile) 2>&5
5906   ac_status=$?
5907   echo "$as_me:5907: \$? = $ac_status" >&5
5908   (exit $ac_status); } &&
5909          { ac_try='test -s conftest.$ac_objext'
5910   { (eval echo "$as_me:5910: \"$ac_try\"") >&5
5911   (eval $ac_try) 2>&5
5912   ac_status=$?
5913   echo "$as_me:5913: \$? = $ac_status" >&5
5914   (exit $ac_status); }; }; then
5915   :
5916 else
5917   echo "$as_me: failed program was:" >&5
5918 cat conftest.$ac_ext >&5
5919 cf_have_incdir=yes
5920 fi
5921 rm -f conftest.$ac_objext conftest.$ac_ext
5922                           CPPFLAGS=$cf_save_CPPFLAGS
5923                         fi
5924                   fi
5925                 fi
5926
5927                 if test "$cf_have_incdir" = no ; then
5928                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5929
5930 echo "${as_me:-configure}:5930: testing adding $cf_add_incdir to include-path ..." 1>&5
5931
5932                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5933
5934                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5935                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5936                   cf_add_incdir="$cf_top_incdir"
5937                 else
5938                   break
5939                 fi
5940           else
5941                 break
5942           fi
5943         done
5944   done
5945 fi
5946
5947 if test -n "$cf_cv_curses_dir/lib" ; then
5948         for cf_add_libdir in $cf_cv_curses_dir/lib
5949         do
5950                 if test $cf_add_libdir = /usr/lib ; then
5951                         :
5952                 elif test -d $cf_add_libdir
5953                 then
5954                         cf_have_libdir=no
5955                         if test -n "$LDFLAGS$LIBS" ; then
5956                                 # a loop is needed to ensure we can add subdirs of existing dirs
5957                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5958                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5959                                                 cf_have_libdir=yes; break
5960                                         fi
5961                                 done
5962                         fi
5963                         if test "$cf_have_libdir" = no ; then
5964                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5965
5966 echo "${as_me:-configure}:5966: testing adding $cf_add_libdir to library-path ..." 1>&5
5967
5968                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5969                         fi
5970                 fi
5971         done
5972 fi
5973
5974         fi
5975 fi
5976
5977 cf_cv_screen=curses
5978
5979 echo "$as_me:5979: checking for specified curses library type" >&5
5980 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5981
5982 # Check whether --with-screen or --without-screen was given.
5983 if test "${with_screen+set}" = set; then
5984   withval="$with_screen"
5985   cf_cv_screen=$withval
5986 else
5987
5988 # Check whether --with-ncursesw or --without-ncursesw was given.
5989 if test "${with_ncursesw+set}" = set; then
5990   withval="$with_ncursesw"
5991   cf_cv_screen=ncursesw
5992 else
5993
5994 # Check whether --with-ncurses or --without-ncurses was given.
5995 if test "${with_ncurses+set}" = set; then
5996   withval="$with_ncurses"
5997   cf_cv_screen=ncurses
5998 else
5999
6000 # Check whether --with-pdcurses or --without-pdcurses was given.
6001 if test "${with_pdcurses+set}" = set; then
6002   withval="$with_pdcurses"
6003   cf_cv_screen=pdcurses
6004 else
6005
6006 # Check whether --with-curses-colr or --without-curses-colr was given.
6007 if test "${with_curses_colr+set}" = set; then
6008   withval="$with_curses_colr"
6009   cf_cv_screen=curses_colr
6010 else
6011
6012 # Check whether --with-curses-5lib or --without-curses-5lib was given.
6013 if test "${with_curses_5lib+set}" = set; then
6014   withval="$with_curses_5lib"
6015   cf_cv_screen=curses_5lib
6016 fi;
6017 fi;
6018 fi;
6019 fi;
6020 fi;
6021 fi;
6022
6023 echo "$as_me:6023: result: $cf_cv_screen" >&5
6024 echo "${ECHO_T}$cf_cv_screen" >&6
6025
6026 case $cf_cv_screen in
6027 (curses|curses_*)
6028
6029 echo "$as_me:6029: checking for extra include directories" >&5
6030 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
6031 if test "${cf_cv_curses_incdir+set}" = set; then
6032   echo $ECHO_N "(cached) $ECHO_C" >&6
6033 else
6034
6035 cf_cv_curses_incdir=no
6036 case $host_os in
6037 (hpux10.*)
6038         if test "x$cf_cv_screen" = "xcurses_colr"
6039         then
6040                 test -d /usr/include/curses_colr && \
6041                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
6042         fi
6043         ;;
6044 (sunos3*|sunos4*)
6045         if test "x$cf_cv_screen" = "xcurses_5lib"
6046         then
6047                 test -d /usr/5lib && \
6048                 test -d /usr/5include && \
6049                 cf_cv_curses_incdir="-I/usr/5include"
6050         fi
6051         ;;
6052 esac
6053
6054 fi
6055 echo "$as_me:6055: result: $cf_cv_curses_incdir" >&5
6056 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
6057 if test "$cf_cv_curses_incdir" != no
6058 then
6059
6060         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6061         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
6062
6063 fi
6064
6065 echo "$as_me:6065: checking if we have identified curses headers" >&5
6066 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6067 if test "${cf_cv_ncurses_header+set}" = set; then
6068   echo $ECHO_N "(cached) $ECHO_C" >&6
6069 else
6070
6071 cf_cv_ncurses_header=none
6072 for cf_header in \
6073         ncurses.h  \
6074         curses.h  ncurses/ncurses.h ncurses/curses.h
6075 do
6076 cat >conftest.$ac_ext <<_ACEOF
6077 #line 6077 "configure"
6078 #include "confdefs.h"
6079 #include <${cf_header}>
6080 int
6081 main (void)
6082 {
6083 initscr(); tgoto("?", 0,0)
6084   ;
6085   return 0;
6086 }
6087 _ACEOF
6088 rm -f conftest.$ac_objext
6089 if { (eval echo "$as_me:6089: \"$ac_compile\"") >&5
6090   (eval $ac_compile) 2>&5
6091   ac_status=$?
6092   echo "$as_me:6092: \$? = $ac_status" >&5
6093   (exit $ac_status); } &&
6094          { ac_try='test -s conftest.$ac_objext'
6095   { (eval echo "$as_me:6095: \"$ac_try\"") >&5
6096   (eval $ac_try) 2>&5
6097   ac_status=$?
6098   echo "$as_me:6098: \$? = $ac_status" >&5
6099   (exit $ac_status); }; }; then
6100   cf_cv_ncurses_header=$cf_header; break
6101 else
6102   echo "$as_me: failed program was:" >&5
6103 cat conftest.$ac_ext >&5
6104 fi
6105 rm -f conftest.$ac_objext conftest.$ac_ext
6106 done
6107
6108 fi
6109 echo "$as_me:6109: result: $cf_cv_ncurses_header" >&5
6110 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6111
6112 if test "$cf_cv_ncurses_header" = none ; then
6113         { { echo "$as_me:6113: error: No curses header-files found" >&5
6114 echo "$as_me: error: No curses header-files found" >&2;}
6115    { (exit 1); exit 1; }; }
6116 fi
6117
6118 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6119
6120 for ac_header in $cf_cv_ncurses_header
6121 do
6122 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6123 echo "$as_me:6123: checking for $ac_header" >&5
6124 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6125 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6126   echo $ECHO_N "(cached) $ECHO_C" >&6
6127 else
6128   cat >conftest.$ac_ext <<_ACEOF
6129 #line 6129 "configure"
6130 #include "confdefs.h"
6131 #include <$ac_header>
6132 _ACEOF
6133 if { (eval echo "$as_me:6133: \"$ac_cpp conftest.$ac_ext\"") >&5
6134   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6135   ac_status=$?
6136   egrep -v '^ *\+' conftest.er1 >conftest.err
6137   rm -f conftest.er1
6138   cat conftest.err >&5
6139   echo "$as_me:6139: \$? = $ac_status" >&5
6140   (exit $ac_status); } >/dev/null; then
6141   if test -s conftest.err; then
6142     ac_cpp_err=$ac_c_preproc_warn_flag
6143   else
6144     ac_cpp_err=
6145   fi
6146 else
6147   ac_cpp_err=yes
6148 fi
6149 if test -z "$ac_cpp_err"; then
6150   eval "$as_ac_Header=yes"
6151 else
6152   echo "$as_me: failed program was:" >&5
6153   cat conftest.$ac_ext >&5
6154   eval "$as_ac_Header=no"
6155 fi
6156 rm -f conftest.err conftest.$ac_ext
6157 fi
6158 echo "$as_me:6158: result: `eval echo '${'$as_ac_Header'}'`" >&5
6159 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6160 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6161   cat >>confdefs.h <<EOF
6162 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6163 EOF
6164
6165 fi
6166 done
6167
6168 echo "$as_me:6168: checking for terminfo header" >&5
6169 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
6170 if test "${cf_cv_term_header+set}" = set; then
6171   echo $ECHO_N "(cached) $ECHO_C" >&6
6172 else
6173
6174 case ${cf_cv_ncurses_header} in
6175 (*/ncurses.h|*/ncursesw.h)
6176         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
6177         ;;
6178 (*)
6179         cf_term_header=term.h
6180         ;;
6181 esac
6182
6183 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
6184 do
6185 cat >conftest.$ac_ext <<_ACEOF
6186 #line 6186 "configure"
6187 #include "confdefs.h"
6188 #include <stdio.h>
6189 #include <${cf_cv_ncurses_header:-curses.h}>
6190 #include <$cf_test>
6191
6192 int
6193 main (void)
6194 {
6195 int x = auto_left_margin; (void)x
6196   ;
6197   return 0;
6198 }
6199 _ACEOF
6200 rm -f conftest.$ac_objext
6201 if { (eval echo "$as_me:6201: \"$ac_compile\"") >&5
6202   (eval $ac_compile) 2>&5
6203   ac_status=$?
6204   echo "$as_me:6204: \$? = $ac_status" >&5
6205   (exit $ac_status); } &&
6206          { ac_try='test -s conftest.$ac_objext'
6207   { (eval echo "$as_me:6207: \"$ac_try\"") >&5
6208   (eval $ac_try) 2>&5
6209   ac_status=$?
6210   echo "$as_me:6210: \$? = $ac_status" >&5
6211   (exit $ac_status); }; }; then
6212
6213         cf_cv_term_header="$cf_test"
6214 else
6215   echo "$as_me: failed program was:" >&5
6216 cat conftest.$ac_ext >&5
6217
6218         cf_cv_term_header=unknown
6219
6220 fi
6221 rm -f conftest.$ac_objext conftest.$ac_ext
6222         test "$cf_cv_term_header" != unknown && break
6223 done
6224
6225 fi
6226 echo "$as_me:6226: result: $cf_cv_term_header" >&5
6227 echo "${ECHO_T}$cf_cv_term_header" >&6
6228
6229 # Set definitions to allow ifdef'ing to accommodate subdirectories
6230
6231 case $cf_cv_term_header in
6232 (*term.h)
6233
6234 cat >>confdefs.h <<\EOF
6235 #define HAVE_TERM_H 1
6236 EOF
6237
6238         ;;
6239 esac
6240
6241 case $cf_cv_term_header in
6242 (ncurses/term.h)
6243
6244 cat >>confdefs.h <<\EOF
6245 #define HAVE_NCURSES_TERM_H 1
6246 EOF
6247
6248         ;;
6249 (ncursesw/term.h)
6250
6251 cat >>confdefs.h <<\EOF
6252 #define HAVE_NCURSESW_TERM_H 1
6253 EOF
6254
6255         ;;
6256 esac
6257
6258 echo "$as_me:6258: checking for ncurses version" >&5
6259 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6260 if test "${cf_cv_ncurses_version+set}" = set; then
6261   echo $ECHO_N "(cached) $ECHO_C" >&6
6262 else
6263
6264         cf_cv_ncurses_version=no
6265         cf_tempfile=out$$
6266         rm -f $cf_tempfile
6267         if test "$cross_compiling" = yes; then
6268
6269         # This will not work if the preprocessor splits the line after the
6270         # Autoconf token.  The 'unproto' program does that.
6271         cat > conftest.$ac_ext <<EOF
6272 #include <${cf_cv_ncurses_header:-curses.h}>
6273 #undef Autoconf
6274 #ifdef NCURSES_VERSION
6275 Autoconf NCURSES_VERSION
6276 #else
6277 #ifdef __NCURSES_H
6278 Autoconf "old"
6279 #endif
6280 ;
6281 #endif
6282 EOF
6283         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6284         { (eval echo "$as_me:6284: \"$cf_try\"") >&5
6285   (eval $cf_try) 2>&5
6286   ac_status=$?
6287   echo "$as_me:6287: \$? = $ac_status" >&5
6288   (exit $ac_status); }
6289         if test -f conftest.out ; then
6290                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6291                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6292                 rm -f conftest.out
6293         fi
6294
6295 else
6296   cat >conftest.$ac_ext <<_ACEOF
6297 #line 6297 "configure"
6298 #include "confdefs.h"
6299
6300 #include <${cf_cv_ncurses_header:-curses.h}>
6301 #include <stdio.h>
6302 int main(void)
6303 {
6304         FILE *fp = fopen("$cf_tempfile", "w");
6305 #ifdef NCURSES_VERSION
6306 # ifdef NCURSES_VERSION_PATCH
6307         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6308 # else
6309         fprintf(fp, "%s\n", NCURSES_VERSION);
6310 # endif
6311 #else
6312 # ifdef __NCURSES_H
6313         fprintf(fp, "old\n");
6314 # else
6315         make an error
6316 # endif
6317 #endif
6318         ${cf_cv_main_return:-return}(0);
6319 }
6320 _ACEOF
6321 rm -f conftest$ac_exeext
6322 if { (eval echo "$as_me:6322: \"$ac_link\"") >&5
6323   (eval $ac_link) 2>&5
6324   ac_status=$?
6325   echo "$as_me:6325: \$? = $ac_status" >&5
6326   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6327   { (eval echo "$as_me:6327: \"$ac_try\"") >&5
6328   (eval $ac_try) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit $ac_status); }; }; then
6332
6333         cf_cv_ncurses_version=`cat $cf_tempfile`
6334 else
6335   echo "$as_me: program exited with status $ac_status" >&5
6336 echo "$as_me: failed program was:" >&5
6337 cat conftest.$ac_ext >&5
6338 fi
6339 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6340 fi
6341         rm -f $cf_tempfile
6342
6343 fi
6344 echo "$as_me:6344: result: $cf_cv_ncurses_version" >&5
6345 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6346 test "$cf_cv_ncurses_version" = no ||
6347 cat >>confdefs.h <<\EOF
6348 #define NCURSES 1
6349 EOF
6350
6351 echo "$as_me:6351: checking if we have identified curses libraries" >&5
6352 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6353 cat >conftest.$ac_ext <<_ACEOF
6354 #line 6354 "configure"
6355 #include "confdefs.h"
6356 #include <${cf_cv_ncurses_header:-curses.h}>
6357 int
6358 main (void)
6359 {
6360 initscr(); tgoto("?", 0,0)
6361   ;
6362   return 0;
6363 }
6364 _ACEOF
6365 rm -f conftest.$ac_objext conftest$ac_exeext
6366 if { (eval echo "$as_me:6366: \"$ac_link\"") >&5
6367   (eval $ac_link) 2>&5
6368   ac_status=$?
6369   echo "$as_me:6369: \$? = $ac_status" >&5
6370   (exit $ac_status); } &&
6371          { ac_try='test -s conftest$ac_exeext'
6372   { (eval echo "$as_me:6372: \"$ac_try\"") >&5
6373   (eval $ac_try) 2>&5
6374   ac_status=$?
6375   echo "$as_me:6375: \$? = $ac_status" >&5
6376   (exit $ac_status); }; }; then
6377   cf_result=yes
6378 else
6379   echo "$as_me: failed program was:" >&5
6380 cat conftest.$ac_ext >&5
6381 cf_result=no
6382 fi
6383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6384 echo "$as_me:6384: result: $cf_result" >&5
6385 echo "${ECHO_T}$cf_result" >&6
6386
6387 if test "$cf_result" = no ; then
6388 case $host_os in
6389 (freebsd*)
6390         echo "$as_me:6390: checking for tgoto in -lmytinfo" >&5
6391 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6392 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6393   echo $ECHO_N "(cached) $ECHO_C" >&6
6394 else
6395   ac_check_lib_save_LIBS=$LIBS
6396 LIBS="-lmytinfo  $LIBS"
6397 cat >conftest.$ac_ext <<_ACEOF
6398 #line 6398 "configure"
6399 #include "confdefs.h"
6400
6401 /* Override any gcc2 internal prototype to avoid an error.  */
6402 #ifdef __cplusplus
6403 extern "C"
6404 #endif
6405 /* We use char because int might match the return type of a gcc2
6406    builtin and then its argument prototype would still apply.  */
6407 char tgoto ();
6408 int
6409 main (void)
6410 {
6411 tgoto ();
6412   ;
6413   return 0;
6414 }
6415 _ACEOF
6416 rm -f conftest.$ac_objext conftest$ac_exeext
6417 if { (eval echo "$as_me:6417: \"$ac_link\"") >&5
6418   (eval $ac_link) 2>&5
6419   ac_status=$?
6420   echo "$as_me:6420: \$? = $ac_status" >&5
6421   (exit $ac_status); } &&
6422          { ac_try='test -s conftest$ac_exeext'
6423   { (eval echo "$as_me:6423: \"$ac_try\"") >&5
6424   (eval $ac_try) 2>&5
6425   ac_status=$?
6426   echo "$as_me:6426: \$? = $ac_status" >&5
6427   (exit $ac_status); }; }; then
6428   ac_cv_lib_mytinfo_tgoto=yes
6429 else
6430   echo "$as_me: failed program was:" >&5
6431 cat conftest.$ac_ext >&5
6432 ac_cv_lib_mytinfo_tgoto=no
6433 fi
6434 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6435 LIBS=$ac_check_lib_save_LIBS
6436 fi
6437 echo "$as_me:6437: result: $ac_cv_lib_mytinfo_tgoto" >&5
6438 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6439 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6440
6441 cf_add_libs="$LIBS"
6442 # reverse order
6443 cf_add_0lib=
6444 for cf_add_1lib in -lmytinfo; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6445 # filter duplicates
6446 for cf_add_1lib in $cf_add_0lib; do
6447         for cf_add_2lib in $cf_add_libs; do
6448                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6449                         cf_add_1lib=
6450                         break
6451                 fi
6452         done
6453         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6454 done
6455 LIBS="$cf_add_libs"
6456
6457 fi
6458
6459         ;;
6460 (hpux10.*)
6461         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6462         # next (1998), and xcurses "newer" (2000).  There is no header file for
6463         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6464         # term.h) for cur_colr
6465         if test "x$cf_cv_screen" = "xcurses_colr"
6466         then
6467                 echo "$as_me:6467: checking for initscr in -lcur_colr" >&5
6468 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6469 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6470   echo $ECHO_N "(cached) $ECHO_C" >&6
6471 else
6472   ac_check_lib_save_LIBS=$LIBS
6473 LIBS="-lcur_colr  $LIBS"
6474 cat >conftest.$ac_ext <<_ACEOF
6475 #line 6475 "configure"
6476 #include "confdefs.h"
6477
6478 /* Override any gcc2 internal prototype to avoid an error.  */
6479 #ifdef __cplusplus
6480 extern "C"
6481 #endif
6482 /* We use char because int might match the return type of a gcc2
6483    builtin and then its argument prototype would still apply.  */
6484 char initscr ();
6485 int
6486 main (void)
6487 {
6488 initscr ();
6489   ;
6490   return 0;
6491 }
6492 _ACEOF
6493 rm -f conftest.$ac_objext conftest$ac_exeext
6494 if { (eval echo "$as_me:6494: \"$ac_link\"") >&5
6495   (eval $ac_link) 2>&5
6496   ac_status=$?
6497   echo "$as_me:6497: \$? = $ac_status" >&5
6498   (exit $ac_status); } &&
6499          { ac_try='test -s conftest$ac_exeext'
6500   { (eval echo "$as_me:6500: \"$ac_try\"") >&5
6501   (eval $ac_try) 2>&5
6502   ac_status=$?
6503   echo "$as_me:6503: \$? = $ac_status" >&5
6504   (exit $ac_status); }; }; then
6505   ac_cv_lib_cur_colr_initscr=yes
6506 else
6507   echo "$as_me: failed program was:" >&5
6508 cat conftest.$ac_ext >&5
6509 ac_cv_lib_cur_colr_initscr=no
6510 fi
6511 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6512 LIBS=$ac_check_lib_save_LIBS
6513 fi
6514 echo "$as_me:6514: result: $ac_cv_lib_cur_colr_initscr" >&5
6515 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6516 if test $ac_cv_lib_cur_colr_initscr = yes; then
6517
6518 cf_add_libs="$LIBS"
6519 # reverse order
6520 cf_add_0lib=
6521 for cf_add_1lib in -lcur_colr; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6522 # filter duplicates
6523 for cf_add_1lib in $cf_add_0lib; do
6524         for cf_add_2lib in $cf_add_libs; do
6525                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6526                         cf_add_1lib=
6527                         break
6528                 fi
6529         done
6530         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6531 done
6532 LIBS="$cf_add_libs"
6533
6534                         ac_cv_func_initscr=yes
6535
6536 else
6537
6538                 echo "$as_me:6538: checking for initscr in -lHcurses" >&5
6539 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6540 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6541   echo $ECHO_N "(cached) $ECHO_C" >&6
6542 else
6543   ac_check_lib_save_LIBS=$LIBS
6544 LIBS="-lHcurses  $LIBS"
6545 cat >conftest.$ac_ext <<_ACEOF
6546 #line 6546 "configure"
6547 #include "confdefs.h"
6548
6549 /* Override any gcc2 internal prototype to avoid an error.  */
6550 #ifdef __cplusplus
6551 extern "C"
6552 #endif
6553 /* We use char because int might match the return type of a gcc2
6554    builtin and then its argument prototype would still apply.  */
6555 char initscr ();
6556 int
6557 main (void)
6558 {
6559 initscr ();
6560   ;
6561   return 0;
6562 }
6563 _ACEOF
6564 rm -f conftest.$ac_objext conftest$ac_exeext
6565 if { (eval echo "$as_me:6565: \"$ac_link\"") >&5
6566   (eval $ac_link) 2>&5
6567   ac_status=$?
6568   echo "$as_me:6568: \$? = $ac_status" >&5
6569   (exit $ac_status); } &&
6570          { ac_try='test -s conftest$ac_exeext'
6571   { (eval echo "$as_me:6571: \"$ac_try\"") >&5
6572   (eval $ac_try) 2>&5
6573   ac_status=$?
6574   echo "$as_me:6574: \$? = $ac_status" >&5
6575   (exit $ac_status); }; }; then
6576   ac_cv_lib_Hcurses_initscr=yes
6577 else
6578   echo "$as_me: failed program was:" >&5
6579 cat conftest.$ac_ext >&5
6580 ac_cv_lib_Hcurses_initscr=no
6581 fi
6582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6583 LIBS=$ac_check_lib_save_LIBS
6584 fi
6585 echo "$as_me:6585: result: $ac_cv_lib_Hcurses_initscr" >&5
6586 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6587 if test $ac_cv_lib_Hcurses_initscr = yes; then
6588
6589                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6590
6591 cf_add_libs="$LIBS"
6592 # reverse order
6593 cf_add_0lib=
6594 for cf_add_1lib in -lHcurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6595 # filter duplicates
6596 for cf_add_1lib in $cf_add_0lib; do
6597         for cf_add_2lib in $cf_add_libs; do
6598                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6599                         cf_add_1lib=
6600                         break
6601                 fi
6602         done
6603         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6604 done
6605 LIBS="$cf_add_libs"
6606
6607         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6608         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6609
6610                         ac_cv_func_initscr=yes
6611
6612 fi
6613
6614 fi
6615
6616         fi
6617         ;;
6618 (linux*)
6619         case `arch 2>/dev/null` in
6620         (x86_64)
6621                 if test -d /lib64
6622                 then
6623
6624 if test -n "/lib64" ; then
6625         for cf_add_libdir in /lib64
6626         do
6627                 if test $cf_add_libdir = /usr/lib ; then
6628                         :
6629                 elif test -d $cf_add_libdir
6630                 then
6631                         cf_have_libdir=no
6632                         if test -n "$LDFLAGS$LIBS" ; then
6633                                 # a loop is needed to ensure we can add subdirs of existing dirs
6634                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6635                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6636                                                 cf_have_libdir=yes; break
6637                                         fi
6638                                 done
6639                         fi
6640                         if test "$cf_have_libdir" = no ; then
6641                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6642
6643 echo "${as_me:-configure}:6643: testing adding $cf_add_libdir to library-path ..." 1>&5
6644
6645                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6646                         fi
6647                 fi
6648         done
6649 fi
6650
6651                 else
6652
6653 if test -n "/lib" ; then
6654         for cf_add_libdir in /lib
6655         do
6656                 if test $cf_add_libdir = /usr/lib ; then
6657                         :
6658                 elif test -d $cf_add_libdir
6659                 then
6660                         cf_have_libdir=no
6661                         if test -n "$LDFLAGS$LIBS" ; then
6662                                 # a loop is needed to ensure we can add subdirs of existing dirs
6663                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6664                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6665                                                 cf_have_libdir=yes; break
6666                                         fi
6667                                 done
6668                         fi
6669                         if test "$cf_have_libdir" = no ; then
6670                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6671
6672 echo "${as_me:-configure}:6672: testing adding $cf_add_libdir to library-path ..." 1>&5
6673
6674                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6675                         fi
6676                 fi
6677         done
6678 fi
6679
6680                 fi
6681                 ;;
6682         (*)
6683
6684 if test -n "/lib" ; then
6685         for cf_add_libdir in /lib
6686         do
6687                 if test $cf_add_libdir = /usr/lib ; then
6688                         :
6689                 elif test -d $cf_add_libdir
6690                 then
6691                         cf_have_libdir=no
6692                         if test -n "$LDFLAGS$LIBS" ; then
6693                                 # a loop is needed to ensure we can add subdirs of existing dirs
6694                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6695                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6696                                                 cf_have_libdir=yes; break
6697                                         fi
6698                                 done
6699                         fi
6700                         if test "$cf_have_libdir" = no ; then
6701                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6702
6703 echo "${as_me:-configure}:6703: testing adding $cf_add_libdir to library-path ..." 1>&5
6704
6705                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6706                         fi
6707                 fi
6708         done
6709 fi
6710
6711                 ;;
6712         esac
6713         ;;
6714 (sunos3*|sunos4*)
6715         if test "x$cf_cv_screen" = "xcurses_5lib"
6716         then
6717                 if test -d /usr/5lib ; then
6718
6719 if test -n "/usr/5lib" ; then
6720         for cf_add_libdir in /usr/5lib
6721         do
6722                 if test $cf_add_libdir = /usr/lib ; then
6723                         :
6724                 elif test -d $cf_add_libdir
6725                 then
6726                         cf_have_libdir=no
6727                         if test -n "$LDFLAGS$LIBS" ; then
6728                                 # a loop is needed to ensure we can add subdirs of existing dirs
6729                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6730                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6731                                                 cf_have_libdir=yes; break
6732                                         fi
6733                                 done
6734                         fi
6735                         if test "$cf_have_libdir" = no ; then
6736                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6737
6738 echo "${as_me:-configure}:6738: testing adding $cf_add_libdir to library-path ..." 1>&5
6739
6740                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6741                         fi
6742                 fi
6743         done
6744 fi
6745
6746 cf_add_libs="$LIBS"
6747 # reverse order
6748 cf_add_0lib=
6749 for cf_add_1lib in -lcurses -ltermcap; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
6750 # filter duplicates
6751 for cf_add_1lib in $cf_add_0lib; do
6752         for cf_add_2lib in $cf_add_libs; do
6753                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
6754                         cf_add_1lib=
6755                         break
6756                 fi
6757         done
6758         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
6759 done
6760 LIBS="$cf_add_libs"
6761
6762                 fi
6763         fi
6764         ac_cv_func_initscr=yes
6765         ;;
6766 esac
6767
6768 if test ".$ac_cv_func_initscr" != .yes ; then
6769         cf_save_LIBS="$LIBS"
6770
6771         if test ".${cf_cv_ncurses_version:-no}" != .no
6772         then
6773                 cf_check_list="ncurses curses cursesX"
6774         else
6775                 cf_check_list="cursesX curses ncurses"
6776         fi
6777
6778         # Check for library containing tgoto.  Do this before curses library
6779         # because it may be needed to link the test-case for initscr.
6780         if test "x$cf_term_lib" = x
6781         then
6782                 echo "$as_me:6782: checking for tgoto" >&5
6783 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6784 if test "${ac_cv_func_tgoto+set}" = set; then
6785   echo $ECHO_N "(cached) $ECHO_C" >&6
6786 else
6787   cat >conftest.$ac_ext <<_ACEOF
6788 #line 6788 "configure"
6789 #include "confdefs.h"
6790 #define tgoto autoconf_temporary
6791 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
6792 #undef tgoto
6793
6794 #ifdef __cplusplus
6795 extern "C"
6796 #endif
6797
6798 /* We use char because int might match the return type of a gcc2
6799    builtin and then its argument prototype would still apply.  */
6800 char tgoto (void);
6801
6802 int
6803 main (void)
6804 {
6805
6806 /* The GNU C library defines stubs for functions which it implements
6807     to always fail with ENOSYS.  Some functions are actually named
6808     something starting with __ and the normal name is an alias.  */
6809 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6810 #error found stub for tgoto
6811 #endif
6812
6813         return tgoto ();
6814   ;
6815   return 0;
6816 }
6817 _ACEOF
6818 rm -f conftest.$ac_objext conftest$ac_exeext
6819 if { (eval echo "$as_me:6819: \"$ac_link\"") >&5
6820   (eval $ac_link) 2>&5
6821   ac_status=$?
6822   echo "$as_me:6822: \$? = $ac_status" >&5
6823   (exit $ac_status); } &&
6824          { ac_try='test -s conftest$ac_exeext'
6825   { (eval echo "$as_me:6825: \"$ac_try\"") >&5
6826   (eval $ac_try) 2>&5
6827   ac_status=$?
6828   echo "$as_me:6828: \$? = $ac_status" >&5
6829   (exit $ac_status); }; }; then
6830   ac_cv_func_tgoto=yes
6831 else
6832   echo "$as_me: failed program was:" >&5
6833 cat conftest.$ac_ext >&5
6834 ac_cv_func_tgoto=no
6835 fi
6836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6837 fi
6838 echo "$as_me:6838: result: $ac_cv_func_tgoto" >&5
6839 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6840 if test $ac_cv_func_tgoto = yes; then
6841   cf_term_lib=predefined
6842 else
6843
6844                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6845                         do
6846                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6847 echo "$as_me:6847: checking for tgoto in -l$cf_term_lib" >&5
6848 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6849 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6850   echo $ECHO_N "(cached) $ECHO_C" >&6
6851 else
6852   ac_check_lib_save_LIBS=$LIBS
6853 LIBS="-l$cf_term_lib  $LIBS"
6854 cat >conftest.$ac_ext <<_ACEOF
6855 #line 6855 "configure"
6856 #include "confdefs.h"
6857
6858 /* Override any gcc2 internal prototype to avoid an error.  */
6859 #ifdef __cplusplus
6860 extern "C"
6861 #endif
6862 /* We use char because int might match the return type of a gcc2
6863    builtin and then its argument prototype would still apply.  */
6864 char tgoto ();
6865 int
6866 main (void)
6867 {
6868 tgoto ();
6869   ;
6870   return 0;
6871 }
6872 _ACEOF
6873 rm -f conftest.$ac_objext conftest$ac_exeext
6874 if { (eval echo "$as_me:6874: \"$ac_link\"") >&5
6875   (eval $ac_link) 2>&5
6876   ac_status=$?
6877   echo "$as_me:6877: \$? = $ac_status" >&5
6878   (exit $ac_status); } &&
6879          { ac_try='test -s conftest$ac_exeext'
6880   { (eval echo "$as_me:6880: \"$ac_try\"") >&5
6881   (eval $ac_try) 2>&5
6882   ac_status=$?
6883   echo "$as_me:6883: \$? = $ac_status" >&5
6884   (exit $ac_status); }; }; then
6885   eval "$as_ac_Lib=yes"
6886 else
6887   echo "$as_me: failed program was:" >&5
6888 cat conftest.$ac_ext >&5
6889 eval "$as_ac_Lib=no"
6890 fi
6891 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6892 LIBS=$ac_check_lib_save_LIBS
6893 fi
6894 echo "$as_me:6894: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6895 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6896 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6897
6898                                         : ${cf_nculib_root:=$cf_term_lib}
6899                                         break
6900
6901 fi
6902
6903                         done
6904
6905 fi
6906
6907         fi
6908
6909         # Check for library containing initscr
6910         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6911         if test "x$cf_curs_lib" = x
6912         then
6913                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6914                 do
6915                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6916                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6917                                 echo "$as_me:6917: checking if we can link with $cf_curs_lib library" >&5
6918 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6919                                 cat >conftest.$ac_ext <<_ACEOF
6920 #line 6920 "configure"
6921 #include "confdefs.h"
6922 #include <${cf_cv_ncurses_header:-curses.h}>
6923 int
6924 main (void)
6925 {
6926 initscr()
6927   ;
6928   return 0;
6929 }
6930 _ACEOF
6931 rm -f conftest.$ac_objext conftest$ac_exeext
6932 if { (eval echo "$as_me:6932: \"$ac_link\"") >&5
6933   (eval $ac_link) 2>&5
6934   ac_status=$?
6935   echo "$as_me:6935: \$? = $ac_status" >&5
6936   (exit $ac_status); } &&
6937          { ac_try='test -s conftest$ac_exeext'
6938   { (eval echo "$as_me:6938: \"$ac_try\"") >&5
6939   (eval $ac_try) 2>&5
6940   ac_status=$?
6941   echo "$as_me:6941: \$? = $ac_status" >&5
6942   (exit $ac_status); }; }; then
6943   cf_result=yes
6944 else
6945   echo "$as_me: failed program was:" >&5
6946 cat conftest.$ac_ext >&5
6947 cf_result=no
6948 fi
6949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6950                                 echo "$as_me:6950: result: $cf_result" >&5
6951 echo "${ECHO_T}$cf_result" >&6
6952                                 test $cf_result = yes && break
6953                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6954                                 cf_result=no
6955                         elif test "$cf_term_lib" != predefined ; then
6956                                 echo "$as_me:6956: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6957 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6958                                 cat >conftest.$ac_ext <<_ACEOF
6959 #line 6959 "configure"
6960 #include "confdefs.h"
6961 #include <${cf_cv_ncurses_header:-curses.h}>
6962 int
6963 main (void)
6964 {
6965 initscr(); tgoto((char *)0, 0, 0);
6966   ;
6967   return 0;
6968 }
6969 _ACEOF
6970 rm -f conftest.$ac_objext conftest$ac_exeext
6971 if { (eval echo "$as_me:6971: \"$ac_link\"") >&5
6972   (eval $ac_link) 2>&5
6973   ac_status=$?
6974   echo "$as_me:6974: \$? = $ac_status" >&5
6975   (exit $ac_status); } &&
6976          { ac_try='test -s conftest$ac_exeext'
6977   { (eval echo "$as_me:6977: \"$ac_try\"") >&5
6978   (eval $ac_try) 2>&5
6979   ac_status=$?
6980   echo "$as_me:6980: \$? = $ac_status" >&5
6981   (exit $ac_status); }; }; then
6982   cf_result=no
6983 else
6984   echo "$as_me: failed program was:" >&5
6985 cat conftest.$ac_ext >&5
6986
6987                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6988                                         cat >conftest.$ac_ext <<_ACEOF
6989 #line 6989 "configure"
6990 #include "confdefs.h"
6991 #include <${cf_cv_ncurses_header:-curses.h}>
6992 int
6993 main (void)
6994 {
6995 initscr()
6996   ;
6997   return 0;
6998 }
6999 _ACEOF
7000 rm -f conftest.$ac_objext conftest$ac_exeext
7001 if { (eval echo "$as_me:7001: \"$ac_link\"") >&5
7002   (eval $ac_link) 2>&5
7003   ac_status=$?
7004   echo "$as_me:7004: \$? = $ac_status" >&5
7005   (exit $ac_status); } &&
7006          { ac_try='test -s conftest$ac_exeext'
7007   { (eval echo "$as_me:7007: \"$ac_try\"") >&5
7008   (eval $ac_try) 2>&5
7009   ac_status=$?
7010   echo "$as_me:7010: \$? = $ac_status" >&5
7011   (exit $ac_status); }; }; then
7012   cf_result=yes
7013 else
7014   echo "$as_me: failed program was:" >&5
7015 cat conftest.$ac_ext >&5
7016 cf_result=error
7017 fi
7018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7019
7020 fi
7021 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7022                                 echo "$as_me:7022: result: $cf_result" >&5
7023 echo "${ECHO_T}$cf_result" >&6
7024                                 test $cf_result != error && break
7025                         fi
7026                 done
7027         fi
7028         test $cf_curs_lib = unknown && { { echo "$as_me:7028: error: no curses library found" >&5
7029 echo "$as_me: error: no curses library found" >&2;}
7030    { (exit 1); exit 1; }; }
7031 fi
7032 fi
7033
7034         ;;
7035 (ncursesw*)
7036
7037 echo "$as_me:7037: checking for multibyte character support" >&5
7038 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7039 if test "${cf_cv_utf8_lib+set}" = set; then
7040   echo $ECHO_N "(cached) $ECHO_C" >&6
7041 else
7042
7043         cf_save_LIBS="$LIBS"
7044         cat >conftest.$ac_ext <<_ACEOF
7045 #line 7045 "configure"
7046 #include "confdefs.h"
7047
7048 #include <stdlib.h>
7049 int
7050 main (void)
7051 {
7052 putwc(0,0);
7053   ;
7054   return 0;
7055 }
7056 _ACEOF
7057 rm -f conftest.$ac_objext conftest$ac_exeext
7058 if { (eval echo "$as_me:7058: \"$ac_link\"") >&5
7059   (eval $ac_link) 2>&5
7060   ac_status=$?
7061   echo "$as_me:7061: \$? = $ac_status" >&5
7062   (exit $ac_status); } &&
7063          { ac_try='test -s conftest$ac_exeext'
7064   { (eval echo "$as_me:7064: \"$ac_try\"") >&5
7065   (eval $ac_try) 2>&5
7066   ac_status=$?
7067   echo "$as_me:7067: \$? = $ac_status" >&5
7068   (exit $ac_status); }; }; then
7069   cf_cv_utf8_lib=yes
7070 else
7071   echo "$as_me: failed program was:" >&5
7072 cat conftest.$ac_ext >&5
7073
7074 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7075 # will be set on completion of the AC_TRY_LINK below.
7076 cf_cv_header_path_utf8=
7077 cf_cv_library_path_utf8=
7078
7079 echo "${as_me:-configure}:7079: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7080
7081 cf_save_LIBS="$LIBS"
7082
7083 cat >conftest.$ac_ext <<_ACEOF
7084 #line 7084 "configure"
7085 #include "confdefs.h"
7086
7087 #include <libutf8.h>
7088 int
7089 main (void)
7090 {
7091 putwc(0,0);
7092   ;
7093   return 0;
7094 }
7095 _ACEOF
7096 rm -f conftest.$ac_objext conftest$ac_exeext
7097 if { (eval echo "$as_me:7097: \"$ac_link\"") >&5
7098   (eval $ac_link) 2>&5
7099   ac_status=$?
7100   echo "$as_me:7100: \$? = $ac_status" >&5
7101   (exit $ac_status); } &&
7102          { ac_try='test -s conftest$ac_exeext'
7103   { (eval echo "$as_me:7103: \"$ac_try\"") >&5
7104   (eval $ac_try) 2>&5
7105   ac_status=$?
7106   echo "$as_me:7106: \$? = $ac_status" >&5
7107   (exit $ac_status); }; }; then
7108
7109         cf_cv_find_linkage_utf8=yes
7110         cf_cv_header_path_utf8=/usr/include
7111         cf_cv_library_path_utf8=/usr/lib
7112
7113 else
7114   echo "$as_me: failed program was:" >&5
7115 cat conftest.$ac_ext >&5
7116
7117 LIBS="-lutf8  $cf_save_LIBS"
7118
7119 cat >conftest.$ac_ext <<_ACEOF
7120 #line 7120 "configure"
7121 #include "confdefs.h"
7122
7123 #include <libutf8.h>
7124 int
7125 main (void)
7126 {
7127 putwc(0,0);
7128   ;
7129   return 0;
7130 }
7131 _ACEOF
7132 rm -f conftest.$ac_objext conftest$ac_exeext
7133 if { (eval echo "$as_me:7133: \"$ac_link\"") >&5
7134   (eval $ac_link) 2>&5
7135   ac_status=$?
7136   echo "$as_me:7136: \$? = $ac_status" >&5
7137   (exit $ac_status); } &&
7138          { ac_try='test -s conftest$ac_exeext'
7139   { (eval echo "$as_me:7139: \"$ac_try\"") >&5
7140   (eval $ac_try) 2>&5
7141   ac_status=$?
7142   echo "$as_me:7142: \$? = $ac_status" >&5
7143   (exit $ac_status); }; }; then
7144
7145         cf_cv_find_linkage_utf8=yes
7146         cf_cv_header_path_utf8=/usr/include
7147         cf_cv_library_path_utf8=/usr/lib
7148         cf_cv_library_file_utf8="-lutf8"
7149
7150 else
7151   echo "$as_me: failed program was:" >&5
7152 cat conftest.$ac_ext >&5
7153
7154         cf_cv_find_linkage_utf8=no
7155         LIBS="$cf_save_LIBS"
7156
7157         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
7158
7159 echo "${as_me:-configure}:7159: testing find linkage for utf8 library ..." 1>&5
7160
7161 echo "${as_me:-configure}:7161: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7162
7163         cf_save_CPPFLAGS="$CPPFLAGS"
7164         cf_test_CPPFLAGS="$CPPFLAGS"
7165
7166 cf_search=
7167
7168 # collect the current set of include-directories from compiler flags
7169 cf_header_path_list=""
7170 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7171         for cf_header_path in $CPPFLAGS $CFLAGS
7172         do
7173                 case $cf_header_path in
7174                 (-I*)
7175                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7176
7177 test "x$cf_header_path" != "xNONE" && \
7178 test -d "$cf_header_path" && \
7179  {
7180         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7181         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7182         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7183         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7184         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7185         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7186 }
7187
7188                         cf_header_path_list="$cf_header_path_list $cf_search"
7189                         ;;
7190                 esac
7191         done
7192 fi
7193
7194 # add the variations for the package we are looking for
7195
7196 cf_search=
7197
7198 test "x$prefix" != "xNONE" && \
7199 test -d "$prefix" && \
7200  {
7201         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7202         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7203         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
7204         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
7205         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
7206         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
7207 }
7208
7209 for cf_subdir_prefix in \
7210         /usr \
7211         /usr/local \
7212         /usr/pkg \
7213         /opt \
7214         /opt/local \
7215         $HOME
7216 do
7217
7218 test "x$cf_subdir_prefix" != "x$prefix" && \
7219 test -d "$cf_subdir_prefix" && \
7220 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7221         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7222         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7223         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
7224         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
7225         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
7226         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
7227 }
7228
7229 done
7230
7231 test "$includedir" != NONE && \
7232 test "$includedir" != "/usr/include" && \
7233 test -d "$includedir" && {
7234         test -d $includedir &&    cf_search="$cf_search $includedir"
7235         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7236 }
7237
7238 test "$oldincludedir" != NONE && \
7239 test "$oldincludedir" != "/usr/include" && \
7240 test -d "$oldincludedir" && {
7241         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7242         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7243 }
7244
7245 cf_search="$cf_search $cf_header_path_list"
7246
7247         for cf_cv_header_path_utf8 in $cf_search
7248         do
7249                 if test -d $cf_cv_header_path_utf8 ; then
7250                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7251
7252 echo "${as_me:-configure}:7252: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7253
7254                         CPPFLAGS="$cf_save_CPPFLAGS"
7255
7256         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7257         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7258
7259                         cat >conftest.$ac_ext <<_ACEOF
7260 #line 7260 "configure"
7261 #include "confdefs.h"
7262
7263 #include <libutf8.h>
7264 int
7265 main (void)
7266 {
7267 putwc(0,0);
7268   ;
7269   return 0;
7270 }
7271 _ACEOF
7272 rm -f conftest.$ac_objext
7273 if { (eval echo "$as_me:7273: \"$ac_compile\"") >&5
7274   (eval $ac_compile) 2>&5
7275   ac_status=$?
7276   echo "$as_me:7276: \$? = $ac_status" >&5
7277   (exit $ac_status); } &&
7278          { ac_try='test -s conftest.$ac_objext'
7279   { (eval echo "$as_me:7279: \"$ac_try\"") >&5
7280   (eval $ac_try) 2>&5
7281   ac_status=$?
7282   echo "$as_me:7282: \$? = $ac_status" >&5
7283   (exit $ac_status); }; }; then
7284
7285                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7286
7287 echo "${as_me:-configure}:7287: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7288
7289                                 cf_cv_find_linkage_utf8=maybe
7290                                 cf_test_CPPFLAGS="$CPPFLAGS"
7291                                 break
7292 else
7293   echo "$as_me: failed program was:" >&5
7294 cat conftest.$ac_ext >&5
7295
7296                                 CPPFLAGS="$cf_save_CPPFLAGS"
7297
7298 fi
7299 rm -f conftest.$ac_objext conftest.$ac_ext
7300                 fi
7301         done
7302
7303         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7304
7305 echo "${as_me:-configure}:7305: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7306
7307                 cf_save_LIBS="$LIBS"
7308                 cf_save_LDFLAGS="$LDFLAGS"
7309
7310                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7311
7312 cf_search=
7313 cf_library_path_list=""
7314 if test -n "${LDFLAGS}${LIBS}" ; then
7315         for cf_library_path in $LDFLAGS $LIBS
7316         do
7317                 case $cf_library_path in
7318                 (-L*)
7319                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7320
7321 test "x$cf_library_path" != "xNONE" && \
7322 test -d "$cf_library_path" && \
7323  {
7324         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7325         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7326         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7327         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7328         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7329         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7330 }
7331
7332                         cf_library_path_list="$cf_library_path_list $cf_search"
7333                         ;;
7334                 esac
7335         done
7336 fi
7337
7338 cf_search=
7339
7340 test "x$prefix" != "xNONE" && \
7341 test -d "$prefix" && \
7342  {
7343         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7344         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7345         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7346         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7347         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7348         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7349 }
7350
7351 for cf_subdir_prefix in \
7352         /usr \
7353         /usr/local \
7354         /usr/pkg \
7355         /opt \
7356         /opt/local \
7357         $HOME
7358 do
7359
7360 test "x$cf_subdir_prefix" != "x$prefix" && \
7361 test -d "$cf_subdir_prefix" && \
7362 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7363         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7364         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7365         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7366         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7367         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7368         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7369 }
7370
7371 done
7372
7373 cf_search="$cf_library_path_list $cf_search"
7374
7375                         for cf_cv_library_path_utf8 in $cf_search
7376                         do
7377                                 if test -d $cf_cv_library_path_utf8 ; then
7378                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7379
7380 echo "${as_me:-configure}:7380: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7381
7382                                         CPPFLAGS="$cf_test_CPPFLAGS"
7383                                         LIBS="-lutf8  $cf_save_LIBS"
7384                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7385                                         cat >conftest.$ac_ext <<_ACEOF
7386 #line 7386 "configure"
7387 #include "confdefs.h"
7388
7389 #include <libutf8.h>
7390 int
7391 main (void)
7392 {
7393 putwc(0,0);
7394   ;
7395   return 0;
7396 }
7397 _ACEOF
7398 rm -f conftest.$ac_objext conftest$ac_exeext
7399 if { (eval echo "$as_me:7399: \"$ac_link\"") >&5
7400   (eval $ac_link) 2>&5
7401   ac_status=$?
7402   echo "$as_me:7402: \$? = $ac_status" >&5
7403   (exit $ac_status); } &&
7404          { ac_try='test -s conftest$ac_exeext'
7405   { (eval echo "$as_me:7405: \"$ac_try\"") >&5
7406   (eval $ac_try) 2>&5
7407   ac_status=$?
7408   echo "$as_me:7408: \$? = $ac_status" >&5
7409   (exit $ac_status); }; }; then
7410
7411                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7412
7413 echo "${as_me:-configure}:7413: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7414
7415                                         cf_cv_find_linkage_utf8=yes
7416                                         cf_cv_library_file_utf8="-lutf8"
7417                                         break
7418 else
7419   echo "$as_me: failed program was:" >&5
7420 cat conftest.$ac_ext >&5
7421
7422                                         CPPFLAGS="$cf_save_CPPFLAGS"
7423                                         LIBS="$cf_save_LIBS"
7424                                         LDFLAGS="$cf_save_LDFLAGS"
7425
7426 fi
7427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7428                                 fi
7429                         done
7430                         CPPFLAGS="$cf_save_CPPFLAGS"
7431                         LDFLAGS="$cf_save_LDFLAGS"
7432                 fi
7433
7434         else
7435                 cf_cv_find_linkage_utf8=no
7436         fi
7437
7438 fi
7439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7440
7441 fi
7442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7443
7444 LIBS="$cf_save_LIBS"
7445
7446 if test "$cf_cv_find_linkage_utf8" = yes ; then
7447 cf_cv_utf8_lib=add-on
7448 else
7449 cf_cv_utf8_lib=no
7450 fi
7451
7452 fi
7453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7454 fi
7455 echo "$as_me:7455: result: $cf_cv_utf8_lib" >&5
7456 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7457
7458 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7459 # ncurses/ncursesw:
7460 if test "$cf_cv_utf8_lib" = "add-on" ; then
7461
7462 cat >>confdefs.h <<\EOF
7463 #define HAVE_LIBUTF8_H 1
7464 EOF
7465
7466 if test -n "$cf_cv_header_path_utf8" ; then
7467   for cf_add_incdir in $cf_cv_header_path_utf8
7468   do
7469         while test $cf_add_incdir != /usr/include
7470         do
7471           if test -d $cf_add_incdir
7472           then
7473                 cf_have_incdir=no
7474                 if test -n "$CFLAGS$CPPFLAGS" ; then
7475                   # a loop is needed to ensure we can add subdirs of existing dirs
7476                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7477                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7478                           cf_have_incdir=yes; break
7479                         fi
7480                   done
7481                 fi
7482
7483                 if test "$cf_have_incdir" = no ; then
7484                   if test "$cf_add_incdir" = /usr/local/include ; then
7485                         if test "$GCC" = yes
7486                         then
7487                           cf_save_CPPFLAGS=$CPPFLAGS
7488
7489         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7490         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7491
7492                           cat >conftest.$ac_ext <<_ACEOF
7493 #line 7493 "configure"
7494 #include "confdefs.h"
7495 #include <stdio.h>
7496 int
7497 main (void)
7498 {
7499 printf("Hello")
7500   ;
7501   return 0;
7502 }
7503 _ACEOF
7504 rm -f conftest.$ac_objext
7505 if { (eval echo "$as_me:7505: \"$ac_compile\"") >&5
7506   (eval $ac_compile) 2>&5
7507   ac_status=$?
7508   echo "$as_me:7508: \$? = $ac_status" >&5
7509   (exit $ac_status); } &&
7510          { ac_try='test -s conftest.$ac_objext'
7511   { (eval echo "$as_me:7511: \"$ac_try\"") >&5
7512   (eval $ac_try) 2>&5
7513   ac_status=$?
7514   echo "$as_me:7514: \$? = $ac_status" >&5
7515   (exit $ac_status); }; }; then
7516   :
7517 else
7518   echo "$as_me: failed program was:" >&5
7519 cat conftest.$ac_ext >&5
7520 cf_have_incdir=yes
7521 fi
7522 rm -f conftest.$ac_objext conftest.$ac_ext
7523                           CPPFLAGS=$cf_save_CPPFLAGS
7524                         fi
7525                   fi
7526                 fi
7527
7528                 if test "$cf_have_incdir" = no ; then
7529                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7530
7531 echo "${as_me:-configure}:7531: testing adding $cf_add_incdir to include-path ..." 1>&5
7532
7533                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7534
7535                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7536                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7537                   cf_add_incdir="$cf_top_incdir"
7538                 else
7539                   break
7540                 fi
7541           else
7542                 break
7543           fi
7544         done
7545   done
7546 fi
7547
7548 if test -n "$cf_cv_library_path_utf8" ; then
7549         for cf_add_libdir in $cf_cv_library_path_utf8
7550         do
7551                 if test $cf_add_libdir = /usr/lib ; then
7552                         :
7553                 elif test -d $cf_add_libdir
7554                 then
7555                         cf_have_libdir=no
7556                         if test -n "$LDFLAGS$LIBS" ; then
7557                                 # a loop is needed to ensure we can add subdirs of existing dirs
7558                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7559                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7560                                                 cf_have_libdir=yes; break
7561                                         fi
7562                                 done
7563                         fi
7564                         if test "$cf_have_libdir" = no ; then
7565                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7566
7567 echo "${as_me:-configure}:7567: testing adding $cf_add_libdir to library-path ..." 1>&5
7568
7569                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7570                         fi
7571                 fi
7572         done
7573 fi
7574
7575 cf_add_libs="$LIBS"
7576 # reverse order
7577 cf_add_0lib=
7578 for cf_add_1lib in $cf_cv_library_file_utf8; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7579 # filter duplicates
7580 for cf_add_1lib in $cf_add_0lib; do
7581         for cf_add_2lib in $cf_add_libs; do
7582                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7583                         cf_add_1lib=
7584                         break
7585                 fi
7586         done
7587         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7588 done
7589 LIBS="$cf_add_libs"
7590
7591 fi
7592
7593 cf_ncuconfig_root=$cf_cv_screen
7594 cf_have_ncuconfig=no
7595
7596 if test "x${PKG_CONFIG:=none}" != xnone; then
7597         echo "$as_me:7597: checking pkg-config for $cf_ncuconfig_root" >&5
7598 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7599         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7600                 echo "$as_me:7600: result: yes" >&5
7601 echo "${ECHO_T}yes" >&6
7602
7603                 echo "$as_me:7603: checking if the $cf_ncuconfig_root package files work" >&5
7604 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7605                 cf_have_ncuconfig=unknown
7606
7607                 cf_save_CFLAGS="$CFLAGS"
7608                 cf_save_CPPFLAGS="$CPPFLAGS"
7609                 cf_save_LIBS="$LIBS"
7610
7611                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
7612                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
7613
7614                 # while -W for passing linker flags is prevalent, it is not "standard".
7615                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
7616                 # incompatible _and_ non-standard -W option which gives an error.  Work
7617                 # around that pitfall.
7618                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
7619                 (x*c[89]9@@*-W*)
7620
7621 cf_fix_cppflags=no
7622 cf_new_cflags=
7623 cf_new_cppflags=
7624 cf_new_extra_cppflags=
7625
7626 for cf_add_cflags in $cf_pkg_cflags
7627 do
7628 case $cf_fix_cppflags in
7629 (no)
7630         case $cf_add_cflags in
7631         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7632                 case $cf_add_cflags in
7633                 (-D*)
7634                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7635
7636                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7637                                 && test -z "${cf_tst_cflags}" \
7638                                 && cf_fix_cppflags=yes
7639
7640                         if test $cf_fix_cppflags = yes ; then
7641
7642         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7643         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7644
7645                                 continue
7646                         elif test "${cf_tst_cflags}" = "\"'" ; then
7647
7648         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7649         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7650
7651                                 continue
7652                         fi
7653                         ;;
7654                 esac
7655                 case "$CPPFLAGS" in
7656                 (*$cf_add_cflags)
7657                         ;;
7658                 (*)
7659                         case $cf_add_cflags in
7660                         (-D*)
7661                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7662
7663 CPPFLAGS=`echo "$CPPFLAGS" | \
7664         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7665                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7666
7667                                 ;;
7668                         esac
7669
7670         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7671         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7672
7673                         ;;
7674                 esac
7675                 ;;
7676         (*)
7677
7678         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7679         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7680
7681                 ;;
7682         esac
7683         ;;
7684 (yes)
7685
7686         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7687         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7688
7689         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7690
7691         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7692                 && test -z "${cf_tst_cflags}" \
7693                 && cf_fix_cppflags=no
7694         ;;
7695 esac
7696 done
7697
7698 if test -n "$cf_new_cflags" ; then
7699
7700         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7701         CFLAGS="${CFLAGS}$cf_new_cflags"
7702
7703 fi
7704
7705 if test -n "$cf_new_cppflags" ; then
7706
7707         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7708         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7709
7710 fi
7711
7712 if test -n "$cf_new_extra_cppflags" ; then
7713
7714         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7715         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7716
7717 fi
7718
7719 cf_add_libs="$LIBS"
7720 # reverse order
7721 cf_add_0lib=
7722 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7723 # filter duplicates
7724 for cf_add_1lib in $cf_add_0lib; do
7725         for cf_add_2lib in $cf_add_libs; do
7726                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7727                         cf_add_1lib=
7728                         break
7729                 fi
7730         done
7731         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7732 done
7733 LIBS="$cf_add_libs"
7734
7735                         cat >conftest.$ac_ext <<_ACEOF
7736 #line 7736 "configure"
7737 #include "confdefs.h"
7738 #include <${cf_cv_ncurses_header:-curses.h}>
7739 int
7740 main (void)
7741 {
7742 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7743   ;
7744   return 0;
7745 }
7746 _ACEOF
7747 rm -f conftest.$ac_objext conftest$ac_exeext
7748 if { (eval echo "$as_me:7748: \"$ac_link\"") >&5
7749   (eval $ac_link) 2>&5
7750   ac_status=$?
7751   echo "$as_me:7751: \$? = $ac_status" >&5
7752   (exit $ac_status); } &&
7753          { ac_try='test -s conftest$ac_exeext'
7754   { (eval echo "$as_me:7754: \"$ac_try\"") >&5
7755   (eval $ac_try) 2>&5
7756   ac_status=$?
7757   echo "$as_me:7757: \$? = $ac_status" >&5
7758   (exit $ac_status); }; }; then
7759   if test "$cross_compiling" = yes; then
7760   cf_test_ncuconfig=maybe
7761 else
7762   cat >conftest.$ac_ext <<_ACEOF
7763 #line 7763 "configure"
7764 #include "confdefs.h"
7765 #include <${cf_cv_ncurses_header:-curses.h}>
7766                                         int main(void)
7767                                         { char *xx = curses_version(); return (xx == 0); }
7768 _ACEOF
7769 rm -f conftest$ac_exeext
7770 if { (eval echo "$as_me:7770: \"$ac_link\"") >&5
7771   (eval $ac_link) 2>&5
7772   ac_status=$?
7773   echo "$as_me:7773: \$? = $ac_status" >&5
7774   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7775   { (eval echo "$as_me:7775: \"$ac_try\"") >&5
7776   (eval $ac_try) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); }; }; then
7780   cf_test_ncuconfig=yes
7781 else
7782   echo "$as_me: program exited with status $ac_status" >&5
7783 echo "$as_me: failed program was:" >&5
7784 cat conftest.$ac_ext >&5
7785 cf_test_ncuconfig=no
7786 fi
7787 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7788 fi
7789 else
7790   echo "$as_me: failed program was:" >&5
7791 cat conftest.$ac_ext >&5
7792 cf_test_ncuconfig=no
7793 fi
7794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7795
7796                         CFLAGS="$cf_save_CFLAGS"
7797                         CPPFLAGS="$cf_save_CPPFLAGS"
7798                         LIBS="$cf_save_LIBS"
7799
7800                         if test "x$cf_test_ncuconfig" != xyes; then
7801                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
7802                                 cf_pkg_cflags="$cf_temp"
7803                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
7804                                 cf_pkg_libs="$cf_temp"
7805                         fi
7806                         ;;
7807                 esac
7808
7809 cf_fix_cppflags=no
7810 cf_new_cflags=
7811 cf_new_cppflags=
7812 cf_new_extra_cppflags=
7813
7814 for cf_add_cflags in $cf_pkg_cflags
7815 do
7816 case $cf_fix_cppflags in
7817 (no)
7818         case $cf_add_cflags in
7819         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7820                 case $cf_add_cflags in
7821                 (-D*)
7822                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7823
7824                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7825                                 && test -z "${cf_tst_cflags}" \
7826                                 && cf_fix_cppflags=yes
7827
7828                         if test $cf_fix_cppflags = yes ; then
7829
7830         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7831         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7832
7833                                 continue
7834                         elif test "${cf_tst_cflags}" = "\"'" ; then
7835
7836         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7837         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7838
7839                                 continue
7840                         fi
7841                         ;;
7842                 esac
7843                 case "$CPPFLAGS" in
7844                 (*$cf_add_cflags)
7845                         ;;
7846                 (*)
7847                         case $cf_add_cflags in
7848                         (-D*)
7849                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7850
7851 CPPFLAGS=`echo "$CPPFLAGS" | \
7852         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7853                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7854
7855                                 ;;
7856                         esac
7857
7858         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7859         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7860
7861                         ;;
7862                 esac
7863                 ;;
7864         (*)
7865
7866         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7867         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7868
7869                 ;;
7870         esac
7871         ;;
7872 (yes)
7873
7874         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7875         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7876
7877         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7878
7879         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7880                 && test -z "${cf_tst_cflags}" \
7881                 && cf_fix_cppflags=no
7882         ;;
7883 esac
7884 done
7885
7886 if test -n "$cf_new_cflags" ; then
7887
7888         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7889         CFLAGS="${CFLAGS}$cf_new_cflags"
7890
7891 fi
7892
7893 if test -n "$cf_new_cppflags" ; then
7894
7895         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7896         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7897
7898 fi
7899
7900 if test -n "$cf_new_extra_cppflags" ; then
7901
7902         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7903         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7904
7905 fi
7906
7907 cf_add_libs="$LIBS"
7908 # reverse order
7909 cf_add_0lib=
7910 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
7911 # filter duplicates
7912 for cf_add_1lib in $cf_add_0lib; do
7913         for cf_add_2lib in $cf_add_libs; do
7914                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
7915                         cf_add_1lib=
7916                         break
7917                 fi
7918         done
7919         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
7920 done
7921 LIBS="$cf_add_libs"
7922
7923                 cat >conftest.$ac_ext <<_ACEOF
7924 #line 7924 "configure"
7925 #include "confdefs.h"
7926 #include <${cf_cv_ncurses_header:-curses.h}>
7927 int
7928 main (void)
7929 {
7930 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7931   ;
7932   return 0;
7933 }
7934 _ACEOF
7935 rm -f conftest.$ac_objext conftest$ac_exeext
7936 if { (eval echo "$as_me:7936: \"$ac_link\"") >&5
7937   (eval $ac_link) 2>&5
7938   ac_status=$?
7939   echo "$as_me:7939: \$? = $ac_status" >&5
7940   (exit $ac_status); } &&
7941          { ac_try='test -s conftest$ac_exeext'
7942   { (eval echo "$as_me:7942: \"$ac_try\"") >&5
7943   (eval $ac_try) 2>&5
7944   ac_status=$?
7945   echo "$as_me:7945: \$? = $ac_status" >&5
7946   (exit $ac_status); }; }; then
7947   if test "$cross_compiling" = yes; then
7948   cf_have_ncuconfig=maybe
7949 else
7950   cat >conftest.$ac_ext <<_ACEOF
7951 #line 7951 "configure"
7952 #include "confdefs.h"
7953 #include <${cf_cv_ncurses_header:-curses.h}>
7954                                 int main(void)
7955                                 { char *xx = curses_version(); return (xx == 0); }
7956 _ACEOF
7957 rm -f conftest$ac_exeext
7958 if { (eval echo "$as_me:7958: \"$ac_link\"") >&5
7959   (eval $ac_link) 2>&5
7960   ac_status=$?
7961   echo "$as_me:7961: \$? = $ac_status" >&5
7962   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7963   { (eval echo "$as_me:7963: \"$ac_try\"") >&5
7964   (eval $ac_try) 2>&5
7965   ac_status=$?
7966   echo "$as_me:7966: \$? = $ac_status" >&5
7967   (exit $ac_status); }; }; then
7968   cf_have_ncuconfig=yes
7969 else
7970   echo "$as_me: program exited with status $ac_status" >&5
7971 echo "$as_me: failed program was:" >&5
7972 cat conftest.$ac_ext >&5
7973 cf_have_ncuconfig=no
7974 fi
7975 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7976 fi
7977 else
7978   echo "$as_me: failed program was:" >&5
7979 cat conftest.$ac_ext >&5
7980 cf_have_ncuconfig=no
7981 fi
7982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7983                 echo "$as_me:7983: result: $cf_have_ncuconfig" >&5
7984 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7985                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7986                 if test "$cf_have_ncuconfig" != "yes"
7987                 then
7988                         CPPFLAGS="$cf_save_CPPFLAGS"
7989                         LIBS="$cf_save_LIBS"
7990                         NCURSES_CONFIG_PKG=none
7991                 else
7992
7993 cat >>confdefs.h <<\EOF
7994 #define NCURSES 1
7995 EOF
7996
7997                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7998
7999 echo "$as_me:7999: checking for terminfo header" >&5
8000 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8001 if test "${cf_cv_term_header+set}" = set; then
8002   echo $ECHO_N "(cached) $ECHO_C" >&6
8003 else
8004
8005 case ${cf_cv_ncurses_header} in
8006 (*/ncurses.h|*/ncursesw.h)
8007         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8008         ;;
8009 (*)
8010         cf_term_header=term.h
8011         ;;
8012 esac
8013
8014 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8015 do
8016 cat >conftest.$ac_ext <<_ACEOF
8017 #line 8017 "configure"
8018 #include "confdefs.h"
8019 #include <stdio.h>
8020 #include <${cf_cv_ncurses_header:-curses.h}>
8021 #include <$cf_test>
8022
8023 int
8024 main (void)
8025 {
8026 int x = auto_left_margin; (void)x
8027   ;
8028   return 0;
8029 }
8030 _ACEOF
8031 rm -f conftest.$ac_objext
8032 if { (eval echo "$as_me:8032: \"$ac_compile\"") >&5
8033   (eval $ac_compile) 2>&5
8034   ac_status=$?
8035   echo "$as_me:8035: \$? = $ac_status" >&5
8036   (exit $ac_status); } &&
8037          { ac_try='test -s conftest.$ac_objext'
8038   { (eval echo "$as_me:8038: \"$ac_try\"") >&5
8039   (eval $ac_try) 2>&5
8040   ac_status=$?
8041   echo "$as_me:8041: \$? = $ac_status" >&5
8042   (exit $ac_status); }; }; then
8043
8044         cf_cv_term_header="$cf_test"
8045 else
8046   echo "$as_me: failed program was:" >&5
8047 cat conftest.$ac_ext >&5
8048
8049         cf_cv_term_header=unknown
8050
8051 fi
8052 rm -f conftest.$ac_objext conftest.$ac_ext
8053         test "$cf_cv_term_header" != unknown && break
8054 done
8055
8056 fi
8057 echo "$as_me:8057: result: $cf_cv_term_header" >&5
8058 echo "${ECHO_T}$cf_cv_term_header" >&6
8059
8060 # Set definitions to allow ifdef'ing to accommodate subdirectories
8061
8062 case $cf_cv_term_header in
8063 (*term.h)
8064
8065 cat >>confdefs.h <<\EOF
8066 #define HAVE_TERM_H 1
8067 EOF
8068
8069         ;;
8070 esac
8071
8072 case $cf_cv_term_header in
8073 (ncurses/term.h)
8074
8075 cat >>confdefs.h <<\EOF
8076 #define HAVE_NCURSES_TERM_H 1
8077 EOF
8078
8079         ;;
8080 (ncursesw/term.h)
8081
8082 cat >>confdefs.h <<\EOF
8083 #define HAVE_NCURSESW_TERM_H 1
8084 EOF
8085
8086         ;;
8087 esac
8088
8089                 fi
8090
8091         else
8092                 echo "$as_me:8092: result: no" >&5
8093 echo "${ECHO_T}no" >&6
8094                 NCURSES_CONFIG_PKG=none
8095         fi
8096 else
8097         NCURSES_CONFIG_PKG=none
8098 fi
8099
8100 if test "x$cf_have_ncuconfig" = "xno"; then
8101         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8102
8103 if test -n "$ac_tool_prefix"; then
8104   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8105   do
8106     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8107 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8108 echo "$as_me:8108: checking for $ac_word" >&5
8109 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8110 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8111   echo $ECHO_N "(cached) $ECHO_C" >&6
8112 else
8113   if test -n "$NCURSES_CONFIG"; then
8114   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8115 else
8116   ac_save_IFS=$IFS; IFS=$ac_path_separator
8117 ac_dummy="$PATH"
8118 for ac_dir in $ac_dummy; do
8119   IFS=$ac_save_IFS
8120   test -z "$ac_dir" && ac_dir=.
8121   $as_executable_p "$ac_dir/$ac_word" || continue
8122 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8123 echo "$as_me:8123: found $ac_dir/$ac_word" >&5
8124 break
8125 done
8126
8127 fi
8128 fi
8129 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8130 if test -n "$NCURSES_CONFIG"; then
8131   echo "$as_me:8131: result: $NCURSES_CONFIG" >&5
8132 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8133 else
8134   echo "$as_me:8134: result: no" >&5
8135 echo "${ECHO_T}no" >&6
8136 fi
8137
8138     test -n "$NCURSES_CONFIG" && break
8139   done
8140 fi
8141 if test -z "$NCURSES_CONFIG"; then
8142   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8143   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8144 do
8145   # Extract the first word of "$ac_prog", so it can be a program name with args.
8146 set dummy $ac_prog; ac_word=$2
8147 echo "$as_me:8147: checking for $ac_word" >&5
8148 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8149 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8150   echo $ECHO_N "(cached) $ECHO_C" >&6
8151 else
8152   if test -n "$ac_ct_NCURSES_CONFIG"; then
8153   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8154 else
8155   ac_save_IFS=$IFS; IFS=$ac_path_separator
8156 ac_dummy="$PATH"
8157 for ac_dir in $ac_dummy; do
8158   IFS=$ac_save_IFS
8159   test -z "$ac_dir" && ac_dir=.
8160   $as_executable_p "$ac_dir/$ac_word" || continue
8161 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8162 echo "$as_me:8162: found $ac_dir/$ac_word" >&5
8163 break
8164 done
8165
8166 fi
8167 fi
8168 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8169 if test -n "$ac_ct_NCURSES_CONFIG"; then
8170   echo "$as_me:8170: result: $ac_ct_NCURSES_CONFIG" >&5
8171 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8172 else
8173   echo "$as_me:8173: result: no" >&5
8174 echo "${ECHO_T}no" >&6
8175 fi
8176
8177   test -n "$ac_ct_NCURSES_CONFIG" && break
8178 done
8179 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8180
8181   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8182 fi
8183
8184         if test "$NCURSES_CONFIG" != none ; then
8185
8186 cf_fix_cppflags=no
8187 cf_new_cflags=
8188 cf_new_cppflags=
8189 cf_new_extra_cppflags=
8190
8191 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
8192 do
8193 case $cf_fix_cppflags in
8194 (no)
8195         case $cf_add_cflags in
8196         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
8197                 case $cf_add_cflags in
8198                 (-D*)
8199                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
8200
8201                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8202                                 && test -z "${cf_tst_cflags}" \
8203                                 && cf_fix_cppflags=yes
8204
8205                         if test $cf_fix_cppflags = yes ; then
8206
8207         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8208         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8209
8210                                 continue
8211                         elif test "${cf_tst_cflags}" = "\"'" ; then
8212
8213         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8214         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8215
8216                                 continue
8217                         fi
8218                         ;;
8219                 esac
8220                 case "$CPPFLAGS" in
8221                 (*$cf_add_cflags)
8222                         ;;
8223                 (*)
8224                         case $cf_add_cflags in
8225                         (-D*)
8226                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
8227
8228 CPPFLAGS=`echo "$CPPFLAGS" | \
8229         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
8230                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
8231
8232                                 ;;
8233                         esac
8234
8235         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
8236         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
8237
8238                         ;;
8239                 esac
8240                 ;;
8241         (*)
8242
8243         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
8244         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
8245
8246                 ;;
8247         esac
8248         ;;
8249 (yes)
8250
8251         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
8252         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
8253
8254         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
8255
8256         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
8257                 && test -z "${cf_tst_cflags}" \
8258                 && cf_fix_cppflags=no
8259         ;;
8260 esac
8261 done
8262
8263 if test -n "$cf_new_cflags" ; then
8264
8265         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
8266         CFLAGS="${CFLAGS}$cf_new_cflags"
8267
8268 fi
8269
8270 if test -n "$cf_new_cppflags" ; then
8271
8272         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8273         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
8274
8275 fi
8276
8277 if test -n "$cf_new_extra_cppflags" ; then
8278
8279         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
8280         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
8281
8282 fi
8283
8284 cf_add_libs="$LIBS"
8285 # reverse order
8286 cf_add_0lib=
8287 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
8288 # filter duplicates
8289 for cf_add_1lib in $cf_add_0lib; do
8290         for cf_add_2lib in $cf_add_libs; do
8291                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
8292                         cf_add_1lib=
8293                         break
8294                 fi
8295         done
8296         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
8297 done
8298 LIBS="$cf_add_libs"
8299
8300                 # even with config script, some packages use no-override for curses.h
8301
8302 echo "$as_me:8302: checking if we have identified curses headers" >&5
8303 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8304 if test "${cf_cv_ncurses_header+set}" = set; then
8305   echo $ECHO_N "(cached) $ECHO_C" >&6
8306 else
8307
8308 cf_cv_ncurses_header=none
8309 for cf_header in \
8310         ncurses.h $cf_cv_screen/ncurses.h \
8311         curses.h $cf_cv_screen/curses.h
8312 do
8313 cat >conftest.$ac_ext <<_ACEOF
8314 #line 8314 "configure"
8315 #include "confdefs.h"
8316 #include <${cf_header}>
8317 int
8318 main (void)
8319 {
8320 initscr(); tgoto("?", 0,0)
8321   ;
8322   return 0;
8323 }
8324 _ACEOF
8325 rm -f conftest.$ac_objext
8326 if { (eval echo "$as_me:8326: \"$ac_compile\"") >&5
8327   (eval $ac_compile) 2>&5
8328   ac_status=$?
8329   echo "$as_me:8329: \$? = $ac_status" >&5
8330   (exit $ac_status); } &&
8331          { ac_try='test -s conftest.$ac_objext'
8332   { (eval echo "$as_me:8332: \"$ac_try\"") >&5
8333   (eval $ac_try) 2>&5
8334   ac_status=$?
8335   echo "$as_me:8335: \$? = $ac_status" >&5
8336   (exit $ac_status); }; }; then
8337   cf_cv_ncurses_header=$cf_header; break
8338 else
8339   echo "$as_me: failed program was:" >&5
8340 cat conftest.$ac_ext >&5
8341 fi
8342 rm -f conftest.$ac_objext conftest.$ac_ext
8343 done
8344
8345 fi
8346 echo "$as_me:8346: result: $cf_cv_ncurses_header" >&5
8347 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8348
8349 if test "$cf_cv_ncurses_header" = none ; then
8350         { { echo "$as_me:8350: error: No curses header-files found" >&5
8351 echo "$as_me: error: No curses header-files found" >&2;}
8352    { (exit 1); exit 1; }; }
8353 fi
8354
8355 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8356
8357 for ac_header in $cf_cv_ncurses_header
8358 do
8359 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8360 echo "$as_me:8360: checking for $ac_header" >&5
8361 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8362 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8363   echo $ECHO_N "(cached) $ECHO_C" >&6
8364 else
8365   cat >conftest.$ac_ext <<_ACEOF
8366 #line 8366 "configure"
8367 #include "confdefs.h"
8368 #include <$ac_header>
8369 _ACEOF
8370 if { (eval echo "$as_me:8370: \"$ac_cpp conftest.$ac_ext\"") >&5
8371   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8372   ac_status=$?
8373   egrep -v '^ *\+' conftest.er1 >conftest.err
8374   rm -f conftest.er1
8375   cat conftest.err >&5
8376   echo "$as_me:8376: \$? = $ac_status" >&5
8377   (exit $ac_status); } >/dev/null; then
8378   if test -s conftest.err; then
8379     ac_cpp_err=$ac_c_preproc_warn_flag
8380   else
8381     ac_cpp_err=
8382   fi
8383 else
8384   ac_cpp_err=yes
8385 fi
8386 if test -z "$ac_cpp_err"; then
8387   eval "$as_ac_Header=yes"
8388 else
8389   echo "$as_me: failed program was:" >&5
8390   cat conftest.$ac_ext >&5
8391   eval "$as_ac_Header=no"
8392 fi
8393 rm -f conftest.err conftest.$ac_ext
8394 fi
8395 echo "$as_me:8395: result: `eval echo '${'$as_ac_Header'}'`" >&5
8396 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8397 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8398   cat >>confdefs.h <<EOF
8399 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8400 EOF
8401
8402 fi
8403 done
8404
8405 cat >>confdefs.h <<\EOF
8406 #define NCURSES 1
8407 EOF
8408
8409 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8410
8411                 cat >>confdefs.h <<EOF
8412 #define $cf_nculib_ROOT 1
8413 EOF
8414
8415                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8416
8417         else
8418
8419 cf_ncuhdr_root=$cf_cv_screen
8420
8421 test -n "$cf_cv_curses_dir" && \
8422 test "$cf_cv_curses_dir" != "no" && { \
8423
8424 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8425   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8426   do
8427         while test $cf_add_incdir != /usr/include
8428         do
8429           if test -d $cf_add_incdir
8430           then
8431                 cf_have_incdir=no
8432                 if test -n "$CFLAGS$CPPFLAGS" ; then
8433                   # a loop is needed to ensure we can add subdirs of existing dirs
8434                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8435                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8436                           cf_have_incdir=yes; break
8437                         fi
8438                   done
8439                 fi
8440
8441                 if test "$cf_have_incdir" = no ; then
8442                   if test "$cf_add_incdir" = /usr/local/include ; then
8443                         if test "$GCC" = yes
8444                         then
8445                           cf_save_CPPFLAGS=$CPPFLAGS
8446
8447         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8448         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8449
8450                           cat >conftest.$ac_ext <<_ACEOF
8451 #line 8451 "configure"
8452 #include "confdefs.h"
8453 #include <stdio.h>
8454 int
8455 main (void)
8456 {
8457 printf("Hello")
8458   ;
8459   return 0;
8460 }
8461 _ACEOF
8462 rm -f conftest.$ac_objext
8463 if { (eval echo "$as_me:8463: \"$ac_compile\"") >&5
8464   (eval $ac_compile) 2>&5
8465   ac_status=$?
8466   echo "$as_me:8466: \$? = $ac_status" >&5
8467   (exit $ac_status); } &&
8468          { ac_try='test -s conftest.$ac_objext'
8469   { (eval echo "$as_me:8469: \"$ac_try\"") >&5
8470   (eval $ac_try) 2>&5
8471   ac_status=$?
8472   echo "$as_me:8472: \$? = $ac_status" >&5
8473   (exit $ac_status); }; }; then
8474   :
8475 else
8476   echo "$as_me: failed program was:" >&5
8477 cat conftest.$ac_ext >&5
8478 cf_have_incdir=yes
8479 fi
8480 rm -f conftest.$ac_objext conftest.$ac_ext
8481                           CPPFLAGS=$cf_save_CPPFLAGS
8482                         fi
8483                   fi
8484                 fi
8485
8486                 if test "$cf_have_incdir" = no ; then
8487                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8488
8489 echo "${as_me:-configure}:8489: testing adding $cf_add_incdir to include-path ..." 1>&5
8490
8491                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8492
8493                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8494                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8495                   cf_add_incdir="$cf_top_incdir"
8496                 else
8497                   break
8498                 fi
8499           else
8500                 break
8501           fi
8502         done
8503   done
8504 fi
8505
8506 }
8507
8508 echo "$as_me:8508: checking for $cf_ncuhdr_root header in include-path" >&5
8509 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8510 if test "${cf_cv_ncurses_h+set}" = set; then
8511   echo $ECHO_N "(cached) $ECHO_C" >&6
8512 else
8513
8514         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8515         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8516         for cf_header in $cf_header_list
8517         do
8518
8519         cat >conftest.$ac_ext <<_ACEOF
8520 #line 8520 "configure"
8521 #include "confdefs.h"
8522
8523 #include <$cf_header>
8524 int
8525 main (void)
8526 {
8527
8528 #ifdef NCURSES_VERSION
8529
8530 printf("%s\n", NCURSES_VERSION);
8531 #else
8532 #ifdef __NCURSES_H
8533 printf("old\n");
8534 #else
8535         make an error
8536 #endif
8537 #endif
8538
8539   ;
8540   return 0;
8541 }
8542 _ACEOF
8543 rm -f conftest.$ac_objext
8544 if { (eval echo "$as_me:8544: \"$ac_compile\"") >&5
8545   (eval $ac_compile) 2>&5
8546   ac_status=$?
8547   echo "$as_me:8547: \$? = $ac_status" >&5
8548   (exit $ac_status); } &&
8549          { ac_try='test -s conftest.$ac_objext'
8550   { (eval echo "$as_me:8550: \"$ac_try\"") >&5
8551   (eval $ac_try) 2>&5
8552   ac_status=$?
8553   echo "$as_me:8553: \$? = $ac_status" >&5
8554   (exit $ac_status); }; }; then
8555   cf_cv_ncurses_h=$cf_header
8556
8557 else
8558   echo "$as_me: failed program was:" >&5
8559 cat conftest.$ac_ext >&5
8560 cf_cv_ncurses_h=no
8561 fi
8562 rm -f conftest.$ac_objext conftest.$ac_ext
8563
8564                 test "$cf_cv_ncurses_h" != no && break
8565         done
8566
8567 fi
8568 echo "$as_me:8568: result: $cf_cv_ncurses_h" >&5
8569 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8570
8571 if test "$cf_cv_ncurses_h" != no ; then
8572         cf_cv_ncurses_header=$cf_cv_ncurses_h
8573 else
8574
8575 echo "$as_me:8575: checking for $cf_ncuhdr_root include-path" >&5
8576 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8577 if test "${cf_cv_ncurses_h2+set}" = set; then
8578   echo $ECHO_N "(cached) $ECHO_C" >&6
8579 else
8580
8581         test -n "$verbose" && echo
8582
8583 cf_search=
8584
8585 # collect the current set of include-directories from compiler flags
8586 cf_header_path_list=""
8587 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8588         for cf_header_path in $CPPFLAGS $CFLAGS
8589         do
8590                 case $cf_header_path in
8591                 (-I*)
8592                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8593
8594 test "x$cf_header_path" != "xNONE" && \
8595 test -d "$cf_header_path" && \
8596  {
8597         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8598         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8599         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8600         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8601         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8602         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"
8603 }
8604
8605                         cf_header_path_list="$cf_header_path_list $cf_search"
8606                         ;;
8607                 esac
8608         done
8609 fi
8610
8611 # add the variations for the package we are looking for
8612
8613 cf_search=
8614
8615 test "x$prefix" != "xNONE" && \
8616 test -d "$prefix" && \
8617  {
8618         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8619         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8620         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8621         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8622         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8623         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8624 }
8625
8626 for cf_subdir_prefix in \
8627         /usr \
8628         /usr/local \
8629         /usr/pkg \
8630         /opt \
8631         /opt/local \
8632         $HOME
8633 do
8634
8635 test "x$cf_subdir_prefix" != "x$prefix" && \
8636 test -d "$cf_subdir_prefix" && \
8637 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8638         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8639         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8640         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8641         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8642         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8643         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"
8644 }
8645
8646 done
8647
8648 test "$includedir" != NONE && \
8649 test "$includedir" != "/usr/include" && \
8650 test -d "$includedir" && {
8651         test -d $includedir &&    cf_search="$cf_search $includedir"
8652         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8653 }
8654
8655 test "$oldincludedir" != NONE && \
8656 test "$oldincludedir" != "/usr/include" && \
8657 test -d "$oldincludedir" && {
8658         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8659         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8660 }
8661
8662 cf_search="$cf_search $cf_header_path_list"
8663
8664         test -n "$verbose" && echo search path $cf_search
8665         cf_save2_CPPFLAGS="$CPPFLAGS"
8666         for cf_incdir in $cf_search
8667         do
8668
8669 if test -n "$cf_incdir" ; then
8670   for cf_add_incdir in $cf_incdir
8671   do
8672         while test $cf_add_incdir != /usr/include
8673         do
8674           if test -d $cf_add_incdir
8675           then
8676                 cf_have_incdir=no
8677                 if test -n "$CFLAGS$CPPFLAGS" ; then
8678                   # a loop is needed to ensure we can add subdirs of existing dirs
8679                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8680                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8681                           cf_have_incdir=yes; break
8682                         fi
8683                   done
8684                 fi
8685
8686                 if test "$cf_have_incdir" = no ; then
8687                   if test "$cf_add_incdir" = /usr/local/include ; then
8688                         if test "$GCC" = yes
8689                         then
8690                           cf_save_CPPFLAGS=$CPPFLAGS
8691
8692         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8693         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8694
8695                           cat >conftest.$ac_ext <<_ACEOF
8696 #line 8696 "configure"
8697 #include "confdefs.h"
8698 #include <stdio.h>
8699 int
8700 main (void)
8701 {
8702 printf("Hello")
8703   ;
8704   return 0;
8705 }
8706 _ACEOF
8707 rm -f conftest.$ac_objext
8708 if { (eval echo "$as_me:8708: \"$ac_compile\"") >&5
8709   (eval $ac_compile) 2>&5
8710   ac_status=$?
8711   echo "$as_me:8711: \$? = $ac_status" >&5
8712   (exit $ac_status); } &&
8713          { ac_try='test -s conftest.$ac_objext'
8714   { (eval echo "$as_me:8714: \"$ac_try\"") >&5
8715   (eval $ac_try) 2>&5
8716   ac_status=$?
8717   echo "$as_me:8717: \$? = $ac_status" >&5
8718   (exit $ac_status); }; }; then
8719   :
8720 else
8721   echo "$as_me: failed program was:" >&5
8722 cat conftest.$ac_ext >&5
8723 cf_have_incdir=yes
8724 fi
8725 rm -f conftest.$ac_objext conftest.$ac_ext
8726                           CPPFLAGS=$cf_save_CPPFLAGS
8727                         fi
8728                   fi
8729                 fi
8730
8731                 if test "$cf_have_incdir" = no ; then
8732                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8733
8734 echo "${as_me:-configure}:8734: testing adding $cf_add_incdir to include-path ..." 1>&5
8735
8736                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8737
8738                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8739                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8740                   cf_add_incdir="$cf_top_incdir"
8741                 else
8742                   break
8743                 fi
8744           else
8745                 break
8746           fi
8747         done
8748   done
8749 fi
8750
8751                 for cf_header in \
8752                         ncurses.h \
8753                         curses.h
8754                 do
8755
8756         cat >conftest.$ac_ext <<_ACEOF
8757 #line 8757 "configure"
8758 #include "confdefs.h"
8759
8760 #include <$cf_header>
8761 int
8762 main (void)
8763 {
8764
8765 #ifdef NCURSES_VERSION
8766
8767 printf("%s\n", NCURSES_VERSION);
8768 #else
8769 #ifdef __NCURSES_H
8770 printf("old\n");
8771 #else
8772         make an error
8773 #endif
8774 #endif
8775
8776   ;
8777   return 0;
8778 }
8779 _ACEOF
8780 rm -f conftest.$ac_objext
8781 if { (eval echo "$as_me:8781: \"$ac_compile\"") >&5
8782   (eval $ac_compile) 2>&5
8783   ac_status=$?
8784   echo "$as_me:8784: \$? = $ac_status" >&5
8785   (exit $ac_status); } &&
8786          { ac_try='test -s conftest.$ac_objext'
8787   { (eval echo "$as_me:8787: \"$ac_try\"") >&5
8788   (eval $ac_try) 2>&5
8789   ac_status=$?
8790   echo "$as_me:8790: \$? = $ac_status" >&5
8791   (exit $ac_status); }; }; then
8792   cf_cv_ncurses_h2=$cf_header
8793
8794 else
8795   echo "$as_me: failed program was:" >&5
8796 cat conftest.$ac_ext >&5
8797 cf_cv_ncurses_h2=no
8798 fi
8799 rm -f conftest.$ac_objext conftest.$ac_ext
8800
8801                         if test "$cf_cv_ncurses_h2" != no ; then
8802                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8803                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8804                                 break
8805                         fi
8806                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8807                 done
8808                 CPPFLAGS="$cf_save2_CPPFLAGS"
8809                 test "$cf_cv_ncurses_h2" != no && break
8810         done
8811         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8811: error: not found" >&5
8812 echo "$as_me: error: not found" >&2;}
8813    { (exit 1); exit 1; }; }
8814
8815 fi
8816 echo "$as_me:8816: result: $cf_cv_ncurses_h2" >&5
8817 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8818
8819         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8820         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8821         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8822                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8823         fi
8824
8825 if test -n "$cf_1st_incdir" ; then
8826   for cf_add_incdir in $cf_1st_incdir
8827   do
8828         while test $cf_add_incdir != /usr/include
8829         do
8830           if test -d $cf_add_incdir
8831           then
8832                 cf_have_incdir=no
8833                 if test -n "$CFLAGS$CPPFLAGS" ; then
8834                   # a loop is needed to ensure we can add subdirs of existing dirs
8835                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8836                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8837                           cf_have_incdir=yes; break
8838                         fi
8839                   done
8840                 fi
8841
8842                 if test "$cf_have_incdir" = no ; then
8843                   if test "$cf_add_incdir" = /usr/local/include ; then
8844                         if test "$GCC" = yes
8845                         then
8846                           cf_save_CPPFLAGS=$CPPFLAGS
8847
8848         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8849         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8850
8851                           cat >conftest.$ac_ext <<_ACEOF
8852 #line 8852 "configure"
8853 #include "confdefs.h"
8854 #include <stdio.h>
8855 int
8856 main (void)
8857 {
8858 printf("Hello")
8859   ;
8860   return 0;
8861 }
8862 _ACEOF
8863 rm -f conftest.$ac_objext
8864 if { (eval echo "$as_me:8864: \"$ac_compile\"") >&5
8865   (eval $ac_compile) 2>&5
8866   ac_status=$?
8867   echo "$as_me:8867: \$? = $ac_status" >&5
8868   (exit $ac_status); } &&
8869          { ac_try='test -s conftest.$ac_objext'
8870   { (eval echo "$as_me:8870: \"$ac_try\"") >&5
8871   (eval $ac_try) 2>&5
8872   ac_status=$?
8873   echo "$as_me:8873: \$? = $ac_status" >&5
8874   (exit $ac_status); }; }; then
8875   :
8876 else
8877   echo "$as_me: failed program was:" >&5
8878 cat conftest.$ac_ext >&5
8879 cf_have_incdir=yes
8880 fi
8881 rm -f conftest.$ac_objext conftest.$ac_ext
8882                           CPPFLAGS=$cf_save_CPPFLAGS
8883                         fi
8884                   fi
8885                 fi
8886
8887                 if test "$cf_have_incdir" = no ; then
8888                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8889
8890 echo "${as_me:-configure}:8890: testing adding $cf_add_incdir to include-path ..." 1>&5
8891
8892                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8893
8894                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8895                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8896                   cf_add_incdir="$cf_top_incdir"
8897                 else
8898                   break
8899                 fi
8900           else
8901                 break
8902           fi
8903         done
8904   done
8905 fi
8906
8907 fi
8908
8909 # Set definitions to allow ifdef'ing for ncurses.h
8910
8911 case $cf_cv_ncurses_header in
8912 (*ncurses.h)
8913
8914 cat >>confdefs.h <<\EOF
8915 #define HAVE_NCURSES_H 1
8916 EOF
8917
8918         ;;
8919 esac
8920
8921 case $cf_cv_ncurses_header in
8922 (ncurses/curses.h|ncurses/ncurses.h)
8923
8924 cat >>confdefs.h <<\EOF
8925 #define HAVE_NCURSES_NCURSES_H 1
8926 EOF
8927
8928         ;;
8929 (ncursesw/curses.h|ncursesw/ncurses.h)
8930
8931 cat >>confdefs.h <<\EOF
8932 #define HAVE_NCURSESW_NCURSES_H 1
8933 EOF
8934
8935         ;;
8936 esac
8937
8938 echo "$as_me:8938: checking for terminfo header" >&5
8939 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8940 if test "${cf_cv_term_header+set}" = set; then
8941   echo $ECHO_N "(cached) $ECHO_C" >&6
8942 else
8943
8944 case ${cf_cv_ncurses_header} in
8945 (*/ncurses.h|*/ncursesw.h)
8946         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8947         ;;
8948 (*)
8949         cf_term_header=term.h
8950         ;;
8951 esac
8952
8953 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8954 do
8955 cat >conftest.$ac_ext <<_ACEOF
8956 #line 8956 "configure"
8957 #include "confdefs.h"
8958 #include <stdio.h>
8959 #include <${cf_cv_ncurses_header:-curses.h}>
8960 #include <$cf_test>
8961
8962 int
8963 main (void)
8964 {
8965 int x = auto_left_margin; (void)x
8966   ;
8967   return 0;
8968 }
8969 _ACEOF
8970 rm -f conftest.$ac_objext
8971 if { (eval echo "$as_me:8971: \"$ac_compile\"") >&5
8972   (eval $ac_compile) 2>&5
8973   ac_status=$?
8974   echo "$as_me:8974: \$? = $ac_status" >&5
8975   (exit $ac_status); } &&
8976          { ac_try='test -s conftest.$ac_objext'
8977   { (eval echo "$as_me:8977: \"$ac_try\"") >&5
8978   (eval $ac_try) 2>&5
8979   ac_status=$?
8980   echo "$as_me:8980: \$? = $ac_status" >&5
8981   (exit $ac_status); }; }; then
8982
8983         cf_cv_term_header="$cf_test"
8984 else
8985   echo "$as_me: failed program was:" >&5
8986 cat conftest.$ac_ext >&5
8987
8988         cf_cv_term_header=unknown
8989
8990 fi
8991 rm -f conftest.$ac_objext conftest.$ac_ext
8992         test "$cf_cv_term_header" != unknown && break
8993 done
8994
8995 fi
8996 echo "$as_me:8996: result: $cf_cv_term_header" >&5
8997 echo "${ECHO_T}$cf_cv_term_header" >&6
8998
8999 # Set definitions to allow ifdef'ing to accommodate subdirectories
9000
9001 case $cf_cv_term_header in
9002 (*term.h)
9003
9004 cat >>confdefs.h <<\EOF
9005 #define HAVE_TERM_H 1
9006 EOF
9007
9008         ;;
9009 esac
9010
9011 case $cf_cv_term_header in
9012 (ncurses/term.h)
9013
9014 cat >>confdefs.h <<\EOF
9015 #define HAVE_NCURSES_TERM_H 1
9016 EOF
9017
9018         ;;
9019 (ncursesw/term.h)
9020
9021 cat >>confdefs.h <<\EOF
9022 #define HAVE_NCURSESW_TERM_H 1
9023 EOF
9024
9025         ;;
9026 esac
9027
9028 # some applications need this, but should check for NCURSES_VERSION
9029
9030 cat >>confdefs.h <<\EOF
9031 #define NCURSES 1
9032 EOF
9033
9034 echo "$as_me:9034: checking for ncurses version" >&5
9035 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9036 if test "${cf_cv_ncurses_version+set}" = set; then
9037   echo $ECHO_N "(cached) $ECHO_C" >&6
9038 else
9039
9040         cf_cv_ncurses_version=no
9041         cf_tempfile=out$$
9042         rm -f $cf_tempfile
9043         if test "$cross_compiling" = yes; then
9044
9045         # This will not work if the preprocessor splits the line after the
9046         # Autoconf token.  The 'unproto' program does that.
9047         cat > conftest.$ac_ext <<EOF
9048 #include <${cf_cv_ncurses_header:-curses.h}>
9049 #undef Autoconf
9050 #ifdef NCURSES_VERSION
9051 Autoconf NCURSES_VERSION
9052 #else
9053 #ifdef __NCURSES_H
9054 Autoconf "old"
9055 #endif
9056 ;
9057 #endif
9058 EOF
9059         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9060         { (eval echo "$as_me:9060: \"$cf_try\"") >&5
9061   (eval $cf_try) 2>&5
9062   ac_status=$?
9063   echo "$as_me:9063: \$? = $ac_status" >&5
9064   (exit $ac_status); }
9065         if test -f conftest.out ; then
9066                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9067                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9068                 rm -f conftest.out
9069         fi
9070
9071 else
9072   cat >conftest.$ac_ext <<_ACEOF
9073 #line 9073 "configure"
9074 #include "confdefs.h"
9075
9076 #include <${cf_cv_ncurses_header:-curses.h}>
9077 #include <stdio.h>
9078 int main(void)
9079 {
9080         FILE *fp = fopen("$cf_tempfile", "w");
9081 #ifdef NCURSES_VERSION
9082 # ifdef NCURSES_VERSION_PATCH
9083         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9084 # else
9085         fprintf(fp, "%s\n", NCURSES_VERSION);
9086 # endif
9087 #else
9088 # ifdef __NCURSES_H
9089         fprintf(fp, "old\n");
9090 # else
9091         make an error
9092 # endif
9093 #endif
9094         ${cf_cv_main_return:-return}(0);
9095 }
9096 _ACEOF
9097 rm -f conftest$ac_exeext
9098 if { (eval echo "$as_me:9098: \"$ac_link\"") >&5
9099   (eval $ac_link) 2>&5
9100   ac_status=$?
9101   echo "$as_me:9101: \$? = $ac_status" >&5
9102   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9103   { (eval echo "$as_me:9103: \"$ac_try\"") >&5
9104   (eval $ac_try) 2>&5
9105   ac_status=$?
9106   echo "$as_me:9106: \$? = $ac_status" >&5
9107   (exit $ac_status); }; }; then
9108
9109         cf_cv_ncurses_version=`cat $cf_tempfile`
9110 else
9111   echo "$as_me: program exited with status $ac_status" >&5
9112 echo "$as_me: failed program was:" >&5
9113 cat conftest.$ac_ext >&5
9114 fi
9115 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9116 fi
9117         rm -f $cf_tempfile
9118
9119 fi
9120 echo "$as_me:9120: result: $cf_cv_ncurses_version" >&5
9121 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9122 test "$cf_cv_ncurses_version" = no ||
9123 cat >>confdefs.h <<\EOF
9124 #define NCURSES 1
9125 EOF
9126
9127 cf_nculib_root=$cf_cv_screen
9128         # This works, except for the special case where we find gpm, but
9129         # ncurses is in a nonstandard location via $LIBS, and we really want
9130         # to link gpm.
9131 cf_ncurses_LIBS=""
9132 cf_ncurses_SAVE="$LIBS"
9133 echo "$as_me:9133: checking for Gpm_Open in -lgpm" >&5
9134 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9135 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9136   echo $ECHO_N "(cached) $ECHO_C" >&6
9137 else
9138   ac_check_lib_save_LIBS=$LIBS
9139 LIBS="-lgpm  $LIBS"
9140 cat >conftest.$ac_ext <<_ACEOF
9141 #line 9141 "configure"
9142 #include "confdefs.h"
9143
9144 /* Override any gcc2 internal prototype to avoid an error.  */
9145 #ifdef __cplusplus
9146 extern "C"
9147 #endif
9148 /* We use char because int might match the return type of a gcc2
9149    builtin and then its argument prototype would still apply.  */
9150 char Gpm_Open ();
9151 int
9152 main (void)
9153 {
9154 Gpm_Open ();
9155   ;
9156   return 0;
9157 }
9158 _ACEOF
9159 rm -f conftest.$ac_objext conftest$ac_exeext
9160 if { (eval echo "$as_me:9160: \"$ac_link\"") >&5
9161   (eval $ac_link) 2>&5
9162   ac_status=$?
9163   echo "$as_me:9163: \$? = $ac_status" >&5
9164   (exit $ac_status); } &&
9165          { ac_try='test -s conftest$ac_exeext'
9166   { (eval echo "$as_me:9166: \"$ac_try\"") >&5
9167   (eval $ac_try) 2>&5
9168   ac_status=$?
9169   echo "$as_me:9169: \$? = $ac_status" >&5
9170   (exit $ac_status); }; }; then
9171   ac_cv_lib_gpm_Gpm_Open=yes
9172 else
9173   echo "$as_me: failed program was:" >&5
9174 cat conftest.$ac_ext >&5
9175 ac_cv_lib_gpm_Gpm_Open=no
9176 fi
9177 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9178 LIBS=$ac_check_lib_save_LIBS
9179 fi
9180 echo "$as_me:9180: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9181 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9182 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9183   echo "$as_me:9183: checking for initscr in -lgpm" >&5
9184 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9185 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9186   echo $ECHO_N "(cached) $ECHO_C" >&6
9187 else
9188   ac_check_lib_save_LIBS=$LIBS
9189 LIBS="-lgpm  $LIBS"
9190 cat >conftest.$ac_ext <<_ACEOF
9191 #line 9191 "configure"
9192 #include "confdefs.h"
9193
9194 /* Override any gcc2 internal prototype to avoid an error.  */
9195 #ifdef __cplusplus
9196 extern "C"
9197 #endif
9198 /* We use char because int might match the return type of a gcc2
9199    builtin and then its argument prototype would still apply.  */
9200 char initscr ();
9201 int
9202 main (void)
9203 {
9204 initscr ();
9205   ;
9206   return 0;
9207 }
9208 _ACEOF
9209 rm -f conftest.$ac_objext conftest$ac_exeext
9210 if { (eval echo "$as_me:9210: \"$ac_link\"") >&5
9211   (eval $ac_link) 2>&5
9212   ac_status=$?
9213   echo "$as_me:9213: \$? = $ac_status" >&5
9214   (exit $ac_status); } &&
9215          { ac_try='test -s conftest$ac_exeext'
9216   { (eval echo "$as_me:9216: \"$ac_try\"") >&5
9217   (eval $ac_try) 2>&5
9218   ac_status=$?
9219   echo "$as_me:9219: \$? = $ac_status" >&5
9220   (exit $ac_status); }; }; then
9221   ac_cv_lib_gpm_initscr=yes
9222 else
9223   echo "$as_me: failed program was:" >&5
9224 cat conftest.$ac_ext >&5
9225 ac_cv_lib_gpm_initscr=no
9226 fi
9227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9228 LIBS=$ac_check_lib_save_LIBS
9229 fi
9230 echo "$as_me:9230: result: $ac_cv_lib_gpm_initscr" >&5
9231 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9232 if test $ac_cv_lib_gpm_initscr = yes; then
9233   LIBS="$cf_ncurses_SAVE"
9234 else
9235   cf_ncurses_LIBS="-lgpm"
9236 fi
9237
9238 fi
9239
9240 case $host_os in
9241 (freebsd*)
9242         # This is only necessary if you are linking against an obsolete
9243         # version of ncurses (but it should do no harm, since it's static).
9244         if test "$cf_nculib_root" = ncurses ; then
9245                 echo "$as_me:9245: checking for tgoto in -lmytinfo" >&5
9246 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9247 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9248   echo $ECHO_N "(cached) $ECHO_C" >&6
9249 else
9250   ac_check_lib_save_LIBS=$LIBS
9251 LIBS="-lmytinfo  $LIBS"
9252 cat >conftest.$ac_ext <<_ACEOF
9253 #line 9253 "configure"
9254 #include "confdefs.h"
9255
9256 /* Override any gcc2 internal prototype to avoid an error.  */
9257 #ifdef __cplusplus
9258 extern "C"
9259 #endif
9260 /* We use char because int might match the return type of a gcc2
9261    builtin and then its argument prototype would still apply.  */
9262 char tgoto ();
9263 int
9264 main (void)
9265 {
9266 tgoto ();
9267   ;
9268   return 0;
9269 }
9270 _ACEOF
9271 rm -f conftest.$ac_objext conftest$ac_exeext
9272 if { (eval echo "$as_me:9272: \"$ac_link\"") >&5
9273   (eval $ac_link) 2>&5
9274   ac_status=$?
9275   echo "$as_me:9275: \$? = $ac_status" >&5
9276   (exit $ac_status); } &&
9277          { ac_try='test -s conftest$ac_exeext'
9278   { (eval echo "$as_me:9278: \"$ac_try\"") >&5
9279   (eval $ac_try) 2>&5
9280   ac_status=$?
9281   echo "$as_me:9281: \$? = $ac_status" >&5
9282   (exit $ac_status); }; }; then
9283   ac_cv_lib_mytinfo_tgoto=yes
9284 else
9285   echo "$as_me: failed program was:" >&5
9286 cat conftest.$ac_ext >&5
9287 ac_cv_lib_mytinfo_tgoto=no
9288 fi
9289 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9290 LIBS=$ac_check_lib_save_LIBS
9291 fi
9292 echo "$as_me:9292: result: $ac_cv_lib_mytinfo_tgoto" >&5
9293 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9294 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9295   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9296 fi
9297
9298         fi
9299         ;;
9300 esac
9301
9302 cf_add_libs="$LIBS"
9303 # reverse order
9304 cf_add_0lib=
9305 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9306 # filter duplicates
9307 for cf_add_1lib in $cf_add_0lib; do
9308         for cf_add_2lib in $cf_add_libs; do
9309                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9310                         cf_add_1lib=
9311                         break
9312                 fi
9313         done
9314         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9315 done
9316 LIBS="$cf_add_libs"
9317
9318 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9319 then
9320
9321 cf_add_libs="$LIBS"
9322 # reverse order
9323 cf_add_0lib=
9324 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9325 # filter duplicates
9326 for cf_add_1lib in $cf_add_0lib; do
9327         for cf_add_2lib in $cf_add_libs; do
9328                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9329                         cf_add_1lib=
9330                         break
9331                 fi
9332         done
9333         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9334 done
9335 LIBS="$cf_add_libs"
9336
9337 else
9338
9339         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9340         cf_libdir=""
9341         echo "$as_me:9341: checking for initscr" >&5
9342 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9343 if test "${ac_cv_func_initscr+set}" = set; then
9344   echo $ECHO_N "(cached) $ECHO_C" >&6
9345 else
9346   cat >conftest.$ac_ext <<_ACEOF
9347 #line 9347 "configure"
9348 #include "confdefs.h"
9349 #define initscr autoconf_temporary
9350 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
9351 #undef initscr
9352
9353 #ifdef __cplusplus
9354 extern "C"
9355 #endif
9356
9357 /* We use char because int might match the return type of a gcc2
9358    builtin and then its argument prototype would still apply.  */
9359 char initscr (void);
9360
9361 int
9362 main (void)
9363 {
9364
9365 /* The GNU C library defines stubs for functions which it implements
9366     to always fail with ENOSYS.  Some functions are actually named
9367     something starting with __ and the normal name is an alias.  */
9368 #if defined (__stub_initscr) || defined (__stub___initscr)
9369 #error found stub for initscr
9370 #endif
9371
9372         return initscr ();
9373   ;
9374   return 0;
9375 }
9376 _ACEOF
9377 rm -f conftest.$ac_objext conftest$ac_exeext
9378 if { (eval echo "$as_me:9378: \"$ac_link\"") >&5
9379   (eval $ac_link) 2>&5
9380   ac_status=$?
9381   echo "$as_me:9381: \$? = $ac_status" >&5
9382   (exit $ac_status); } &&
9383          { ac_try='test -s conftest$ac_exeext'
9384   { (eval echo "$as_me:9384: \"$ac_try\"") >&5
9385   (eval $ac_try) 2>&5
9386   ac_status=$?
9387   echo "$as_me:9387: \$? = $ac_status" >&5
9388   (exit $ac_status); }; }; then
9389   ac_cv_func_initscr=yes
9390 else
9391   echo "$as_me: failed program was:" >&5
9392 cat conftest.$ac_ext >&5
9393 ac_cv_func_initscr=no
9394 fi
9395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9396 fi
9397 echo "$as_me:9397: result: $ac_cv_func_initscr" >&5
9398 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9399 if test $ac_cv_func_initscr = yes; then
9400   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9401 else
9402
9403                 cf_save_LIBS="$LIBS"
9404                 echo "$as_me:9404: checking for initscr in -l$cf_nculib_root" >&5
9405 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9406                 LIBS="-l$cf_nculib_root $LIBS"
9407                 cat >conftest.$ac_ext <<_ACEOF
9408 #line 9408 "configure"
9409 #include "confdefs.h"
9410 #include <${cf_cv_ncurses_header:-curses.h}>
9411 int
9412 main (void)
9413 {
9414 initscr()
9415   ;
9416   return 0;
9417 }
9418 _ACEOF
9419 rm -f conftest.$ac_objext conftest$ac_exeext
9420 if { (eval echo "$as_me:9420: \"$ac_link\"") >&5
9421   (eval $ac_link) 2>&5
9422   ac_status=$?
9423   echo "$as_me:9423: \$? = $ac_status" >&5
9424   (exit $ac_status); } &&
9425          { ac_try='test -s conftest$ac_exeext'
9426   { (eval echo "$as_me:9426: \"$ac_try\"") >&5
9427   (eval $ac_try) 2>&5
9428   ac_status=$?
9429   echo "$as_me:9429: \$? = $ac_status" >&5
9430   (exit $ac_status); }; }; then
9431   echo "$as_me:9431: result: yes" >&5
9432 echo "${ECHO_T}yes" >&6
9433                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9434
9435 else
9436   echo "$as_me: failed program was:" >&5
9437 cat conftest.$ac_ext >&5
9438 echo "$as_me:9438: result: no" >&5
9439 echo "${ECHO_T}no" >&6
9440
9441 cf_search=
9442 cf_library_path_list=""
9443 if test -n "${LDFLAGS}${LIBS}" ; then
9444         for cf_library_path in $LDFLAGS $LIBS
9445         do
9446                 case $cf_library_path in
9447                 (-L*)
9448                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9449
9450 test "x$cf_library_path" != "xNONE" && \
9451 test -d "$cf_library_path" && \
9452  {
9453         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9454         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9455         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9456         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9457         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9458         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"
9459 }
9460
9461                         cf_library_path_list="$cf_library_path_list $cf_search"
9462                         ;;
9463                 esac
9464         done
9465 fi
9466
9467 cf_search=
9468
9469 test "x$prefix" != "xNONE" && \
9470 test -d "$prefix" && \
9471  {
9472         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9473         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9474         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9475         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9476         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9477         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9478 }
9479
9480 for cf_subdir_prefix in \
9481         /usr \
9482         /usr/local \
9483         /usr/pkg \
9484         /opt \
9485         /opt/local \
9486         $HOME
9487 do
9488
9489 test "x$cf_subdir_prefix" != "x$prefix" && \
9490 test -d "$cf_subdir_prefix" && \
9491 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9492         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9493         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9494         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9495         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9496         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9497         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"
9498 }
9499
9500 done
9501
9502 cf_search="$cf_library_path_list $cf_search"
9503
9504                         for cf_libdir in $cf_search
9505                         do
9506                                 echo "$as_me:9506: checking for -l$cf_nculib_root in $cf_libdir" >&5
9507 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9508                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9509                                 cat >conftest.$ac_ext <<_ACEOF
9510 #line 9510 "configure"
9511 #include "confdefs.h"
9512 #include <${cf_cv_ncurses_header:-curses.h}>
9513 int
9514 main (void)
9515 {
9516 initscr()
9517   ;
9518   return 0;
9519 }
9520 _ACEOF
9521 rm -f conftest.$ac_objext conftest$ac_exeext
9522 if { (eval echo "$as_me:9522: \"$ac_link\"") >&5
9523   (eval $ac_link) 2>&5
9524   ac_status=$?
9525   echo "$as_me:9525: \$? = $ac_status" >&5
9526   (exit $ac_status); } &&
9527          { ac_try='test -s conftest$ac_exeext'
9528   { (eval echo "$as_me:9528: \"$ac_try\"") >&5
9529   (eval $ac_try) 2>&5
9530   ac_status=$?
9531   echo "$as_me:9531: \$? = $ac_status" >&5
9532   (exit $ac_status); }; }; then
9533   echo "$as_me:9533: result: yes" >&5
9534 echo "${ECHO_T}yes" >&6
9535                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9536                                          break
9537 else
9538   echo "$as_me: failed program was:" >&5
9539 cat conftest.$ac_ext >&5
9540 echo "$as_me:9540: result: no" >&5
9541 echo "${ECHO_T}no" >&6
9542                                          LIBS="$cf_save_LIBS"
9543 fi
9544 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9545                         done
9546
9547 fi
9548 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9549
9550 fi
9551
9552 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9553
9554 if test $cf_found_library = no ; then
9555         { { echo "$as_me:9555: error: Cannot link $cf_nculib_root library" >&5
9556 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9557    { (exit 1); exit 1; }; }
9558 fi
9559
9560 fi
9561
9562 if test -n "$cf_ncurses_LIBS" ; then
9563         echo "$as_me:9563: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9564 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9565         cf_ncurses_SAVE="$LIBS"
9566         for p in $cf_ncurses_LIBS ; do
9567                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9568                 if test "$q" != "$LIBS" ; then
9569                         LIBS="$q"
9570                 fi
9571         done
9572         cat >conftest.$ac_ext <<_ACEOF
9573 #line 9573 "configure"
9574 #include "confdefs.h"
9575 #include <${cf_cv_ncurses_header:-curses.h}>
9576 int
9577 main (void)
9578 {
9579 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9580   ;
9581   return 0;
9582 }
9583 _ACEOF
9584 rm -f conftest.$ac_objext conftest$ac_exeext
9585 if { (eval echo "$as_me:9585: \"$ac_link\"") >&5
9586   (eval $ac_link) 2>&5
9587   ac_status=$?
9588   echo "$as_me:9588: \$? = $ac_status" >&5
9589   (exit $ac_status); } &&
9590          { ac_try='test -s conftest$ac_exeext'
9591   { (eval echo "$as_me:9591: \"$ac_try\"") >&5
9592   (eval $ac_try) 2>&5
9593   ac_status=$?
9594   echo "$as_me:9594: \$? = $ac_status" >&5
9595   (exit $ac_status); }; }; then
9596   echo "$as_me:9596: result: yes" >&5
9597 echo "${ECHO_T}yes" >&6
9598 else
9599   echo "$as_me: failed program was:" >&5
9600 cat conftest.$ac_ext >&5
9601 echo "$as_me:9601: result: no" >&5
9602 echo "${ECHO_T}no" >&6
9603                  LIBS="$cf_ncurses_SAVE"
9604 fi
9605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9606 fi
9607
9608 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9609
9610 cat >>confdefs.h <<EOF
9611 #define $cf_nculib_ROOT 1
9612 EOF
9613
9614         fi
9615 else
9616         NCURSES_CONFIG=none
9617 fi
9618
9619         ;;
9620 (ncurses*)
9621
9622 cf_ncuconfig_root=$cf_cv_screen
9623 cf_have_ncuconfig=no
9624
9625 if test "x${PKG_CONFIG:=none}" != xnone; then
9626         echo "$as_me:9626: checking pkg-config for $cf_ncuconfig_root" >&5
9627 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9628         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9629                 echo "$as_me:9629: result: yes" >&5
9630 echo "${ECHO_T}yes" >&6
9631
9632                 echo "$as_me:9632: checking if the $cf_ncuconfig_root package files work" >&5
9633 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9634                 cf_have_ncuconfig=unknown
9635
9636                 cf_save_CFLAGS="$CFLAGS"
9637                 cf_save_CPPFLAGS="$CPPFLAGS"
9638                 cf_save_LIBS="$LIBS"
9639
9640                 cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root`
9641                 cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root`
9642
9643                 # while -W for passing linker flags is prevalent, it is not "standard".
9644                 # At least one wrapper for c89/c99 (in Apple's xcode) has its own
9645                 # incompatible _and_ non-standard -W option which gives an error.  Work
9646                 # around that pitfall.
9647                 case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in
9648                 (x*c[89]9@@*-W*)
9649
9650 cf_fix_cppflags=no
9651 cf_new_cflags=
9652 cf_new_cppflags=
9653 cf_new_extra_cppflags=
9654
9655 for cf_add_cflags in $cf_pkg_cflags
9656 do
9657 case $cf_fix_cppflags in
9658 (no)
9659         case $cf_add_cflags in
9660         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9661                 case $cf_add_cflags in
9662                 (-D*)
9663                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9664
9665                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9666                                 && test -z "${cf_tst_cflags}" \
9667                                 && cf_fix_cppflags=yes
9668
9669                         if test $cf_fix_cppflags = yes ; then
9670
9671         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9672         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9673
9674                                 continue
9675                         elif test "${cf_tst_cflags}" = "\"'" ; then
9676
9677         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9678         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9679
9680                                 continue
9681                         fi
9682                         ;;
9683                 esac
9684                 case "$CPPFLAGS" in
9685                 (*$cf_add_cflags)
9686                         ;;
9687                 (*)
9688                         case $cf_add_cflags in
9689                         (-D*)
9690                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9691
9692 CPPFLAGS=`echo "$CPPFLAGS" | \
9693         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9694                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9695
9696                                 ;;
9697                         esac
9698
9699         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9700         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9701
9702                         ;;
9703                 esac
9704                 ;;
9705         (*)
9706
9707         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9708         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9709
9710                 ;;
9711         esac
9712         ;;
9713 (yes)
9714
9715         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9716         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9717
9718         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9719
9720         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9721                 && test -z "${cf_tst_cflags}" \
9722                 && cf_fix_cppflags=no
9723         ;;
9724 esac
9725 done
9726
9727 if test -n "$cf_new_cflags" ; then
9728
9729         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9730         CFLAGS="${CFLAGS}$cf_new_cflags"
9731
9732 fi
9733
9734 if test -n "$cf_new_cppflags" ; then
9735
9736         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9737         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9738
9739 fi
9740
9741 if test -n "$cf_new_extra_cppflags" ; then
9742
9743         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9744         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9745
9746 fi
9747
9748 cf_add_libs="$LIBS"
9749 # reverse order
9750 cf_add_0lib=
9751 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9752 # filter duplicates
9753 for cf_add_1lib in $cf_add_0lib; do
9754         for cf_add_2lib in $cf_add_libs; do
9755                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9756                         cf_add_1lib=
9757                         break
9758                 fi
9759         done
9760         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9761 done
9762 LIBS="$cf_add_libs"
9763
9764                         cat >conftest.$ac_ext <<_ACEOF
9765 #line 9765 "configure"
9766 #include "confdefs.h"
9767 #include <${cf_cv_ncurses_header:-curses.h}>
9768 int
9769 main (void)
9770 {
9771 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9772   ;
9773   return 0;
9774 }
9775 _ACEOF
9776 rm -f conftest.$ac_objext conftest$ac_exeext
9777 if { (eval echo "$as_me:9777: \"$ac_link\"") >&5
9778   (eval $ac_link) 2>&5
9779   ac_status=$?
9780   echo "$as_me:9780: \$? = $ac_status" >&5
9781   (exit $ac_status); } &&
9782          { ac_try='test -s conftest$ac_exeext'
9783   { (eval echo "$as_me:9783: \"$ac_try\"") >&5
9784   (eval $ac_try) 2>&5
9785   ac_status=$?
9786   echo "$as_me:9786: \$? = $ac_status" >&5
9787   (exit $ac_status); }; }; then
9788   if test "$cross_compiling" = yes; then
9789   cf_test_ncuconfig=maybe
9790 else
9791   cat >conftest.$ac_ext <<_ACEOF
9792 #line 9792 "configure"
9793 #include "confdefs.h"
9794 #include <${cf_cv_ncurses_header:-curses.h}>
9795                                         int main(void)
9796                                         { char *xx = curses_version(); return (xx == 0); }
9797 _ACEOF
9798 rm -f conftest$ac_exeext
9799 if { (eval echo "$as_me:9799: \"$ac_link\"") >&5
9800   (eval $ac_link) 2>&5
9801   ac_status=$?
9802   echo "$as_me:9802: \$? = $ac_status" >&5
9803   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9804   { (eval echo "$as_me:9804: \"$ac_try\"") >&5
9805   (eval $ac_try) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); }; }; then
9809   cf_test_ncuconfig=yes
9810 else
9811   echo "$as_me: program exited with status $ac_status" >&5
9812 echo "$as_me: failed program was:" >&5
9813 cat conftest.$ac_ext >&5
9814 cf_test_ncuconfig=no
9815 fi
9816 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9817 fi
9818 else
9819   echo "$as_me: failed program was:" >&5
9820 cat conftest.$ac_ext >&5
9821 cf_test_ncuconfig=no
9822 fi
9823 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9824
9825                         CFLAGS="$cf_save_CFLAGS"
9826                         CPPFLAGS="$cf_save_CPPFLAGS"
9827                         LIBS="$cf_save_LIBS"
9828
9829                         if test "x$cf_test_ncuconfig" != xyes; then
9830                                 cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^      ]*//g'`
9831                                 cf_pkg_cflags="$cf_temp"
9832                                 cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^        ]*//g'`
9833                                 cf_pkg_libs="$cf_temp"
9834                         fi
9835                         ;;
9836                 esac
9837
9838 cf_fix_cppflags=no
9839 cf_new_cflags=
9840 cf_new_cppflags=
9841 cf_new_extra_cppflags=
9842
9843 for cf_add_cflags in $cf_pkg_cflags
9844 do
9845 case $cf_fix_cppflags in
9846 (no)
9847         case $cf_add_cflags in
9848         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9849                 case $cf_add_cflags in
9850                 (-D*)
9851                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9852
9853                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9854                                 && test -z "${cf_tst_cflags}" \
9855                                 && cf_fix_cppflags=yes
9856
9857                         if test $cf_fix_cppflags = yes ; then
9858
9859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9861
9862                                 continue
9863                         elif test "${cf_tst_cflags}" = "\"'" ; then
9864
9865         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9866         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9867
9868                                 continue
9869                         fi
9870                         ;;
9871                 esac
9872                 case "$CPPFLAGS" in
9873                 (*$cf_add_cflags)
9874                         ;;
9875                 (*)
9876                         case $cf_add_cflags in
9877                         (-D*)
9878                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9879
9880 CPPFLAGS=`echo "$CPPFLAGS" | \
9881         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9882                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9883
9884                                 ;;
9885                         esac
9886
9887         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9888         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9889
9890                         ;;
9891                 esac
9892                 ;;
9893         (*)
9894
9895         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9896         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9897
9898                 ;;
9899         esac
9900         ;;
9901 (yes)
9902
9903         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9904         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9905
9906         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9907
9908         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9909                 && test -z "${cf_tst_cflags}" \
9910                 && cf_fix_cppflags=no
9911         ;;
9912 esac
9913 done
9914
9915 if test -n "$cf_new_cflags" ; then
9916
9917         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9918         CFLAGS="${CFLAGS}$cf_new_cflags"
9919
9920 fi
9921
9922 if test -n "$cf_new_cppflags" ; then
9923
9924         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9925         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9926
9927 fi
9928
9929 if test -n "$cf_new_extra_cppflags" ; then
9930
9931         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9932         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9933
9934 fi
9935
9936 cf_add_libs="$LIBS"
9937 # reverse order
9938 cf_add_0lib=
9939 for cf_add_1lib in $cf_pkg_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
9940 # filter duplicates
9941 for cf_add_1lib in $cf_add_0lib; do
9942         for cf_add_2lib in $cf_add_libs; do
9943                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
9944                         cf_add_1lib=
9945                         break
9946                 fi
9947         done
9948         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
9949 done
9950 LIBS="$cf_add_libs"
9951
9952                 cat >conftest.$ac_ext <<_ACEOF
9953 #line 9953 "configure"
9954 #include "confdefs.h"
9955 #include <${cf_cv_ncurses_header:-curses.h}>
9956 int
9957 main (void)
9958 {
9959 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9960   ;
9961   return 0;
9962 }
9963 _ACEOF
9964 rm -f conftest.$ac_objext conftest$ac_exeext
9965 if { (eval echo "$as_me:9965: \"$ac_link\"") >&5
9966   (eval $ac_link) 2>&5
9967   ac_status=$?
9968   echo "$as_me:9968: \$? = $ac_status" >&5
9969   (exit $ac_status); } &&
9970          { ac_try='test -s conftest$ac_exeext'
9971   { (eval echo "$as_me:9971: \"$ac_try\"") >&5
9972   (eval $ac_try) 2>&5
9973   ac_status=$?
9974   echo "$as_me:9974: \$? = $ac_status" >&5
9975   (exit $ac_status); }; }; then
9976   if test "$cross_compiling" = yes; then
9977   cf_have_ncuconfig=maybe
9978 else
9979   cat >conftest.$ac_ext <<_ACEOF
9980 #line 9980 "configure"
9981 #include "confdefs.h"
9982 #include <${cf_cv_ncurses_header:-curses.h}>
9983                                 int main(void)
9984                                 { char *xx = curses_version(); return (xx == 0); }
9985 _ACEOF
9986 rm -f conftest$ac_exeext
9987 if { (eval echo "$as_me:9987: \"$ac_link\"") >&5
9988   (eval $ac_link) 2>&5
9989   ac_status=$?
9990   echo "$as_me:9990: \$? = $ac_status" >&5
9991   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9992   { (eval echo "$as_me:9992: \"$ac_try\"") >&5
9993   (eval $ac_try) 2>&5
9994   ac_status=$?
9995   echo "$as_me:9995: \$? = $ac_status" >&5
9996   (exit $ac_status); }; }; then
9997   cf_have_ncuconfig=yes
9998 else
9999   echo "$as_me: program exited with status $ac_status" >&5
10000 echo "$as_me: failed program was:" >&5
10001 cat conftest.$ac_ext >&5
10002 cf_have_ncuconfig=no
10003 fi
10004 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10005 fi
10006 else
10007   echo "$as_me: failed program was:" >&5
10008 cat conftest.$ac_ext >&5
10009 cf_have_ncuconfig=no
10010 fi
10011 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10012                 echo "$as_me:10012: result: $cf_have_ncuconfig" >&5
10013 echo "${ECHO_T}$cf_have_ncuconfig" >&6
10014                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
10015                 if test "$cf_have_ncuconfig" != "yes"
10016                 then
10017                         CPPFLAGS="$cf_save_CPPFLAGS"
10018                         LIBS="$cf_save_LIBS"
10019                         NCURSES_CONFIG_PKG=none
10020                 else
10021
10022 cat >>confdefs.h <<\EOF
10023 #define NCURSES 1
10024 EOF
10025
10026                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
10027
10028 echo "$as_me:10028: checking for terminfo header" >&5
10029 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10030 if test "${cf_cv_term_header+set}" = set; then
10031   echo $ECHO_N "(cached) $ECHO_C" >&6
10032 else
10033
10034 case ${cf_cv_ncurses_header} in
10035 (*/ncurses.h|*/ncursesw.h)
10036         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10037         ;;
10038 (*)
10039         cf_term_header=term.h
10040         ;;
10041 esac
10042
10043 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10044 do
10045 cat >conftest.$ac_ext <<_ACEOF
10046 #line 10046 "configure"
10047 #include "confdefs.h"
10048 #include <stdio.h>
10049 #include <${cf_cv_ncurses_header:-curses.h}>
10050 #include <$cf_test>
10051
10052 int
10053 main (void)
10054 {
10055 int x = auto_left_margin; (void)x
10056   ;
10057   return 0;
10058 }
10059 _ACEOF
10060 rm -f conftest.$ac_objext
10061 if { (eval echo "$as_me:10061: \"$ac_compile\"") >&5
10062   (eval $ac_compile) 2>&5
10063   ac_status=$?
10064   echo "$as_me:10064: \$? = $ac_status" >&5
10065   (exit $ac_status); } &&
10066          { ac_try='test -s conftest.$ac_objext'
10067   { (eval echo "$as_me:10067: \"$ac_try\"") >&5
10068   (eval $ac_try) 2>&5
10069   ac_status=$?
10070   echo "$as_me:10070: \$? = $ac_status" >&5
10071   (exit $ac_status); }; }; then
10072
10073         cf_cv_term_header="$cf_test"
10074 else
10075   echo "$as_me: failed program was:" >&5
10076 cat conftest.$ac_ext >&5
10077
10078         cf_cv_term_header=unknown
10079
10080 fi
10081 rm -f conftest.$ac_objext conftest.$ac_ext
10082         test "$cf_cv_term_header" != unknown && break
10083 done
10084
10085 fi
10086 echo "$as_me:10086: result: $cf_cv_term_header" >&5
10087 echo "${ECHO_T}$cf_cv_term_header" >&6
10088
10089 # Set definitions to allow ifdef'ing to accommodate subdirectories
10090
10091 case $cf_cv_term_header in
10092 (*term.h)
10093
10094 cat >>confdefs.h <<\EOF
10095 #define HAVE_TERM_H 1
10096 EOF
10097
10098         ;;
10099 esac
10100
10101 case $cf_cv_term_header in
10102 (ncurses/term.h)
10103
10104 cat >>confdefs.h <<\EOF
10105 #define HAVE_NCURSES_TERM_H 1
10106 EOF
10107
10108         ;;
10109 (ncursesw/term.h)
10110
10111 cat >>confdefs.h <<\EOF
10112 #define HAVE_NCURSESW_TERM_H 1
10113 EOF
10114
10115         ;;
10116 esac
10117
10118                 fi
10119
10120         else
10121                 echo "$as_me:10121: result: no" >&5
10122 echo "${ECHO_T}no" >&6
10123                 NCURSES_CONFIG_PKG=none
10124         fi
10125 else
10126         NCURSES_CONFIG_PKG=none
10127 fi
10128
10129 if test "x$cf_have_ncuconfig" = "xno"; then
10130         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
10131
10132 if test -n "$ac_tool_prefix"; then
10133   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10134   do
10135     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
10136 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
10137 echo "$as_me:10137: checking for $ac_word" >&5
10138 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10139 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
10140   echo $ECHO_N "(cached) $ECHO_C" >&6
10141 else
10142   if test -n "$NCURSES_CONFIG"; then
10143   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
10144 else
10145   ac_save_IFS=$IFS; IFS=$ac_path_separator
10146 ac_dummy="$PATH"
10147 for ac_dir in $ac_dummy; do
10148   IFS=$ac_save_IFS
10149   test -z "$ac_dir" && ac_dir=.
10150   $as_executable_p "$ac_dir/$ac_word" || continue
10151 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
10152 echo "$as_me:10152: found $ac_dir/$ac_word" >&5
10153 break
10154 done
10155
10156 fi
10157 fi
10158 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
10159 if test -n "$NCURSES_CONFIG"; then
10160   echo "$as_me:10160: result: $NCURSES_CONFIG" >&5
10161 echo "${ECHO_T}$NCURSES_CONFIG" >&6
10162 else
10163   echo "$as_me:10163: result: no" >&5
10164 echo "${ECHO_T}no" >&6
10165 fi
10166
10167     test -n "$NCURSES_CONFIG" && break
10168   done
10169 fi
10170 if test -z "$NCURSES_CONFIG"; then
10171   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
10172   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
10173 do
10174   # Extract the first word of "$ac_prog", so it can be a program name with args.
10175 set dummy $ac_prog; ac_word=$2
10176 echo "$as_me:10176: checking for $ac_word" >&5
10177 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
10178 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
10179   echo $ECHO_N "(cached) $ECHO_C" >&6
10180 else
10181   if test -n "$ac_ct_NCURSES_CONFIG"; then
10182   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
10183 else
10184   ac_save_IFS=$IFS; IFS=$ac_path_separator
10185 ac_dummy="$PATH"
10186 for ac_dir in $ac_dummy; do
10187   IFS=$ac_save_IFS
10188   test -z "$ac_dir" && ac_dir=.
10189   $as_executable_p "$ac_dir/$ac_word" || continue
10190 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
10191 echo "$as_me:10191: found $ac_dir/$ac_word" >&5
10192 break
10193 done
10194
10195 fi
10196 fi
10197 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
10198 if test -n "$ac_ct_NCURSES_CONFIG"; then
10199   echo "$as_me:10199: result: $ac_ct_NCURSES_CONFIG" >&5
10200 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
10201 else
10202   echo "$as_me:10202: result: no" >&5
10203 echo "${ECHO_T}no" >&6
10204 fi
10205
10206   test -n "$ac_ct_NCURSES_CONFIG" && break
10207 done
10208 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
10209
10210   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
10211 fi
10212
10213         if test "$NCURSES_CONFIG" != none ; then
10214
10215 cf_fix_cppflags=no
10216 cf_new_cflags=
10217 cf_new_cppflags=
10218 cf_new_extra_cppflags=
10219
10220 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
10221 do
10222 case $cf_fix_cppflags in
10223 (no)
10224         case $cf_add_cflags in
10225         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
10226                 case $cf_add_cflags in
10227                 (-D*)
10228                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
10229
10230                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10231                                 && test -z "${cf_tst_cflags}" \
10232                                 && cf_fix_cppflags=yes
10233
10234                         if test $cf_fix_cppflags = yes ; then
10235
10236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10238
10239                                 continue
10240                         elif test "${cf_tst_cflags}" = "\"'" ; then
10241
10242         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10243         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10244
10245                                 continue
10246                         fi
10247                         ;;
10248                 esac
10249                 case "$CPPFLAGS" in
10250                 (*$cf_add_cflags)
10251                         ;;
10252                 (*)
10253                         case $cf_add_cflags in
10254                         (-D*)
10255                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
10256
10257 CPPFLAGS=`echo "$CPPFLAGS" | \
10258         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
10259                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
10260
10261                                 ;;
10262                         esac
10263
10264         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
10265         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
10266
10267                         ;;
10268                 esac
10269                 ;;
10270         (*)
10271
10272         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
10273         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
10274
10275                 ;;
10276         esac
10277         ;;
10278 (yes)
10279
10280         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
10281         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
10282
10283         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
10284
10285         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
10286                 && test -z "${cf_tst_cflags}" \
10287                 && cf_fix_cppflags=no
10288         ;;
10289 esac
10290 done
10291
10292 if test -n "$cf_new_cflags" ; then
10293
10294         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
10295         CFLAGS="${CFLAGS}$cf_new_cflags"
10296
10297 fi
10298
10299 if test -n "$cf_new_cppflags" ; then
10300
10301         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10302         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
10303
10304 fi
10305
10306 if test -n "$cf_new_extra_cppflags" ; then
10307
10308         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
10309         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
10310
10311 fi
10312
10313 cf_add_libs="$LIBS"
10314 # reverse order
10315 cf_add_0lib=
10316 for cf_add_1lib in `$NCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
10317 # filter duplicates
10318 for cf_add_1lib in $cf_add_0lib; do
10319         for cf_add_2lib in $cf_add_libs; do
10320                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
10321                         cf_add_1lib=
10322                         break
10323                 fi
10324         done
10325         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
10326 done
10327 LIBS="$cf_add_libs"
10328
10329                 # even with config script, some packages use no-override for curses.h
10330
10331 echo "$as_me:10331: checking if we have identified curses headers" >&5
10332 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
10333 if test "${cf_cv_ncurses_header+set}" = set; then
10334   echo $ECHO_N "(cached) $ECHO_C" >&6
10335 else
10336
10337 cf_cv_ncurses_header=none
10338 for cf_header in \
10339         ncurses.h $cf_cv_screen/ncurses.h \
10340         curses.h $cf_cv_screen/curses.h
10341 do
10342 cat >conftest.$ac_ext <<_ACEOF
10343 #line 10343 "configure"
10344 #include "confdefs.h"
10345 #include <${cf_header}>
10346 int
10347 main (void)
10348 {
10349 initscr(); tgoto("?", 0,0)
10350   ;
10351   return 0;
10352 }
10353 _ACEOF
10354 rm -f conftest.$ac_objext
10355 if { (eval echo "$as_me:10355: \"$ac_compile\"") >&5
10356   (eval $ac_compile) 2>&5
10357   ac_status=$?
10358   echo "$as_me:10358: \$? = $ac_status" >&5
10359   (exit $ac_status); } &&
10360          { ac_try='test -s conftest.$ac_objext'
10361   { (eval echo "$as_me:10361: \"$ac_try\"") >&5
10362   (eval $ac_try) 2>&5
10363   ac_status=$?
10364   echo "$as_me:10364: \$? = $ac_status" >&5
10365   (exit $ac_status); }; }; then
10366   cf_cv_ncurses_header=$cf_header; break
10367 else
10368   echo "$as_me: failed program was:" >&5
10369 cat conftest.$ac_ext >&5
10370 fi
10371 rm -f conftest.$ac_objext conftest.$ac_ext
10372 done
10373
10374 fi
10375 echo "$as_me:10375: result: $cf_cv_ncurses_header" >&5
10376 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
10377
10378 if test "$cf_cv_ncurses_header" = none ; then
10379         { { echo "$as_me:10379: error: No curses header-files found" >&5
10380 echo "$as_me: error: No curses header-files found" >&2;}
10381    { (exit 1); exit 1; }; }
10382 fi
10383
10384 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
10385
10386 for ac_header in $cf_cv_ncurses_header
10387 do
10388 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10389 echo "$as_me:10389: checking for $ac_header" >&5
10390 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10391 if eval "test \"\${$as_ac_Header+set}\" = set"; then
10392   echo $ECHO_N "(cached) $ECHO_C" >&6
10393 else
10394   cat >conftest.$ac_ext <<_ACEOF
10395 #line 10395 "configure"
10396 #include "confdefs.h"
10397 #include <$ac_header>
10398 _ACEOF
10399 if { (eval echo "$as_me:10399: \"$ac_cpp conftest.$ac_ext\"") >&5
10400   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10401   ac_status=$?
10402   egrep -v '^ *\+' conftest.er1 >conftest.err
10403   rm -f conftest.er1
10404   cat conftest.err >&5
10405   echo "$as_me:10405: \$? = $ac_status" >&5
10406   (exit $ac_status); } >/dev/null; then
10407   if test -s conftest.err; then
10408     ac_cpp_err=$ac_c_preproc_warn_flag
10409   else
10410     ac_cpp_err=
10411   fi
10412 else
10413   ac_cpp_err=yes
10414 fi
10415 if test -z "$ac_cpp_err"; then
10416   eval "$as_ac_Header=yes"
10417 else
10418   echo "$as_me: failed program was:" >&5
10419   cat conftest.$ac_ext >&5
10420   eval "$as_ac_Header=no"
10421 fi
10422 rm -f conftest.err conftest.$ac_ext
10423 fi
10424 echo "$as_me:10424: result: `eval echo '${'$as_ac_Header'}'`" >&5
10425 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10426 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10427   cat >>confdefs.h <<EOF
10428 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10429 EOF
10430
10431 fi
10432 done
10433
10434 cat >>confdefs.h <<\EOF
10435 #define NCURSES 1
10436 EOF
10437
10438 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10439
10440                 cat >>confdefs.h <<EOF
10441 #define $cf_nculib_ROOT 1
10442 EOF
10443
10444                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
10445
10446         else
10447
10448 cf_ncuhdr_root=$cf_cv_screen
10449
10450 test -n "$cf_cv_curses_dir" && \
10451 test "$cf_cv_curses_dir" != "no" && { \
10452
10453 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
10454   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
10455   do
10456         while test $cf_add_incdir != /usr/include
10457         do
10458           if test -d $cf_add_incdir
10459           then
10460                 cf_have_incdir=no
10461                 if test -n "$CFLAGS$CPPFLAGS" ; then
10462                   # a loop is needed to ensure we can add subdirs of existing dirs
10463                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10464                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10465                           cf_have_incdir=yes; break
10466                         fi
10467                   done
10468                 fi
10469
10470                 if test "$cf_have_incdir" = no ; then
10471                   if test "$cf_add_incdir" = /usr/local/include ; then
10472                         if test "$GCC" = yes
10473                         then
10474                           cf_save_CPPFLAGS=$CPPFLAGS
10475
10476         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10477         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10478
10479                           cat >conftest.$ac_ext <<_ACEOF
10480 #line 10480 "configure"
10481 #include "confdefs.h"
10482 #include <stdio.h>
10483 int
10484 main (void)
10485 {
10486 printf("Hello")
10487   ;
10488   return 0;
10489 }
10490 _ACEOF
10491 rm -f conftest.$ac_objext
10492 if { (eval echo "$as_me:10492: \"$ac_compile\"") >&5
10493   (eval $ac_compile) 2>&5
10494   ac_status=$?
10495   echo "$as_me:10495: \$? = $ac_status" >&5
10496   (exit $ac_status); } &&
10497          { ac_try='test -s conftest.$ac_objext'
10498   { (eval echo "$as_me:10498: \"$ac_try\"") >&5
10499   (eval $ac_try) 2>&5
10500   ac_status=$?
10501   echo "$as_me:10501: \$? = $ac_status" >&5
10502   (exit $ac_status); }; }; then
10503   :
10504 else
10505   echo "$as_me: failed program was:" >&5
10506 cat conftest.$ac_ext >&5
10507 cf_have_incdir=yes
10508 fi
10509 rm -f conftest.$ac_objext conftest.$ac_ext
10510                           CPPFLAGS=$cf_save_CPPFLAGS
10511                         fi
10512                   fi
10513                 fi
10514
10515                 if test "$cf_have_incdir" = no ; then
10516                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10517
10518 echo "${as_me:-configure}:10518: testing adding $cf_add_incdir to include-path ..." 1>&5
10519
10520                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10521
10522                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10523                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10524                   cf_add_incdir="$cf_top_incdir"
10525                 else
10526                   break
10527                 fi
10528           else
10529                 break
10530           fi
10531         done
10532   done
10533 fi
10534
10535 }
10536
10537 echo "$as_me:10537: checking for $cf_ncuhdr_root header in include-path" >&5
10538 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
10539 if test "${cf_cv_ncurses_h+set}" = set; then
10540   echo $ECHO_N "(cached) $ECHO_C" >&6
10541 else
10542
10543         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
10544         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
10545         for cf_header in $cf_header_list
10546         do
10547
10548         cat >conftest.$ac_ext <<_ACEOF
10549 #line 10549 "configure"
10550 #include "confdefs.h"
10551
10552 #include <$cf_header>
10553 int
10554 main (void)
10555 {
10556
10557 #ifdef NCURSES_VERSION
10558
10559 printf("%s\n", NCURSES_VERSION);
10560 #else
10561 #ifdef __NCURSES_H
10562 printf("old\n");
10563 #else
10564         make an error
10565 #endif
10566 #endif
10567
10568   ;
10569   return 0;
10570 }
10571 _ACEOF
10572 rm -f conftest.$ac_objext
10573 if { (eval echo "$as_me:10573: \"$ac_compile\"") >&5
10574   (eval $ac_compile) 2>&5
10575   ac_status=$?
10576   echo "$as_me:10576: \$? = $ac_status" >&5
10577   (exit $ac_status); } &&
10578          { ac_try='test -s conftest.$ac_objext'
10579   { (eval echo "$as_me:10579: \"$ac_try\"") >&5
10580   (eval $ac_try) 2>&5
10581   ac_status=$?
10582   echo "$as_me:10582: \$? = $ac_status" >&5
10583   (exit $ac_status); }; }; then
10584   cf_cv_ncurses_h=$cf_header
10585
10586 else
10587   echo "$as_me: failed program was:" >&5
10588 cat conftest.$ac_ext >&5
10589 cf_cv_ncurses_h=no
10590 fi
10591 rm -f conftest.$ac_objext conftest.$ac_ext
10592
10593                 test "$cf_cv_ncurses_h" != no && break
10594         done
10595
10596 fi
10597 echo "$as_me:10597: result: $cf_cv_ncurses_h" >&5
10598 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
10599
10600 if test "$cf_cv_ncurses_h" != no ; then
10601         cf_cv_ncurses_header=$cf_cv_ncurses_h
10602 else
10603
10604 echo "$as_me:10604: checking for $cf_ncuhdr_root include-path" >&5
10605 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
10606 if test "${cf_cv_ncurses_h2+set}" = set; then
10607   echo $ECHO_N "(cached) $ECHO_C" >&6
10608 else
10609
10610         test -n "$verbose" && echo
10611
10612 cf_search=
10613
10614 # collect the current set of include-directories from compiler flags
10615 cf_header_path_list=""
10616 if test -n "${CFLAGS}${CPPFLAGS}" ; then
10617         for cf_header_path in $CPPFLAGS $CFLAGS
10618         do
10619                 case $cf_header_path in
10620                 (-I*)
10621                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
10622
10623 test "x$cf_header_path" != "xNONE" && \
10624 test -d "$cf_header_path" && \
10625  {
10626         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
10627         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
10628         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10629         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10630         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10631         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"
10632 }
10633
10634                         cf_header_path_list="$cf_header_path_list $cf_search"
10635                         ;;
10636                 esac
10637         done
10638 fi
10639
10640 # add the variations for the package we are looking for
10641
10642 cf_search=
10643
10644 test "x$prefix" != "xNONE" && \
10645 test -d "$prefix" && \
10646  {
10647         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10648         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10649         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10650         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10651         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10652         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10653 }
10654
10655 for cf_subdir_prefix in \
10656         /usr \
10657         /usr/local \
10658         /usr/pkg \
10659         /opt \
10660         /opt/local \
10661         $HOME
10662 do
10663
10664 test "x$cf_subdir_prefix" != "x$prefix" && \
10665 test -d "$cf_subdir_prefix" && \
10666 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10667         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10668         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10669         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10670         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10671         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10672         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"
10673 }
10674
10675 done
10676
10677 test "$includedir" != NONE && \
10678 test "$includedir" != "/usr/include" && \
10679 test -d "$includedir" && {
10680         test -d $includedir &&    cf_search="$cf_search $includedir"
10681         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10682 }
10683
10684 test "$oldincludedir" != NONE && \
10685 test "$oldincludedir" != "/usr/include" && \
10686 test -d "$oldincludedir" && {
10687         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10688         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10689 }
10690
10691 cf_search="$cf_search $cf_header_path_list"
10692
10693         test -n "$verbose" && echo search path $cf_search
10694         cf_save2_CPPFLAGS="$CPPFLAGS"
10695         for cf_incdir in $cf_search
10696         do
10697
10698 if test -n "$cf_incdir" ; then
10699   for cf_add_incdir in $cf_incdir
10700   do
10701         while test $cf_add_incdir != /usr/include
10702         do
10703           if test -d $cf_add_incdir
10704           then
10705                 cf_have_incdir=no
10706                 if test -n "$CFLAGS$CPPFLAGS" ; then
10707                   # a loop is needed to ensure we can add subdirs of existing dirs
10708                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10709                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10710                           cf_have_incdir=yes; break
10711                         fi
10712                   done
10713                 fi
10714
10715                 if test "$cf_have_incdir" = no ; then
10716                   if test "$cf_add_incdir" = /usr/local/include ; then
10717                         if test "$GCC" = yes
10718                         then
10719                           cf_save_CPPFLAGS=$CPPFLAGS
10720
10721         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10722         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10723
10724                           cat >conftest.$ac_ext <<_ACEOF
10725 #line 10725 "configure"
10726 #include "confdefs.h"
10727 #include <stdio.h>
10728 int
10729 main (void)
10730 {
10731 printf("Hello")
10732   ;
10733   return 0;
10734 }
10735 _ACEOF
10736 rm -f conftest.$ac_objext
10737 if { (eval echo "$as_me:10737: \"$ac_compile\"") >&5
10738   (eval $ac_compile) 2>&5
10739   ac_status=$?
10740   echo "$as_me:10740: \$? = $ac_status" >&5
10741   (exit $ac_status); } &&
10742          { ac_try='test -s conftest.$ac_objext'
10743   { (eval echo "$as_me:10743: \"$ac_try\"") >&5
10744   (eval $ac_try) 2>&5
10745   ac_status=$?
10746   echo "$as_me:10746: \$? = $ac_status" >&5
10747   (exit $ac_status); }; }; then
10748   :
10749 else
10750   echo "$as_me: failed program was:" >&5
10751 cat conftest.$ac_ext >&5
10752 cf_have_incdir=yes
10753 fi
10754 rm -f conftest.$ac_objext conftest.$ac_ext
10755                           CPPFLAGS=$cf_save_CPPFLAGS
10756                         fi
10757                   fi
10758                 fi
10759
10760                 if test "$cf_have_incdir" = no ; then
10761                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10762
10763 echo "${as_me:-configure}:10763: testing adding $cf_add_incdir to include-path ..." 1>&5
10764
10765                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10766
10767                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10768                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10769                   cf_add_incdir="$cf_top_incdir"
10770                 else
10771                   break
10772                 fi
10773           else
10774                 break
10775           fi
10776         done
10777   done
10778 fi
10779
10780                 for cf_header in \
10781                         ncurses.h \
10782                         curses.h
10783                 do
10784
10785         cat >conftest.$ac_ext <<_ACEOF
10786 #line 10786 "configure"
10787 #include "confdefs.h"
10788
10789 #include <$cf_header>
10790 int
10791 main (void)
10792 {
10793
10794 #ifdef NCURSES_VERSION
10795
10796 printf("%s\n", NCURSES_VERSION);
10797 #else
10798 #ifdef __NCURSES_H
10799 printf("old\n");
10800 #else
10801         make an error
10802 #endif
10803 #endif
10804
10805   ;
10806   return 0;
10807 }
10808 _ACEOF
10809 rm -f conftest.$ac_objext
10810 if { (eval echo "$as_me:10810: \"$ac_compile\"") >&5
10811   (eval $ac_compile) 2>&5
10812   ac_status=$?
10813   echo "$as_me:10813: \$? = $ac_status" >&5
10814   (exit $ac_status); } &&
10815          { ac_try='test -s conftest.$ac_objext'
10816   { (eval echo "$as_me:10816: \"$ac_try\"") >&5
10817   (eval $ac_try) 2>&5
10818   ac_status=$?
10819   echo "$as_me:10819: \$? = $ac_status" >&5
10820   (exit $ac_status); }; }; then
10821   cf_cv_ncurses_h2=$cf_header
10822
10823 else
10824   echo "$as_me: failed program was:" >&5
10825 cat conftest.$ac_ext >&5
10826 cf_cv_ncurses_h2=no
10827 fi
10828 rm -f conftest.$ac_objext conftest.$ac_ext
10829
10830                         if test "$cf_cv_ncurses_h2" != no ; then
10831                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10832                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10833                                 break
10834                         fi
10835                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10836                 done
10837                 CPPFLAGS="$cf_save2_CPPFLAGS"
10838                 test "$cf_cv_ncurses_h2" != no && break
10839         done
10840         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10840: error: not found" >&5
10841 echo "$as_me: error: not found" >&2;}
10842    { (exit 1); exit 1; }; }
10843
10844 fi
10845 echo "$as_me:10845: result: $cf_cv_ncurses_h2" >&5
10846 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10847
10848         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10849         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10850         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10851                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10852         fi
10853
10854 if test -n "$cf_1st_incdir" ; then
10855   for cf_add_incdir in $cf_1st_incdir
10856   do
10857         while test $cf_add_incdir != /usr/include
10858         do
10859           if test -d $cf_add_incdir
10860           then
10861                 cf_have_incdir=no
10862                 if test -n "$CFLAGS$CPPFLAGS" ; then
10863                   # a loop is needed to ensure we can add subdirs of existing dirs
10864                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10865                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10866                           cf_have_incdir=yes; break
10867                         fi
10868                   done
10869                 fi
10870
10871                 if test "$cf_have_incdir" = no ; then
10872                   if test "$cf_add_incdir" = /usr/local/include ; then
10873                         if test "$GCC" = yes
10874                         then
10875                           cf_save_CPPFLAGS=$CPPFLAGS
10876
10877         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10878         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10879
10880                           cat >conftest.$ac_ext <<_ACEOF
10881 #line 10881 "configure"
10882 #include "confdefs.h"
10883 #include <stdio.h>
10884 int
10885 main (void)
10886 {
10887 printf("Hello")
10888   ;
10889   return 0;
10890 }
10891 _ACEOF
10892 rm -f conftest.$ac_objext
10893 if { (eval echo "$as_me:10893: \"$ac_compile\"") >&5
10894   (eval $ac_compile) 2>&5
10895   ac_status=$?
10896   echo "$as_me:10896: \$? = $ac_status" >&5
10897   (exit $ac_status); } &&
10898          { ac_try='test -s conftest.$ac_objext'
10899   { (eval echo "$as_me:10899: \"$ac_try\"") >&5
10900   (eval $ac_try) 2>&5
10901   ac_status=$?
10902   echo "$as_me:10902: \$? = $ac_status" >&5
10903   (exit $ac_status); }; }; then
10904   :
10905 else
10906   echo "$as_me: failed program was:" >&5
10907 cat conftest.$ac_ext >&5
10908 cf_have_incdir=yes
10909 fi
10910 rm -f conftest.$ac_objext conftest.$ac_ext
10911                           CPPFLAGS=$cf_save_CPPFLAGS
10912                         fi
10913                   fi
10914                 fi
10915
10916                 if test "$cf_have_incdir" = no ; then
10917                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10918
10919 echo "${as_me:-configure}:10919: testing adding $cf_add_incdir to include-path ..." 1>&5
10920
10921                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10922
10923                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10924                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10925                   cf_add_incdir="$cf_top_incdir"
10926                 else
10927                   break
10928                 fi
10929           else
10930                 break
10931           fi
10932         done
10933   done
10934 fi
10935
10936 fi
10937
10938 # Set definitions to allow ifdef'ing for ncurses.h
10939
10940 case $cf_cv_ncurses_header in
10941 (*ncurses.h)
10942
10943 cat >>confdefs.h <<\EOF
10944 #define HAVE_NCURSES_H 1
10945 EOF
10946
10947         ;;
10948 esac
10949
10950 case $cf_cv_ncurses_header in
10951 (ncurses/curses.h|ncurses/ncurses.h)
10952
10953 cat >>confdefs.h <<\EOF
10954 #define HAVE_NCURSES_NCURSES_H 1
10955 EOF
10956
10957         ;;
10958 (ncursesw/curses.h|ncursesw/ncurses.h)
10959
10960 cat >>confdefs.h <<\EOF
10961 #define HAVE_NCURSESW_NCURSES_H 1
10962 EOF
10963
10964         ;;
10965 esac
10966
10967 echo "$as_me:10967: checking for terminfo header" >&5
10968 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10969 if test "${cf_cv_term_header+set}" = set; then
10970   echo $ECHO_N "(cached) $ECHO_C" >&6
10971 else
10972
10973 case ${cf_cv_ncurses_header} in
10974 (*/ncurses.h|*/ncursesw.h)
10975         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10976         ;;
10977 (*)
10978         cf_term_header=term.h
10979         ;;
10980 esac
10981
10982 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10983 do
10984 cat >conftest.$ac_ext <<_ACEOF
10985 #line 10985 "configure"
10986 #include "confdefs.h"
10987 #include <stdio.h>
10988 #include <${cf_cv_ncurses_header:-curses.h}>
10989 #include <$cf_test>
10990
10991 int
10992 main (void)
10993 {
10994 int x = auto_left_margin; (void)x
10995   ;
10996   return 0;
10997 }
10998 _ACEOF
10999 rm -f conftest.$ac_objext
11000 if { (eval echo "$as_me:11000: \"$ac_compile\"") >&5
11001   (eval $ac_compile) 2>&5
11002   ac_status=$?
11003   echo "$as_me:11003: \$? = $ac_status" >&5
11004   (exit $ac_status); } &&
11005          { ac_try='test -s conftest.$ac_objext'
11006   { (eval echo "$as_me:11006: \"$ac_try\"") >&5
11007   (eval $ac_try) 2>&5
11008   ac_status=$?
11009   echo "$as_me:11009: \$? = $ac_status" >&5
11010   (exit $ac_status); }; }; then
11011
11012         cf_cv_term_header="$cf_test"
11013 else
11014   echo "$as_me: failed program was:" >&5
11015 cat conftest.$ac_ext >&5
11016
11017         cf_cv_term_header=unknown
11018
11019 fi
11020 rm -f conftest.$ac_objext conftest.$ac_ext
11021         test "$cf_cv_term_header" != unknown && break
11022 done
11023
11024 fi
11025 echo "$as_me:11025: result: $cf_cv_term_header" >&5
11026 echo "${ECHO_T}$cf_cv_term_header" >&6
11027
11028 # Set definitions to allow ifdef'ing to accommodate subdirectories
11029
11030 case $cf_cv_term_header in
11031 (*term.h)
11032
11033 cat >>confdefs.h <<\EOF
11034 #define HAVE_TERM_H 1
11035 EOF
11036
11037         ;;
11038 esac
11039
11040 case $cf_cv_term_header in
11041 (ncurses/term.h)
11042
11043 cat >>confdefs.h <<\EOF
11044 #define HAVE_NCURSES_TERM_H 1
11045 EOF
11046
11047         ;;
11048 (ncursesw/term.h)
11049
11050 cat >>confdefs.h <<\EOF
11051 #define HAVE_NCURSESW_TERM_H 1
11052 EOF
11053
11054         ;;
11055 esac
11056
11057 # some applications need this, but should check for NCURSES_VERSION
11058
11059 cat >>confdefs.h <<\EOF
11060 #define NCURSES 1
11061 EOF
11062
11063 echo "$as_me:11063: checking for ncurses version" >&5
11064 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
11065 if test "${cf_cv_ncurses_version+set}" = set; then
11066   echo $ECHO_N "(cached) $ECHO_C" >&6
11067 else
11068
11069         cf_cv_ncurses_version=no
11070         cf_tempfile=out$$
11071         rm -f $cf_tempfile
11072         if test "$cross_compiling" = yes; then
11073
11074         # This will not work if the preprocessor splits the line after the
11075         # Autoconf token.  The 'unproto' program does that.
11076         cat > conftest.$ac_ext <<EOF
11077 #include <${cf_cv_ncurses_header:-curses.h}>
11078 #undef Autoconf
11079 #ifdef NCURSES_VERSION
11080 Autoconf NCURSES_VERSION
11081 #else
11082 #ifdef __NCURSES_H
11083 Autoconf "old"
11084 #endif
11085 ;
11086 #endif
11087 EOF
11088         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
11089         { (eval echo "$as_me:11089: \"$cf_try\"") >&5
11090   (eval $cf_try) 2>&5
11091   ac_status=$?
11092   echo "$as_me:11092: \$? = $ac_status" >&5
11093   (exit $ac_status); }
11094         if test -f conftest.out ; then
11095                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
11096                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
11097                 rm -f conftest.out
11098         fi
11099
11100 else
11101   cat >conftest.$ac_ext <<_ACEOF
11102 #line 11102 "configure"
11103 #include "confdefs.h"
11104
11105 #include <${cf_cv_ncurses_header:-curses.h}>
11106 #include <stdio.h>
11107 int main(void)
11108 {
11109         FILE *fp = fopen("$cf_tempfile", "w");
11110 #ifdef NCURSES_VERSION
11111 # ifdef NCURSES_VERSION_PATCH
11112         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
11113 # else
11114         fprintf(fp, "%s\n", NCURSES_VERSION);
11115 # endif
11116 #else
11117 # ifdef __NCURSES_H
11118         fprintf(fp, "old\n");
11119 # else
11120         make an error
11121 # endif
11122 #endif
11123         ${cf_cv_main_return:-return}(0);
11124 }
11125 _ACEOF
11126 rm -f conftest$ac_exeext
11127 if { (eval echo "$as_me:11127: \"$ac_link\"") >&5
11128   (eval $ac_link) 2>&5
11129   ac_status=$?
11130   echo "$as_me:11130: \$? = $ac_status" >&5
11131   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
11132   { (eval echo "$as_me:11132: \"$ac_try\"") >&5
11133   (eval $ac_try) 2>&5
11134   ac_status=$?
11135   echo "$as_me:11135: \$? = $ac_status" >&5
11136   (exit $ac_status); }; }; then
11137
11138         cf_cv_ncurses_version=`cat $cf_tempfile`
11139 else
11140   echo "$as_me: program exited with status $ac_status" >&5
11141 echo "$as_me: failed program was:" >&5
11142 cat conftest.$ac_ext >&5
11143 fi
11144 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
11145 fi
11146         rm -f $cf_tempfile
11147
11148 fi
11149 echo "$as_me:11149: result: $cf_cv_ncurses_version" >&5
11150 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
11151 test "$cf_cv_ncurses_version" = no ||
11152 cat >>confdefs.h <<\EOF
11153 #define NCURSES 1
11154 EOF
11155
11156 cf_nculib_root=$cf_cv_screen
11157         # This works, except for the special case where we find gpm, but
11158         # ncurses is in a nonstandard location via $LIBS, and we really want
11159         # to link gpm.
11160 cf_ncurses_LIBS=""
11161 cf_ncurses_SAVE="$LIBS"
11162 echo "$as_me:11162: checking for Gpm_Open in -lgpm" >&5
11163 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
11164 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
11165   echo $ECHO_N "(cached) $ECHO_C" >&6
11166 else
11167   ac_check_lib_save_LIBS=$LIBS
11168 LIBS="-lgpm  $LIBS"
11169 cat >conftest.$ac_ext <<_ACEOF
11170 #line 11170 "configure"
11171 #include "confdefs.h"
11172
11173 /* Override any gcc2 internal prototype to avoid an error.  */
11174 #ifdef __cplusplus
11175 extern "C"
11176 #endif
11177 /* We use char because int might match the return type of a gcc2
11178    builtin and then its argument prototype would still apply.  */
11179 char Gpm_Open ();
11180 int
11181 main (void)
11182 {
11183 Gpm_Open ();
11184   ;
11185   return 0;
11186 }
11187 _ACEOF
11188 rm -f conftest.$ac_objext conftest$ac_exeext
11189 if { (eval echo "$as_me:11189: \"$ac_link\"") >&5
11190   (eval $ac_link) 2>&5
11191   ac_status=$?
11192   echo "$as_me:11192: \$? = $ac_status" >&5
11193   (exit $ac_status); } &&
11194          { ac_try='test -s conftest$ac_exeext'
11195   { (eval echo "$as_me:11195: \"$ac_try\"") >&5
11196   (eval $ac_try) 2>&5
11197   ac_status=$?
11198   echo "$as_me:11198: \$? = $ac_status" >&5
11199   (exit $ac_status); }; }; then
11200   ac_cv_lib_gpm_Gpm_Open=yes
11201 else
11202   echo "$as_me: failed program was:" >&5
11203 cat conftest.$ac_ext >&5
11204 ac_cv_lib_gpm_Gpm_Open=no
11205 fi
11206 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11207 LIBS=$ac_check_lib_save_LIBS
11208 fi
11209 echo "$as_me:11209: result: $ac_cv_lib_gpm_Gpm_Open" >&5
11210 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
11211 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
11212   echo "$as_me:11212: checking for initscr in -lgpm" >&5
11213 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
11214 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
11215   echo $ECHO_N "(cached) $ECHO_C" >&6
11216 else
11217   ac_check_lib_save_LIBS=$LIBS
11218 LIBS="-lgpm  $LIBS"
11219 cat >conftest.$ac_ext <<_ACEOF
11220 #line 11220 "configure"
11221 #include "confdefs.h"
11222
11223 /* Override any gcc2 internal prototype to avoid an error.  */
11224 #ifdef __cplusplus
11225 extern "C"
11226 #endif
11227 /* We use char because int might match the return type of a gcc2
11228    builtin and then its argument prototype would still apply.  */
11229 char initscr ();
11230 int
11231 main (void)
11232 {
11233 initscr ();
11234   ;
11235   return 0;
11236 }
11237 _ACEOF
11238 rm -f conftest.$ac_objext conftest$ac_exeext
11239 if { (eval echo "$as_me:11239: \"$ac_link\"") >&5
11240   (eval $ac_link) 2>&5
11241   ac_status=$?
11242   echo "$as_me:11242: \$? = $ac_status" >&5
11243   (exit $ac_status); } &&
11244          { ac_try='test -s conftest$ac_exeext'
11245   { (eval echo "$as_me:11245: \"$ac_try\"") >&5
11246   (eval $ac_try) 2>&5
11247   ac_status=$?
11248   echo "$as_me:11248: \$? = $ac_status" >&5
11249   (exit $ac_status); }; }; then
11250   ac_cv_lib_gpm_initscr=yes
11251 else
11252   echo "$as_me: failed program was:" >&5
11253 cat conftest.$ac_ext >&5
11254 ac_cv_lib_gpm_initscr=no
11255 fi
11256 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11257 LIBS=$ac_check_lib_save_LIBS
11258 fi
11259 echo "$as_me:11259: result: $ac_cv_lib_gpm_initscr" >&5
11260 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
11261 if test $ac_cv_lib_gpm_initscr = yes; then
11262   LIBS="$cf_ncurses_SAVE"
11263 else
11264   cf_ncurses_LIBS="-lgpm"
11265 fi
11266
11267 fi
11268
11269 case $host_os in
11270 (freebsd*)
11271         # This is only necessary if you are linking against an obsolete
11272         # version of ncurses (but it should do no harm, since it's static).
11273         if test "$cf_nculib_root" = ncurses ; then
11274                 echo "$as_me:11274: checking for tgoto in -lmytinfo" >&5
11275 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
11276 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
11277   echo $ECHO_N "(cached) $ECHO_C" >&6
11278 else
11279   ac_check_lib_save_LIBS=$LIBS
11280 LIBS="-lmytinfo  $LIBS"
11281 cat >conftest.$ac_ext <<_ACEOF
11282 #line 11282 "configure"
11283 #include "confdefs.h"
11284
11285 /* Override any gcc2 internal prototype to avoid an error.  */
11286 #ifdef __cplusplus
11287 extern "C"
11288 #endif
11289 /* We use char because int might match the return type of a gcc2
11290    builtin and then its argument prototype would still apply.  */
11291 char tgoto ();
11292 int
11293 main (void)
11294 {
11295 tgoto ();
11296   ;
11297   return 0;
11298 }
11299 _ACEOF
11300 rm -f conftest.$ac_objext conftest$ac_exeext
11301 if { (eval echo "$as_me:11301: \"$ac_link\"") >&5
11302   (eval $ac_link) 2>&5
11303   ac_status=$?
11304   echo "$as_me:11304: \$? = $ac_status" >&5
11305   (exit $ac_status); } &&
11306          { ac_try='test -s conftest$ac_exeext'
11307   { (eval echo "$as_me:11307: \"$ac_try\"") >&5
11308   (eval $ac_try) 2>&5
11309   ac_status=$?
11310   echo "$as_me:11310: \$? = $ac_status" >&5
11311   (exit $ac_status); }; }; then
11312   ac_cv_lib_mytinfo_tgoto=yes
11313 else
11314   echo "$as_me: failed program was:" >&5
11315 cat conftest.$ac_ext >&5
11316 ac_cv_lib_mytinfo_tgoto=no
11317 fi
11318 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11319 LIBS=$ac_check_lib_save_LIBS
11320 fi
11321 echo "$as_me:11321: result: $ac_cv_lib_mytinfo_tgoto" >&5
11322 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
11323 if test $ac_cv_lib_mytinfo_tgoto = yes; then
11324   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
11325 fi
11326
11327         fi
11328         ;;
11329 esac
11330
11331 cf_add_libs="$LIBS"
11332 # reverse order
11333 cf_add_0lib=
11334 for cf_add_1lib in $cf_ncurses_LIBS; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11335 # filter duplicates
11336 for cf_add_1lib in $cf_add_0lib; do
11337         for cf_add_2lib in $cf_add_libs; do
11338                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11339                         cf_add_1lib=
11340                         break
11341                 fi
11342         done
11343         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11344 done
11345 LIBS="$cf_add_libs"
11346
11347 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
11348 then
11349
11350 cf_add_libs="$LIBS"
11351 # reverse order
11352 cf_add_0lib=
11353 for cf_add_1lib in -l$cf_nculib_root; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
11354 # filter duplicates
11355 for cf_add_1lib in $cf_add_0lib; do
11356         for cf_add_2lib in $cf_add_libs; do
11357                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
11358                         cf_add_1lib=
11359                         break
11360                 fi
11361         done
11362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
11363 done
11364 LIBS="$cf_add_libs"
11365
11366 else
11367
11368         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
11369         cf_libdir=""
11370         echo "$as_me:11370: checking for initscr" >&5
11371 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
11372 if test "${ac_cv_func_initscr+set}" = set; then
11373   echo $ECHO_N "(cached) $ECHO_C" >&6
11374 else
11375   cat >conftest.$ac_ext <<_ACEOF
11376 #line 11376 "configure"
11377 #include "confdefs.h"
11378 #define initscr autoconf_temporary
11379 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
11380 #undef initscr
11381
11382 #ifdef __cplusplus
11383 extern "C"
11384 #endif
11385
11386 /* We use char because int might match the return type of a gcc2
11387    builtin and then its argument prototype would still apply.  */
11388 char initscr (void);
11389
11390 int
11391 main (void)
11392 {
11393
11394 /* The GNU C library defines stubs for functions which it implements
11395     to always fail with ENOSYS.  Some functions are actually named
11396     something starting with __ and the normal name is an alias.  */
11397 #if defined (__stub_initscr) || defined (__stub___initscr)
11398 #error found stub for initscr
11399 #endif
11400
11401         return initscr ();
11402   ;
11403   return 0;
11404 }
11405 _ACEOF
11406 rm -f conftest.$ac_objext conftest$ac_exeext
11407 if { (eval echo "$as_me:11407: \"$ac_link\"") >&5
11408   (eval $ac_link) 2>&5
11409   ac_status=$?
11410   echo "$as_me:11410: \$? = $ac_status" >&5
11411   (exit $ac_status); } &&
11412          { ac_try='test -s conftest$ac_exeext'
11413   { (eval echo "$as_me:11413: \"$ac_try\"") >&5
11414   (eval $ac_try) 2>&5
11415   ac_status=$?
11416   echo "$as_me:11416: \$? = $ac_status" >&5
11417   (exit $ac_status); }; }; then
11418   ac_cv_func_initscr=yes
11419 else
11420   echo "$as_me: failed program was:" >&5
11421 cat conftest.$ac_ext >&5
11422 ac_cv_func_initscr=no
11423 fi
11424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11425 fi
11426 echo "$as_me:11426: result: $ac_cv_func_initscr" >&5
11427 echo "${ECHO_T}$ac_cv_func_initscr" >&6
11428 if test $ac_cv_func_initscr = yes; then
11429   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11430 else
11431
11432                 cf_save_LIBS="$LIBS"
11433                 echo "$as_me:11433: checking for initscr in -l$cf_nculib_root" >&5
11434 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
11435                 LIBS="-l$cf_nculib_root $LIBS"
11436                 cat >conftest.$ac_ext <<_ACEOF
11437 #line 11437 "configure"
11438 #include "confdefs.h"
11439 #include <${cf_cv_ncurses_header:-curses.h}>
11440 int
11441 main (void)
11442 {
11443 initscr()
11444   ;
11445   return 0;
11446 }
11447 _ACEOF
11448 rm -f conftest.$ac_objext conftest$ac_exeext
11449 if { (eval echo "$as_me:11449: \"$ac_link\"") >&5
11450   (eval $ac_link) 2>&5
11451   ac_status=$?
11452   echo "$as_me:11452: \$? = $ac_status" >&5
11453   (exit $ac_status); } &&
11454          { ac_try='test -s conftest$ac_exeext'
11455   { (eval echo "$as_me:11455: \"$ac_try\"") >&5
11456   (eval $ac_try) 2>&5
11457   ac_status=$?
11458   echo "$as_me:11458: \$? = $ac_status" >&5
11459   (exit $ac_status); }; }; then
11460   echo "$as_me:11460: result: yes" >&5
11461 echo "${ECHO_T}yes" >&6
11462                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11463
11464 else
11465   echo "$as_me: failed program was:" >&5
11466 cat conftest.$ac_ext >&5
11467 echo "$as_me:11467: result: no" >&5
11468 echo "${ECHO_T}no" >&6
11469
11470 cf_search=
11471 cf_library_path_list=""
11472 if test -n "${LDFLAGS}${LIBS}" ; then
11473         for cf_library_path in $LDFLAGS $LIBS
11474         do
11475                 case $cf_library_path in
11476                 (-L*)
11477                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
11478
11479 test "x$cf_library_path" != "xNONE" && \
11480 test -d "$cf_library_path" && \
11481  {
11482         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
11483         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
11484         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
11485         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
11486         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
11487         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"
11488 }
11489
11490                         cf_library_path_list="$cf_library_path_list $cf_search"
11491                         ;;
11492                 esac
11493         done
11494 fi
11495
11496 cf_search=
11497
11498 test "x$prefix" != "xNONE" && \
11499 test -d "$prefix" && \
11500  {
11501         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
11502         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
11503         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
11504         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
11505         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
11506         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
11507 }
11508
11509 for cf_subdir_prefix in \
11510         /usr \
11511         /usr/local \
11512         /usr/pkg \
11513         /opt \
11514         /opt/local \
11515         $HOME
11516 do
11517
11518 test "x$cf_subdir_prefix" != "x$prefix" && \
11519 test -d "$cf_subdir_prefix" && \
11520 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
11521         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
11522         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
11523         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
11524         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
11525         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
11526         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"
11527 }
11528
11529 done
11530
11531 cf_search="$cf_library_path_list $cf_search"
11532
11533                         for cf_libdir in $cf_search
11534                         do
11535                                 echo "$as_me:11535: checking for -l$cf_nculib_root in $cf_libdir" >&5
11536 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
11537                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
11538                                 cat >conftest.$ac_ext <<_ACEOF
11539 #line 11539 "configure"
11540 #include "confdefs.h"
11541 #include <${cf_cv_ncurses_header:-curses.h}>
11542 int
11543 main (void)
11544 {
11545 initscr()
11546   ;
11547   return 0;
11548 }
11549 _ACEOF
11550 rm -f conftest.$ac_objext conftest$ac_exeext
11551 if { (eval echo "$as_me:11551: \"$ac_link\"") >&5
11552   (eval $ac_link) 2>&5
11553   ac_status=$?
11554   echo "$as_me:11554: \$? = $ac_status" >&5
11555   (exit $ac_status); } &&
11556          { ac_try='test -s conftest$ac_exeext'
11557   { (eval echo "$as_me:11557: \"$ac_try\"") >&5
11558   (eval $ac_try) 2>&5
11559   ac_status=$?
11560   echo "$as_me:11560: \$? = $ac_status" >&5
11561   (exit $ac_status); }; }; then
11562   echo "$as_me:11562: result: yes" >&5
11563 echo "${ECHO_T}yes" >&6
11564                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
11565                                          break
11566 else
11567   echo "$as_me: failed program was:" >&5
11568 cat conftest.$ac_ext >&5
11569 echo "$as_me:11569: result: no" >&5
11570 echo "${ECHO_T}no" >&6
11571                                          LIBS="$cf_save_LIBS"
11572 fi
11573 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11574                         done
11575
11576 fi
11577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11578
11579 fi
11580
11581 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
11582
11583 if test $cf_found_library = no ; then
11584         { { echo "$as_me:11584: error: Cannot link $cf_nculib_root library" >&5
11585 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
11586    { (exit 1); exit 1; }; }
11587 fi
11588
11589 fi
11590
11591 if test -n "$cf_ncurses_LIBS" ; then
11592         echo "$as_me:11592: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
11593 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
11594         cf_ncurses_SAVE="$LIBS"
11595         for p in $cf_ncurses_LIBS ; do
11596                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
11597                 if test "$q" != "$LIBS" ; then
11598                         LIBS="$q"
11599                 fi
11600         done
11601         cat >conftest.$ac_ext <<_ACEOF
11602 #line 11602 "configure"
11603 #include "confdefs.h"
11604 #include <${cf_cv_ncurses_header:-curses.h}>
11605 int
11606 main (void)
11607 {
11608 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
11609   ;
11610   return 0;
11611 }
11612 _ACEOF
11613 rm -f conftest.$ac_objext conftest$ac_exeext
11614 if { (eval echo "$as_me:11614: \"$ac_link\"") >&5
11615   (eval $ac_link) 2>&5
11616   ac_status=$?
11617   echo "$as_me:11617: \$? = $ac_status" >&5
11618   (exit $ac_status); } &&
11619          { ac_try='test -s conftest$ac_exeext'
11620   { (eval echo "$as_me:11620: \"$ac_try\"") >&5
11621   (eval $ac_try) 2>&5
11622   ac_status=$?
11623   echo "$as_me:11623: \$? = $ac_status" >&5
11624   (exit $ac_status); }; }; then
11625   echo "$as_me:11625: result: yes" >&5
11626 echo "${ECHO_T}yes" >&6
11627 else
11628   echo "$as_me: failed program was:" >&5
11629 cat conftest.$ac_ext >&5
11630 echo "$as_me:11630: result: no" >&5
11631 echo "${ECHO_T}no" >&6
11632                  LIBS="$cf_ncurses_SAVE"
11633 fi
11634 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11635 fi
11636
11637 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11638
11639 cat >>confdefs.h <<EOF
11640 #define $cf_nculib_ROOT 1
11641 EOF
11642
11643         fi
11644 else
11645         NCURSES_CONFIG=none
11646 fi
11647
11648         ;;
11649 (pdcurses)
11650         echo "$as_me:11650: checking for X" >&5
11651 echo $ECHO_N "checking for X... $ECHO_C" >&6
11652
11653 # Check whether --with-x or --without-x was given.
11654 if test "${with_x+set}" = set; then
11655   withval="$with_x"
11656
11657 fi;
11658 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11659 if test "x$with_x" = xno; then
11660   # The user explicitly disabled X.
11661   have_x=disabled
11662 else
11663   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11664     # Both variables are already set.
11665     have_x=yes
11666   else
11667     if test "${ac_cv_have_x+set}" = set; then
11668   echo $ECHO_N "(cached) $ECHO_C" >&6
11669 else
11670   # One or both of the vars are not set, and there is no cached value.
11671 ac_x_includes=no ac_x_libraries=no
11672 rm -fr conftest.dir
11673 if mkdir conftest.dir; then
11674   cd conftest.dir
11675   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11676   cat >Imakefile <<'EOF'
11677 acfindx:
11678         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11679 EOF
11680   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11681     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11682     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11683     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11684     for ac_extension in a so sl dylib dll; do
11685       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11686          test -f $ac_im_libdir/libX11.$ac_extension; then
11687         ac_im_usrlibdir=$ac_im_libdir; break
11688       fi
11689     done
11690     # Screen out bogus values from the imake configuration.  They are
11691     # bogus both because they are the default anyway, and because
11692     # using them would break gcc on systems where it needs fixed includes.
11693     case $ac_im_incroot in
11694         /usr/include) ;;
11695         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11696     esac
11697     case $ac_im_usrlibdir in
11698         /usr/lib | /lib) ;;
11699         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11700     esac
11701   fi
11702   cd ..
11703   rm -fr conftest.dir
11704 fi
11705
11706 # Standard set of common directories for X headers.
11707 # Check X11 before X11Rn because it is often a symlink to the current release.
11708 ac_x_header_dirs='
11709 /usr/X11/include
11710 /usr/X11R7/include
11711 /usr/X11R6/include
11712 /usr/X11R5/include
11713 /usr/X11R4/include
11714
11715 /opt/local/include
11716 /opt/X11/include
11717
11718 /usr/include/X11
11719 /usr/include/X11R7
11720 /usr/include/X11R6
11721 /usr/include/X11R5
11722 /usr/include/X11R4
11723
11724 /usr/local/X11/include
11725 /usr/local/X11R7/include
11726 /usr/local/X11R6/include
11727 /usr/local/X11R5/include
11728 /usr/local/X11R4/include
11729
11730 /usr/local/include/X11
11731 /usr/local/include/X11R7
11732 /usr/local/include/X11R6
11733 /usr/local/include/X11R5
11734 /usr/local/include/X11R4
11735
11736 /usr/X386/include
11737 /usr/x386/include
11738 /usr/XFree86/include/X11
11739
11740 /usr/include
11741 /usr/local/include
11742 /usr/unsupported/include
11743 /usr/athena/include
11744 /usr/local/x11r5/include
11745 /usr/lpp/Xamples/include
11746
11747 /usr/openwin/include
11748 /usr/openwin/share/include'
11749
11750 if test "$ac_x_includes" = no; then
11751   # Guess where to find include files, by looking for Intrinsic.h.
11752   # First, try using that file with no special directory specified.
11753   cat >conftest.$ac_ext <<_ACEOF
11754 #line 11754 "configure"
11755 #include "confdefs.h"
11756 #include <X11/Intrinsic.h>
11757 _ACEOF
11758 if { (eval echo "$as_me:11758: \"$ac_cpp conftest.$ac_ext\"") >&5
11759   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11760   ac_status=$?
11761   egrep -v '^ *\+' conftest.er1 >conftest.err
11762   rm -f conftest.er1
11763   cat conftest.err >&5
11764   echo "$as_me:11764: \$? = $ac_status" >&5
11765   (exit $ac_status); } >/dev/null; then
11766   if test -s conftest.err; then
11767     ac_cpp_err=$ac_c_preproc_warn_flag
11768   else
11769     ac_cpp_err=
11770   fi
11771 else
11772   ac_cpp_err=yes
11773 fi
11774 if test -z "$ac_cpp_err"; then
11775   # We can compile using X headers with no special include directory.
11776 ac_x_includes=
11777 else
11778   echo "$as_me: failed program was:" >&5
11779   cat conftest.$ac_ext >&5
11780   for ac_dir in $ac_x_header_dirs; do
11781   if test -r "$ac_dir/X11/Intrinsic.h"; then
11782     ac_x_includes=$ac_dir
11783     break
11784   fi
11785 done
11786 fi
11787 rm -f conftest.err conftest.$ac_ext
11788 fi # $ac_x_includes = no
11789
11790 if test "$ac_x_libraries" = no; then
11791   # Check for the libraries.
11792   # See if we find them without any special options.
11793   # Don't add to $LIBS permanently.
11794   ac_save_LIBS=$LIBS
11795   LIBS="-lXt $LIBS"
11796   cat >conftest.$ac_ext <<_ACEOF
11797 #line 11797 "configure"
11798 #include "confdefs.h"
11799 #include <X11/Intrinsic.h>
11800 int
11801 main (void)
11802 {
11803 XtMalloc (0)
11804   ;
11805   return 0;
11806 }
11807 _ACEOF
11808 rm -f conftest.$ac_objext conftest$ac_exeext
11809 if { (eval echo "$as_me:11809: \"$ac_link\"") >&5
11810   (eval $ac_link) 2>&5
11811   ac_status=$?
11812   echo "$as_me:11812: \$? = $ac_status" >&5
11813   (exit $ac_status); } &&
11814          { ac_try='test -s conftest$ac_exeext'
11815   { (eval echo "$as_me:11815: \"$ac_try\"") >&5
11816   (eval $ac_try) 2>&5
11817   ac_status=$?
11818   echo "$as_me:11818: \$? = $ac_status" >&5
11819   (exit $ac_status); }; }; then
11820   LIBS=$ac_save_LIBS
11821 # We can link X programs with no special library path.
11822 ac_x_libraries=
11823 else
11824   echo "$as_me: failed program was:" >&5
11825 cat conftest.$ac_ext >&5
11826 LIBS=$ac_save_LIBS
11827 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11828 do
11829   # Don't even attempt the hair of trying to link an X program!
11830   for ac_extension in a so sl dylib dll; do
11831     if test -r $ac_dir/libXt.$ac_extension; then
11832       ac_x_libraries=$ac_dir
11833       break 2
11834     fi
11835   done
11836 done
11837 fi
11838 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11839 fi # $ac_x_libraries = no
11840
11841 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11842   # Didn't find X anywhere.  Cache the known absence of X.
11843   ac_cv_have_x="have_x=no"
11844 else
11845   # Record where we found X for the cache.
11846   ac_cv_have_x="have_x=yes \
11847                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11848 fi
11849 fi
11850
11851   fi
11852   eval "$ac_cv_have_x"
11853 fi # $with_x != no
11854
11855 if test "$have_x" != yes; then
11856   echo "$as_me:11856: result: $have_x" >&5
11857 echo "${ECHO_T}$have_x" >&6
11858   no_x=yes
11859 else
11860   # If each of the values was on the command line, it overrides each guess.
11861   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11862   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11863   # Update the cache value to reflect the command line values.
11864   ac_cv_have_x="have_x=yes \
11865                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11866   echo "$as_me:11866: result: libraries $x_libraries, headers $x_includes" >&5
11867 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11868 fi
11869
11870 if test "$no_x" = yes; then
11871   # Not all programs may use this symbol, but it does not hurt to define it.
11872
11873 cat >>confdefs.h <<\EOF
11874 #define X_DISPLAY_MISSING 1
11875 EOF
11876
11877   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11878 else
11879   if test -n "$x_includes"; then
11880     X_CFLAGS="$X_CFLAGS -I$x_includes"
11881   fi
11882
11883   # It would also be nice to do this for all -L options, not just this one.
11884   if test -n "$x_libraries"; then
11885     X_LIBS="$X_LIBS -L$x_libraries"
11886     # For Solaris; some versions of Sun CC require a space after -R and
11887     # others require no space.  Words are not sufficient . . . .
11888     case `(uname -sr) 2>/dev/null` in
11889     "SunOS 5"*)
11890       echo "$as_me:11890: checking whether -R must be followed by a space" >&5
11891 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11892       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11893       cat >conftest.$ac_ext <<_ACEOF
11894 #line 11894 "configure"
11895 #include "confdefs.h"
11896
11897 int
11898 main (void)
11899 {
11900
11901   ;
11902   return 0;
11903 }
11904 _ACEOF
11905 rm -f conftest.$ac_objext conftest$ac_exeext
11906 if { (eval echo "$as_me:11906: \"$ac_link\"") >&5
11907   (eval $ac_link) 2>&5
11908   ac_status=$?
11909   echo "$as_me:11909: \$? = $ac_status" >&5
11910   (exit $ac_status); } &&
11911          { ac_try='test -s conftest$ac_exeext'
11912   { (eval echo "$as_me:11912: \"$ac_try\"") >&5
11913   (eval $ac_try) 2>&5
11914   ac_status=$?
11915   echo "$as_me:11915: \$? = $ac_status" >&5
11916   (exit $ac_status); }; }; then
11917   ac_R_nospace=yes
11918 else
11919   echo "$as_me: failed program was:" >&5
11920 cat conftest.$ac_ext >&5
11921 ac_R_nospace=no
11922 fi
11923 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11924       if test $ac_R_nospace = yes; then
11925         echo "$as_me:11925: result: no" >&5
11926 echo "${ECHO_T}no" >&6
11927         X_LIBS="$X_LIBS -R$x_libraries"
11928       else
11929         LIBS="$ac_xsave_LIBS -R $x_libraries"
11930         cat >conftest.$ac_ext <<_ACEOF
11931 #line 11931 "configure"
11932 #include "confdefs.h"
11933
11934 int
11935 main (void)
11936 {
11937
11938   ;
11939   return 0;
11940 }
11941 _ACEOF
11942 rm -f conftest.$ac_objext conftest$ac_exeext
11943 if { (eval echo "$as_me:11943: \"$ac_link\"") >&5
11944   (eval $ac_link) 2>&5
11945   ac_status=$?
11946   echo "$as_me:11946: \$? = $ac_status" >&5
11947   (exit $ac_status); } &&
11948          { ac_try='test -s conftest$ac_exeext'
11949   { (eval echo "$as_me:11949: \"$ac_try\"") >&5
11950   (eval $ac_try) 2>&5
11951   ac_status=$?
11952   echo "$as_me:11952: \$? = $ac_status" >&5
11953   (exit $ac_status); }; }; then
11954   ac_R_space=yes
11955 else
11956   echo "$as_me: failed program was:" >&5
11957 cat conftest.$ac_ext >&5
11958 ac_R_space=no
11959 fi
11960 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11961         if test $ac_R_space = yes; then
11962           echo "$as_me:11962: result: yes" >&5
11963 echo "${ECHO_T}yes" >&6
11964           X_LIBS="$X_LIBS -R $x_libraries"
11965         else
11966           echo "$as_me:11966: result: neither works" >&5
11967 echo "${ECHO_T}neither works" >&6
11968         fi
11969       fi
11970       LIBS=$ac_xsave_LIBS
11971     esac
11972   fi
11973
11974   # Check for system-dependent libraries X programs must link with.
11975   # Do this before checking for the system-independent R6 libraries
11976   # (-lICE), since we may need -lsocket or whatever for X linking.
11977
11978   if test "$ISC" = yes; then
11979     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11980   else
11981     # Martyn Johnson says this is needed for Ultrix, if the X
11982     # libraries were built with DECnet support.  And Karl Berry says
11983     # the Alpha needs dnet_stub (dnet does not exist).
11984     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11985     cat >conftest.$ac_ext <<_ACEOF
11986 #line 11986 "configure"
11987 #include "confdefs.h"
11988
11989 /* Override any gcc2 internal prototype to avoid an error.  */
11990 #ifdef __cplusplus
11991 extern "C"
11992 #endif
11993 /* We use char because int might match the return type of a gcc2
11994    builtin and then its argument prototype would still apply.  */
11995 char XOpenDisplay ();
11996 int
11997 main (void)
11998 {
11999 XOpenDisplay ();
12000   ;
12001   return 0;
12002 }
12003 _ACEOF
12004 rm -f conftest.$ac_objext conftest$ac_exeext
12005 if { (eval echo "$as_me:12005: \"$ac_link\"") >&5
12006   (eval $ac_link) 2>&5
12007   ac_status=$?
12008   echo "$as_me:12008: \$? = $ac_status" >&5
12009   (exit $ac_status); } &&
12010          { ac_try='test -s conftest$ac_exeext'
12011   { (eval echo "$as_me:12011: \"$ac_try\"") >&5
12012   (eval $ac_try) 2>&5
12013   ac_status=$?
12014   echo "$as_me:12014: \$? = $ac_status" >&5
12015   (exit $ac_status); }; }; then
12016   :
12017 else
12018   echo "$as_me: failed program was:" >&5
12019 cat conftest.$ac_ext >&5
12020 echo "$as_me:12020: checking for dnet_ntoa in -ldnet" >&5
12021 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
12022 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
12023   echo $ECHO_N "(cached) $ECHO_C" >&6
12024 else
12025   ac_check_lib_save_LIBS=$LIBS
12026 LIBS="-ldnet  $LIBS"
12027 cat >conftest.$ac_ext <<_ACEOF
12028 #line 12028 "configure"
12029 #include "confdefs.h"
12030
12031 /* Override any gcc2 internal prototype to avoid an error.  */
12032 #ifdef __cplusplus
12033 extern "C"
12034 #endif
12035 /* We use char because int might match the return type of a gcc2
12036    builtin and then its argument prototype would still apply.  */
12037 char dnet_ntoa ();
12038 int
12039 main (void)
12040 {
12041 dnet_ntoa ();
12042   ;
12043   return 0;
12044 }
12045 _ACEOF
12046 rm -f conftest.$ac_objext conftest$ac_exeext
12047 if { (eval echo "$as_me:12047: \"$ac_link\"") >&5
12048   (eval $ac_link) 2>&5
12049   ac_status=$?
12050   echo "$as_me:12050: \$? = $ac_status" >&5
12051   (exit $ac_status); } &&
12052          { ac_try='test -s conftest$ac_exeext'
12053   { (eval echo "$as_me:12053: \"$ac_try\"") >&5
12054   (eval $ac_try) 2>&5
12055   ac_status=$?
12056   echo "$as_me:12056: \$? = $ac_status" >&5
12057   (exit $ac_status); }; }; then
12058   ac_cv_lib_dnet_dnet_ntoa=yes
12059 else
12060   echo "$as_me: failed program was:" >&5
12061 cat conftest.$ac_ext >&5
12062 ac_cv_lib_dnet_dnet_ntoa=no
12063 fi
12064 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12065 LIBS=$ac_check_lib_save_LIBS
12066 fi
12067 echo "$as_me:12067: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
12068 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
12069 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
12070   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
12071 fi
12072
12073     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
12074       echo "$as_me:12074: checking for dnet_ntoa in -ldnet_stub" >&5
12075 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
12076 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
12077   echo $ECHO_N "(cached) $ECHO_C" >&6
12078 else
12079   ac_check_lib_save_LIBS=$LIBS
12080 LIBS="-ldnet_stub  $LIBS"
12081 cat >conftest.$ac_ext <<_ACEOF
12082 #line 12082 "configure"
12083 #include "confdefs.h"
12084
12085 /* Override any gcc2 internal prototype to avoid an error.  */
12086 #ifdef __cplusplus
12087 extern "C"
12088 #endif
12089 /* We use char because int might match the return type of a gcc2
12090    builtin and then its argument prototype would still apply.  */
12091 char dnet_ntoa ();
12092 int
12093 main (void)
12094 {
12095 dnet_ntoa ();
12096   ;
12097   return 0;
12098 }
12099 _ACEOF
12100 rm -f conftest.$ac_objext conftest$ac_exeext
12101 if { (eval echo "$as_me:12101: \"$ac_link\"") >&5
12102   (eval $ac_link) 2>&5
12103   ac_status=$?
12104   echo "$as_me:12104: \$? = $ac_status" >&5
12105   (exit $ac_status); } &&
12106          { ac_try='test -s conftest$ac_exeext'
12107   { (eval echo "$as_me:12107: \"$ac_try\"") >&5
12108   (eval $ac_try) 2>&5
12109   ac_status=$?
12110   echo "$as_me:12110: \$? = $ac_status" >&5
12111   (exit $ac_status); }; }; then
12112   ac_cv_lib_dnet_stub_dnet_ntoa=yes
12113 else
12114   echo "$as_me: failed program was:" >&5
12115 cat conftest.$ac_ext >&5
12116 ac_cv_lib_dnet_stub_dnet_ntoa=no
12117 fi
12118 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12119 LIBS=$ac_check_lib_save_LIBS
12120 fi
12121 echo "$as_me:12121: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
12122 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
12123 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
12124   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
12125 fi
12126
12127     fi
12128 fi
12129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12130     LIBS="$ac_xsave_LIBS"
12131
12132     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
12133     # to get the SysV transport functions.
12134     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
12135     # needs -lnsl.
12136     # The nsl library prevents programs from opening the X display
12137     # on Irix 5.2, according to T.E. Dickey.
12138     # The functions gethostbyname, getservbyname, and inet_addr are
12139     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
12140     echo "$as_me:12140: checking for gethostbyname" >&5
12141 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
12142 if test "${ac_cv_func_gethostbyname+set}" = set; then
12143   echo $ECHO_N "(cached) $ECHO_C" >&6
12144 else
12145   cat >conftest.$ac_ext <<_ACEOF
12146 #line 12146 "configure"
12147 #include "confdefs.h"
12148 #define gethostbyname autoconf_temporary
12149 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12150 #undef gethostbyname
12151
12152 #ifdef __cplusplus
12153 extern "C"
12154 #endif
12155
12156 /* We use char because int might match the return type of a gcc2
12157    builtin and then its argument prototype would still apply.  */
12158 char gethostbyname (void);
12159
12160 int
12161 main (void)
12162 {
12163
12164 /* The GNU C library defines stubs for functions which it implements
12165     to always fail with ENOSYS.  Some functions are actually named
12166     something starting with __ and the normal name is an alias.  */
12167 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
12168 #error found stub for gethostbyname
12169 #endif
12170
12171         return gethostbyname ();
12172   ;
12173   return 0;
12174 }
12175 _ACEOF
12176 rm -f conftest.$ac_objext conftest$ac_exeext
12177 if { (eval echo "$as_me:12177: \"$ac_link\"") >&5
12178   (eval $ac_link) 2>&5
12179   ac_status=$?
12180   echo "$as_me:12180: \$? = $ac_status" >&5
12181   (exit $ac_status); } &&
12182          { ac_try='test -s conftest$ac_exeext'
12183   { (eval echo "$as_me:12183: \"$ac_try\"") >&5
12184   (eval $ac_try) 2>&5
12185   ac_status=$?
12186   echo "$as_me:12186: \$? = $ac_status" >&5
12187   (exit $ac_status); }; }; then
12188   ac_cv_func_gethostbyname=yes
12189 else
12190   echo "$as_me: failed program was:" >&5
12191 cat conftest.$ac_ext >&5
12192 ac_cv_func_gethostbyname=no
12193 fi
12194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12195 fi
12196 echo "$as_me:12196: result: $ac_cv_func_gethostbyname" >&5
12197 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
12198
12199     if test $ac_cv_func_gethostbyname = no; then
12200       echo "$as_me:12200: checking for gethostbyname in -lnsl" >&5
12201 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
12202 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
12203   echo $ECHO_N "(cached) $ECHO_C" >&6
12204 else
12205   ac_check_lib_save_LIBS=$LIBS
12206 LIBS="-lnsl  $LIBS"
12207 cat >conftest.$ac_ext <<_ACEOF
12208 #line 12208 "configure"
12209 #include "confdefs.h"
12210
12211 /* Override any gcc2 internal prototype to avoid an error.  */
12212 #ifdef __cplusplus
12213 extern "C"
12214 #endif
12215 /* We use char because int might match the return type of a gcc2
12216    builtin and then its argument prototype would still apply.  */
12217 char gethostbyname ();
12218 int
12219 main (void)
12220 {
12221 gethostbyname ();
12222   ;
12223   return 0;
12224 }
12225 _ACEOF
12226 rm -f conftest.$ac_objext conftest$ac_exeext
12227 if { (eval echo "$as_me:12227: \"$ac_link\"") >&5
12228   (eval $ac_link) 2>&5
12229   ac_status=$?
12230   echo "$as_me:12230: \$? = $ac_status" >&5
12231   (exit $ac_status); } &&
12232          { ac_try='test -s conftest$ac_exeext'
12233   { (eval echo "$as_me:12233: \"$ac_try\"") >&5
12234   (eval $ac_try) 2>&5
12235   ac_status=$?
12236   echo "$as_me:12236: \$? = $ac_status" >&5
12237   (exit $ac_status); }; }; then
12238   ac_cv_lib_nsl_gethostbyname=yes
12239 else
12240   echo "$as_me: failed program was:" >&5
12241 cat conftest.$ac_ext >&5
12242 ac_cv_lib_nsl_gethostbyname=no
12243 fi
12244 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12245 LIBS=$ac_check_lib_save_LIBS
12246 fi
12247 echo "$as_me:12247: result: $ac_cv_lib_nsl_gethostbyname" >&5
12248 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
12249 if test $ac_cv_lib_nsl_gethostbyname = yes; then
12250   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
12251 fi
12252
12253       if test $ac_cv_lib_nsl_gethostbyname = no; then
12254         echo "$as_me:12254: checking for gethostbyname in -lbsd" >&5
12255 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
12256 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
12257   echo $ECHO_N "(cached) $ECHO_C" >&6
12258 else
12259   ac_check_lib_save_LIBS=$LIBS
12260 LIBS="-lbsd  $LIBS"
12261 cat >conftest.$ac_ext <<_ACEOF
12262 #line 12262 "configure"
12263 #include "confdefs.h"
12264
12265 /* Override any gcc2 internal prototype to avoid an error.  */
12266 #ifdef __cplusplus
12267 extern "C"
12268 #endif
12269 /* We use char because int might match the return type of a gcc2
12270    builtin and then its argument prototype would still apply.  */
12271 char gethostbyname ();
12272 int
12273 main (void)
12274 {
12275 gethostbyname ();
12276   ;
12277   return 0;
12278 }
12279 _ACEOF
12280 rm -f conftest.$ac_objext conftest$ac_exeext
12281 if { (eval echo "$as_me:12281: \"$ac_link\"") >&5
12282   (eval $ac_link) 2>&5
12283   ac_status=$?
12284   echo "$as_me:12284: \$? = $ac_status" >&5
12285   (exit $ac_status); } &&
12286          { ac_try='test -s conftest$ac_exeext'
12287   { (eval echo "$as_me:12287: \"$ac_try\"") >&5
12288   (eval $ac_try) 2>&5
12289   ac_status=$?
12290   echo "$as_me:12290: \$? = $ac_status" >&5
12291   (exit $ac_status); }; }; then
12292   ac_cv_lib_bsd_gethostbyname=yes
12293 else
12294   echo "$as_me: failed program was:" >&5
12295 cat conftest.$ac_ext >&5
12296 ac_cv_lib_bsd_gethostbyname=no
12297 fi
12298 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12299 LIBS=$ac_check_lib_save_LIBS
12300 fi
12301 echo "$as_me:12301: result: $ac_cv_lib_bsd_gethostbyname" >&5
12302 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
12303 if test $ac_cv_lib_bsd_gethostbyname = yes; then
12304   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
12305 fi
12306
12307       fi
12308     fi
12309
12310     # lieder@skyler.mavd.honeywell.com says without -lsocket,
12311     # socket/setsockopt and other routines are undefined under SCO ODT
12312     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
12313     # on later versions), says Simon Leinen: it contains gethostby*
12314     # variants that don't use the nameserver (or something).  -lsocket
12315     # must be given before -lnsl if both are needed.  We assume that
12316     # if connect needs -lnsl, so does gethostbyname.
12317     echo "$as_me:12317: checking for connect" >&5
12318 echo $ECHO_N "checking for connect... $ECHO_C" >&6
12319 if test "${ac_cv_func_connect+set}" = set; then
12320   echo $ECHO_N "(cached) $ECHO_C" >&6
12321 else
12322   cat >conftest.$ac_ext <<_ACEOF
12323 #line 12323 "configure"
12324 #include "confdefs.h"
12325 #define connect autoconf_temporary
12326 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12327 #undef connect
12328
12329 #ifdef __cplusplus
12330 extern "C"
12331 #endif
12332
12333 /* We use char because int might match the return type of a gcc2
12334    builtin and then its argument prototype would still apply.  */
12335 char connect (void);
12336
12337 int
12338 main (void)
12339 {
12340
12341 /* The GNU C library defines stubs for functions which it implements
12342     to always fail with ENOSYS.  Some functions are actually named
12343     something starting with __ and the normal name is an alias.  */
12344 #if defined (__stub_connect) || defined (__stub___connect)
12345 #error found stub for connect
12346 #endif
12347
12348         return connect ();
12349   ;
12350   return 0;
12351 }
12352 _ACEOF
12353 rm -f conftest.$ac_objext conftest$ac_exeext
12354 if { (eval echo "$as_me:12354: \"$ac_link\"") >&5
12355   (eval $ac_link) 2>&5
12356   ac_status=$?
12357   echo "$as_me:12357: \$? = $ac_status" >&5
12358   (exit $ac_status); } &&
12359          { ac_try='test -s conftest$ac_exeext'
12360   { (eval echo "$as_me:12360: \"$ac_try\"") >&5
12361   (eval $ac_try) 2>&5
12362   ac_status=$?
12363   echo "$as_me:12363: \$? = $ac_status" >&5
12364   (exit $ac_status); }; }; then
12365   ac_cv_func_connect=yes
12366 else
12367   echo "$as_me: failed program was:" >&5
12368 cat conftest.$ac_ext >&5
12369 ac_cv_func_connect=no
12370 fi
12371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12372 fi
12373 echo "$as_me:12373: result: $ac_cv_func_connect" >&5
12374 echo "${ECHO_T}$ac_cv_func_connect" >&6
12375
12376     if test $ac_cv_func_connect = no; then
12377       echo "$as_me:12377: checking for connect in -lsocket" >&5
12378 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
12379 if test "${ac_cv_lib_socket_connect+set}" = set; then
12380   echo $ECHO_N "(cached) $ECHO_C" >&6
12381 else
12382   ac_check_lib_save_LIBS=$LIBS
12383 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
12384 cat >conftest.$ac_ext <<_ACEOF
12385 #line 12385 "configure"
12386 #include "confdefs.h"
12387
12388 /* Override any gcc2 internal prototype to avoid an error.  */
12389 #ifdef __cplusplus
12390 extern "C"
12391 #endif
12392 /* We use char because int might match the return type of a gcc2
12393    builtin and then its argument prototype would still apply.  */
12394 char connect ();
12395 int
12396 main (void)
12397 {
12398 connect ();
12399   ;
12400   return 0;
12401 }
12402 _ACEOF
12403 rm -f conftest.$ac_objext conftest$ac_exeext
12404 if { (eval echo "$as_me:12404: \"$ac_link\"") >&5
12405   (eval $ac_link) 2>&5
12406   ac_status=$?
12407   echo "$as_me:12407: \$? = $ac_status" >&5
12408   (exit $ac_status); } &&
12409          { ac_try='test -s conftest$ac_exeext'
12410   { (eval echo "$as_me:12410: \"$ac_try\"") >&5
12411   (eval $ac_try) 2>&5
12412   ac_status=$?
12413   echo "$as_me:12413: \$? = $ac_status" >&5
12414   (exit $ac_status); }; }; then
12415   ac_cv_lib_socket_connect=yes
12416 else
12417   echo "$as_me: failed program was:" >&5
12418 cat conftest.$ac_ext >&5
12419 ac_cv_lib_socket_connect=no
12420 fi
12421 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12422 LIBS=$ac_check_lib_save_LIBS
12423 fi
12424 echo "$as_me:12424: result: $ac_cv_lib_socket_connect" >&5
12425 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
12426 if test $ac_cv_lib_socket_connect = yes; then
12427   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
12428 fi
12429
12430     fi
12431
12432     # Guillermo Gomez says -lposix is necessary on A/UX.
12433     echo "$as_me:12433: checking for remove" >&5
12434 echo $ECHO_N "checking for remove... $ECHO_C" >&6
12435 if test "${ac_cv_func_remove+set}" = set; then
12436   echo $ECHO_N "(cached) $ECHO_C" >&6
12437 else
12438   cat >conftest.$ac_ext <<_ACEOF
12439 #line 12439 "configure"
12440 #include "confdefs.h"
12441 #define remove autoconf_temporary
12442 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12443 #undef remove
12444
12445 #ifdef __cplusplus
12446 extern "C"
12447 #endif
12448
12449 /* We use char because int might match the return type of a gcc2
12450    builtin and then its argument prototype would still apply.  */
12451 char remove (void);
12452
12453 int
12454 main (void)
12455 {
12456
12457 /* The GNU C library defines stubs for functions which it implements
12458     to always fail with ENOSYS.  Some functions are actually named
12459     something starting with __ and the normal name is an alias.  */
12460 #if defined (__stub_remove) || defined (__stub___remove)
12461 #error found stub for remove
12462 #endif
12463
12464         return remove ();
12465   ;
12466   return 0;
12467 }
12468 _ACEOF
12469 rm -f conftest.$ac_objext conftest$ac_exeext
12470 if { (eval echo "$as_me:12470: \"$ac_link\"") >&5
12471   (eval $ac_link) 2>&5
12472   ac_status=$?
12473   echo "$as_me:12473: \$? = $ac_status" >&5
12474   (exit $ac_status); } &&
12475          { ac_try='test -s conftest$ac_exeext'
12476   { (eval echo "$as_me:12476: \"$ac_try\"") >&5
12477   (eval $ac_try) 2>&5
12478   ac_status=$?
12479   echo "$as_me:12479: \$? = $ac_status" >&5
12480   (exit $ac_status); }; }; then
12481   ac_cv_func_remove=yes
12482 else
12483   echo "$as_me: failed program was:" >&5
12484 cat conftest.$ac_ext >&5
12485 ac_cv_func_remove=no
12486 fi
12487 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12488 fi
12489 echo "$as_me:12489: result: $ac_cv_func_remove" >&5
12490 echo "${ECHO_T}$ac_cv_func_remove" >&6
12491
12492     if test $ac_cv_func_remove = no; then
12493       echo "$as_me:12493: checking for remove in -lposix" >&5
12494 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
12495 if test "${ac_cv_lib_posix_remove+set}" = set; then
12496   echo $ECHO_N "(cached) $ECHO_C" >&6
12497 else
12498   ac_check_lib_save_LIBS=$LIBS
12499 LIBS="-lposix  $LIBS"
12500 cat >conftest.$ac_ext <<_ACEOF
12501 #line 12501 "configure"
12502 #include "confdefs.h"
12503
12504 /* Override any gcc2 internal prototype to avoid an error.  */
12505 #ifdef __cplusplus
12506 extern "C"
12507 #endif
12508 /* We use char because int might match the return type of a gcc2
12509    builtin and then its argument prototype would still apply.  */
12510 char remove ();
12511 int
12512 main (void)
12513 {
12514 remove ();
12515   ;
12516   return 0;
12517 }
12518 _ACEOF
12519 rm -f conftest.$ac_objext conftest$ac_exeext
12520 if { (eval echo "$as_me:12520: \"$ac_link\"") >&5
12521   (eval $ac_link) 2>&5
12522   ac_status=$?
12523   echo "$as_me:12523: \$? = $ac_status" >&5
12524   (exit $ac_status); } &&
12525          { ac_try='test -s conftest$ac_exeext'
12526   { (eval echo "$as_me:12526: \"$ac_try\"") >&5
12527   (eval $ac_try) 2>&5
12528   ac_status=$?
12529   echo "$as_me:12529: \$? = $ac_status" >&5
12530   (exit $ac_status); }; }; then
12531   ac_cv_lib_posix_remove=yes
12532 else
12533   echo "$as_me: failed program was:" >&5
12534 cat conftest.$ac_ext >&5
12535 ac_cv_lib_posix_remove=no
12536 fi
12537 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12538 LIBS=$ac_check_lib_save_LIBS
12539 fi
12540 echo "$as_me:12540: result: $ac_cv_lib_posix_remove" >&5
12541 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
12542 if test $ac_cv_lib_posix_remove = yes; then
12543   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
12544 fi
12545
12546     fi
12547
12548     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
12549     echo "$as_me:12549: checking for shmat" >&5
12550 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
12551 if test "${ac_cv_func_shmat+set}" = set; then
12552   echo $ECHO_N "(cached) $ECHO_C" >&6
12553 else
12554   cat >conftest.$ac_ext <<_ACEOF
12555 #line 12555 "configure"
12556 #include "confdefs.h"
12557 #define shmat autoconf_temporary
12558 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
12559 #undef shmat
12560
12561 #ifdef __cplusplus
12562 extern "C"
12563 #endif
12564
12565 /* We use char because int might match the return type of a gcc2
12566    builtin and then its argument prototype would still apply.  */
12567 char shmat (void);
12568
12569 int
12570 main (void)
12571 {
12572
12573 /* The GNU C library defines stubs for functions which it implements
12574     to always fail with ENOSYS.  Some functions are actually named
12575     something starting with __ and the normal name is an alias.  */
12576 #if defined (__stub_shmat) || defined (__stub___shmat)
12577 #error found stub for shmat
12578 #endif
12579
12580         return shmat ();
12581   ;
12582   return 0;
12583 }
12584 _ACEOF
12585 rm -f conftest.$ac_objext conftest$ac_exeext
12586 if { (eval echo "$as_me:12586: \"$ac_link\"") >&5
12587   (eval $ac_link) 2>&5
12588   ac_status=$?
12589   echo "$as_me:12589: \$? = $ac_status" >&5
12590   (exit $ac_status); } &&
12591          { ac_try='test -s conftest$ac_exeext'
12592   { (eval echo "$as_me:12592: \"$ac_try\"") >&5
12593   (eval $ac_try) 2>&5
12594   ac_status=$?
12595   echo "$as_me:12595: \$? = $ac_status" >&5
12596   (exit $ac_status); }; }; then
12597   ac_cv_func_shmat=yes
12598 else
12599   echo "$as_me: failed program was:" >&5
12600 cat conftest.$ac_ext >&5
12601 ac_cv_func_shmat=no
12602 fi
12603 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12604 fi
12605 echo "$as_me:12605: result: $ac_cv_func_shmat" >&5
12606 echo "${ECHO_T}$ac_cv_func_shmat" >&6
12607
12608     if test $ac_cv_func_shmat = no; then
12609       echo "$as_me:12609: checking for shmat in -lipc" >&5
12610 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
12611 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
12612   echo $ECHO_N "(cached) $ECHO_C" >&6
12613 else
12614   ac_check_lib_save_LIBS=$LIBS
12615 LIBS="-lipc  $LIBS"
12616 cat >conftest.$ac_ext <<_ACEOF
12617 #line 12617 "configure"
12618 #include "confdefs.h"
12619
12620 /* Override any gcc2 internal prototype to avoid an error.  */
12621 #ifdef __cplusplus
12622 extern "C"
12623 #endif
12624 /* We use char because int might match the return type of a gcc2
12625    builtin and then its argument prototype would still apply.  */
12626 char shmat ();
12627 int
12628 main (void)
12629 {
12630 shmat ();
12631   ;
12632   return 0;
12633 }
12634 _ACEOF
12635 rm -f conftest.$ac_objext conftest$ac_exeext
12636 if { (eval echo "$as_me:12636: \"$ac_link\"") >&5
12637   (eval $ac_link) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit $ac_status); } &&
12641          { ac_try='test -s conftest$ac_exeext'
12642   { (eval echo "$as_me:12642: \"$ac_try\"") >&5
12643   (eval $ac_try) 2>&5
12644   ac_status=$?
12645   echo "$as_me:12645: \$? = $ac_status" >&5
12646   (exit $ac_status); }; }; then
12647   ac_cv_lib_ipc_shmat=yes
12648 else
12649   echo "$as_me: failed program was:" >&5
12650 cat conftest.$ac_ext >&5
12651 ac_cv_lib_ipc_shmat=no
12652 fi
12653 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12654 LIBS=$ac_check_lib_save_LIBS
12655 fi
12656 echo "$as_me:12656: result: $ac_cv_lib_ipc_shmat" >&5
12657 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12658 if test $ac_cv_lib_ipc_shmat = yes; then
12659   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12660 fi
12661
12662     fi
12663   fi
12664
12665   # Check for libraries that X11R6 Xt/Xaw programs need.
12666   ac_save_LDFLAGS=$LDFLAGS
12667   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12668   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12669   # check for ICE first), but we must link in the order -lSM -lICE or
12670   # we get undefined symbols.  So assume we have SM if we have ICE.
12671   # These have to be linked with before -lX11, unlike the other
12672   # libraries we check for below, so use a different variable.
12673   # John Interrante, Karl Berry
12674   echo "$as_me:12674: checking for IceConnectionNumber in -lICE" >&5
12675 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12676 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12677   echo $ECHO_N "(cached) $ECHO_C" >&6
12678 else
12679   ac_check_lib_save_LIBS=$LIBS
12680 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12681 cat >conftest.$ac_ext <<_ACEOF
12682 #line 12682 "configure"
12683 #include "confdefs.h"
12684
12685 /* Override any gcc2 internal prototype to avoid an error.  */
12686 #ifdef __cplusplus
12687 extern "C"
12688 #endif
12689 /* We use char because int might match the return type of a gcc2
12690    builtin and then its argument prototype would still apply.  */
12691 char IceConnectionNumber ();
12692 int
12693 main (void)
12694 {
12695 IceConnectionNumber ();
12696   ;
12697   return 0;
12698 }
12699 _ACEOF
12700 rm -f conftest.$ac_objext conftest$ac_exeext
12701 if { (eval echo "$as_me:12701: \"$ac_link\"") >&5
12702   (eval $ac_link) 2>&5
12703   ac_status=$?
12704   echo "$as_me:12704: \$? = $ac_status" >&5
12705   (exit $ac_status); } &&
12706          { ac_try='test -s conftest$ac_exeext'
12707   { (eval echo "$as_me:12707: \"$ac_try\"") >&5
12708   (eval $ac_try) 2>&5
12709   ac_status=$?
12710   echo "$as_me:12710: \$? = $ac_status" >&5
12711   (exit $ac_status); }; }; then
12712   ac_cv_lib_ICE_IceConnectionNumber=yes
12713 else
12714   echo "$as_me: failed program was:" >&5
12715 cat conftest.$ac_ext >&5
12716 ac_cv_lib_ICE_IceConnectionNumber=no
12717 fi
12718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12719 LIBS=$ac_check_lib_save_LIBS
12720 fi
12721 echo "$as_me:12721: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12722 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12723 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12724   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12725 fi
12726
12727   LDFLAGS=$ac_save_LDFLAGS
12728
12729 fi
12730
12731 cf_x_athena=${cf_x_athena:-Xaw}
12732
12733 echo "$as_me:12733: checking if you want to link with Xaw 3d library" >&5
12734 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12735 withval=
12736
12737 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12738 if test "${with_Xaw3d+set}" = set; then
12739   withval="$with_Xaw3d"
12740
12741 fi;
12742 if test "$withval" = yes ; then
12743         cf_x_athena=Xaw3d
12744         echo "$as_me:12744: result: yes" >&5
12745 echo "${ECHO_T}yes" >&6
12746 else
12747         echo "$as_me:12747: result: no" >&5
12748 echo "${ECHO_T}no" >&6
12749 fi
12750
12751 echo "$as_me:12751: checking if you want to link with Xaw 3d xft library" >&5
12752 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12753 withval=
12754
12755 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12756 if test "${with_Xaw3dxft+set}" = set; then
12757   withval="$with_Xaw3dxft"
12758
12759 fi;
12760 if test "$withval" = yes ; then
12761         cf_x_athena=Xaw3dxft
12762         echo "$as_me:12762: result: yes" >&5
12763 echo "${ECHO_T}yes" >&6
12764 else
12765         echo "$as_me:12765: result: no" >&5
12766 echo "${ECHO_T}no" >&6
12767 fi
12768
12769 echo "$as_me:12769: checking if you want to link with neXT Athena library" >&5
12770 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12771 withval=
12772
12773 # Check whether --with-neXtaw or --without-neXtaw was given.
12774 if test "${with_neXtaw+set}" = set; then
12775   withval="$with_neXtaw"
12776
12777 fi;
12778 if test "$withval" = yes ; then
12779         cf_x_athena=neXtaw
12780         echo "$as_me:12780: result: yes" >&5
12781 echo "${ECHO_T}yes" >&6
12782 else
12783         echo "$as_me:12783: result: no" >&5
12784 echo "${ECHO_T}no" >&6
12785 fi
12786
12787 echo "$as_me:12787: checking if you want to link with Athena-Plus library" >&5
12788 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12789 withval=
12790
12791 # Check whether --with-XawPlus or --without-XawPlus was given.
12792 if test "${with_XawPlus+set}" = set; then
12793   withval="$with_XawPlus"
12794
12795 fi;
12796 if test "$withval" = yes ; then
12797         cf_x_athena=XawPlus
12798         echo "$as_me:12798: result: yes" >&5
12799 echo "${ECHO_T}yes" >&6
12800 else
12801         echo "$as_me:12801: result: no" >&5
12802 echo "${ECHO_T}no" >&6
12803 fi
12804
12805 cf_x_athena_lib=""
12806
12807 if test "$PKG_CONFIG" != none ; then
12808         cf_athena_list=
12809         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12810         for cf_athena_pkg in \
12811                 $cf_athena_list \
12812                 ${cf_x_athena} \
12813                 ${cf_x_athena}-devel \
12814                 lib${cf_x_athena} \
12815                 lib${cf_x_athena}-devel
12816         do
12817
12818 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12819         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12820
12821 echo "${as_me:-configure}:12821: testing found package $cf_athena_pkg ..." 1>&5
12822
12823         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12824         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12825         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12826
12827 echo "${as_me:-configure}:12827: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12828
12829         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12830
12831 echo "${as_me:-configure}:12831: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12832
12833 cf_fix_cppflags=no
12834 cf_new_cflags=
12835 cf_new_cppflags=
12836 cf_new_extra_cppflags=
12837
12838 for cf_add_cflags in $cf_pkgconfig_incs
12839 do
12840 case $cf_fix_cppflags in
12841 (no)
12842         case $cf_add_cflags in
12843         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12844                 case $cf_add_cflags in
12845                 (-D*)
12846                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12847
12848                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12849                                 && test -z "${cf_tst_cflags}" \
12850                                 && cf_fix_cppflags=yes
12851
12852                         if test $cf_fix_cppflags = yes ; then
12853
12854         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12855         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12856
12857                                 continue
12858                         elif test "${cf_tst_cflags}" = "\"'" ; then
12859
12860         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12861         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12862
12863                                 continue
12864                         fi
12865                         ;;
12866                 esac
12867                 case "$CPPFLAGS" in
12868                 (*$cf_add_cflags)
12869                         ;;
12870                 (*)
12871                         case $cf_add_cflags in
12872                         (-D*)
12873                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12874
12875 CPPFLAGS=`echo "$CPPFLAGS" | \
12876         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12877                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12878
12879                                 ;;
12880                         esac
12881
12882         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12883         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12884
12885                         ;;
12886                 esac
12887                 ;;
12888         (*)
12889
12890         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12891         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12892
12893                 ;;
12894         esac
12895         ;;
12896 (yes)
12897
12898         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12899         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12900
12901         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12902
12903         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12904                 && test -z "${cf_tst_cflags}" \
12905                 && cf_fix_cppflags=no
12906         ;;
12907 esac
12908 done
12909
12910 if test -n "$cf_new_cflags" ; then
12911
12912         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12913         CFLAGS="${CFLAGS}$cf_new_cflags"
12914
12915 fi
12916
12917 if test -n "$cf_new_cppflags" ; then
12918
12919         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12920         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12921
12922 fi
12923
12924 if test -n "$cf_new_extra_cppflags" ; then
12925
12926         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12927         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12928
12929 fi
12930
12931 cf_add_libs="$LIBS"
12932 # reverse order
12933 cf_add_0lib=
12934 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
12935 # filter duplicates
12936 for cf_add_1lib in $cf_add_0lib; do
12937         for cf_add_2lib in $cf_add_libs; do
12938                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
12939                         cf_add_1lib=
12940                         break
12941                 fi
12942         done
12943         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
12944 done
12945 LIBS="$cf_add_libs"
12946
12947                         cf_x_athena_lib="$cf_pkgconfig_libs"
12948
12949 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12950
12951                         cat >>confdefs.h <<EOF
12952 #define $cf_x_athena_LIBS 1
12953 EOF
12954
12955         for cf_trim_lib in Xmu Xt X11
12956         do
12957                 case "$LIBS" in
12958                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12959                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12960                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12961
12962 echo "${as_me:-configure}:12962: testing ..trimmed $LIBS ..." 1>&5
12963
12964                         ;;
12965                 esac
12966         done
12967
12968 echo "$as_me:12968: checking for usable $cf_x_athena/Xmu package" >&5
12969 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12970 if test "${cf_cv_xaw_compat+set}" = set; then
12971   echo $ECHO_N "(cached) $ECHO_C" >&6
12972 else
12973
12974 cat >conftest.$ac_ext <<_ACEOF
12975 #line 12975 "configure"
12976 #include "confdefs.h"
12977
12978 #include <X11/Xmu/CharSet.h>
12979
12980 int
12981 main (void)
12982 {
12983
12984 int check = XmuCompareISOLatin1("big", "small");
12985 (void)check;
12986
12987   ;
12988   return 0;
12989 }
12990 _ACEOF
12991 rm -f conftest.$ac_objext conftest$ac_exeext
12992 if { (eval echo "$as_me:12992: \"$ac_link\"") >&5
12993   (eval $ac_link) 2>&5
12994   ac_status=$?
12995   echo "$as_me:12995: \$? = $ac_status" >&5
12996   (exit $ac_status); } &&
12997          { ac_try='test -s conftest$ac_exeext'
12998   { (eval echo "$as_me:12998: \"$ac_try\"") >&5
12999   (eval $ac_try) 2>&5
13000   ac_status=$?
13001   echo "$as_me:13001: \$? = $ac_status" >&5
13002   (exit $ac_status); }; }; then
13003   cf_cv_xaw_compat=yes
13004 else
13005   echo "$as_me: failed program was:" >&5
13006 cat conftest.$ac_ext >&5
13007 cf_cv_xaw_compat=no
13008 fi
13009 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13010 fi
13011 echo "$as_me:13011: result: $cf_cv_xaw_compat" >&5
13012 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
13013
13014                         if test "$cf_cv_xaw_compat" = no
13015                         then
13016                                 # workaround for broken ".pc" files...
13017                                 case "$cf_x_athena_lib" in
13018                                 (*-lXmu*)
13019                                         ;;
13020                                 (*)
13021                                         test -n "$verbose" && echo "    work around broken package" 1>&6
13022
13023 echo "${as_me:-configure}:13023: testing work around broken package ..." 1>&5
13024
13025                                         cf_save_xmu="$LIBS"
13026                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
13027
13028 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
13029         test -n "$verbose" && echo "    found package xmu" 1>&6
13030
13031 echo "${as_me:-configure}:13031: testing found package xmu ..." 1>&5
13032
13033         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
13034         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
13035         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
13036
13037 echo "${as_me:-configure}:13037: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13038
13039         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
13040
13041 echo "${as_me:-configure}:13041: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
13042
13043 cf_fix_cppflags=no
13044 cf_new_cflags=
13045 cf_new_cppflags=
13046 cf_new_extra_cppflags=
13047
13048 for cf_add_cflags in $cf_pkgconfig_incs
13049 do
13050 case $cf_fix_cppflags in
13051 (no)
13052         case $cf_add_cflags in
13053         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13054                 case $cf_add_cflags in
13055                 (-D*)
13056                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13057
13058                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13059                                 && test -z "${cf_tst_cflags}" \
13060                                 && cf_fix_cppflags=yes
13061
13062                         if test $cf_fix_cppflags = yes ; then
13063
13064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13066
13067                                 continue
13068                         elif test "${cf_tst_cflags}" = "\"'" ; then
13069
13070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13072
13073                                 continue
13074                         fi
13075                         ;;
13076                 esac
13077                 case "$CPPFLAGS" in
13078                 (*$cf_add_cflags)
13079                         ;;
13080                 (*)
13081                         case $cf_add_cflags in
13082                         (-D*)
13083                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13084
13085 CPPFLAGS=`echo "$CPPFLAGS" | \
13086         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13087                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13088
13089                                 ;;
13090                         esac
13091
13092         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13093         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13094
13095                         ;;
13096                 esac
13097                 ;;
13098         (*)
13099
13100         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13101         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13102
13103                 ;;
13104         esac
13105         ;;
13106 (yes)
13107
13108         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13109         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13110
13111         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13112
13113         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13114                 && test -z "${cf_tst_cflags}" \
13115                 && cf_fix_cppflags=no
13116         ;;
13117 esac
13118 done
13119
13120 if test -n "$cf_new_cflags" ; then
13121
13122         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13123         CFLAGS="${CFLAGS}$cf_new_cflags"
13124
13125 fi
13126
13127 if test -n "$cf_new_cppflags" ; then
13128
13129         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13130         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13131
13132 fi
13133
13134 if test -n "$cf_new_extra_cppflags" ; then
13135
13136         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13137         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13138
13139 fi
13140
13141 cf_add_libs="$LIBS"
13142 # reverse order
13143 cf_add_0lib=
13144 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13145 # filter duplicates
13146 for cf_add_1lib in $cf_add_0lib; do
13147         for cf_add_2lib in $cf_add_libs; do
13148                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13149                         cf_add_1lib=
13150                         break
13151                 fi
13152         done
13153         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13154 done
13155 LIBS="$cf_add_libs"
13156
13157                                                         LIBS="$cf_save_xmu"
13158
13159 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13160
13161 echo "${as_me:-configure}:13161: testing ...before $LIBS ..." 1>&5
13162
13163 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
13164 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13165
13166 echo "${as_me:-configure}:13166: testing ...after  $LIBS ..." 1>&5
13167
13168 else
13169         cf_pkgconfig_incs=
13170         cf_pkgconfig_libs=
13171
13172 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13173
13174 echo "${as_me:-configure}:13174: testing ...before $LIBS ..." 1>&5
13175
13176 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
13177 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13178
13179 echo "${as_me:-configure}:13179: testing ...after  $LIBS ..." 1>&5
13180
13181 fi
13182
13183         for cf_trim_lib in Xmu Xt X11
13184         do
13185                 case "$LIBS" in
13186                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
13187                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
13188                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
13189
13190 echo "${as_me:-configure}:13190: testing ..trimmed $LIBS ..." 1>&5
13191
13192                         ;;
13193                 esac
13194         done
13195
13196                                         ;;
13197                                 esac
13198                         fi
13199
13200                         break
13201 else
13202         cf_pkgconfig_incs=
13203         cf_pkgconfig_libs=
13204         :
13205 fi
13206
13207         done
13208 fi
13209
13210 if test -z "$cf_x_athena_lib" ; then
13211
13212 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
13213         test -n "$verbose" && echo "    found package Xext" 1>&6
13214
13215 echo "${as_me:-configure}:13215: testing found package Xext ..." 1>&5
13216
13217         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
13218         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
13219         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
13220
13221 echo "${as_me:-configure}:13221: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13222
13223         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
13224
13225 echo "${as_me:-configure}:13225: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
13226
13227 cf_fix_cppflags=no
13228 cf_new_cflags=
13229 cf_new_cppflags=
13230 cf_new_extra_cppflags=
13231
13232 for cf_add_cflags in $cf_pkgconfig_incs
13233 do
13234 case $cf_fix_cppflags in
13235 (no)
13236         case $cf_add_cflags in
13237         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13238                 case $cf_add_cflags in
13239                 (-D*)
13240                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13241
13242                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13243                                 && test -z "${cf_tst_cflags}" \
13244                                 && cf_fix_cppflags=yes
13245
13246                         if test $cf_fix_cppflags = yes ; then
13247
13248         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13249         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13250
13251                                 continue
13252                         elif test "${cf_tst_cflags}" = "\"'" ; then
13253
13254         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13255         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13256
13257                                 continue
13258                         fi
13259                         ;;
13260                 esac
13261                 case "$CPPFLAGS" in
13262                 (*$cf_add_cflags)
13263                         ;;
13264                 (*)
13265                         case $cf_add_cflags in
13266                         (-D*)
13267                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13268
13269 CPPFLAGS=`echo "$CPPFLAGS" | \
13270         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13271                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13272
13273                                 ;;
13274                         esac
13275
13276         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13277         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13278
13279                         ;;
13280                 esac
13281                 ;;
13282         (*)
13283
13284         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13285         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13286
13287                 ;;
13288         esac
13289         ;;
13290 (yes)
13291
13292         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13293         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13294
13295         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13296
13297         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13298                 && test -z "${cf_tst_cflags}" \
13299                 && cf_fix_cppflags=no
13300         ;;
13301 esac
13302 done
13303
13304 if test -n "$cf_new_cflags" ; then
13305
13306         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13307         CFLAGS="${CFLAGS}$cf_new_cflags"
13308
13309 fi
13310
13311 if test -n "$cf_new_cppflags" ; then
13312
13313         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13314         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13315
13316 fi
13317
13318 if test -n "$cf_new_extra_cppflags" ; then
13319
13320         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13321         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13322
13323 fi
13324
13325 cf_add_libs="$LIBS"
13326 # reverse order
13327 cf_add_0lib=
13328 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13329 # filter duplicates
13330 for cf_add_1lib in $cf_add_0lib; do
13331         for cf_add_2lib in $cf_add_libs; do
13332                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13333                         cf_add_1lib=
13334                         break
13335                 fi
13336         done
13337         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13338 done
13339 LIBS="$cf_add_libs"
13340
13341         :
13342 else
13343         cf_pkgconfig_incs=
13344         cf_pkgconfig_libs=
13345
13346         echo "$as_me:13346: checking for XextCreateExtension in -lXext" >&5
13347 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
13348 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
13349   echo $ECHO_N "(cached) $ECHO_C" >&6
13350 else
13351   ac_check_lib_save_LIBS=$LIBS
13352 LIBS="-lXext  $LIBS"
13353 cat >conftest.$ac_ext <<_ACEOF
13354 #line 13354 "configure"
13355 #include "confdefs.h"
13356
13357 /* Override any gcc2 internal prototype to avoid an error.  */
13358 #ifdef __cplusplus
13359 extern "C"
13360 #endif
13361 /* We use char because int might match the return type of a gcc2
13362    builtin and then its argument prototype would still apply.  */
13363 char XextCreateExtension ();
13364 int
13365 main (void)
13366 {
13367 XextCreateExtension ();
13368   ;
13369   return 0;
13370 }
13371 _ACEOF
13372 rm -f conftest.$ac_objext conftest$ac_exeext
13373 if { (eval echo "$as_me:13373: \"$ac_link\"") >&5
13374   (eval $ac_link) 2>&5
13375   ac_status=$?
13376   echo "$as_me:13376: \$? = $ac_status" >&5
13377   (exit $ac_status); } &&
13378          { ac_try='test -s conftest$ac_exeext'
13379   { (eval echo "$as_me:13379: \"$ac_try\"") >&5
13380   (eval $ac_try) 2>&5
13381   ac_status=$?
13382   echo "$as_me:13382: \$? = $ac_status" >&5
13383   (exit $ac_status); }; }; then
13384   ac_cv_lib_Xext_XextCreateExtension=yes
13385 else
13386   echo "$as_me: failed program was:" >&5
13387 cat conftest.$ac_ext >&5
13388 ac_cv_lib_Xext_XextCreateExtension=no
13389 fi
13390 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13391 LIBS=$ac_check_lib_save_LIBS
13392 fi
13393 echo "$as_me:13393: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
13394 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
13395 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
13396
13397 cf_add_libs="$LIBS"
13398 # reverse order
13399 cf_add_0lib=
13400 for cf_add_1lib in -lXext; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13401 # filter duplicates
13402 for cf_add_1lib in $cf_add_0lib; do
13403         for cf_add_2lib in $cf_add_libs; do
13404                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13405                         cf_add_1lib=
13406                         break
13407                 fi
13408         done
13409         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13410 done
13411 LIBS="$cf_add_libs"
13412
13413 fi
13414
13415 fi
13416
13417 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new) (and
13418 # in some cases has installed dummy files in the former, other cases replaced
13419 # it with a link to the new location).  This complicates the configure script.
13420 # Check for that pitfall, and recover using pkg-config
13421 #
13422 # If none of these are set, the configuration is almost certainly broken.
13423 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
13424 then
13425
13426 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13427         test -n "$verbose" && echo "    found package x11" 1>&6
13428
13429 echo "${as_me:-configure}:13429: testing found package x11 ..." 1>&5
13430
13431         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13432         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13433         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13434
13435 echo "${as_me:-configure}:13435: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13436
13437         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13438
13439 echo "${as_me:-configure}:13439: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13440
13441 cf_fix_cppflags=no
13442 cf_new_cflags=
13443 cf_new_cppflags=
13444 cf_new_extra_cppflags=
13445
13446 for cf_add_cflags in $cf_pkgconfig_incs
13447 do
13448 case $cf_fix_cppflags in
13449 (no)
13450         case $cf_add_cflags in
13451         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13452                 case $cf_add_cflags in
13453                 (-D*)
13454                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13455
13456                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13457                                 && test -z "${cf_tst_cflags}" \
13458                                 && cf_fix_cppflags=yes
13459
13460                         if test $cf_fix_cppflags = yes ; then
13461
13462         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13463         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13464
13465                                 continue
13466                         elif test "${cf_tst_cflags}" = "\"'" ; then
13467
13468         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13469         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13470
13471                                 continue
13472                         fi
13473                         ;;
13474                 esac
13475                 case "$CPPFLAGS" in
13476                 (*$cf_add_cflags)
13477                         ;;
13478                 (*)
13479                         case $cf_add_cflags in
13480                         (-D*)
13481                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13482
13483 CPPFLAGS=`echo "$CPPFLAGS" | \
13484         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13485                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13486
13487                                 ;;
13488                         esac
13489
13490         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13491         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13492
13493                         ;;
13494                 esac
13495                 ;;
13496         (*)
13497
13498         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13499         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13500
13501                 ;;
13502         esac
13503         ;;
13504 (yes)
13505
13506         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13507         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13508
13509         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13510
13511         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13512                 && test -z "${cf_tst_cflags}" \
13513                 && cf_fix_cppflags=no
13514         ;;
13515 esac
13516 done
13517
13518 if test -n "$cf_new_cflags" ; then
13519
13520         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13521         CFLAGS="${CFLAGS}$cf_new_cflags"
13522
13523 fi
13524
13525 if test -n "$cf_new_cppflags" ; then
13526
13527         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13528         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13529
13530 fi
13531
13532 if test -n "$cf_new_extra_cppflags" ; then
13533
13534         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13535         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13536
13537 fi
13538
13539 cf_add_libs="$LIBS"
13540 # reverse order
13541 cf_add_0lib=
13542 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13543 # filter duplicates
13544 for cf_add_1lib in $cf_add_0lib; do
13545         for cf_add_2lib in $cf_add_libs; do
13546                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13547                         cf_add_1lib=
13548                         break
13549                 fi
13550         done
13551         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13552 done
13553 LIBS="$cf_add_libs"
13554
13555         :
13556 else
13557         cf_pkgconfig_incs=
13558         cf_pkgconfig_libs=
13559         { echo "$as_me:13559: WARNING: unable to find X11 library" >&5
13560 echo "$as_me: WARNING: unable to find X11 library" >&2;}
13561 fi
13562
13563 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13564         test -n "$verbose" && echo "    found package ice" 1>&6
13565
13566 echo "${as_me:-configure}:13566: testing found package ice ..." 1>&5
13567
13568         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13569         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13570         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13571
13572 echo "${as_me:-configure}:13572: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13573
13574         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13575
13576 echo "${as_me:-configure}:13576: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13577
13578 cf_fix_cppflags=no
13579 cf_new_cflags=
13580 cf_new_cppflags=
13581 cf_new_extra_cppflags=
13582
13583 for cf_add_cflags in $cf_pkgconfig_incs
13584 do
13585 case $cf_fix_cppflags in
13586 (no)
13587         case $cf_add_cflags in
13588         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13589                 case $cf_add_cflags in
13590                 (-D*)
13591                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13592
13593                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13594                                 && test -z "${cf_tst_cflags}" \
13595                                 && cf_fix_cppflags=yes
13596
13597                         if test $cf_fix_cppflags = yes ; then
13598
13599         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13600         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13601
13602                                 continue
13603                         elif test "${cf_tst_cflags}" = "\"'" ; then
13604
13605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13607
13608                                 continue
13609                         fi
13610                         ;;
13611                 esac
13612                 case "$CPPFLAGS" in
13613                 (*$cf_add_cflags)
13614                         ;;
13615                 (*)
13616                         case $cf_add_cflags in
13617                         (-D*)
13618                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13619
13620 CPPFLAGS=`echo "$CPPFLAGS" | \
13621         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13622                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13623
13624                                 ;;
13625                         esac
13626
13627         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13628         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13629
13630                         ;;
13631                 esac
13632                 ;;
13633         (*)
13634
13635         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13636         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13637
13638                 ;;
13639         esac
13640         ;;
13641 (yes)
13642
13643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13645
13646         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13647
13648         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13649                 && test -z "${cf_tst_cflags}" \
13650                 && cf_fix_cppflags=no
13651         ;;
13652 esac
13653 done
13654
13655 if test -n "$cf_new_cflags" ; then
13656
13657         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13658         CFLAGS="${CFLAGS}$cf_new_cflags"
13659
13660 fi
13661
13662 if test -n "$cf_new_cppflags" ; then
13663
13664         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13665         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13666
13667 fi
13668
13669 if test -n "$cf_new_extra_cppflags" ; then
13670
13671         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13672         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13673
13674 fi
13675
13676 cf_add_libs="$LIBS"
13677 # reverse order
13678 cf_add_0lib=
13679 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13680 # filter duplicates
13681 for cf_add_1lib in $cf_add_0lib; do
13682         for cf_add_2lib in $cf_add_libs; do
13683                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13684                         cf_add_1lib=
13685                         break
13686                 fi
13687         done
13688         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13689 done
13690 LIBS="$cf_add_libs"
13691
13692         :
13693 else
13694         cf_pkgconfig_incs=
13695         cf_pkgconfig_libs=
13696         { echo "$as_me:13696: WARNING: unable to find ICE library" >&5
13697 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13698 fi
13699
13700 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13701         test -n "$verbose" && echo "    found package sm" 1>&6
13702
13703 echo "${as_me:-configure}:13703: testing found package sm ..." 1>&5
13704
13705         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13706         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13707         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13708
13709 echo "${as_me:-configure}:13709: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13710
13711         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13712
13713 echo "${as_me:-configure}:13713: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13714
13715 cf_fix_cppflags=no
13716 cf_new_cflags=
13717 cf_new_cppflags=
13718 cf_new_extra_cppflags=
13719
13720 for cf_add_cflags in $cf_pkgconfig_incs
13721 do
13722 case $cf_fix_cppflags in
13723 (no)
13724         case $cf_add_cflags in
13725         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13726                 case $cf_add_cflags in
13727                 (-D*)
13728                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13729
13730                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13731                                 && test -z "${cf_tst_cflags}" \
13732                                 && cf_fix_cppflags=yes
13733
13734                         if test $cf_fix_cppflags = yes ; then
13735
13736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13738
13739                                 continue
13740                         elif test "${cf_tst_cflags}" = "\"'" ; then
13741
13742         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13743         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13744
13745                                 continue
13746                         fi
13747                         ;;
13748                 esac
13749                 case "$CPPFLAGS" in
13750                 (*$cf_add_cflags)
13751                         ;;
13752                 (*)
13753                         case $cf_add_cflags in
13754                         (-D*)
13755                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13756
13757 CPPFLAGS=`echo "$CPPFLAGS" | \
13758         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13759                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13760
13761                                 ;;
13762                         esac
13763
13764         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13765         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13766
13767                         ;;
13768                 esac
13769                 ;;
13770         (*)
13771
13772         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13773         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13774
13775                 ;;
13776         esac
13777         ;;
13778 (yes)
13779
13780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13782
13783         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13784
13785         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13786                 && test -z "${cf_tst_cflags}" \
13787                 && cf_fix_cppflags=no
13788         ;;
13789 esac
13790 done
13791
13792 if test -n "$cf_new_cflags" ; then
13793
13794         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13795         CFLAGS="${CFLAGS}$cf_new_cflags"
13796
13797 fi
13798
13799 if test -n "$cf_new_cppflags" ; then
13800
13801         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13802         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13803
13804 fi
13805
13806 if test -n "$cf_new_extra_cppflags" ; then
13807
13808         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13809         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13810
13811 fi
13812
13813 cf_add_libs="$LIBS"
13814 # reverse order
13815 cf_add_0lib=
13816 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13817 # filter duplicates
13818 for cf_add_1lib in $cf_add_0lib; do
13819         for cf_add_2lib in $cf_add_libs; do
13820                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13821                         cf_add_1lib=
13822                         break
13823                 fi
13824         done
13825         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13826 done
13827 LIBS="$cf_add_libs"
13828
13829         :
13830 else
13831         cf_pkgconfig_incs=
13832         cf_pkgconfig_libs=
13833         { echo "$as_me:13833: WARNING: unable to find SM library" >&5
13834 echo "$as_me: WARNING: unable to find SM library" >&2;}
13835 fi
13836
13837 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13838         test -n "$verbose" && echo "    found package xt" 1>&6
13839
13840 echo "${as_me:-configure}:13840: testing found package xt ..." 1>&5
13841
13842         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13843         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13844         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13845
13846 echo "${as_me:-configure}:13846: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13847
13848         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13849
13850 echo "${as_me:-configure}:13850: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13851
13852 cf_fix_cppflags=no
13853 cf_new_cflags=
13854 cf_new_cppflags=
13855 cf_new_extra_cppflags=
13856
13857 for cf_add_cflags in $cf_pkgconfig_incs
13858 do
13859 case $cf_fix_cppflags in
13860 (no)
13861         case $cf_add_cflags in
13862         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13863                 case $cf_add_cflags in
13864                 (-D*)
13865                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13866
13867                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13868                                 && test -z "${cf_tst_cflags}" \
13869                                 && cf_fix_cppflags=yes
13870
13871                         if test $cf_fix_cppflags = yes ; then
13872
13873         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13874         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13875
13876                                 continue
13877                         elif test "${cf_tst_cflags}" = "\"'" ; then
13878
13879         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13880         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13881
13882                                 continue
13883                         fi
13884                         ;;
13885                 esac
13886                 case "$CPPFLAGS" in
13887                 (*$cf_add_cflags)
13888                         ;;
13889                 (*)
13890                         case $cf_add_cflags in
13891                         (-D*)
13892                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13893
13894 CPPFLAGS=`echo "$CPPFLAGS" | \
13895         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13896                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13897
13898                                 ;;
13899                         esac
13900
13901         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13902         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13903
13904                         ;;
13905                 esac
13906                 ;;
13907         (*)
13908
13909         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13910         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13911
13912                 ;;
13913         esac
13914         ;;
13915 (yes)
13916
13917         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13918         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13919
13920         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13921
13922         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13923                 && test -z "${cf_tst_cflags}" \
13924                 && cf_fix_cppflags=no
13925         ;;
13926 esac
13927 done
13928
13929 if test -n "$cf_new_cflags" ; then
13930
13931         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13932         CFLAGS="${CFLAGS}$cf_new_cflags"
13933
13934 fi
13935
13936 if test -n "$cf_new_cppflags" ; then
13937
13938         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13939         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13940
13941 fi
13942
13943 if test -n "$cf_new_extra_cppflags" ; then
13944
13945         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13946         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13947
13948 fi
13949
13950 cf_add_libs="$LIBS"
13951 # reverse order
13952 cf_add_0lib=
13953 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
13954 # filter duplicates
13955 for cf_add_1lib in $cf_add_0lib; do
13956         for cf_add_2lib in $cf_add_libs; do
13957                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
13958                         cf_add_1lib=
13959                         break
13960                 fi
13961         done
13962         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
13963 done
13964 LIBS="$cf_add_libs"
13965
13966         :
13967 else
13968         cf_pkgconfig_incs=
13969         cf_pkgconfig_libs=
13970         { echo "$as_me:13970: WARNING: unable to find Xt library" >&5
13971 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13972 fi
13973
13974 else
13975         LIBS="$X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13976 fi
13977
13978 cf_have_X_LIBS=no
13979
13980 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13981         test -n "$verbose" && echo "    found package xt" 1>&6
13982
13983 echo "${as_me:-configure}:13983: testing found package xt ..." 1>&5
13984
13985         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13986         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13987         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13988
13989 echo "${as_me:-configure}:13989: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13990
13991         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13992
13993 echo "${as_me:-configure}:13993: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13994
13995 cf_fix_cppflags=no
13996 cf_new_cflags=
13997 cf_new_cppflags=
13998 cf_new_extra_cppflags=
13999
14000 for cf_add_cflags in $cf_pkgconfig_incs
14001 do
14002 case $cf_fix_cppflags in
14003 (no)
14004         case $cf_add_cflags in
14005         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14006                 case $cf_add_cflags in
14007                 (-D*)
14008                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14009
14010                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14011                                 && test -z "${cf_tst_cflags}" \
14012                                 && cf_fix_cppflags=yes
14013
14014                         if test $cf_fix_cppflags = yes ; then
14015
14016         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14017         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14018
14019                                 continue
14020                         elif test "${cf_tst_cflags}" = "\"'" ; then
14021
14022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14024
14025                                 continue
14026                         fi
14027                         ;;
14028                 esac
14029                 case "$CPPFLAGS" in
14030                 (*$cf_add_cflags)
14031                         ;;
14032                 (*)
14033                         case $cf_add_cflags in
14034                         (-D*)
14035                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14036
14037 CPPFLAGS=`echo "$CPPFLAGS" | \
14038         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14039                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14040
14041                                 ;;
14042                         esac
14043
14044         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14045         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14046
14047                         ;;
14048                 esac
14049                 ;;
14050         (*)
14051
14052         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14053         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14054
14055                 ;;
14056         esac
14057         ;;
14058 (yes)
14059
14060         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14061         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14062
14063         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14064
14065         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14066                 && test -z "${cf_tst_cflags}" \
14067                 && cf_fix_cppflags=no
14068         ;;
14069 esac
14070 done
14071
14072 if test -n "$cf_new_cflags" ; then
14073
14074         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14075         CFLAGS="${CFLAGS}$cf_new_cflags"
14076
14077 fi
14078
14079 if test -n "$cf_new_cppflags" ; then
14080
14081         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14082         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14083
14084 fi
14085
14086 if test -n "$cf_new_extra_cppflags" ; then
14087
14088         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14089         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14090
14091 fi
14092
14093 cf_add_libs="$LIBS"
14094 # reverse order
14095 cf_add_0lib=
14096 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14097 # filter duplicates
14098 for cf_add_1lib in $cf_add_0lib; do
14099         for cf_add_2lib in $cf_add_libs; do
14100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14101                         cf_add_1lib=
14102                         break
14103                 fi
14104         done
14105         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14106 done
14107 LIBS="$cf_add_libs"
14108
14109         case "x$LIBS" in
14110         (*-lX11*)
14111                 ;;
14112         (*)
14113 # we have an "xt" package, but it may omit Xt's dependency on X11
14114 echo "$as_me:14114: checking for usable X dependency" >&5
14115 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
14116 if test "${cf_cv_xt_x11_compat+set}" = set; then
14117   echo $ECHO_N "(cached) $ECHO_C" >&6
14118 else
14119
14120 cat >conftest.$ac_ext <<_ACEOF
14121 #line 14121 "configure"
14122 #include "confdefs.h"
14123
14124 #include <X11/Xlib.h>
14125
14126 int
14127 main (void)
14128 {
14129
14130         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
14131         int rc2 = XClearWindow((Display*) 0, (Window) 0);
14132         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
14133         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
14134
14135   ;
14136   return 0;
14137 }
14138 _ACEOF
14139 rm -f conftest.$ac_objext conftest$ac_exeext
14140 if { (eval echo "$as_me:14140: \"$ac_link\"") >&5
14141   (eval $ac_link) 2>&5
14142   ac_status=$?
14143   echo "$as_me:14143: \$? = $ac_status" >&5
14144   (exit $ac_status); } &&
14145          { ac_try='test -s conftest$ac_exeext'
14146   { (eval echo "$as_me:14146: \"$ac_try\"") >&5
14147   (eval $ac_try) 2>&5
14148   ac_status=$?
14149   echo "$as_me:14149: \$? = $ac_status" >&5
14150   (exit $ac_status); }; }; then
14151   cf_cv_xt_x11_compat=yes
14152 else
14153   echo "$as_me: failed program was:" >&5
14154 cat conftest.$ac_ext >&5
14155 cf_cv_xt_x11_compat=no
14156 fi
14157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14158 fi
14159 echo "$as_me:14159: result: $cf_cv_xt_x11_compat" >&5
14160 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
14161                 if test "$cf_cv_xt_x11_compat" = no
14162                 then
14163                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
14164
14165 echo "${as_me:-configure}:14165: testing work around broken X11 dependency ..." 1>&5
14166
14167                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
14168
14169 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
14170         test -n "$verbose" && echo "    found package x11" 1>&6
14171
14172 echo "${as_me:-configure}:14172: testing found package x11 ..." 1>&5
14173
14174         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
14175         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
14176         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
14177
14178 echo "${as_me:-configure}:14178: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14179
14180         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
14181
14182 echo "${as_me:-configure}:14182: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
14183
14184 cf_fix_cppflags=no
14185 cf_new_cflags=
14186 cf_new_cppflags=
14187 cf_new_extra_cppflags=
14188
14189 for cf_add_cflags in $cf_pkgconfig_incs
14190 do
14191 case $cf_fix_cppflags in
14192 (no)
14193         case $cf_add_cflags in
14194         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14195                 case $cf_add_cflags in
14196                 (-D*)
14197                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14198
14199                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14200                                 && test -z "${cf_tst_cflags}" \
14201                                 && cf_fix_cppflags=yes
14202
14203                         if test $cf_fix_cppflags = yes ; then
14204
14205         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14206         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14207
14208                                 continue
14209                         elif test "${cf_tst_cflags}" = "\"'" ; then
14210
14211         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14212         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14213
14214                                 continue
14215                         fi
14216                         ;;
14217                 esac
14218                 case "$CPPFLAGS" in
14219                 (*$cf_add_cflags)
14220                         ;;
14221                 (*)
14222                         case $cf_add_cflags in
14223                         (-D*)
14224                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14225
14226 CPPFLAGS=`echo "$CPPFLAGS" | \
14227         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14228                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14229
14230                                 ;;
14231                         esac
14232
14233         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14234         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14235
14236                         ;;
14237                 esac
14238                 ;;
14239         (*)
14240
14241         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14242         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14243
14244                 ;;
14245         esac
14246         ;;
14247 (yes)
14248
14249         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14250         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14251
14252         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14253
14254         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14255                 && test -z "${cf_tst_cflags}" \
14256                 && cf_fix_cppflags=no
14257         ;;
14258 esac
14259 done
14260
14261 if test -n "$cf_new_cflags" ; then
14262
14263         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14264         CFLAGS="${CFLAGS}$cf_new_cflags"
14265
14266 fi
14267
14268 if test -n "$cf_new_cppflags" ; then
14269
14270         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14271         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14272
14273 fi
14274
14275 if test -n "$cf_new_extra_cppflags" ; then
14276
14277         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14278         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14279
14280 fi
14281
14282 cf_add_libs="$LIBS"
14283 # reverse order
14284 cf_add_0lib=
14285 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14286 # filter duplicates
14287 for cf_add_1lib in $cf_add_0lib; do
14288         for cf_add_2lib in $cf_add_libs; do
14289                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14290                         cf_add_1lib=
14291                         break
14292                 fi
14293         done
14294         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14295 done
14296 LIBS="$cf_add_libs"
14297
14298         :
14299 else
14300         cf_pkgconfig_incs=
14301         cf_pkgconfig_libs=
14302
14303 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14304
14305 echo "${as_me:-configure}:14305: testing ...before $LIBS ..." 1>&5
14306
14307 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
14308 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14309
14310 echo "${as_me:-configure}:14310: testing ...after  $LIBS ..." 1>&5
14311
14312 fi
14313
14314                 fi
14315                 ;;
14316         esac
14317
14318 echo "$as_me:14318: checking for usable X Toolkit package" >&5
14319 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
14320 if test "${cf_cv_xt_ice_compat+set}" = set; then
14321   echo $ECHO_N "(cached) $ECHO_C" >&6
14322 else
14323
14324 cat >conftest.$ac_ext <<_ACEOF
14325 #line 14325 "configure"
14326 #include "confdefs.h"
14327
14328 #include <X11/Shell.h>
14329
14330 int
14331 main (void)
14332 {
14333 int num = IceConnectionNumber(0); (void) num
14334
14335   ;
14336   return 0;
14337 }
14338 _ACEOF
14339 rm -f conftest.$ac_objext conftest$ac_exeext
14340 if { (eval echo "$as_me:14340: \"$ac_link\"") >&5
14341   (eval $ac_link) 2>&5
14342   ac_status=$?
14343   echo "$as_me:14343: \$? = $ac_status" >&5
14344   (exit $ac_status); } &&
14345          { ac_try='test -s conftest$ac_exeext'
14346   { (eval echo "$as_me:14346: \"$ac_try\"") >&5
14347   (eval $ac_try) 2>&5
14348   ac_status=$?
14349   echo "$as_me:14349: \$? = $ac_status" >&5
14350   (exit $ac_status); }; }; then
14351   cf_cv_xt_ice_compat=yes
14352 else
14353   echo "$as_me: failed program was:" >&5
14354 cat conftest.$ac_ext >&5
14355 cf_cv_xt_ice_compat=no
14356 fi
14357 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14358 fi
14359 echo "$as_me:14359: result: $cf_cv_xt_ice_compat" >&5
14360 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
14361
14362         if test "$cf_cv_xt_ice_compat" = no
14363         then
14364                 # workaround for broken ".pc" files used for X Toolkit.
14365                 case "x$X_PRE_LIBS" in
14366                 (*-lICE*)
14367                         case "x$LIBS" in
14368                         (*-lICE*)
14369                                 ;;
14370                         (*)
14371                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
14372
14373 echo "${as_me:-configure}:14373: testing work around broken ICE dependency ..." 1>&5
14374
14375 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
14376         test -n "$verbose" && echo "    found package ice" 1>&6
14377
14378 echo "${as_me:-configure}:14378: testing found package ice ..." 1>&5
14379
14380         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
14381         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
14382         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
14383
14384 echo "${as_me:-configure}:14384: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14385
14386         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
14387
14388 echo "${as_me:-configure}:14388: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
14389
14390 cf_fix_cppflags=no
14391 cf_new_cflags=
14392 cf_new_cppflags=
14393 cf_new_extra_cppflags=
14394
14395 for cf_add_cflags in $cf_pkgconfig_incs
14396 do
14397 case $cf_fix_cppflags in
14398 (no)
14399         case $cf_add_cflags in
14400         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14401                 case $cf_add_cflags in
14402                 (-D*)
14403                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14404
14405                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14406                                 && test -z "${cf_tst_cflags}" \
14407                                 && cf_fix_cppflags=yes
14408
14409                         if test $cf_fix_cppflags = yes ; then
14410
14411         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14412         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14413
14414                                 continue
14415                         elif test "${cf_tst_cflags}" = "\"'" ; then
14416
14417         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14418         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14419
14420                                 continue
14421                         fi
14422                         ;;
14423                 esac
14424                 case "$CPPFLAGS" in
14425                 (*$cf_add_cflags)
14426                         ;;
14427                 (*)
14428                         case $cf_add_cflags in
14429                         (-D*)
14430                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14431
14432 CPPFLAGS=`echo "$CPPFLAGS" | \
14433         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14434                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14435
14436                                 ;;
14437                         esac
14438
14439         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14440         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14441
14442                         ;;
14443                 esac
14444                 ;;
14445         (*)
14446
14447         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14448         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14449
14450                 ;;
14451         esac
14452         ;;
14453 (yes)
14454
14455         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14456         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14457
14458         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14459
14460         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14461                 && test -z "${cf_tst_cflags}" \
14462                 && cf_fix_cppflags=no
14463         ;;
14464 esac
14465 done
14466
14467 if test -n "$cf_new_cflags" ; then
14468
14469         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14470         CFLAGS="${CFLAGS}$cf_new_cflags"
14471
14472 fi
14473
14474 if test -n "$cf_new_cppflags" ; then
14475
14476         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14477         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14478
14479 fi
14480
14481 if test -n "$cf_new_extra_cppflags" ; then
14482
14483         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14484         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14485
14486 fi
14487
14488 cf_add_libs="$LIBS"
14489 # reverse order
14490 cf_add_0lib=
14491 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14492 # filter duplicates
14493 for cf_add_1lib in $cf_add_0lib; do
14494         for cf_add_2lib in $cf_add_libs; do
14495                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14496                         cf_add_1lib=
14497                         break
14498                 fi
14499         done
14500         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14501 done
14502 LIBS="$cf_add_libs"
14503
14504 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
14505         test -n "$verbose" && echo "    found package sm" 1>&6
14506
14507 echo "${as_me:-configure}:14507: testing found package sm ..." 1>&5
14508
14509         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
14510         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
14511         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
14512
14513 echo "${as_me:-configure}:14513: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
14514
14515         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
14516
14517 echo "${as_me:-configure}:14517: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
14518
14519 cf_fix_cppflags=no
14520 cf_new_cflags=
14521 cf_new_cppflags=
14522 cf_new_extra_cppflags=
14523
14524 for cf_add_cflags in $cf_pkgconfig_incs
14525 do
14526 case $cf_fix_cppflags in
14527 (no)
14528         case $cf_add_cflags in
14529         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14530                 case $cf_add_cflags in
14531                 (-D*)
14532                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14533
14534                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14535                                 && test -z "${cf_tst_cflags}" \
14536                                 && cf_fix_cppflags=yes
14537
14538                         if test $cf_fix_cppflags = yes ; then
14539
14540         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14541         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14542
14543                                 continue
14544                         elif test "${cf_tst_cflags}" = "\"'" ; then
14545
14546         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14547         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14548
14549                                 continue
14550                         fi
14551                         ;;
14552                 esac
14553                 case "$CPPFLAGS" in
14554                 (*$cf_add_cflags)
14555                         ;;
14556                 (*)
14557                         case $cf_add_cflags in
14558                         (-D*)
14559                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14560
14561 CPPFLAGS=`echo "$CPPFLAGS" | \
14562         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14563                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14564
14565                                 ;;
14566                         esac
14567
14568         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14569         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14570
14571                         ;;
14572                 esac
14573                 ;;
14574         (*)
14575
14576         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14577         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14578
14579                 ;;
14580         esac
14581         ;;
14582 (yes)
14583
14584         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14585         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14586
14587         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14588
14589         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14590                 && test -z "${cf_tst_cflags}" \
14591                 && cf_fix_cppflags=no
14592         ;;
14593 esac
14594 done
14595
14596 if test -n "$cf_new_cflags" ; then
14597
14598         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14599         CFLAGS="${CFLAGS}$cf_new_cflags"
14600
14601 fi
14602
14603 if test -n "$cf_new_cppflags" ; then
14604
14605         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14606         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14607
14608 fi
14609
14610 if test -n "$cf_new_extra_cppflags" ; then
14611
14612         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14613         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14614
14615 fi
14616
14617 cf_add_libs="$LIBS"
14618 # reverse order
14619 cf_add_0lib=
14620 for cf_add_1lib in $cf_pkgconfig_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14621 # filter duplicates
14622 for cf_add_1lib in $cf_add_0lib; do
14623         for cf_add_2lib in $cf_add_libs; do
14624                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14625                         cf_add_1lib=
14626                         break
14627                 fi
14628         done
14629         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14630 done
14631 LIBS="$cf_add_libs"
14632
14633         :
14634 else
14635         cf_pkgconfig_incs=
14636         cf_pkgconfig_libs=
14637         :
14638 fi
14639
14640 else
14641         cf_pkgconfig_incs=
14642         cf_pkgconfig_libs=
14643
14644 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14645
14646 echo "${as_me:-configure}:14646: testing ...before $LIBS ..." 1>&5
14647
14648 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14649 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14650
14651 echo "${as_me:-configure}:14651: testing ...after  $LIBS ..." 1>&5
14652
14653 fi
14654
14655                                 ;;
14656                         esac
14657                         ;;
14658                 esac
14659         fi
14660
14661         cf_have_X_LIBS=yes
14662
14663 else
14664         cf_pkgconfig_incs=
14665         cf_pkgconfig_libs=
14666
14667         LDFLAGS="$X_LIBS $LDFLAGS"
14668
14669 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14670
14671 echo "${as_me:-configure}:14671: testing checking additions to CFLAGS ..." 1>&5
14672
14673 cf_check_cflags="$CFLAGS"
14674 cf_check_cppflags="$CPPFLAGS"
14675
14676 cf_fix_cppflags=no
14677 cf_new_cflags=
14678 cf_new_cppflags=
14679 cf_new_extra_cppflags=
14680
14681 for cf_add_cflags in $X_CFLAGS
14682 do
14683 case $cf_fix_cppflags in
14684 (no)
14685         case $cf_add_cflags in
14686         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14687                 case $cf_add_cflags in
14688                 (-D*)
14689                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14690
14691                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14692                                 && test -z "${cf_tst_cflags}" \
14693                                 && cf_fix_cppflags=yes
14694
14695                         if test $cf_fix_cppflags = yes ; then
14696
14697         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14698         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14699
14700                                 continue
14701                         elif test "${cf_tst_cflags}" = "\"'" ; then
14702
14703         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14704         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14705
14706                                 continue
14707                         fi
14708                         ;;
14709                 esac
14710                 case "$CPPFLAGS" in
14711                 (*$cf_add_cflags)
14712                         ;;
14713                 (*)
14714                         case $cf_add_cflags in
14715                         (-D*)
14716                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14717
14718 CPPFLAGS=`echo "$CPPFLAGS" | \
14719         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14720                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14721
14722                                 ;;
14723                         esac
14724
14725         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14726         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14727
14728                         ;;
14729                 esac
14730                 ;;
14731         (*)
14732
14733         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14734         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14735
14736                 ;;
14737         esac
14738         ;;
14739 (yes)
14740
14741         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14742         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14743
14744         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14745
14746         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14747                 && test -z "${cf_tst_cflags}" \
14748                 && cf_fix_cppflags=no
14749         ;;
14750 esac
14751 done
14752
14753 if test -n "$cf_new_cflags" ; then
14754         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14755
14756 echo "${as_me:-configure}:14756: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14757
14758         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14759         CFLAGS="${CFLAGS}$cf_new_cflags"
14760
14761 fi
14762
14763 if test -n "$cf_new_cppflags" ; then
14764         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14765
14766 echo "${as_me:-configure}:14766: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14767
14768         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14769         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14770
14771 fi
14772
14773 if test -n "$cf_new_extra_cppflags" ; then
14774         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14775
14776 echo "${as_me:-configure}:14776: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14777
14778         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14779         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14780
14781 fi
14782
14783 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14784 cat >conftest.$ac_ext <<_ACEOF
14785 #line 14785 "configure"
14786 #include "confdefs.h"
14787 #include <stdio.h>
14788 int
14789 main (void)
14790 {
14791 printf("Hello world");
14792   ;
14793   return 0;
14794 }
14795 _ACEOF
14796 rm -f conftest.$ac_objext conftest$ac_exeext
14797 if { (eval echo "$as_me:14797: \"$ac_link\"") >&5
14798   (eval $ac_link) 2>&5
14799   ac_status=$?
14800   echo "$as_me:14800: \$? = $ac_status" >&5
14801   (exit $ac_status); } &&
14802          { ac_try='test -s conftest$ac_exeext'
14803   { (eval echo "$as_me:14803: \"$ac_try\"") >&5
14804   (eval $ac_try) 2>&5
14805   ac_status=$?
14806   echo "$as_me:14806: \$? = $ac_status" >&5
14807   (exit $ac_status); }; }; then
14808   :
14809 else
14810   echo "$as_me: failed program was:" >&5
14811 cat conftest.$ac_ext >&5
14812 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14813
14814 echo "${as_me:-configure}:14814: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14815
14816          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14817                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14818
14819 echo "${as_me:-configure}:14819: testing but keeping change to \$CPPFLAGS ..." 1>&5
14820
14821          fi
14822          CFLAGS="$cf_check_flags"
14823 fi
14824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14825 fi
14826
14827         echo "$as_me:14827: checking for XOpenDisplay" >&5
14828 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14829 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14830   echo $ECHO_N "(cached) $ECHO_C" >&6
14831 else
14832   cat >conftest.$ac_ext <<_ACEOF
14833 #line 14833 "configure"
14834 #include "confdefs.h"
14835 #define XOpenDisplay autoconf_temporary
14836 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14837 #undef XOpenDisplay
14838
14839 #ifdef __cplusplus
14840 extern "C"
14841 #endif
14842
14843 /* We use char because int might match the return type of a gcc2
14844    builtin and then its argument prototype would still apply.  */
14845 char XOpenDisplay (void);
14846
14847 int
14848 main (void)
14849 {
14850
14851 /* The GNU C library defines stubs for functions which it implements
14852     to always fail with ENOSYS.  Some functions are actually named
14853     something starting with __ and the normal name is an alias.  */
14854 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14855 #error found stub for XOpenDisplay
14856 #endif
14857
14858         return XOpenDisplay ();
14859   ;
14860   return 0;
14861 }
14862 _ACEOF
14863 rm -f conftest.$ac_objext conftest$ac_exeext
14864 if { (eval echo "$as_me:14864: \"$ac_link\"") >&5
14865   (eval $ac_link) 2>&5
14866   ac_status=$?
14867   echo "$as_me:14867: \$? = $ac_status" >&5
14868   (exit $ac_status); } &&
14869          { ac_try='test -s conftest$ac_exeext'
14870   { (eval echo "$as_me:14870: \"$ac_try\"") >&5
14871   (eval $ac_try) 2>&5
14872   ac_status=$?
14873   echo "$as_me:14873: \$? = $ac_status" >&5
14874   (exit $ac_status); }; }; then
14875   ac_cv_func_XOpenDisplay=yes
14876 else
14877   echo "$as_me: failed program was:" >&5
14878 cat conftest.$ac_ext >&5
14879 ac_cv_func_XOpenDisplay=no
14880 fi
14881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14882 fi
14883 echo "$as_me:14883: result: $ac_cv_func_XOpenDisplay" >&5
14884 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14885 if test $ac_cv_func_XOpenDisplay = yes; then
14886   :
14887 else
14888
14889         echo "$as_me:14889: checking for XOpenDisplay in -lX11" >&5
14890 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14891 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14892   echo $ECHO_N "(cached) $ECHO_C" >&6
14893 else
14894   ac_check_lib_save_LIBS=$LIBS
14895 LIBS="-lX11  $LIBS"
14896 cat >conftest.$ac_ext <<_ACEOF
14897 #line 14897 "configure"
14898 #include "confdefs.h"
14899
14900 /* Override any gcc2 internal prototype to avoid an error.  */
14901 #ifdef __cplusplus
14902 extern "C"
14903 #endif
14904 /* We use char because int might match the return type of a gcc2
14905    builtin and then its argument prototype would still apply.  */
14906 char XOpenDisplay ();
14907 int
14908 main (void)
14909 {
14910 XOpenDisplay ();
14911   ;
14912   return 0;
14913 }
14914 _ACEOF
14915 rm -f conftest.$ac_objext conftest$ac_exeext
14916 if { (eval echo "$as_me:14916: \"$ac_link\"") >&5
14917   (eval $ac_link) 2>&5
14918   ac_status=$?
14919   echo "$as_me:14919: \$? = $ac_status" >&5
14920   (exit $ac_status); } &&
14921          { ac_try='test -s conftest$ac_exeext'
14922   { (eval echo "$as_me:14922: \"$ac_try\"") >&5
14923   (eval $ac_try) 2>&5
14924   ac_status=$?
14925   echo "$as_me:14925: \$? = $ac_status" >&5
14926   (exit $ac_status); }; }; then
14927   ac_cv_lib_X11_XOpenDisplay=yes
14928 else
14929   echo "$as_me: failed program was:" >&5
14930 cat conftest.$ac_ext >&5
14931 ac_cv_lib_X11_XOpenDisplay=no
14932 fi
14933 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14934 LIBS=$ac_check_lib_save_LIBS
14935 fi
14936 echo "$as_me:14936: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14937 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14938 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14939
14940 cf_add_libs="$LIBS"
14941 # reverse order
14942 cf_add_0lib=
14943 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
14944 # filter duplicates
14945 for cf_add_1lib in $cf_add_0lib; do
14946         for cf_add_2lib in $cf_add_libs; do
14947                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
14948                         cf_add_1lib=
14949                         break
14950                 fi
14951         done
14952         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
14953 done
14954 LIBS="$cf_add_libs"
14955
14956 fi
14957
14958 fi
14959
14960         echo "$as_me:14960: checking for XtAppInitialize" >&5
14961 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14962 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14963   echo $ECHO_N "(cached) $ECHO_C" >&6
14964 else
14965   cat >conftest.$ac_ext <<_ACEOF
14966 #line 14966 "configure"
14967 #include "confdefs.h"
14968 #define XtAppInitialize autoconf_temporary
14969 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
14970 #undef XtAppInitialize
14971
14972 #ifdef __cplusplus
14973 extern "C"
14974 #endif
14975
14976 /* We use char because int might match the return type of a gcc2
14977    builtin and then its argument prototype would still apply.  */
14978 char XtAppInitialize (void);
14979
14980 int
14981 main (void)
14982 {
14983
14984 /* The GNU C library defines stubs for functions which it implements
14985     to always fail with ENOSYS.  Some functions are actually named
14986     something starting with __ and the normal name is an alias.  */
14987 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14988 #error found stub for XtAppInitialize
14989 #endif
14990
14991         return XtAppInitialize ();
14992   ;
14993   return 0;
14994 }
14995 _ACEOF
14996 rm -f conftest.$ac_objext conftest$ac_exeext
14997 if { (eval echo "$as_me:14997: \"$ac_link\"") >&5
14998   (eval $ac_link) 2>&5
14999   ac_status=$?
15000   echo "$as_me:15000: \$? = $ac_status" >&5
15001   (exit $ac_status); } &&
15002          { ac_try='test -s conftest$ac_exeext'
15003   { (eval echo "$as_me:15003: \"$ac_try\"") >&5
15004   (eval $ac_try) 2>&5
15005   ac_status=$?
15006   echo "$as_me:15006: \$? = $ac_status" >&5
15007   (exit $ac_status); }; }; then
15008   ac_cv_func_XtAppInitialize=yes
15009 else
15010   echo "$as_me: failed program was:" >&5
15011 cat conftest.$ac_ext >&5
15012 ac_cv_func_XtAppInitialize=no
15013 fi
15014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15015 fi
15016 echo "$as_me:15016: result: $ac_cv_func_XtAppInitialize" >&5
15017 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
15018 if test $ac_cv_func_XtAppInitialize = yes; then
15019   :
15020 else
15021
15022         echo "$as_me:15022: checking for XtAppInitialize in -lXt" >&5
15023 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
15024 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
15025   echo $ECHO_N "(cached) $ECHO_C" >&6
15026 else
15027   ac_check_lib_save_LIBS=$LIBS
15028 LIBS="-lXt  $LIBS"
15029 cat >conftest.$ac_ext <<_ACEOF
15030 #line 15030 "configure"
15031 #include "confdefs.h"
15032
15033 /* Override any gcc2 internal prototype to avoid an error.  */
15034 #ifdef __cplusplus
15035 extern "C"
15036 #endif
15037 /* We use char because int might match the return type of a gcc2
15038    builtin and then its argument prototype would still apply.  */
15039 char XtAppInitialize ();
15040 int
15041 main (void)
15042 {
15043 XtAppInitialize ();
15044   ;
15045   return 0;
15046 }
15047 _ACEOF
15048 rm -f conftest.$ac_objext conftest$ac_exeext
15049 if { (eval echo "$as_me:15049: \"$ac_link\"") >&5
15050   (eval $ac_link) 2>&5
15051   ac_status=$?
15052   echo "$as_me:15052: \$? = $ac_status" >&5
15053   (exit $ac_status); } &&
15054          { ac_try='test -s conftest$ac_exeext'
15055   { (eval echo "$as_me:15055: \"$ac_try\"") >&5
15056   (eval $ac_try) 2>&5
15057   ac_status=$?
15058   echo "$as_me:15058: \$? = $ac_status" >&5
15059   (exit $ac_status); }; }; then
15060   ac_cv_lib_Xt_XtAppInitialize=yes
15061 else
15062   echo "$as_me: failed program was:" >&5
15063 cat conftest.$ac_ext >&5
15064 ac_cv_lib_Xt_XtAppInitialize=no
15065 fi
15066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15067 LIBS=$ac_check_lib_save_LIBS
15068 fi
15069 echo "$as_me:15069: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
15070 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
15071 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
15072
15073 cat >>confdefs.h <<\EOF
15074 #define HAVE_LIBXT 1
15075 EOF
15076
15077                  cf_have_X_LIBS=Xt
15078                  LIBS="-lXt $LIBS"
15079 fi
15080
15081 fi
15082
15083 fi
15084
15085 if test $cf_have_X_LIBS = no ; then
15086         { echo "$as_me:15086: WARNING: Unable to successfully link X Toolkit library (-lXt) with
15087 test program.  You will have to check and add the proper libraries by hand
15088 to makefile." >&5
15089 echo "$as_me: 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." >&2;}
15092 fi
15093
15094 cf_x_athena_root=$cf_x_athena
15095 cf_x_athena_inc=""
15096
15097 for cf_path in default \
15098         /usr/contrib/X11R6 \
15099         /usr/contrib/X11R5 \
15100         /usr/lib/X11R5 \
15101         /usr/local
15102 do
15103         if test -z "$cf_x_athena_inc" ; then
15104
15105 cf_save_LIBS_CF_X_ATHENA_CPPFLAGS="$LIBS"
15106 cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS="$CFLAGS"
15107 cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS="$CPPFLAGS"
15108 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15109 for cf_X_CFLAGS in $X_CFLAGS
15110 do
15111         case "x$cf_X_CFLAGS" in
15112         x-[IUD]*)
15113                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15114                 ;;
15115         *)
15116                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15117                 ;;
15118         esac
15119 done
15120
15121                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
15122                 if test $cf_path != default ; then
15123
15124         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15125         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
15126
15127                         echo "$as_me:15127: checking for $cf_test in $cf_path" >&5
15128 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
15129                 else
15130                         echo "$as_me:15130: checking for $cf_test" >&5
15131 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
15132                 fi
15133                 cat >conftest.$ac_ext <<_ACEOF
15134 #line 15134 "configure"
15135 #include "confdefs.h"
15136
15137 #include <X11/Intrinsic.h>
15138 #include <$cf_test>
15139 int
15140 main (void)
15141 {
15142
15143   ;
15144   return 0;
15145 }
15146 _ACEOF
15147 rm -f conftest.$ac_objext
15148 if { (eval echo "$as_me:15148: \"$ac_compile\"") >&5
15149   (eval $ac_compile) 2>&5
15150   ac_status=$?
15151   echo "$as_me:15151: \$? = $ac_status" >&5
15152   (exit $ac_status); } &&
15153          { ac_try='test -s conftest.$ac_objext'
15154   { (eval echo "$as_me:15154: \"$ac_try\"") >&5
15155   (eval $ac_try) 2>&5
15156   ac_status=$?
15157   echo "$as_me:15157: \$? = $ac_status" >&5
15158   (exit $ac_status); }; }; then
15159   cf_result=yes
15160 else
15161   echo "$as_me: failed program was:" >&5
15162 cat conftest.$ac_ext >&5
15163 cf_result=no
15164 fi
15165 rm -f conftest.$ac_objext conftest.$ac_ext
15166                 echo "$as_me:15166: result: $cf_result" >&5
15167 echo "${ECHO_T}$cf_result" >&6
15168
15169 LIBS="$cf_save_LIBS_CF_X_ATHENA_CPPFLAGS"
15170 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_CPPFLAGS"
15171 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_CPPFLAGS"
15172
15173                 if test "$cf_result" = yes ; then
15174                         test "$cf_path"  = default && cf_x_athena_inc=default
15175                         test "$cf_path" != default && cf_x_athena_inc=$cf_path/include
15176                         break
15177                 fi
15178         fi
15179 done
15180
15181 if test -z "$cf_x_athena_inc" ; then
15182         { echo "$as_me:15182: WARNING: Unable to find Athena header files" >&5
15183 echo "$as_me: WARNING: Unable to find Athena header files" >&2;}
15184 elif test "$cf_x_athena_inc" != default ; then
15185
15186         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15187         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
15188
15189 fi
15190
15191 cf_x_athena_root=$cf_x_athena
15192 cf_x_athena_lib=""
15193
15194 for cf_path in default \
15195         /usr/contrib/X11R6 \
15196         /usr/contrib/X11R5 \
15197         /usr/lib/X11R5 \
15198         /usr/local
15199 do
15200         for cf_lib in \
15201                 ${cf_x_athena_root} \
15202                 ${cf_x_athena_root}7 \
15203                 ${cf_x_athena_root}6
15204         do
15205         for cf_libs in \
15206                 "-l$cf_lib -lXmu" \
15207                 "-l$cf_lib -lXpm -lXmu" \
15208                 "-l${cf_lib}_s -lXmu_s"
15209         do
15210                 test -n "$cf_x_athena_lib" && break
15211
15212 cf_save_LIBS_CF_X_ATHENA_LIBS="$LIBS"
15213 cf_save_CFLAGS_CF_X_ATHENA_LIBS="$CFLAGS"
15214 cf_save_CPPFLAGS_CF_X_ATHENA_LIBS="$CPPFLAGS"
15215 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
15216 for cf_X_CFLAGS in $X_CFLAGS
15217 do
15218         case "x$cf_X_CFLAGS" in
15219         x-[IUD]*)
15220                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
15221                 ;;
15222         *)
15223                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
15224                 ;;
15225         esac
15226 done
15227
15228                 cf_test=XawSimpleMenuAddGlobalActions
15229                 test "$cf_path" != default && cf_libs="-L$cf_path/lib $cf_libs"
15230
15231 cf_add_libs="$LIBS"
15232 # reverse order
15233 cf_add_0lib=
15234 for cf_add_1lib in $cf_libs; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15235 # filter duplicates
15236 for cf_add_1lib in $cf_add_0lib; do
15237         for cf_add_2lib in $cf_add_libs; do
15238                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15239                         cf_add_1lib=
15240                         break
15241                 fi
15242         done
15243         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15244 done
15245 LIBS="$cf_add_libs"
15246
15247                 echo "$as_me:15247: checking for $cf_test in $cf_libs" >&5
15248 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
15249                 cat >conftest.$ac_ext <<_ACEOF
15250 #line 15250 "configure"
15251 #include "confdefs.h"
15252
15253 #include <X11/Intrinsic.h>
15254 #include <X11/$cf_x_athena_root/SimpleMenu.h>
15255
15256 int
15257 main (void)
15258 {
15259
15260 $cf_test((XtAppContext) 0)
15261   ;
15262   return 0;
15263 }
15264 _ACEOF
15265 rm -f conftest.$ac_objext conftest$ac_exeext
15266 if { (eval echo "$as_me:15266: \"$ac_link\"") >&5
15267   (eval $ac_link) 2>&5
15268   ac_status=$?
15269   echo "$as_me:15269: \$? = $ac_status" >&5
15270   (exit $ac_status); } &&
15271          { ac_try='test -s conftest$ac_exeext'
15272   { (eval echo "$as_me:15272: \"$ac_try\"") >&5
15273   (eval $ac_try) 2>&5
15274   ac_status=$?
15275   echo "$as_me:15275: \$? = $ac_status" >&5
15276   (exit $ac_status); }; }; then
15277   cf_result=yes
15278 else
15279   echo "$as_me: failed program was:" >&5
15280 cat conftest.$ac_ext >&5
15281 cf_result=no
15282 fi
15283 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15284                 echo "$as_me:15284: result: $cf_result" >&5
15285 echo "${ECHO_T}$cf_result" >&6
15286
15287 LIBS="$cf_save_LIBS_CF_X_ATHENA_LIBS"
15288 CFLAGS="$cf_save_CFLAGS_CF_X_ATHENA_LIBS"
15289 CPPFLAGS="$cf_save_CPPFLAGS_CF_X_ATHENA_LIBS"
15290
15291                 if test "$cf_result" = yes ; then
15292                         cf_x_athena_lib="$cf_libs"
15293                         break
15294                 fi
15295         done # cf_libs
15296                 test -n "$cf_x_athena_lib" && break
15297         done # cf_lib
15298 done
15299
15300 if test -z "$cf_x_athena_lib" ; then
15301         { { echo "$as_me:15301: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
15302 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
15303    { (exit 1); exit 1; }; }
15304 fi
15305
15306 cf_add_libs="$LIBS"
15307 # reverse order
15308 cf_add_0lib=
15309 for cf_add_1lib in $cf_x_athena_lib; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15310 # filter duplicates
15311 for cf_add_1lib in $cf_add_0lib; do
15312         for cf_add_2lib in $cf_add_libs; do
15313                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15314                         cf_add_1lib=
15315                         break
15316                 fi
15317         done
15318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15319 done
15320 LIBS="$cf_add_libs"
15321
15322 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15323
15324 cat >>confdefs.h <<EOF
15325 #define $cf_x_athena_LIBS 1
15326 EOF
15327
15328 fi
15329
15330 if test -n "$ac_tool_prefix"; then
15331   for ac_prog in xcurses-config
15332   do
15333     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
15334 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
15335 echo "$as_me:15335: checking for $ac_word" >&5
15336 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15337 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
15338   echo $ECHO_N "(cached) $ECHO_C" >&6
15339 else
15340   if test -n "$XCURSES_CONFIG"; then
15341   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
15342 else
15343   ac_save_IFS=$IFS; IFS=$ac_path_separator
15344 ac_dummy="$PATH"
15345 for ac_dir in $ac_dummy; do
15346   IFS=$ac_save_IFS
15347   test -z "$ac_dir" && ac_dir=.
15348   $as_executable_p "$ac_dir/$ac_word" || continue
15349 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
15350 echo "$as_me:15350: found $ac_dir/$ac_word" >&5
15351 break
15352 done
15353
15354 fi
15355 fi
15356 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
15357 if test -n "$XCURSES_CONFIG"; then
15358   echo "$as_me:15358: result: $XCURSES_CONFIG" >&5
15359 echo "${ECHO_T}$XCURSES_CONFIG" >&6
15360 else
15361   echo "$as_me:15361: result: no" >&5
15362 echo "${ECHO_T}no" >&6
15363 fi
15364
15365     test -n "$XCURSES_CONFIG" && break
15366   done
15367 fi
15368 if test -z "$XCURSES_CONFIG"; then
15369   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
15370   for ac_prog in xcurses-config
15371 do
15372   # Extract the first word of "$ac_prog", so it can be a program name with args.
15373 set dummy $ac_prog; ac_word=$2
15374 echo "$as_me:15374: checking for $ac_word" >&5
15375 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
15376 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
15377   echo $ECHO_N "(cached) $ECHO_C" >&6
15378 else
15379   if test -n "$ac_ct_XCURSES_CONFIG"; then
15380   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
15381 else
15382   ac_save_IFS=$IFS; IFS=$ac_path_separator
15383 ac_dummy="$PATH"
15384 for ac_dir in $ac_dummy; do
15385   IFS=$ac_save_IFS
15386   test -z "$ac_dir" && ac_dir=.
15387   $as_executable_p "$ac_dir/$ac_word" || continue
15388 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
15389 echo "$as_me:15389: found $ac_dir/$ac_word" >&5
15390 break
15391 done
15392
15393 fi
15394 fi
15395 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
15396 if test -n "$ac_ct_XCURSES_CONFIG"; then
15397   echo "$as_me:15397: result: $ac_ct_XCURSES_CONFIG" >&5
15398 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
15399 else
15400   echo "$as_me:15400: result: no" >&5
15401 echo "${ECHO_T}no" >&6
15402 fi
15403
15404   test -n "$ac_ct_XCURSES_CONFIG" && break
15405 done
15406 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
15407
15408   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
15409 fi
15410
15411 if test "$XCURSES_CONFIG" != none ; then
15412
15413 cf_fix_cppflags=no
15414 cf_new_cflags=
15415 cf_new_cppflags=
15416 cf_new_extra_cppflags=
15417
15418 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
15419 do
15420 case $cf_fix_cppflags in
15421 (no)
15422         case $cf_add_cflags in
15423         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15424                 case $cf_add_cflags in
15425                 (-D*)
15426                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15427
15428                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15429                                 && test -z "${cf_tst_cflags}" \
15430                                 && cf_fix_cppflags=yes
15431
15432                         if test $cf_fix_cppflags = yes ; then
15433
15434         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15435         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15436
15437                                 continue
15438                         elif test "${cf_tst_cflags}" = "\"'" ; then
15439
15440         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15441         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15442
15443                                 continue
15444                         fi
15445                         ;;
15446                 esac
15447                 case "$CPPFLAGS" in
15448                 (*$cf_add_cflags)
15449                         ;;
15450                 (*)
15451                         case $cf_add_cflags in
15452                         (-D*)
15453                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15454
15455 CPPFLAGS=`echo "$CPPFLAGS" | \
15456         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15457                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15458
15459                                 ;;
15460                         esac
15461
15462         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15463         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15464
15465                         ;;
15466                 esac
15467                 ;;
15468         (*)
15469
15470         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15471         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15472
15473                 ;;
15474         esac
15475         ;;
15476 (yes)
15477
15478         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15479         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15480
15481         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15482
15483         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15484                 && test -z "${cf_tst_cflags}" \
15485                 && cf_fix_cppflags=no
15486         ;;
15487 esac
15488 done
15489
15490 if test -n "$cf_new_cflags" ; then
15491
15492         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15493         CFLAGS="${CFLAGS}$cf_new_cflags"
15494
15495 fi
15496
15497 if test -n "$cf_new_cppflags" ; then
15498
15499         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15500         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15501
15502 fi
15503
15504 if test -n "$cf_new_extra_cppflags" ; then
15505
15506         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15507         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15508
15509 fi
15510
15511 cf_add_libs="$LIBS"
15512 # reverse order
15513 cf_add_0lib=
15514 for cf_add_1lib in `$XCURSES_CONFIG --libs`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15515 # filter duplicates
15516 for cf_add_1lib in $cf_add_0lib; do
15517         for cf_add_2lib in $cf_add_libs; do
15518                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15519                         cf_add_1lib=
15520                         break
15521                 fi
15522         done
15523         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15524 done
15525 LIBS="$cf_add_libs"
15526
15527 cf_cv_lib_XCurses=yes
15528
15529 else
15530
15531 LDFLAGS="$LDFLAGS $X_LIBS"
15532
15533 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
15534
15535 echo "${as_me:-configure}:15535: testing checking additions to CFLAGS ..." 1>&5
15536
15537 cf_check_cflags="$CFLAGS"
15538 cf_check_cppflags="$CPPFLAGS"
15539
15540 cf_fix_cppflags=no
15541 cf_new_cflags=
15542 cf_new_cppflags=
15543 cf_new_extra_cppflags=
15544
15545 for cf_add_cflags in $X_CFLAGS
15546 do
15547 case $cf_fix_cppflags in
15548 (no)
15549         case $cf_add_cflags in
15550         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15551                 case $cf_add_cflags in
15552                 (-D*)
15553                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15554
15555                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15556                                 && test -z "${cf_tst_cflags}" \
15557                                 && cf_fix_cppflags=yes
15558
15559                         if test $cf_fix_cppflags = yes ; then
15560
15561         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15562         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15563
15564                                 continue
15565                         elif test "${cf_tst_cflags}" = "\"'" ; then
15566
15567         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15568         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15569
15570                                 continue
15571                         fi
15572                         ;;
15573                 esac
15574                 case "$CPPFLAGS" in
15575                 (*$cf_add_cflags)
15576                         ;;
15577                 (*)
15578                         case $cf_add_cflags in
15579                         (-D*)
15580                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15581
15582 CPPFLAGS=`echo "$CPPFLAGS" | \
15583         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15584                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15585
15586                                 ;;
15587                         esac
15588
15589         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15590         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15591
15592                         ;;
15593                 esac
15594                 ;;
15595         (*)
15596
15597         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15598         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15599
15600                 ;;
15601         esac
15602         ;;
15603 (yes)
15604
15605         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15606         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15607
15608         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15609
15610         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15611                 && test -z "${cf_tst_cflags}" \
15612                 && cf_fix_cppflags=no
15613         ;;
15614 esac
15615 done
15616
15617 if test -n "$cf_new_cflags" ; then
15618         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
15619
15620 echo "${as_me:-configure}:15620: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
15621
15622         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15623         CFLAGS="${CFLAGS}$cf_new_cflags"
15624
15625 fi
15626
15627 if test -n "$cf_new_cppflags" ; then
15628         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
15629
15630 echo "${as_me:-configure}:15630: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
15631
15632         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15633         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15634
15635 fi
15636
15637 if test -n "$cf_new_extra_cppflags" ; then
15638         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
15639
15640 echo "${as_me:-configure}:15640: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
15641
15642         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15643         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15644
15645 fi
15646
15647 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
15648 cat >conftest.$ac_ext <<_ACEOF
15649 #line 15649 "configure"
15650 #include "confdefs.h"
15651 #include <stdio.h>
15652 int
15653 main (void)
15654 {
15655 printf("Hello world");
15656   ;
15657   return 0;
15658 }
15659 _ACEOF
15660 rm -f conftest.$ac_objext conftest$ac_exeext
15661 if { (eval echo "$as_me:15661: \"$ac_link\"") >&5
15662   (eval $ac_link) 2>&5
15663   ac_status=$?
15664   echo "$as_me:15664: \$? = $ac_status" >&5
15665   (exit $ac_status); } &&
15666          { ac_try='test -s conftest$ac_exeext'
15667   { (eval echo "$as_me:15667: \"$ac_try\"") >&5
15668   (eval $ac_try) 2>&5
15669   ac_status=$?
15670   echo "$as_me:15670: \$? = $ac_status" >&5
15671   (exit $ac_status); }; }; then
15672   :
15673 else
15674   echo "$as_me: failed program was:" >&5
15675 cat conftest.$ac_ext >&5
15676 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15677
15678 echo "${as_me:-configure}:15678: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15679
15680          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15681                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15682
15683 echo "${as_me:-configure}:15683: testing but keeping change to \$CPPFLAGS ..." 1>&5
15684
15685          fi
15686          CFLAGS="$cf_check_flags"
15687 fi
15688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15689 fi
15690
15691 echo "$as_me:15691: checking for XOpenDisplay in -lX11" >&5
15692 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15693 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15694   echo $ECHO_N "(cached) $ECHO_C" >&6
15695 else
15696   ac_check_lib_save_LIBS=$LIBS
15697 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15698 cat >conftest.$ac_ext <<_ACEOF
15699 #line 15699 "configure"
15700 #include "confdefs.h"
15701
15702 /* Override any gcc2 internal prototype to avoid an error.  */
15703 #ifdef __cplusplus
15704 extern "C"
15705 #endif
15706 /* We use char because int might match the return type of a gcc2
15707    builtin and then its argument prototype would still apply.  */
15708 char XOpenDisplay ();
15709 int
15710 main (void)
15711 {
15712 XOpenDisplay ();
15713   ;
15714   return 0;
15715 }
15716 _ACEOF
15717 rm -f conftest.$ac_objext conftest$ac_exeext
15718 if { (eval echo "$as_me:15718: \"$ac_link\"") >&5
15719   (eval $ac_link) 2>&5
15720   ac_status=$?
15721   echo "$as_me:15721: \$? = $ac_status" >&5
15722   (exit $ac_status); } &&
15723          { ac_try='test -s conftest$ac_exeext'
15724   { (eval echo "$as_me:15724: \"$ac_try\"") >&5
15725   (eval $ac_try) 2>&5
15726   ac_status=$?
15727   echo "$as_me:15727: \$? = $ac_status" >&5
15728   (exit $ac_status); }; }; then
15729   ac_cv_lib_X11_XOpenDisplay=yes
15730 else
15731   echo "$as_me: failed program was:" >&5
15732 cat conftest.$ac_ext >&5
15733 ac_cv_lib_X11_XOpenDisplay=no
15734 fi
15735 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15736 LIBS=$ac_check_lib_save_LIBS
15737 fi
15738 echo "$as_me:15738: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15739 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15740 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15741
15742 cf_add_libs="$LIBS"
15743 # reverse order
15744 cf_add_0lib=
15745 for cf_add_1lib in -lX11; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15746 # filter duplicates
15747 for cf_add_1lib in $cf_add_0lib; do
15748         for cf_add_2lib in $cf_add_libs; do
15749                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15750                         cf_add_1lib=
15751                         break
15752                 fi
15753         done
15754         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15755 done
15756 LIBS="$cf_add_libs"
15757
15758 fi
15759
15760 echo "$as_me:15760: checking for XCurses library" >&5
15761 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15762 if test "${cf_cv_lib_XCurses+set}" = set; then
15763   echo $ECHO_N "(cached) $ECHO_C" >&6
15764 else
15765
15766 cf_add_libs="$LIBS"
15767 # reverse order
15768 cf_add_0lib=
15769 for cf_add_1lib in -lXCurses; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15770 # filter duplicates
15771 for cf_add_1lib in $cf_add_0lib; do
15772         for cf_add_2lib in $cf_add_libs; do
15773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15774                         cf_add_1lib=
15775                         break
15776                 fi
15777         done
15778         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15779 done
15780 LIBS="$cf_add_libs"
15781
15782 cat >conftest.$ac_ext <<_ACEOF
15783 #line 15783 "configure"
15784 #include "confdefs.h"
15785
15786 #include <xcurses.h>
15787 char *XCursesProgramName = "test";
15788
15789 int
15790 main (void)
15791 {
15792 XCursesExit();
15793   ;
15794   return 0;
15795 }
15796 _ACEOF
15797 rm -f conftest.$ac_objext conftest$ac_exeext
15798 if { (eval echo "$as_me:15798: \"$ac_link\"") >&5
15799   (eval $ac_link) 2>&5
15800   ac_status=$?
15801   echo "$as_me:15801: \$? = $ac_status" >&5
15802   (exit $ac_status); } &&
15803          { ac_try='test -s conftest$ac_exeext'
15804   { (eval echo "$as_me:15804: \"$ac_try\"") >&5
15805   (eval $ac_try) 2>&5
15806   ac_status=$?
15807   echo "$as_me:15807: \$? = $ac_status" >&5
15808   (exit $ac_status); }; }; then
15809   cf_cv_lib_XCurses=yes
15810 else
15811   echo "$as_me: failed program was:" >&5
15812 cat conftest.$ac_ext >&5
15813 cf_cv_lib_XCurses=no
15814 fi
15815 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15816
15817 fi
15818 echo "$as_me:15818: result: $cf_cv_lib_XCurses" >&5
15819 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15820
15821 fi
15822
15823 if test $cf_cv_lib_XCurses = yes ; then
15824
15825 cat >>confdefs.h <<\EOF
15826 #define UNIX 1
15827 EOF
15828
15829 cat >>confdefs.h <<\EOF
15830 #define XCURSES 1
15831 EOF
15832
15833         echo "$as_me:15833: checking for xcurses.h" >&5
15834 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15835 if test "${ac_cv_header_xcurses_h+set}" = set; then
15836   echo $ECHO_N "(cached) $ECHO_C" >&6
15837 else
15838   cat >conftest.$ac_ext <<_ACEOF
15839 #line 15839 "configure"
15840 #include "confdefs.h"
15841 #include <xcurses.h>
15842 _ACEOF
15843 if { (eval echo "$as_me:15843: \"$ac_cpp conftest.$ac_ext\"") >&5
15844   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15845   ac_status=$?
15846   egrep -v '^ *\+' conftest.er1 >conftest.err
15847   rm -f conftest.er1
15848   cat conftest.err >&5
15849   echo "$as_me:15849: \$? = $ac_status" >&5
15850   (exit $ac_status); } >/dev/null; then
15851   if test -s conftest.err; then
15852     ac_cpp_err=$ac_c_preproc_warn_flag
15853   else
15854     ac_cpp_err=
15855   fi
15856 else
15857   ac_cpp_err=yes
15858 fi
15859 if test -z "$ac_cpp_err"; then
15860   ac_cv_header_xcurses_h=yes
15861 else
15862   echo "$as_me: failed program was:" >&5
15863   cat conftest.$ac_ext >&5
15864   ac_cv_header_xcurses_h=no
15865 fi
15866 rm -f conftest.err conftest.$ac_ext
15867 fi
15868 echo "$as_me:15868: result: $ac_cv_header_xcurses_h" >&5
15869 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15870 if test $ac_cv_header_xcurses_h = yes; then
15871
15872 cat >>confdefs.h <<\EOF
15873 #define HAVE_XCURSES 1
15874 EOF
15875
15876 fi
15877
15878 else
15879         { { echo "$as_me:15879: error: Cannot link with XCurses" >&5
15880 echo "$as_me: error: Cannot link with XCurses" >&2;}
15881    { (exit 1); exit 1; }; }
15882 fi
15883
15884         ;;
15885 (*)
15886         { { echo "$as_me:15886: error: unexpected screen-value: $cf_cv_screen" >&5
15887 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15888    { (exit 1); exit 1; }; }
15889         ;;
15890 esac
15891
15892 : ${cf_nculib_root:=$cf_cv_screen}
15893 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15894 echo "$as_me:15894: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15895 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15896 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15897   echo $ECHO_N "(cached) $ECHO_C" >&6
15898 else
15899   ac_check_lib_save_LIBS=$LIBS
15900 LIBS="-l$cf_nculib_root  $LIBS"
15901 cat >conftest.$ac_ext <<_ACEOF
15902 #line 15902 "configure"
15903 #include "confdefs.h"
15904
15905 /* Override any gcc2 internal prototype to avoid an error.  */
15906 #ifdef __cplusplus
15907 extern "C"
15908 #endif
15909 /* We use char because int might match the return type of a gcc2
15910    builtin and then its argument prototype would still apply.  */
15911 char _nc_init_pthreads ();
15912 int
15913 main (void)
15914 {
15915 _nc_init_pthreads ();
15916   ;
15917   return 0;
15918 }
15919 _ACEOF
15920 rm -f conftest.$ac_objext conftest$ac_exeext
15921 if { (eval echo "$as_me:15921: \"$ac_link\"") >&5
15922   (eval $ac_link) 2>&5
15923   ac_status=$?
15924   echo "$as_me:15924: \$? = $ac_status" >&5
15925   (exit $ac_status); } &&
15926          { ac_try='test -s conftest$ac_exeext'
15927   { (eval echo "$as_me:15927: \"$ac_try\"") >&5
15928   (eval $ac_try) 2>&5
15929   ac_status=$?
15930   echo "$as_me:15930: \$? = $ac_status" >&5
15931   (exit $ac_status); }; }; then
15932   eval "$as_ac_Lib=yes"
15933 else
15934   echo "$as_me: failed program was:" >&5
15935 cat conftest.$ac_ext >&5
15936 eval "$as_ac_Lib=no"
15937 fi
15938 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15939 LIBS=$ac_check_lib_save_LIBS
15940 fi
15941 echo "$as_me:15941: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15942 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15943 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15944   cf_cv_ncurses_pthreads=yes
15945 else
15946   cf_cv_ncurses_pthreads=no
15947 fi
15948
15949 if test "$cf_cv_ncurses_pthreads" = yes
15950 then
15951
15952 cf_add_libs="$LIBS"
15953 # reverse order
15954 cf_add_0lib=
15955 for cf_add_1lib in -lpthread; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
15956 # filter duplicates
15957 for cf_add_1lib in $cf_add_0lib; do
15958         for cf_add_2lib in $cf_add_libs; do
15959                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
15960                         cf_add_1lib=
15961                         break
15962                 fi
15963         done
15964         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
15965 done
15966 LIBS="$cf_add_libs"
15967
15968 fi
15969
15970 case $cf_cv_screen in
15971 (ncurses*)
15972         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15973         ;;
15974 esac
15975
15976 echo "$as_me:15976: checking for X11 rgb file" >&5
15977 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15978
15979 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15980 if test "${with_x11_rgb+set}" = set; then
15981   withval="$with_x11_rgb"
15982   RGB_PATH=$withval
15983 else
15984   RGB_PATH=auto
15985 fi;
15986
15987 if test "x$RGB_PATH" = xauto
15988 then
15989         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15990         for cf_path in \
15991                 /opt/local/share/X11/rgb.txt \
15992                 /opt/X11/share/X11/rgb.txt \
15993                 /usr/share/X11/rgb.txt \
15994                 /usr/X11/share/X11/rgb.txt \
15995                 /usr/X11/lib/X11/rgb.txt \
15996                 /usr/lib/X11/rgb.txt \
15997                 /etc/X11/rgb.txt \
15998                 /usr/pkg/lib/X11/rgb.txt \
15999                 /usr/X11R7/lib/X11/rgb.txt \
16000                 /usr/X11R6/lib/X11/rgb.txt \
16001                 /usr/X11R5/lib/X11/rgb.txt \
16002                 /usr/X11R4/lib/X11/rgb.txt \
16003                 /usr/local/lib/X11/rgb.txt \
16004                 /usr/local/share/X11/rgb.txt \
16005                 /usr/lib64/X11/rgb.txt
16006         do
16007                 if test -f "$cf_path" ; then
16008                         RGB_PATH="$cf_path"
16009                         break
16010                 fi
16011         done
16012 else
16013         cf_path=$RGB_PATH
16014
16015 if test "x$prefix" != xNONE; then
16016         cf_path_syntax="$prefix"
16017 else
16018         cf_path_syntax="$ac_default_prefix"
16019 fi
16020
16021 case ".$cf_path" in
16022 (.\$\(*\)*|.\'*\'*)
16023         ;;
16024 (..|./*|.\\*)
16025         ;;
16026 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
16027         ;;
16028 (.\${*prefix}*|.\${*dir}*)
16029         eval cf_path="$cf_path"
16030         case ".$cf_path" in
16031         (.NONE/*)
16032                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16033                 ;;
16034         esac
16035         ;;
16036 (.no|.NONE/*)
16037         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
16038         ;;
16039 (*)
16040         { { echo "$as_me:16040: error: expected a pathname, not \"$cf_path\"" >&5
16041 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
16042    { (exit 1); exit 1; }; }
16043         ;;
16044 esac
16045
16046 fi
16047
16048 echo "$as_me:16048: result: $RGB_PATH" >&5
16049 echo "${ECHO_T}$RGB_PATH" >&6
16050
16051 cat >>confdefs.h <<EOF
16052 #define RGB_PATH "$cf_path"
16053 EOF
16054
16055 no_x11_rgb=
16056 if test "$RGB_PATH" = no
16057 then
16058         no_x11_rgb="#"
16059 fi
16060
16061 cf_curses_headers=
16062
16063 case $cf_cv_screen in
16064 (pdcurses)
16065         cf_default_panel=no
16066         cf_default_form=no
16067         cf_default_menu=no
16068         cf_default_tinfo=no
16069         ;;
16070 (xcurses|bsdcurses)
16071         cf_default_panel=no
16072         cf_default_form=no
16073         cf_default_menu=no
16074         cf_default_tinfo=yes
16075         ;;
16076 (*)
16077         cf_default_panel=yes
16078         cf_default_form=yes
16079         cf_default_menu=yes
16080         cf_default_tinfo=yes
16081         case $cf_cv_screen in
16082         (ncurses*)
16083                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
16084                 ;;
16085         esac
16086         ;;
16087 esac
16088
16089 echo "$as_me:16089: checking for desired basename for form library" >&5
16090 echo $ECHO_N "checking for desired basename for form library... $ECHO_C" >&6
16091
16092 # Check whether --with-form-libname or --without-form-libname was given.
16093 if test "${with_form_libname+set}" = set; then
16094   withval="$with_form_libname"
16095   with_lib_basename=$withval
16096 else
16097   with_lib_basename=form
16098 fi;
16099 FORM_NAME="$with_lib_basename"
16100
16101 case "x$FORM_NAME" in
16102 (x|xno|xnone|xyes)
16103         FORM_NAME=form
16104         ;;
16105 (*)
16106         ;;
16107 esac
16108
16109 echo "$as_me:16109: result: $FORM_NAME" >&5
16110 echo "${ECHO_T}$FORM_NAME" >&6
16111
16112 echo "$as_me:16112: checking for desired basename for menu library" >&5
16113 echo $ECHO_N "checking for desired basename for menu library... $ECHO_C" >&6
16114
16115 # Check whether --with-menu-libname or --without-menu-libname was given.
16116 if test "${with_menu_libname+set}" = set; then
16117   withval="$with_menu_libname"
16118   with_lib_basename=$withval
16119 else
16120   with_lib_basename=menu
16121 fi;
16122 MENU_NAME="$with_lib_basename"
16123
16124 case "x$MENU_NAME" in
16125 (x|xno|xnone|xyes)
16126         MENU_NAME=menu
16127         ;;
16128 (*)
16129         ;;
16130 esac
16131
16132 echo "$as_me:16132: result: $MENU_NAME" >&5
16133 echo "${ECHO_T}$MENU_NAME" >&6
16134
16135 echo "$as_me:16135: checking for desired basename for panel library" >&5
16136 echo $ECHO_N "checking for desired basename for panel library... $ECHO_C" >&6
16137
16138 # Check whether --with-panel-libname or --without-panel-libname was given.
16139 if test "${with_panel_libname+set}" = set; then
16140   withval="$with_panel_libname"
16141   with_lib_basename=$withval
16142 else
16143   with_lib_basename=panel
16144 fi;
16145 PANEL_NAME="$with_lib_basename"
16146
16147 case "x$PANEL_NAME" in
16148 (x|xno|xnone|xyes)
16149         PANEL_NAME=panel
16150         ;;
16151 (*)
16152         ;;
16153 esac
16154
16155 echo "$as_me:16155: result: $PANEL_NAME" >&5
16156 echo "${ECHO_T}$PANEL_NAME" >&6
16157
16158 echo "$as_me:16158: checking if you want to check for panel functions" >&5
16159 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
16160
16161 # Check whether --enable-panel or --disable-panel was given.
16162 if test "${enable_panel+set}" = set; then
16163   enableval="$enable_panel"
16164   test "$enableval" != no && enableval=yes
16165         if test "$enableval" != "yes" ; then
16166     cf_enable_panel=no
16167         else
16168                 cf_enable_panel=$cf_default_panel
16169         fi
16170 else
16171   enableval=yes
16172         cf_enable_panel=$cf_default_panel
16173
16174 fi;
16175 echo "$as_me:16175: result: $cf_enable_panel" >&5
16176 echo "${ECHO_T}$cf_enable_panel" >&6
16177 if test $cf_enable_panel = yes
16178 then
16179
16180 cf_have_curses_lib=no
16181
16182 : ${NCURSES_CONFIG_PKG:=none}
16183 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16184         :
16185 elif test "x${PKG_CONFIG:=none}" != xnone; then
16186         echo "$as_me:16186: checking pkg-config for $PANEL_NAME$cf_cv_libtype" >&5
16187 echo $ECHO_N "checking pkg-config for $PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16188         if "$PKG_CONFIG" --exists $PANEL_NAME$cf_cv_libtype ; then
16189                 echo "$as_me:16189: result: yes" >&5
16190 echo "${ECHO_T}yes" >&6
16191
16192                 echo "$as_me:16192: checking if the $PANEL_NAME$cf_cv_libtype package files work" >&5
16193 echo $ECHO_N "checking if the $PANEL_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16194
16195                 cf_save_CPPFLAGS="$CPPFLAGS"
16196                 cf_save_LIBS="$LIBS"
16197
16198 cf_fix_cppflags=no
16199 cf_new_cflags=
16200 cf_new_cppflags=
16201 cf_new_extra_cppflags=
16202
16203 for cf_add_cflags in `$PKG_CONFIG --cflags $PANEL_NAME$cf_cv_libtype`
16204 do
16205 case $cf_fix_cppflags in
16206 (no)
16207         case $cf_add_cflags in
16208         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16209                 case $cf_add_cflags in
16210                 (-D*)
16211                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16212
16213                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16214                                 && test -z "${cf_tst_cflags}" \
16215                                 && cf_fix_cppflags=yes
16216
16217                         if test $cf_fix_cppflags = yes ; then
16218
16219         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16220         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16221
16222                                 continue
16223                         elif test "${cf_tst_cflags}" = "\"'" ; then
16224
16225         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16226         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16227
16228                                 continue
16229                         fi
16230                         ;;
16231                 esac
16232                 case "$CPPFLAGS" in
16233                 (*$cf_add_cflags)
16234                         ;;
16235                 (*)
16236                         case $cf_add_cflags in
16237                         (-D*)
16238                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16239
16240 CPPFLAGS=`echo "$CPPFLAGS" | \
16241         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16242                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16243
16244                                 ;;
16245                         esac
16246
16247         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16248         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16249
16250                         ;;
16251                 esac
16252                 ;;
16253         (*)
16254
16255         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16256         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16257
16258                 ;;
16259         esac
16260         ;;
16261 (yes)
16262
16263         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16264         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16265
16266         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16267
16268         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16269                 && test -z "${cf_tst_cflags}" \
16270                 && cf_fix_cppflags=no
16271         ;;
16272 esac
16273 done
16274
16275 if test -n "$cf_new_cflags" ; then
16276
16277         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16278         CFLAGS="${CFLAGS}$cf_new_cflags"
16279
16280 fi
16281
16282 if test -n "$cf_new_cppflags" ; then
16283
16284         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16285         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16286
16287 fi
16288
16289 if test -n "$cf_new_extra_cppflags" ; then
16290
16291         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16292         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16293
16294 fi
16295
16296 cf_add_libs="$LIBS"
16297 # reverse order
16298 cf_add_0lib=
16299 for cf_add_1lib in `$PKG_CONFIG --libs $PANEL_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16300 # filter duplicates
16301 for cf_add_1lib in $cf_add_0lib; do
16302         for cf_add_2lib in $cf_add_libs; do
16303                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16304                         cf_add_1lib=
16305                         break
16306                 fi
16307         done
16308         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16309 done
16310 LIBS="$cf_add_libs"
16311
16312                 cat >conftest.$ac_ext <<_ACEOF
16313 #line 16313 "configure"
16314 #include "confdefs.h"
16315 #include <$PANEL_NAME.h>
16316 int
16317 main (void)
16318 {
16319 (void) new_panel ( 0 );
16320   ;
16321   return 0;
16322 }
16323 _ACEOF
16324 rm -f conftest.$ac_objext conftest$ac_exeext
16325 if { (eval echo "$as_me:16325: \"$ac_link\"") >&5
16326   (eval $ac_link) 2>&5
16327   ac_status=$?
16328   echo "$as_me:16328: \$? = $ac_status" >&5
16329   (exit $ac_status); } &&
16330          { ac_try='test -s conftest$ac_exeext'
16331   { (eval echo "$as_me:16331: \"$ac_try\"") >&5
16332   (eval $ac_try) 2>&5
16333   ac_status=$?
16334   echo "$as_me:16334: \$? = $ac_status" >&5
16335   (exit $ac_status); }; }; then
16336   if test "$cross_compiling" = yes; then
16337   cf_have_curses_lib=maybe
16338 else
16339   cat >conftest.$ac_ext <<_ACEOF
16340 #line 16340 "configure"
16341 #include "confdefs.h"
16342 #include <$PANEL_NAME.h>
16343                                 int main(void)
16344                                 { (void) new_panel ( 0 ); return 0; }
16345 _ACEOF
16346 rm -f conftest$ac_exeext
16347 if { (eval echo "$as_me:16347: \"$ac_link\"") >&5
16348   (eval $ac_link) 2>&5
16349   ac_status=$?
16350   echo "$as_me:16350: \$? = $ac_status" >&5
16351   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16352   { (eval echo "$as_me:16352: \"$ac_try\"") >&5
16353   (eval $ac_try) 2>&5
16354   ac_status=$?
16355   echo "$as_me:16355: \$? = $ac_status" >&5
16356   (exit $ac_status); }; }; then
16357   cf_have_curses_lib=yes
16358 else
16359   echo "$as_me: program exited with status $ac_status" >&5
16360 echo "$as_me: failed program was:" >&5
16361 cat conftest.$ac_ext >&5
16362 cf_have_curses_lib=no
16363 fi
16364 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16365 fi
16366 else
16367   echo "$as_me: failed program was:" >&5
16368 cat conftest.$ac_ext >&5
16369 cf_have_curses_lib=no
16370 fi
16371 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16372                 echo "$as_me:16372: result: $cf_have_curses_lib" >&5
16373 echo "${ECHO_T}$cf_have_curses_lib" >&6
16374                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16375                 if test "$cf_have_curses_lib" != "yes"
16376                 then
16377                         CPPFLAGS="$cf_save_CPPFLAGS"
16378                         LIBS="$cf_save_LIBS"
16379                 else
16380
16381 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16382
16383                         cat >>confdefs.h <<EOF
16384 #define $cf_upper 1
16385 EOF
16386
16387                 fi
16388         fi
16389 fi
16390 if test "$cf_have_curses_lib" = no; then
16391         as_ac_Lib=`echo "ac_cv_lib_$PANEL_NAME$cf_cv_libtype''_new_panel" | $as_tr_sh`
16392 echo "$as_me:16392: checking for new_panel in -l$PANEL_NAME$cf_cv_libtype" >&5
16393 echo $ECHO_N "checking for new_panel in -l$PANEL_NAME$cf_cv_libtype... $ECHO_C" >&6
16394 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16395   echo $ECHO_N "(cached) $ECHO_C" >&6
16396 else
16397   ac_check_lib_save_LIBS=$LIBS
16398 LIBS="-l$PANEL_NAME$cf_cv_libtype  $LIBS"
16399 cat >conftest.$ac_ext <<_ACEOF
16400 #line 16400 "configure"
16401 #include "confdefs.h"
16402
16403 /* Override any gcc2 internal prototype to avoid an error.  */
16404 #ifdef __cplusplus
16405 extern "C"
16406 #endif
16407 /* We use char because int might match the return type of a gcc2
16408    builtin and then its argument prototype would still apply.  */
16409 char new_panel ();
16410 int
16411 main (void)
16412 {
16413 new_panel ();
16414   ;
16415   return 0;
16416 }
16417 _ACEOF
16418 rm -f conftest.$ac_objext conftest$ac_exeext
16419 if { (eval echo "$as_me:16419: \"$ac_link\"") >&5
16420   (eval $ac_link) 2>&5
16421   ac_status=$?
16422   echo "$as_me:16422: \$? = $ac_status" >&5
16423   (exit $ac_status); } &&
16424          { ac_try='test -s conftest$ac_exeext'
16425   { (eval echo "$as_me:16425: \"$ac_try\"") >&5
16426   (eval $ac_try) 2>&5
16427   ac_status=$?
16428   echo "$as_me:16428: \$? = $ac_status" >&5
16429   (exit $ac_status); }; }; then
16430   eval "$as_ac_Lib=yes"
16431 else
16432   echo "$as_me: failed program was:" >&5
16433 cat conftest.$ac_ext >&5
16434 eval "$as_ac_Lib=no"
16435 fi
16436 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16437 LIBS=$ac_check_lib_save_LIBS
16438 fi
16439 echo "$as_me:16439: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16440 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16441 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16442
16443 cf_upper=`echo "have_lib$PANEL_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16444
16445 cf_add_libs="$LIBS"
16446 # reverse order
16447 cf_add_0lib=
16448 for cf_add_1lib in -l$PANEL_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16449 # filter duplicates
16450 for cf_add_1lib in $cf_add_0lib; do
16451         for cf_add_2lib in $cf_add_libs; do
16452                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16453                         cf_add_1lib=
16454                         break
16455                 fi
16456         done
16457         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16458 done
16459 LIBS="$cf_add_libs"
16460
16461                 cat >>confdefs.h <<EOF
16462 #define $cf_upper 1
16463 EOF
16464
16465 fi
16466
16467 fi
16468
16469         cf_curses_headers="$cf_curses_headers panel.h"
16470 fi
16471
16472 echo "$as_me:16472: checking if you want to check for menu functions" >&5
16473 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
16474
16475 # Check whether --enable-menu or --disable-menu was given.
16476 if test "${enable_menu+set}" = set; then
16477   enableval="$enable_menu"
16478   test "$enableval" != no && enableval=yes
16479         if test "$enableval" != "yes" ; then
16480     cf_enable_menu=no
16481         else
16482                 cf_enable_menu=$cf_default_menu
16483         fi
16484 else
16485   enableval=yes
16486         cf_enable_menu=$cf_default_menu
16487
16488 fi;
16489 echo "$as_me:16489: result: $cf_enable_menu" >&5
16490 echo "${ECHO_T}$cf_enable_menu" >&6
16491 if test $cf_enable_menu = yes
16492 then
16493         case $cf_cv_screen in
16494         (ncurses*)
16495                 ;;
16496         (curses*)
16497
16498 echo "$as_me:16498: checking for NetBSD menu.h" >&5
16499 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
16500 if test "${cf_cv_netbsd_menu_h+set}" = set; then
16501   echo $ECHO_N "(cached) $ECHO_C" >&6
16502 else
16503
16504 cat >conftest.$ac_ext <<_ACEOF
16505 #line 16505 "configure"
16506 #include "confdefs.h"
16507
16508 #include <${cf_cv_ncurses_header:-curses.h}>
16509 #include <menu.h>
16510
16511 int
16512 main (void)
16513 {
16514
16515         MENU *menu;
16516         int y = menu->max_item_width;
16517
16518   ;
16519   return 0;
16520 }
16521 _ACEOF
16522 rm -f conftest.$ac_objext
16523 if { (eval echo "$as_me:16523: \"$ac_compile\"") >&5
16524   (eval $ac_compile) 2>&5
16525   ac_status=$?
16526   echo "$as_me:16526: \$? = $ac_status" >&5
16527   (exit $ac_status); } &&
16528          { ac_try='test -s conftest.$ac_objext'
16529   { (eval echo "$as_me:16529: \"$ac_try\"") >&5
16530   (eval $ac_try) 2>&5
16531   ac_status=$?
16532   echo "$as_me:16532: \$? = $ac_status" >&5
16533   (exit $ac_status); }; }; then
16534   cf_cv_netbsd_menu_h=yes
16535
16536 else
16537   echo "$as_me: failed program was:" >&5
16538 cat conftest.$ac_ext >&5
16539 cf_cv_netbsd_menu_h=no
16540 fi
16541 rm -f conftest.$ac_objext conftest.$ac_ext
16542
16543 fi
16544 echo "$as_me:16544: result: $cf_cv_netbsd_menu_h" >&5
16545 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
16546
16547 test "$cf_cv_netbsd_menu_h" = yes &&
16548 cat >>confdefs.h <<\EOF
16549 #define HAVE_NETBSD_MENU_H 1
16550 EOF
16551
16552                 ;;
16553         esac
16554
16555 cf_have_curses_lib=no
16556
16557 : ${NCURSES_CONFIG_PKG:=none}
16558 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16559         :
16560 elif test "x${PKG_CONFIG:=none}" != xnone; then
16561         echo "$as_me:16561: checking pkg-config for $MENU_NAME$cf_cv_libtype" >&5
16562 echo $ECHO_N "checking pkg-config for $MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16563         if "$PKG_CONFIG" --exists $MENU_NAME$cf_cv_libtype ; then
16564                 echo "$as_me:16564: result: yes" >&5
16565 echo "${ECHO_T}yes" >&6
16566
16567                 echo "$as_me:16567: checking if the $MENU_NAME$cf_cv_libtype package files work" >&5
16568 echo $ECHO_N "checking if the $MENU_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16569
16570                 cf_save_CPPFLAGS="$CPPFLAGS"
16571                 cf_save_LIBS="$LIBS"
16572
16573 cf_fix_cppflags=no
16574 cf_new_cflags=
16575 cf_new_cppflags=
16576 cf_new_extra_cppflags=
16577
16578 for cf_add_cflags in `$PKG_CONFIG --cflags $MENU_NAME$cf_cv_libtype`
16579 do
16580 case $cf_fix_cppflags in
16581 (no)
16582         case $cf_add_cflags in
16583         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16584                 case $cf_add_cflags in
16585                 (-D*)
16586                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16587
16588                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16589                                 && test -z "${cf_tst_cflags}" \
16590                                 && cf_fix_cppflags=yes
16591
16592                         if test $cf_fix_cppflags = yes ; then
16593
16594         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16595         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16596
16597                                 continue
16598                         elif test "${cf_tst_cflags}" = "\"'" ; then
16599
16600         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16601         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16602
16603                                 continue
16604                         fi
16605                         ;;
16606                 esac
16607                 case "$CPPFLAGS" in
16608                 (*$cf_add_cflags)
16609                         ;;
16610                 (*)
16611                         case $cf_add_cflags in
16612                         (-D*)
16613                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16614
16615 CPPFLAGS=`echo "$CPPFLAGS" | \
16616         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16617                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16618
16619                                 ;;
16620                         esac
16621
16622         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16623         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16624
16625                         ;;
16626                 esac
16627                 ;;
16628         (*)
16629
16630         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16631         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16632
16633                 ;;
16634         esac
16635         ;;
16636 (yes)
16637
16638         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16639         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16640
16641         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16642
16643         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16644                 && test -z "${cf_tst_cflags}" \
16645                 && cf_fix_cppflags=no
16646         ;;
16647 esac
16648 done
16649
16650 if test -n "$cf_new_cflags" ; then
16651
16652         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16653         CFLAGS="${CFLAGS}$cf_new_cflags"
16654
16655 fi
16656
16657 if test -n "$cf_new_cppflags" ; then
16658
16659         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16660         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16661
16662 fi
16663
16664 if test -n "$cf_new_extra_cppflags" ; then
16665
16666         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16667         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16668
16669 fi
16670
16671 cf_add_libs="$LIBS"
16672 # reverse order
16673 cf_add_0lib=
16674 for cf_add_1lib in `$PKG_CONFIG --libs $MENU_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16675 # filter duplicates
16676 for cf_add_1lib in $cf_add_0lib; do
16677         for cf_add_2lib in $cf_add_libs; do
16678                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16679                         cf_add_1lib=
16680                         break
16681                 fi
16682         done
16683         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16684 done
16685 LIBS="$cf_add_libs"
16686
16687                 cat >conftest.$ac_ext <<_ACEOF
16688 #line 16688 "configure"
16689 #include "confdefs.h"
16690 #include <$MENU_NAME.h>
16691 int
16692 main (void)
16693 {
16694 (void) menu_driver ( 0,0 );
16695   ;
16696   return 0;
16697 }
16698 _ACEOF
16699 rm -f conftest.$ac_objext conftest$ac_exeext
16700 if { (eval echo "$as_me:16700: \"$ac_link\"") >&5
16701   (eval $ac_link) 2>&5
16702   ac_status=$?
16703   echo "$as_me:16703: \$? = $ac_status" >&5
16704   (exit $ac_status); } &&
16705          { ac_try='test -s conftest$ac_exeext'
16706   { (eval echo "$as_me:16706: \"$ac_try\"") >&5
16707   (eval $ac_try) 2>&5
16708   ac_status=$?
16709   echo "$as_me:16709: \$? = $ac_status" >&5
16710   (exit $ac_status); }; }; then
16711   if test "$cross_compiling" = yes; then
16712   cf_have_curses_lib=maybe
16713 else
16714   cat >conftest.$ac_ext <<_ACEOF
16715 #line 16715 "configure"
16716 #include "confdefs.h"
16717 #include <$MENU_NAME.h>
16718                                 int main(void)
16719                                 { (void) menu_driver ( 0,0 ); return 0; }
16720 _ACEOF
16721 rm -f conftest$ac_exeext
16722 if { (eval echo "$as_me:16722: \"$ac_link\"") >&5
16723   (eval $ac_link) 2>&5
16724   ac_status=$?
16725   echo "$as_me:16725: \$? = $ac_status" >&5
16726   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16727   { (eval echo "$as_me:16727: \"$ac_try\"") >&5
16728   (eval $ac_try) 2>&5
16729   ac_status=$?
16730   echo "$as_me:16730: \$? = $ac_status" >&5
16731   (exit $ac_status); }; }; then
16732   cf_have_curses_lib=yes
16733 else
16734   echo "$as_me: program exited with status $ac_status" >&5
16735 echo "$as_me: failed program was:" >&5
16736 cat conftest.$ac_ext >&5
16737 cf_have_curses_lib=no
16738 fi
16739 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16740 fi
16741 else
16742   echo "$as_me: failed program was:" >&5
16743 cat conftest.$ac_ext >&5
16744 cf_have_curses_lib=no
16745 fi
16746 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16747                 echo "$as_me:16747: result: $cf_have_curses_lib" >&5
16748 echo "${ECHO_T}$cf_have_curses_lib" >&6
16749                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16750                 if test "$cf_have_curses_lib" != "yes"
16751                 then
16752                         CPPFLAGS="$cf_save_CPPFLAGS"
16753                         LIBS="$cf_save_LIBS"
16754                 else
16755
16756 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16757
16758                         cat >>confdefs.h <<EOF
16759 #define $cf_upper 1
16760 EOF
16761
16762                 fi
16763         fi
16764 fi
16765 if test "$cf_have_curses_lib" = no; then
16766         as_ac_Lib=`echo "ac_cv_lib_$MENU_NAME$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16767 echo "$as_me:16767: checking for menu_driver in -l$MENU_NAME$cf_cv_libtype" >&5
16768 echo $ECHO_N "checking for menu_driver in -l$MENU_NAME$cf_cv_libtype... $ECHO_C" >&6
16769 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16770   echo $ECHO_N "(cached) $ECHO_C" >&6
16771 else
16772   ac_check_lib_save_LIBS=$LIBS
16773 LIBS="-l$MENU_NAME$cf_cv_libtype  $LIBS"
16774 cat >conftest.$ac_ext <<_ACEOF
16775 #line 16775 "configure"
16776 #include "confdefs.h"
16777
16778 /* Override any gcc2 internal prototype to avoid an error.  */
16779 #ifdef __cplusplus
16780 extern "C"
16781 #endif
16782 /* We use char because int might match the return type of a gcc2
16783    builtin and then its argument prototype would still apply.  */
16784 char menu_driver ();
16785 int
16786 main (void)
16787 {
16788 menu_driver ();
16789   ;
16790   return 0;
16791 }
16792 _ACEOF
16793 rm -f conftest.$ac_objext conftest$ac_exeext
16794 if { (eval echo "$as_me:16794: \"$ac_link\"") >&5
16795   (eval $ac_link) 2>&5
16796   ac_status=$?
16797   echo "$as_me:16797: \$? = $ac_status" >&5
16798   (exit $ac_status); } &&
16799          { ac_try='test -s conftest$ac_exeext'
16800   { (eval echo "$as_me:16800: \"$ac_try\"") >&5
16801   (eval $ac_try) 2>&5
16802   ac_status=$?
16803   echo "$as_me:16803: \$? = $ac_status" >&5
16804   (exit $ac_status); }; }; then
16805   eval "$as_ac_Lib=yes"
16806 else
16807   echo "$as_me: failed program was:" >&5
16808 cat conftest.$ac_ext >&5
16809 eval "$as_ac_Lib=no"
16810 fi
16811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16812 LIBS=$ac_check_lib_save_LIBS
16813 fi
16814 echo "$as_me:16814: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16815 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16816 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16817
16818 cf_upper=`echo "have_lib$MENU_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16819
16820 cf_add_libs="$LIBS"
16821 # reverse order
16822 cf_add_0lib=
16823 for cf_add_1lib in -l$MENU_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
16824 # filter duplicates
16825 for cf_add_1lib in $cf_add_0lib; do
16826         for cf_add_2lib in $cf_add_libs; do
16827                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
16828                         cf_add_1lib=
16829                         break
16830                 fi
16831         done
16832         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
16833 done
16834 LIBS="$cf_add_libs"
16835
16836                 cat >>confdefs.h <<EOF
16837 #define $cf_upper 1
16838 EOF
16839
16840 fi
16841
16842 fi
16843
16844         cf_curses_headers="$cf_curses_headers menu.h"
16845 fi
16846
16847 echo "$as_me:16847: checking if you want to check for form functions" >&5
16848 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16849
16850 # Check whether --enable-form or --disable-form was given.
16851 if test "${enable_form+set}" = set; then
16852   enableval="$enable_form"
16853   test "$enableval" != no && enableval=yes
16854         if test "$enableval" != "yes" ; then
16855     cf_enable_form=no
16856         else
16857                 cf_enable_form=$cf_default_form
16858         fi
16859 else
16860   enableval=yes
16861         cf_enable_form=$cf_default_form
16862
16863 fi;
16864 echo "$as_me:16864: result: $cf_enable_form" >&5
16865 echo "${ECHO_T}$cf_enable_form" >&6
16866 if test $cf_enable_form = yes
16867 then
16868         case $cf_cv_screen in
16869         (ncurses*)
16870                 ;;
16871         (curses*)
16872
16873 echo "$as_me:16873: checking for NetBSD form.h" >&5
16874 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16875 if test "${cf_cv_netbsd_form_h+set}" = set; then
16876   echo $ECHO_N "(cached) $ECHO_C" >&6
16877 else
16878
16879 cat >conftest.$ac_ext <<_ACEOF
16880 #line 16880 "configure"
16881 #include "confdefs.h"
16882
16883 #include <${cf_cv_ncurses_header:-curses.h}>
16884 #include <form.h>
16885
16886 int
16887 main (void)
16888 {
16889
16890         FORM *form;
16891         int y = current_field(form)->cursor_ypos;
16892         int x = current_field(form)->cursor_xpos;
16893
16894   ;
16895   return 0;
16896 }
16897 _ACEOF
16898 rm -f conftest.$ac_objext
16899 if { (eval echo "$as_me:16899: \"$ac_compile\"") >&5
16900   (eval $ac_compile) 2>&5
16901   ac_status=$?
16902   echo "$as_me:16902: \$? = $ac_status" >&5
16903   (exit $ac_status); } &&
16904          { ac_try='test -s conftest.$ac_objext'
16905   { (eval echo "$as_me:16905: \"$ac_try\"") >&5
16906   (eval $ac_try) 2>&5
16907   ac_status=$?
16908   echo "$as_me:16908: \$? = $ac_status" >&5
16909   (exit $ac_status); }; }; then
16910   cf_cv_netbsd_form_h=yes
16911
16912 else
16913   echo "$as_me: failed program was:" >&5
16914 cat conftest.$ac_ext >&5
16915 cf_cv_netbsd_form_h=no
16916 fi
16917 rm -f conftest.$ac_objext conftest.$ac_ext
16918
16919 fi
16920 echo "$as_me:16920: result: $cf_cv_netbsd_form_h" >&5
16921 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16922
16923 test "$cf_cv_netbsd_form_h" = yes &&
16924 cat >>confdefs.h <<\EOF
16925 #define HAVE_NETBSD_FORM_H 1
16926 EOF
16927
16928                 ;;
16929         esac
16930
16931 cf_have_curses_lib=no
16932
16933 : ${NCURSES_CONFIG_PKG:=none}
16934 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16935         :
16936 elif test "x${PKG_CONFIG:=none}" != xnone; then
16937         echo "$as_me:16937: checking pkg-config for $FORM_NAME$cf_cv_libtype" >&5
16938 echo $ECHO_N "checking pkg-config for $FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
16939         if "$PKG_CONFIG" --exists $FORM_NAME$cf_cv_libtype ; then
16940                 echo "$as_me:16940: result: yes" >&5
16941 echo "${ECHO_T}yes" >&6
16942
16943                 echo "$as_me:16943: checking if the $FORM_NAME$cf_cv_libtype package files work" >&5
16944 echo $ECHO_N "checking if the $FORM_NAME$cf_cv_libtype package files work... $ECHO_C" >&6
16945
16946                 cf_save_CPPFLAGS="$CPPFLAGS"
16947                 cf_save_LIBS="$LIBS"
16948
16949 cf_fix_cppflags=no
16950 cf_new_cflags=
16951 cf_new_cppflags=
16952 cf_new_extra_cppflags=
16953
16954 for cf_add_cflags in `$PKG_CONFIG --cflags $FORM_NAME$cf_cv_libtype`
16955 do
16956 case $cf_fix_cppflags in
16957 (no)
16958         case $cf_add_cflags in
16959         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16960                 case $cf_add_cflags in
16961                 (-D*)
16962                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16963
16964                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16965                                 && test -z "${cf_tst_cflags}" \
16966                                 && cf_fix_cppflags=yes
16967
16968                         if test $cf_fix_cppflags = yes ; then
16969
16970         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16971         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16972
16973                                 continue
16974                         elif test "${cf_tst_cflags}" = "\"'" ; then
16975
16976         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16977         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16978
16979                                 continue
16980                         fi
16981                         ;;
16982                 esac
16983                 case "$CPPFLAGS" in
16984                 (*$cf_add_cflags)
16985                         ;;
16986                 (*)
16987                         case $cf_add_cflags in
16988                         (-D*)
16989                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16990
16991 CPPFLAGS=`echo "$CPPFLAGS" | \
16992         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16993                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16994
16995                                 ;;
16996                         esac
16997
16998         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16999         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
17000
17001                         ;;
17002                 esac
17003                 ;;
17004         (*)
17005
17006         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
17007         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
17008
17009                 ;;
17010         esac
17011         ;;
17012 (yes)
17013
17014         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
17015         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
17016
17017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
17018
17019         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
17020                 && test -z "${cf_tst_cflags}" \
17021                 && cf_fix_cppflags=no
17022         ;;
17023 esac
17024 done
17025
17026 if test -n "$cf_new_cflags" ; then
17027
17028         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
17029         CFLAGS="${CFLAGS}$cf_new_cflags"
17030
17031 fi
17032
17033 if test -n "$cf_new_cppflags" ; then
17034
17035         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17036         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
17037
17038 fi
17039
17040 if test -n "$cf_new_extra_cppflags" ; then
17041
17042         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
17043         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
17044
17045 fi
17046
17047 cf_add_libs="$LIBS"
17048 # reverse order
17049 cf_add_0lib=
17050 for cf_add_1lib in `$PKG_CONFIG --libs $FORM_NAME$cf_cv_libtype`; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17051 # filter duplicates
17052 for cf_add_1lib in $cf_add_0lib; do
17053         for cf_add_2lib in $cf_add_libs; do
17054                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17055                         cf_add_1lib=
17056                         break
17057                 fi
17058         done
17059         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17060 done
17061 LIBS="$cf_add_libs"
17062
17063                 cat >conftest.$ac_ext <<_ACEOF
17064 #line 17064 "configure"
17065 #include "confdefs.h"
17066 #include <$FORM_NAME.h>
17067 int
17068 main (void)
17069 {
17070 (void) form_driver ( 0,0 );
17071   ;
17072   return 0;
17073 }
17074 _ACEOF
17075 rm -f conftest.$ac_objext conftest$ac_exeext
17076 if { (eval echo "$as_me:17076: \"$ac_link\"") >&5
17077   (eval $ac_link) 2>&5
17078   ac_status=$?
17079   echo "$as_me:17079: \$? = $ac_status" >&5
17080   (exit $ac_status); } &&
17081          { ac_try='test -s conftest$ac_exeext'
17082   { (eval echo "$as_me:17082: \"$ac_try\"") >&5
17083   (eval $ac_try) 2>&5
17084   ac_status=$?
17085   echo "$as_me:17085: \$? = $ac_status" >&5
17086   (exit $ac_status); }; }; then
17087   if test "$cross_compiling" = yes; then
17088   cf_have_curses_lib=maybe
17089 else
17090   cat >conftest.$ac_ext <<_ACEOF
17091 #line 17091 "configure"
17092 #include "confdefs.h"
17093 #include <$FORM_NAME.h>
17094                                 int main(void)
17095                                 { (void) form_driver ( 0,0 ); return 0; }
17096 _ACEOF
17097 rm -f conftest$ac_exeext
17098 if { (eval echo "$as_me:17098: \"$ac_link\"") >&5
17099   (eval $ac_link) 2>&5
17100   ac_status=$?
17101   echo "$as_me:17101: \$? = $ac_status" >&5
17102   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17103   { (eval echo "$as_me:17103: \"$ac_try\"") >&5
17104   (eval $ac_try) 2>&5
17105   ac_status=$?
17106   echo "$as_me:17106: \$? = $ac_status" >&5
17107   (exit $ac_status); }; }; then
17108   cf_have_curses_lib=yes
17109 else
17110   echo "$as_me: program exited with status $ac_status" >&5
17111 echo "$as_me: failed program was:" >&5
17112 cat conftest.$ac_ext >&5
17113 cf_have_curses_lib=no
17114 fi
17115 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17116 fi
17117 else
17118   echo "$as_me: failed program was:" >&5
17119 cat conftest.$ac_ext >&5
17120 cf_have_curses_lib=no
17121 fi
17122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17123                 echo "$as_me:17123: result: $cf_have_curses_lib" >&5
17124 echo "${ECHO_T}$cf_have_curses_lib" >&6
17125                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
17126                 if test "$cf_have_curses_lib" != "yes"
17127                 then
17128                         CPPFLAGS="$cf_save_CPPFLAGS"
17129                         LIBS="$cf_save_LIBS"
17130                 else
17131
17132 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17133
17134                         cat >>confdefs.h <<EOF
17135 #define $cf_upper 1
17136 EOF
17137
17138                 fi
17139         fi
17140 fi
17141 if test "$cf_have_curses_lib" = no; then
17142         as_ac_Lib=`echo "ac_cv_lib_$FORM_NAME$cf_cv_libtype''_form_driver" | $as_tr_sh`
17143 echo "$as_me:17143: checking for form_driver in -l$FORM_NAME$cf_cv_libtype" >&5
17144 echo $ECHO_N "checking for form_driver in -l$FORM_NAME$cf_cv_libtype... $ECHO_C" >&6
17145 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
17146   echo $ECHO_N "(cached) $ECHO_C" >&6
17147 else
17148   ac_check_lib_save_LIBS=$LIBS
17149 LIBS="-l$FORM_NAME$cf_cv_libtype  $LIBS"
17150 cat >conftest.$ac_ext <<_ACEOF
17151 #line 17151 "configure"
17152 #include "confdefs.h"
17153
17154 /* Override any gcc2 internal prototype to avoid an error.  */
17155 #ifdef __cplusplus
17156 extern "C"
17157 #endif
17158 /* We use char because int might match the return type of a gcc2
17159    builtin and then its argument prototype would still apply.  */
17160 char form_driver ();
17161 int
17162 main (void)
17163 {
17164 form_driver ();
17165   ;
17166   return 0;
17167 }
17168 _ACEOF
17169 rm -f conftest.$ac_objext conftest$ac_exeext
17170 if { (eval echo "$as_me:17170: \"$ac_link\"") >&5
17171   (eval $ac_link) 2>&5
17172   ac_status=$?
17173   echo "$as_me:17173: \$? = $ac_status" >&5
17174   (exit $ac_status); } &&
17175          { ac_try='test -s conftest$ac_exeext'
17176   { (eval echo "$as_me:17176: \"$ac_try\"") >&5
17177   (eval $ac_try) 2>&5
17178   ac_status=$?
17179   echo "$as_me:17179: \$? = $ac_status" >&5
17180   (exit $ac_status); }; }; then
17181   eval "$as_ac_Lib=yes"
17182 else
17183   echo "$as_me: failed program was:" >&5
17184 cat conftest.$ac_ext >&5
17185 eval "$as_ac_Lib=no"
17186 fi
17187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17188 LIBS=$ac_check_lib_save_LIBS
17189 fi
17190 echo "$as_me:17190: result: `eval echo '${'$as_ac_Lib'}'`" >&5
17191 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
17192 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
17193
17194 cf_upper=`echo "have_lib$FORM_NAME" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17195
17196 cf_add_libs="$LIBS"
17197 # reverse order
17198 cf_add_0lib=
17199 for cf_add_1lib in -l$FORM_NAME$cf_cv_libtype; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
17200 # filter duplicates
17201 for cf_add_1lib in $cf_add_0lib; do
17202         for cf_add_2lib in $cf_add_libs; do
17203                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
17204                         cf_add_1lib=
17205                         break
17206                 fi
17207         done
17208         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
17209 done
17210 LIBS="$cf_add_libs"
17211
17212                 cat >>confdefs.h <<EOF
17213 #define $cf_upper 1
17214 EOF
17215
17216 fi
17217
17218 fi
17219
17220         cf_curses_headers="$cf_curses_headers form.h"
17221 fi
17222
17223 # look for curses-related headers
17224
17225 for ac_header in $cf_curses_headers
17226 do
17227 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17228 echo "$as_me:17228: checking for $ac_header" >&5
17229 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17230 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17231   echo $ECHO_N "(cached) $ECHO_C" >&6
17232 else
17233   cat >conftest.$ac_ext <<_ACEOF
17234 #line 17234 "configure"
17235 #include "confdefs.h"
17236 #include <$ac_header>
17237 _ACEOF
17238 if { (eval echo "$as_me:17238: \"$ac_cpp conftest.$ac_ext\"") >&5
17239   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17240   ac_status=$?
17241   egrep -v '^ *\+' conftest.er1 >conftest.err
17242   rm -f conftest.er1
17243   cat conftest.err >&5
17244   echo "$as_me:17244: \$? = $ac_status" >&5
17245   (exit $ac_status); } >/dev/null; then
17246   if test -s conftest.err; then
17247     ac_cpp_err=$ac_c_preproc_warn_flag
17248   else
17249     ac_cpp_err=
17250   fi
17251 else
17252   ac_cpp_err=yes
17253 fi
17254 if test -z "$ac_cpp_err"; then
17255   eval "$as_ac_Header=yes"
17256 else
17257   echo "$as_me: failed program was:" >&5
17258   cat conftest.$ac_ext >&5
17259   eval "$as_ac_Header=no"
17260 fi
17261 rm -f conftest.err conftest.$ac_ext
17262 fi
17263 echo "$as_me:17263: result: `eval echo '${'$as_ac_Header'}'`" >&5
17264 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17265 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17266   cat >>confdefs.h <<EOF
17267 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17268 EOF
17269
17270 fi
17271 done
17272
17273 echo "$as_me:17273: checking for ANSI C header files" >&5
17274 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
17275 if test "${ac_cv_header_stdc+set}" = set; then
17276   echo $ECHO_N "(cached) $ECHO_C" >&6
17277 else
17278   cat >conftest.$ac_ext <<_ACEOF
17279 #line 17279 "configure"
17280 #include "confdefs.h"
17281 #include <stdlib.h>
17282 #include <stdarg.h>
17283 #include <string.h>
17284 #include <float.h>
17285
17286 _ACEOF
17287 if { (eval echo "$as_me:17287: \"$ac_cpp conftest.$ac_ext\"") >&5
17288   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17289   ac_status=$?
17290   egrep -v '^ *\+' conftest.er1 >conftest.err
17291   rm -f conftest.er1
17292   cat conftest.err >&5
17293   echo "$as_me:17293: \$? = $ac_status" >&5
17294   (exit $ac_status); } >/dev/null; then
17295   if test -s conftest.err; then
17296     ac_cpp_err=$ac_c_preproc_warn_flag
17297   else
17298     ac_cpp_err=
17299   fi
17300 else
17301   ac_cpp_err=yes
17302 fi
17303 if test -z "$ac_cpp_err"; then
17304   ac_cv_header_stdc=yes
17305 else
17306   echo "$as_me: failed program was:" >&5
17307   cat conftest.$ac_ext >&5
17308   ac_cv_header_stdc=no
17309 fi
17310 rm -f conftest.err conftest.$ac_ext
17311
17312 if test $ac_cv_header_stdc = yes; then
17313   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
17314   cat >conftest.$ac_ext <<_ACEOF
17315 #line 17315 "configure"
17316 #include "confdefs.h"
17317 #include <string.h>
17318
17319 _ACEOF
17320 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17321   egrep "memchr" >/dev/null 2>&1; then
17322   :
17323 else
17324   ac_cv_header_stdc=no
17325 fi
17326 rm -rf conftest*
17327
17328 fi
17329
17330 if test $ac_cv_header_stdc = yes; then
17331   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
17332   cat >conftest.$ac_ext <<_ACEOF
17333 #line 17333 "configure"
17334 #include "confdefs.h"
17335 #include <stdlib.h>
17336
17337 _ACEOF
17338 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
17339   egrep "free" >/dev/null 2>&1; then
17340   :
17341 else
17342   ac_cv_header_stdc=no
17343 fi
17344 rm -rf conftest*
17345
17346 fi
17347
17348 if test $ac_cv_header_stdc = yes; then
17349   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
17350   if test "$cross_compiling" = yes; then
17351   :
17352 else
17353   cat >conftest.$ac_ext <<_ACEOF
17354 #line 17354 "configure"
17355 #include "confdefs.h"
17356 #include <ctype.h>
17357 #if ((' ' & 0x0FF) == 0x020)
17358 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
17359 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
17360 #else
17361 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
17362                      || ('j' <= (c) && (c) <= 'r') \
17363                      || ('s' <= (c) && (c) <= 'z'))
17364 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
17365 #endif
17366
17367 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
17368 int
17369 main (void)
17370 {
17371   int i;
17372   for (i = 0; i < 256; i++)
17373     if (XOR (islower (i), ISLOWER (i))
17374         || toupper (i) != TOUPPER (i))
17375       $ac_main_return(2);
17376   $ac_main_return (0);
17377 }
17378 _ACEOF
17379 rm -f conftest$ac_exeext
17380 if { (eval echo "$as_me:17380: \"$ac_link\"") >&5
17381   (eval $ac_link) 2>&5
17382   ac_status=$?
17383   echo "$as_me:17383: \$? = $ac_status" >&5
17384   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17385   { (eval echo "$as_me:17385: \"$ac_try\"") >&5
17386   (eval $ac_try) 2>&5
17387   ac_status=$?
17388   echo "$as_me:17388: \$? = $ac_status" >&5
17389   (exit $ac_status); }; }; then
17390   :
17391 else
17392   echo "$as_me: program exited with status $ac_status" >&5
17393 echo "$as_me: failed program was:" >&5
17394 cat conftest.$ac_ext >&5
17395 ac_cv_header_stdc=no
17396 fi
17397 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17398 fi
17399 fi
17400 fi
17401 echo "$as_me:17401: result: $ac_cv_header_stdc" >&5
17402 echo "${ECHO_T}$ac_cv_header_stdc" >&6
17403 if test $ac_cv_header_stdc = yes; then
17404
17405 cat >>confdefs.h <<\EOF
17406 #define STDC_HEADERS 1
17407 EOF
17408
17409 fi
17410
17411 echo "$as_me:17411: checking whether time.h and sys/time.h may both be included" >&5
17412 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
17413 if test "${ac_cv_header_time+set}" = set; then
17414   echo $ECHO_N "(cached) $ECHO_C" >&6
17415 else
17416   cat >conftest.$ac_ext <<_ACEOF
17417 #line 17417 "configure"
17418 #include "confdefs.h"
17419 #include <sys/types.h>
17420 #include <sys/time.h>
17421 #include <time.h>
17422
17423 int
17424 main (void)
17425 {
17426 if ((struct tm *) 0)
17427 return 0;
17428   ;
17429   return 0;
17430 }
17431 _ACEOF
17432 rm -f conftest.$ac_objext
17433 if { (eval echo "$as_me:17433: \"$ac_compile\"") >&5
17434   (eval $ac_compile) 2>&5
17435   ac_status=$?
17436   echo "$as_me:17436: \$? = $ac_status" >&5
17437   (exit $ac_status); } &&
17438          { ac_try='test -s conftest.$ac_objext'
17439   { (eval echo "$as_me:17439: \"$ac_try\"") >&5
17440   (eval $ac_try) 2>&5
17441   ac_status=$?
17442   echo "$as_me:17442: \$? = $ac_status" >&5
17443   (exit $ac_status); }; }; then
17444   ac_cv_header_time=yes
17445 else
17446   echo "$as_me: failed program was:" >&5
17447 cat conftest.$ac_ext >&5
17448 ac_cv_header_time=no
17449 fi
17450 rm -f conftest.$ac_objext conftest.$ac_ext
17451 fi
17452 echo "$as_me:17452: result: $ac_cv_header_time" >&5
17453 echo "${ECHO_T}$ac_cv_header_time" >&6
17454 if test $ac_cv_header_time = yes; then
17455
17456 cat >>confdefs.h <<\EOF
17457 #define TIME_WITH_SYS_TIME 1
17458 EOF
17459
17460 fi
17461
17462 for ac_header in \
17463 getopt.h \
17464 locale.h \
17465 math.h \
17466 stdarg.h \
17467 stdint.h \
17468 sys/ioctl.h \
17469 sys/select.h \
17470 sys/time.h \
17471 termios.h \
17472 unistd.h \
17473
17474 do
17475 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17476 echo "$as_me:17476: checking for $ac_header" >&5
17477 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17478 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17479   echo $ECHO_N "(cached) $ECHO_C" >&6
17480 else
17481   cat >conftest.$ac_ext <<_ACEOF
17482 #line 17482 "configure"
17483 #include "confdefs.h"
17484 #include <$ac_header>
17485 _ACEOF
17486 if { (eval echo "$as_me:17486: \"$ac_cpp conftest.$ac_ext\"") >&5
17487   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17488   ac_status=$?
17489   egrep -v '^ *\+' conftest.er1 >conftest.err
17490   rm -f conftest.er1
17491   cat conftest.err >&5
17492   echo "$as_me:17492: \$? = $ac_status" >&5
17493   (exit $ac_status); } >/dev/null; then
17494   if test -s conftest.err; then
17495     ac_cpp_err=$ac_c_preproc_warn_flag
17496   else
17497     ac_cpp_err=
17498   fi
17499 else
17500   ac_cpp_err=yes
17501 fi
17502 if test -z "$ac_cpp_err"; then
17503   eval "$as_ac_Header=yes"
17504 else
17505   echo "$as_me: failed program was:" >&5
17506   cat conftest.$ac_ext >&5
17507   eval "$as_ac_Header=no"
17508 fi
17509 rm -f conftest.err conftest.$ac_ext
17510 fi
17511 echo "$as_me:17511: result: `eval echo '${'$as_ac_Header'}'`" >&5
17512 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17513 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17514   cat >>confdefs.h <<EOF
17515 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17516 EOF
17517
17518 fi
17519 done
17520
17521 for ac_header in unistd.h getopt.h
17522 do
17523 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
17524 echo "$as_me:17524: checking for $ac_header" >&5
17525 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
17526 if eval "test \"\${$as_ac_Header+set}\" = set"; then
17527   echo $ECHO_N "(cached) $ECHO_C" >&6
17528 else
17529   cat >conftest.$ac_ext <<_ACEOF
17530 #line 17530 "configure"
17531 #include "confdefs.h"
17532 #include <$ac_header>
17533 _ACEOF
17534 if { (eval echo "$as_me:17534: \"$ac_cpp conftest.$ac_ext\"") >&5
17535   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
17536   ac_status=$?
17537   egrep -v '^ *\+' conftest.er1 >conftest.err
17538   rm -f conftest.er1
17539   cat conftest.err >&5
17540   echo "$as_me:17540: \$? = $ac_status" >&5
17541   (exit $ac_status); } >/dev/null; then
17542   if test -s conftest.err; then
17543     ac_cpp_err=$ac_c_preproc_warn_flag
17544   else
17545     ac_cpp_err=
17546   fi
17547 else
17548   ac_cpp_err=yes
17549 fi
17550 if test -z "$ac_cpp_err"; then
17551   eval "$as_ac_Header=yes"
17552 else
17553   echo "$as_me: failed program was:" >&5
17554   cat conftest.$ac_ext >&5
17555   eval "$as_ac_Header=no"
17556 fi
17557 rm -f conftest.err conftest.$ac_ext
17558 fi
17559 echo "$as_me:17559: result: `eval echo '${'$as_ac_Header'}'`" >&5
17560 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
17561 if test `eval echo '${'$as_ac_Header'}'` = yes; then
17562   cat >>confdefs.h <<EOF
17563 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
17564 EOF
17565
17566 fi
17567 done
17568
17569 echo "$as_me:17569: checking for header declaring getopt variables" >&5
17570 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
17571 if test "${cf_cv_getopt_header+set}" = set; then
17572   echo $ECHO_N "(cached) $ECHO_C" >&6
17573 else
17574
17575 cf_cv_getopt_header=none
17576 for cf_header in stdio.h stdlib.h unistd.h getopt.h
17577 do
17578 cat >conftest.$ac_ext <<_ACEOF
17579 #line 17579 "configure"
17580 #include "confdefs.h"
17581
17582 #include <$cf_header>
17583 int
17584 main (void)
17585 {
17586 int x = optind; char *y = optarg
17587   ;
17588   return 0;
17589 }
17590 _ACEOF
17591 rm -f conftest.$ac_objext
17592 if { (eval echo "$as_me:17592: \"$ac_compile\"") >&5
17593   (eval $ac_compile) 2>&5
17594   ac_status=$?
17595   echo "$as_me:17595: \$? = $ac_status" >&5
17596   (exit $ac_status); } &&
17597          { ac_try='test -s conftest.$ac_objext'
17598   { (eval echo "$as_me:17598: \"$ac_try\"") >&5
17599   (eval $ac_try) 2>&5
17600   ac_status=$?
17601   echo "$as_me:17601: \$? = $ac_status" >&5
17602   (exit $ac_status); }; }; then
17603   cf_cv_getopt_header=$cf_header
17604  break
17605 else
17606   echo "$as_me: failed program was:" >&5
17607 cat conftest.$ac_ext >&5
17608 fi
17609 rm -f conftest.$ac_objext conftest.$ac_ext
17610 done
17611
17612 fi
17613 echo "$as_me:17613: result: $cf_cv_getopt_header" >&5
17614 echo "${ECHO_T}$cf_cv_getopt_header" >&6
17615 if test $cf_cv_getopt_header != none ; then
17616
17617 cat >>confdefs.h <<\EOF
17618 #define HAVE_GETOPT_HEADER 1
17619 EOF
17620
17621 fi
17622 if test $cf_cv_getopt_header = getopt.h ; then
17623
17624 cat >>confdefs.h <<\EOF
17625 #define NEED_GETOPT_H 1
17626 EOF
17627
17628 fi
17629
17630 for ac_func in \
17631 getopt \
17632 gettimeofday \
17633 snprintf \
17634 strdup \
17635 strstr \
17636 tsearch \
17637
17638 do
17639 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17640 echo "$as_me:17640: checking for $ac_func" >&5
17641 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17642 if eval "test \"\${$as_ac_var+set}\" = set"; then
17643   echo $ECHO_N "(cached) $ECHO_C" >&6
17644 else
17645   cat >conftest.$ac_ext <<_ACEOF
17646 #line 17646 "configure"
17647 #include "confdefs.h"
17648 #define $ac_func autoconf_temporary
17649 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17650 #undef $ac_func
17651
17652 #ifdef __cplusplus
17653 extern "C"
17654 #endif
17655
17656 /* We use char because int might match the return type of a gcc2
17657    builtin and then its argument prototype would still apply.  */
17658 char $ac_func (void);
17659
17660 int
17661 main (void)
17662 {
17663
17664 /* The GNU C library defines stubs for functions which it implements
17665     to always fail with ENOSYS.  Some functions are actually named
17666     something starting with __ and the normal name is an alias.  */
17667 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17668 #error found stub for $ac_func
17669 #endif
17670
17671         return $ac_func ();
17672   ;
17673   return 0;
17674 }
17675 _ACEOF
17676 rm -f conftest.$ac_objext conftest$ac_exeext
17677 if { (eval echo "$as_me:17677: \"$ac_link\"") >&5
17678   (eval $ac_link) 2>&5
17679   ac_status=$?
17680   echo "$as_me:17680: \$? = $ac_status" >&5
17681   (exit $ac_status); } &&
17682          { ac_try='test -s conftest$ac_exeext'
17683   { (eval echo "$as_me:17683: \"$ac_try\"") >&5
17684   (eval $ac_try) 2>&5
17685   ac_status=$?
17686   echo "$as_me:17686: \$? = $ac_status" >&5
17687   (exit $ac_status); }; }; then
17688   eval "$as_ac_var=yes"
17689 else
17690   echo "$as_me: failed program was:" >&5
17691 cat conftest.$ac_ext >&5
17692 eval "$as_ac_var=no"
17693 fi
17694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17695 fi
17696 echo "$as_me:17696: result: `eval echo '${'$as_ac_var'}'`" >&5
17697 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17698 if test `eval echo '${'$as_ac_var'}'` = yes; then
17699   cat >>confdefs.h <<EOF
17700 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17701 EOF
17702
17703 fi
17704 done
17705
17706 # use a compile-check to work with ncurses*-config and subdirectory includes
17707 echo "$as_me:17707: checking if we can use termcap.h" >&5
17708 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
17709 if test "${cf_cv_have_termcap_h+set}" = set; then
17710   echo $ECHO_N "(cached) $ECHO_C" >&6
17711 else
17712
17713         cat >conftest.$ac_ext <<_ACEOF
17714 #line 17714 "configure"
17715 #include "confdefs.h"
17716
17717 #include <curses.h>
17718 #ifdef NCURSES_VERSION
17719 #undef NCURSES_VERSION
17720 #endif
17721 #include <termcap.h>
17722 #ifndef NCURSES_VERSION
17723 #error wrong header
17724 #endif
17725
17726 int
17727 main (void)
17728 {
17729 return 0;
17730   ;
17731   return 0;
17732 }
17733 _ACEOF
17734 rm -f conftest.$ac_objext
17735 if { (eval echo "$as_me:17735: \"$ac_compile\"") >&5
17736   (eval $ac_compile) 2>&5
17737   ac_status=$?
17738   echo "$as_me:17738: \$? = $ac_status" >&5
17739   (exit $ac_status); } &&
17740          { ac_try='test -s conftest.$ac_objext'
17741   { (eval echo "$as_me:17741: \"$ac_try\"") >&5
17742   (eval $ac_try) 2>&5
17743   ac_status=$?
17744   echo "$as_me:17744: \$? = $ac_status" >&5
17745   (exit $ac_status); }; }; then
17746   cf_cv_have_termcap_h=yes
17747 else
17748   echo "$as_me: failed program was:" >&5
17749 cat conftest.$ac_ext >&5
17750 cf_cv_have_termcap_h=no
17751 fi
17752 rm -f conftest.$ac_objext conftest.$ac_ext
17753 fi
17754 echo "$as_me:17754: result: $cf_cv_have_termcap_h" >&5
17755 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17756 if test "x$cf_cv_have_termcap_h" = xyes
17757 then
17758
17759 cat >>confdefs.h <<\EOF
17760 #define HAVE_TERMCAP_H 1
17761 EOF
17762
17763 else
17764 echo "$as_me:17764: checking if we can use ncurses/termcap.h" >&5
17765 echo $ECHO_N "checking if we can use ncurses/termcap.h... $ECHO_C" >&6
17766 if test "${cf_cv_have_ncurses_termcap_h+set}" = set; then
17767   echo $ECHO_N "(cached) $ECHO_C" >&6
17768 else
17769
17770         cat >conftest.$ac_ext <<_ACEOF
17771 #line 17771 "configure"
17772 #include "confdefs.h"
17773
17774 #include <ncurses/curses.h>
17775 #ifdef NCURSES_VERSION
17776 #undef NCURSES_VERSION
17777 #endif
17778 #include <ncurses/termcap.h>
17779 #ifndef NCURSES_VERSION
17780 #error wrong header
17781 #endif
17782
17783 int
17784 main (void)
17785 {
17786 return 0;
17787   ;
17788   return 0;
17789 }
17790 _ACEOF
17791 rm -f conftest.$ac_objext
17792 if { (eval echo "$as_me:17792: \"$ac_compile\"") >&5
17793   (eval $ac_compile) 2>&5
17794   ac_status=$?
17795   echo "$as_me:17795: \$? = $ac_status" >&5
17796   (exit $ac_status); } &&
17797          { ac_try='test -s conftest.$ac_objext'
17798   { (eval echo "$as_me:17798: \"$ac_try\"") >&5
17799   (eval $ac_try) 2>&5
17800   ac_status=$?
17801   echo "$as_me:17801: \$? = $ac_status" >&5
17802   (exit $ac_status); }; }; then
17803   cf_cv_have_ncurses_termcap_h=yes
17804 else
17805   echo "$as_me: failed program was:" >&5
17806 cat conftest.$ac_ext >&5
17807 cf_cv_have_ncurses_termcap_h=no
17808 fi
17809 rm -f conftest.$ac_objext conftest.$ac_ext
17810 fi
17811 echo "$as_me:17811: result: $cf_cv_have_ncurses_termcap_h" >&5
17812 echo "${ECHO_T}$cf_cv_have_ncurses_termcap_h" >&6
17813 test "x$cf_cv_have_ncurses_termcap_h" = xyes &&
17814 cat >>confdefs.h <<\EOF
17815 #define HAVE_NCURSES_TERMCAP_H 1
17816 EOF
17817
17818 fi
17819
17820 if test "x$ac_cv_func_getopt" = xno; then
17821         { { echo "$as_me:17821: error: getopt is required for building programs" >&5
17822 echo "$as_me: error: getopt is required for building programs" >&2;}
17823    { (exit 1); exit 1; }; }
17824 fi
17825
17826 if test "$cf_enable_widec" = yes; then
17827
17828 for ac_func in \
17829 mblen \
17830 mbrlen \
17831 mbrtowc \
17832 mbsrtowcs \
17833 mbstowcs \
17834 mbtowc \
17835 wcsrtombs \
17836 wcstombs \
17837
17838 do
17839 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17840 echo "$as_me:17840: checking for $ac_func" >&5
17841 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17842 if eval "test \"\${$as_ac_var+set}\" = set"; then
17843   echo $ECHO_N "(cached) $ECHO_C" >&6
17844 else
17845   cat >conftest.$ac_ext <<_ACEOF
17846 #line 17846 "configure"
17847 #include "confdefs.h"
17848 #define $ac_func autoconf_temporary
17849 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
17850 #undef $ac_func
17851
17852 #ifdef __cplusplus
17853 extern "C"
17854 #endif
17855
17856 /* We use char because int might match the return type of a gcc2
17857    builtin and then its argument prototype would still apply.  */
17858 char $ac_func (void);
17859
17860 int
17861 main (void)
17862 {
17863
17864 /* The GNU C library defines stubs for functions which it implements
17865     to always fail with ENOSYS.  Some functions are actually named
17866     something starting with __ and the normal name is an alias.  */
17867 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17868 #error found stub for $ac_func
17869 #endif
17870
17871         return $ac_func ();
17872   ;
17873   return 0;
17874 }
17875 _ACEOF
17876 rm -f conftest.$ac_objext conftest$ac_exeext
17877 if { (eval echo "$as_me:17877: \"$ac_link\"") >&5
17878   (eval $ac_link) 2>&5
17879   ac_status=$?
17880   echo "$as_me:17880: \$? = $ac_status" >&5
17881   (exit $ac_status); } &&
17882          { ac_try='test -s conftest$ac_exeext'
17883   { (eval echo "$as_me:17883: \"$ac_try\"") >&5
17884   (eval $ac_try) 2>&5
17885   ac_status=$?
17886   echo "$as_me:17886: \$? = $ac_status" >&5
17887   (exit $ac_status); }; }; then
17888   eval "$as_ac_var=yes"
17889 else
17890   echo "$as_me: failed program was:" >&5
17891 cat conftest.$ac_ext >&5
17892 eval "$as_ac_var=no"
17893 fi
17894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17895 fi
17896 echo "$as_me:17896: result: `eval echo '${'$as_ac_var'}'`" >&5
17897 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17898 if test `eval echo '${'$as_ac_var'}'` = yes; then
17899   cat >>confdefs.h <<EOF
17900 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17901 EOF
17902
17903 fi
17904 done
17905
17906 fi
17907
17908 echo "$as_me:17908: checking definition to turn on extended curses functions" >&5
17909 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17910 if test "${cf_cv_need_xopen_extension+set}" = set; then
17911   echo $ECHO_N "(cached) $ECHO_C" >&6
17912 else
17913
17914 cf_cv_need_xopen_extension=unknown
17915 cat >conftest.$ac_ext <<_ACEOF
17916 #line 17916 "configure"
17917 #include "confdefs.h"
17918
17919 #include <stdlib.h>
17920 #include <${cf_cv_ncurses_header:-curses.h}>
17921 int
17922 main (void)
17923 {
17924
17925 #if defined(NCURSES_VERSION_PATCH)
17926 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17927         make an error
17928 #endif
17929 #endif
17930 #ifdef NCURSES_VERSION
17931         cchar_t check;
17932         int check2 = curs_set((int)sizeof(check));
17933 #endif
17934         long x = winnstr(stdscr, "", 0);
17935         int x1, y1;
17936 #ifdef NCURSES_VERSION
17937         (void)check2;
17938 #endif
17939         getbegyx(stdscr, y1, x1);
17940         (void)x;
17941         (void)y1;
17942         (void)x1;
17943
17944   ;
17945   return 0;
17946 }
17947 _ACEOF
17948 rm -f conftest.$ac_objext conftest$ac_exeext
17949 if { (eval echo "$as_me:17949: \"$ac_link\"") >&5
17950   (eval $ac_link) 2>&5
17951   ac_status=$?
17952   echo "$as_me:17952: \$? = $ac_status" >&5
17953   (exit $ac_status); } &&
17954          { ac_try='test -s conftest$ac_exeext'
17955   { (eval echo "$as_me:17955: \"$ac_try\"") >&5
17956   (eval $ac_try) 2>&5
17957   ac_status=$?
17958   echo "$as_me:17958: \$? = $ac_status" >&5
17959   (exit $ac_status); }; }; then
17960   cf_cv_need_xopen_extension=none
17961 else
17962   echo "$as_me: failed program was:" >&5
17963 cat conftest.$ac_ext >&5
17964
17965         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17966         do
17967                 cat >conftest.$ac_ext <<_ACEOF
17968 #line 17968 "configure"
17969 #include "confdefs.h"
17970
17971 #define $cf_try_xopen_extension 1
17972 #include <stdlib.h>
17973 #include <${cf_cv_ncurses_header:-curses.h}>
17974 int
17975 main (void)
17976 {
17977
17978 #ifdef NCURSES_VERSION
17979                 cchar_t check;
17980                 int check2 = curs_set((int)sizeof(check));
17981 #endif
17982                 long x = winnstr(stdscr, "", 0);
17983                 int x1, y1;
17984                 getbegyx(stdscr, y1, x1);
17985 #ifdef NCURSES_VERSION
17986                 (void)check2;
17987 #endif
17988                 (void)x;
17989                 (void)y1;
17990                 (void)x1;
17991
17992   ;
17993   return 0;
17994 }
17995 _ACEOF
17996 rm -f conftest.$ac_objext conftest$ac_exeext
17997 if { (eval echo "$as_me:17997: \"$ac_link\"") >&5
17998   (eval $ac_link) 2>&5
17999   ac_status=$?
18000   echo "$as_me:18000: \$? = $ac_status" >&5
18001   (exit $ac_status); } &&
18002          { ac_try='test -s conftest$ac_exeext'
18003   { (eval echo "$as_me:18003: \"$ac_try\"") >&5
18004   (eval $ac_try) 2>&5
18005   ac_status=$?
18006   echo "$as_me:18006: \$? = $ac_status" >&5
18007   (exit $ac_status); }; }; then
18008   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
18009 else
18010   echo "$as_me: failed program was:" >&5
18011 cat conftest.$ac_ext >&5
18012 fi
18013 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18014         done
18015
18016 fi
18017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18018
18019 fi
18020 echo "$as_me:18020: result: $cf_cv_need_xopen_extension" >&5
18021 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
18022
18023 case $cf_cv_need_xopen_extension in
18024 (*_*)
18025
18026         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18027         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
18028
18029         ;;
18030 esac
18031
18032 echo "$as_me:18032: checking for term.h" >&5
18033 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
18034 if test "${cf_cv_term_header+set}" = set; then
18035   echo $ECHO_N "(cached) $ECHO_C" >&6
18036 else
18037
18038 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
18039 # for <term.h> if we do not find the variant.
18040
18041 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
18042
18043 case ${cf_cv_ncurses_header:-curses.h} in
18044 (*/*)
18045         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
18046         cf_header_list="$cf_header_item $cf_header_list"
18047         ;;
18048 esac
18049
18050 for cf_header in $cf_header_list
18051 do
18052         cat >conftest.$ac_ext <<_ACEOF
18053 #line 18053 "configure"
18054 #include "confdefs.h"
18055
18056 #include <${cf_cv_ncurses_header:-curses.h}>
18057 #include <${cf_header}>
18058 int
18059 main (void)
18060 {
18061 WINDOW *x; (void)x
18062   ;
18063   return 0;
18064 }
18065 _ACEOF
18066 rm -f conftest.$ac_objext
18067 if { (eval echo "$as_me:18067: \"$ac_compile\"") >&5
18068   (eval $ac_compile) 2>&5
18069   ac_status=$?
18070   echo "$as_me:18070: \$? = $ac_status" >&5
18071   (exit $ac_status); } &&
18072          { ac_try='test -s conftest.$ac_objext'
18073   { (eval echo "$as_me:18073: \"$ac_try\"") >&5
18074   (eval $ac_try) 2>&5
18075   ac_status=$?
18076   echo "$as_me:18076: \$? = $ac_status" >&5
18077   (exit $ac_status); }; }; then
18078   cf_cv_term_header=$cf_header
18079          break
18080 else
18081   echo "$as_me: failed program was:" >&5
18082 cat conftest.$ac_ext >&5
18083 cf_cv_term_header=no
18084 fi
18085 rm -f conftest.$ac_objext conftest.$ac_ext
18086 done
18087
18088 case $cf_cv_term_header in
18089 (no)
18090         # If curses is ncurses, some packagers still mess it up by trying to make
18091         # us use GNU termcap.  This handles the most common case.
18092         for cf_header in ncurses/term.h ncursesw/term.h
18093         do
18094                 cat >conftest.$ac_ext <<_ACEOF
18095 #line 18095 "configure"
18096 #include "confdefs.h"
18097
18098 #include <${cf_cv_ncurses_header:-curses.h}>
18099 #ifdef NCURSES_VERSION
18100 #include <${cf_header}>
18101 #else
18102 make an error
18103 #endif
18104 int
18105 main (void)
18106 {
18107 WINDOW *x; (void)x
18108   ;
18109   return 0;
18110 }
18111 _ACEOF
18112 rm -f conftest.$ac_objext
18113 if { (eval echo "$as_me:18113: \"$ac_compile\"") >&5
18114   (eval $ac_compile) 2>&5
18115   ac_status=$?
18116   echo "$as_me:18116: \$? = $ac_status" >&5
18117   (exit $ac_status); } &&
18118          { ac_try='test -s conftest.$ac_objext'
18119   { (eval echo "$as_me:18119: \"$ac_try\"") >&5
18120   (eval $ac_try) 2>&5
18121   ac_status=$?
18122   echo "$as_me:18122: \$? = $ac_status" >&5
18123   (exit $ac_status); }; }; then
18124   cf_cv_term_header=$cf_header
18125                          break
18126 else
18127   echo "$as_me: failed program was:" >&5
18128 cat conftest.$ac_ext >&5
18129 cf_cv_term_header=no
18130 fi
18131 rm -f conftest.$ac_objext conftest.$ac_ext
18132         done
18133         ;;
18134 esac
18135
18136 fi
18137 echo "$as_me:18137: result: $cf_cv_term_header" >&5
18138 echo "${ECHO_T}$cf_cv_term_header" >&6
18139
18140 case $cf_cv_term_header in
18141 (term.h)
18142
18143 cat >>confdefs.h <<\EOF
18144 #define HAVE_TERM_H 1
18145 EOF
18146
18147         ;;
18148 (ncurses/term.h)
18149
18150 cat >>confdefs.h <<\EOF
18151 #define HAVE_NCURSES_TERM_H 1
18152 EOF
18153
18154         ;;
18155 (ncursesw/term.h)
18156
18157 cat >>confdefs.h <<\EOF
18158 #define HAVE_NCURSESW_TERM_H 1
18159 EOF
18160
18161         ;;
18162 esac
18163
18164 echo "$as_me:18164: checking for unctrl.h" >&5
18165 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
18166 if test "${cf_cv_unctrl_header+set}" = set; then
18167   echo $ECHO_N "(cached) $ECHO_C" >&6
18168 else
18169
18170 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
18171 # for <unctrl.h> if we do not find the variant.
18172
18173 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
18174
18175 case ${cf_cv_ncurses_header:-curses.h} in
18176 (*/*)
18177         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
18178         cf_header_list="$cf_header_item $cf_header_list"
18179         ;;
18180 esac
18181
18182 for cf_header in $cf_header_list
18183 do
18184         cat >conftest.$ac_ext <<_ACEOF
18185 #line 18185 "configure"
18186 #include "confdefs.h"
18187
18188 #include <${cf_cv_ncurses_header:-curses.h}>
18189 #include <${cf_header}>
18190 int
18191 main (void)
18192 {
18193 WINDOW *x; (void)x
18194   ;
18195   return 0;
18196 }
18197 _ACEOF
18198 rm -f conftest.$ac_objext
18199 if { (eval echo "$as_me:18199: \"$ac_compile\"") >&5
18200   (eval $ac_compile) 2>&5
18201   ac_status=$?
18202   echo "$as_me:18202: \$? = $ac_status" >&5
18203   (exit $ac_status); } &&
18204          { ac_try='test -s conftest.$ac_objext'
18205   { (eval echo "$as_me:18205: \"$ac_try\"") >&5
18206   (eval $ac_try) 2>&5
18207   ac_status=$?
18208   echo "$as_me:18208: \$? = $ac_status" >&5
18209   (exit $ac_status); }; }; then
18210   cf_cv_unctrl_header=$cf_header
18211          break
18212 else
18213   echo "$as_me: failed program was:" >&5
18214 cat conftest.$ac_ext >&5
18215 cf_cv_unctrl_header=no
18216 fi
18217 rm -f conftest.$ac_objext conftest.$ac_ext
18218 done
18219
18220 fi
18221 echo "$as_me:18221: result: $cf_cv_unctrl_header" >&5
18222 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
18223
18224 case $cf_cv_unctrl_header in
18225 (no)
18226         { echo "$as_me:18226: WARNING: unctrl.h header not found" >&5
18227 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
18228         ;;
18229 esac
18230
18231 case $cf_cv_unctrl_header in
18232 (unctrl.h)
18233
18234 cat >>confdefs.h <<\EOF
18235 #define HAVE_UNCTRL_H 1
18236 EOF
18237
18238         ;;
18239 (ncurses/unctrl.h)
18240
18241 cat >>confdefs.h <<\EOF
18242 #define HAVE_NCURSES_UNCTRL_H 1
18243 EOF
18244
18245         ;;
18246 (ncursesw/unctrl.h)
18247
18248 cat >>confdefs.h <<\EOF
18249 #define HAVE_NCURSESW_UNCTRL_H 1
18250 EOF
18251
18252         ;;
18253 esac
18254
18255 for cf_func in \
18256 alloc_pair \
18257 assume_default_colors \
18258 chgat \
18259 color_content \
18260 color_set \
18261 copywin \
18262 delscreen \
18263 dupwin \
18264 exit_curses \
18265 exit_terminfo \
18266 filter \
18267 getbegx \
18268 getcurx \
18269 getmaxx \
18270 getnstr \
18271 getparx \
18272 getwin \
18273 halfdelay \
18274 init_extended_color \
18275 mvderwin \
18276 mvvline \
18277 mvwin \
18278 mvwvline \
18279 napms \
18280 newpad \
18281 putwin \
18282 reset_color_pairs \
18283 resize_term \
18284 resizeterm \
18285 restartterm \
18286 ripoffline \
18287 scr_dump \
18288 setupterm \
18289 slk_color \
18290 slk_init \
18291 termattrs \
18292 termname \
18293 tgetent \
18294 tigetnum \
18295 tigetstr \
18296 tputs_sp \
18297 typeahead \
18298 use_default_colors \
18299 use_env \
18300 use_extended_names \
18301 use_screen \
18302 use_window \
18303 vid_puts \
18304 vidputs \
18305 vsscanf \
18306 vw_printw \
18307 wchgat \
18308 winsdelln \
18309 winsstr \
18310 wresize \
18311 wsyncdown \
18312 _tracef \
18313
18314 do
18315
18316 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18317
18318         echo "$as_me:18318: checking for ${cf_func}" >&5
18319 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18320
18321 echo "${as_me:-configure}:18321: testing ${cf_func} ..." 1>&5
18322
18323         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18324   echo $ECHO_N "(cached) $ECHO_C" >&6
18325 else
18326
18327                 eval cf_result='$ac_cv_func_'$cf_func
18328                 if test ".$cf_result" != ".no"; then
18329                         cat >conftest.$ac_ext <<_ACEOF
18330 #line 18330 "configure"
18331 #include "confdefs.h"
18332
18333 #ifdef HAVE_XCURSES
18334 #include <xcurses.h>
18335 char * XCursesProgramName = "test";
18336 #else
18337 #include <${cf_cv_ncurses_header:-curses.h}>
18338 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18339 #include <ncursesw/term.h>
18340 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18341 #include <ncurses/term.h>
18342 #elif defined(HAVE_TERM_H)
18343 #include <term.h>
18344 #endif
18345 #endif
18346
18347 int
18348 main (void)
18349 {
18350
18351 #ifndef ${cf_func}
18352 long foo = (long)(&${cf_func});
18353 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18354 if (foo + 1234L > 5678L)
18355         ${cf_cv_main_return:-return}(foo != 0);
18356 #endif
18357
18358   ;
18359   return 0;
18360 }
18361 _ACEOF
18362 rm -f conftest.$ac_objext conftest$ac_exeext
18363 if { (eval echo "$as_me:18363: \"$ac_link\"") >&5
18364   (eval $ac_link) 2>&5
18365   ac_status=$?
18366   echo "$as_me:18366: \$? = $ac_status" >&5
18367   (exit $ac_status); } &&
18368          { ac_try='test -s conftest$ac_exeext'
18369   { (eval echo "$as_me:18369: \"$ac_try\"") >&5
18370   (eval $ac_try) 2>&5
18371   ac_status=$?
18372   echo "$as_me:18372: \$? = $ac_status" >&5
18373   (exit $ac_status); }; }; then
18374   cf_result=yes
18375 else
18376   echo "$as_me: failed program was:" >&5
18377 cat conftest.$ac_ext >&5
18378 cf_result=no
18379 fi
18380 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18381                 fi
18382                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18383
18384 fi
18385
18386         # use the computed/retrieved cache-value:
18387         eval 'cf_result=$cf_cv_func_'$cf_func
18388         echo "$as_me:18388: result: $cf_result" >&5
18389 echo "${ECHO_T}$cf_result" >&6
18390         if test $cf_result != no; then
18391                 cat >>confdefs.h <<EOF
18392 #define HAVE_${cf_tr_func} 1
18393 EOF
18394
18395         fi
18396 done
18397
18398 for cf_func in tputs
18399 do
18400
18401 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18402
18403         echo "$as_me:18403: checking for ${cf_func}" >&5
18404 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
18405
18406 echo "${as_me:-configure}:18406: testing ${cf_func} ..." 1>&5
18407
18408         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
18409   echo $ECHO_N "(cached) $ECHO_C" >&6
18410 else
18411
18412                 eval cf_result='$ac_cv_func_'$cf_func
18413                 if test ".$cf_result" != ".no"; then
18414                         cat >conftest.$ac_ext <<_ACEOF
18415 #line 18415 "configure"
18416 #include "confdefs.h"
18417
18418 #ifdef HAVE_XCURSES
18419 #include <xcurses.h>
18420 char * XCursesProgramName = "test";
18421 #else
18422 #include <${cf_cv_ncurses_header:-curses.h}>
18423 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18424 #include <ncursesw/term.h>
18425 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18426 #include <ncurses/term.h>
18427 #elif defined(HAVE_TERM_H)
18428 #include <term.h>
18429 #endif
18430 #endif
18431
18432 int
18433 main (void)
18434 {
18435
18436 #ifndef ${cf_func}
18437 long foo = (long)(&${cf_func});
18438 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
18439 if (foo + 1234L > 5678L)
18440         ${cf_cv_main_return:-return}(foo != 0);
18441 #endif
18442
18443   ;
18444   return 0;
18445 }
18446 _ACEOF
18447 rm -f conftest.$ac_objext conftest$ac_exeext
18448 if { (eval echo "$as_me:18448: \"$ac_link\"") >&5
18449   (eval $ac_link) 2>&5
18450   ac_status=$?
18451   echo "$as_me:18451: \$? = $ac_status" >&5
18452   (exit $ac_status); } &&
18453          { ac_try='test -s conftest$ac_exeext'
18454   { (eval echo "$as_me:18454: \"$ac_try\"") >&5
18455   (eval $ac_try) 2>&5
18456   ac_status=$?
18457   echo "$as_me:18457: \$? = $ac_status" >&5
18458   (exit $ac_status); }; }; then
18459   cf_result=yes
18460 else
18461   echo "$as_me: failed program was:" >&5
18462 cat conftest.$ac_ext >&5
18463 cf_result=no
18464 fi
18465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18466                 fi
18467                 eval 'cf_cv_func_'$cf_func'=$cf_result'
18468
18469 fi
18470
18471         # use the computed/retrieved cache-value:
18472         eval 'cf_result=$cf_cv_func_'$cf_func
18473         echo "$as_me:18473: result: $cf_result" >&5
18474 echo "${ECHO_T}$cf_result" >&6
18475         if test $cf_result != no; then
18476                 cat >>confdefs.h <<EOF
18477 #define HAVE_${cf_tr_func} 1
18478 EOF
18479
18480         fi
18481 done
18482
18483 if test x$cf_cv_func_tputs = xyes
18484 then
18485         cf_done=no
18486         for cf_arg in int char
18487         do
18488                 for cf_ret in int void
18489                 do
18490                         if test $cf_ret = void
18491                         then
18492                                 cf_return="/* nothing */"
18493                         else
18494                                 cf_return="return value"
18495                         fi
18496                         cat >conftest.$ac_ext <<_ACEOF
18497 #line 18497 "configure"
18498 #include "confdefs.h"
18499
18500 #include <${cf_cv_ncurses_header:-curses.h}>
18501 #include <$cf_cv_term_header>
18502
18503 static $cf_ret outc($cf_arg value) { $cf_return; }
18504
18505 int
18506 main (void)
18507 {
18508
18509         tputs("hello", 0, outc);
18510         ${cf_cv_main_return:-return}(0);
18511
18512   ;
18513   return 0;
18514 }
18515 _ACEOF
18516 rm -f conftest.$ac_objext
18517 if { (eval echo "$as_me:18517: \"$ac_compile\"") >&5
18518   (eval $ac_compile) 2>&5
18519   ac_status=$?
18520   echo "$as_me:18520: \$? = $ac_status" >&5
18521   (exit $ac_status); } &&
18522          { ac_try='test -s conftest.$ac_objext'
18523   { (eval echo "$as_me:18523: \"$ac_try\"") >&5
18524   (eval $ac_try) 2>&5
18525   ac_status=$?
18526   echo "$as_me:18526: \$? = $ac_status" >&5
18527   (exit $ac_status); }; }; then
18528
18529                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
18530
18531 echo "${as_me:-configure}:18531: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
18532
18533                 cat >>confdefs.h <<EOF
18534 #define TPUTS_ARG               $cf_arg
18535 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
18536 #define TPUTS_RETURN(value)     $cf_return
18537 EOF
18538                 cf_done=yes
18539                 break
18540
18541 else
18542   echo "$as_me: failed program was:" >&5
18543 cat conftest.$ac_ext >&5
18544 fi
18545 rm -f conftest.$ac_objext conftest.$ac_ext
18546                 done
18547                 test $cf_done = yes && break
18548         done
18549 fi
18550
18551 echo "$as_me:18551: checking for ncurses extended functions" >&5
18552 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
18553 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
18554   echo $ECHO_N "(cached) $ECHO_C" >&6
18555 else
18556
18557 cat >conftest.$ac_ext <<_ACEOF
18558 #line 18558 "configure"
18559 #include "confdefs.h"
18560
18561 #include <${cf_cv_ncurses_header:-curses.h}>
18562 int
18563 main (void)
18564 {
18565
18566 int x = NCURSES_EXT_FUNCS
18567
18568   ;
18569   return 0;
18570 }
18571 _ACEOF
18572 rm -f conftest.$ac_objext
18573 if { (eval echo "$as_me:18573: \"$ac_compile\"") >&5
18574   (eval $ac_compile) 2>&5
18575   ac_status=$?
18576   echo "$as_me:18576: \$? = $ac_status" >&5
18577   (exit $ac_status); } &&
18578          { ac_try='test -s conftest.$ac_objext'
18579   { (eval echo "$as_me:18579: \"$ac_try\"") >&5
18580   (eval $ac_try) 2>&5
18581   ac_status=$?
18582   echo "$as_me:18582: \$? = $ac_status" >&5
18583   (exit $ac_status); }; }; then
18584   cf_cv_ncurses_ext_funcs=defined
18585 else
18586   echo "$as_me: failed program was:" >&5
18587 cat conftest.$ac_ext >&5
18588
18589 cat >conftest.$ac_ext <<_ACEOF
18590 #line 18590 "configure"
18591 #include "confdefs.h"
18592
18593 #include <${cf_cv_ncurses_header:-curses.h}>
18594 int
18595 main (void)
18596 {
18597
18598         (void) assume_default_colors (0, 0);
18599         (void) curses_version ();
18600         (void) define_key (0, 0);
18601         (void) is_term_resized (0, 0);
18602         (void) key_defined (0);
18603         (void) keybound (0, 0);
18604         (void) keyok (0, 0);
18605         (void) resize_term (0, 0);
18606         (void) resizeterm (0, 0);
18607         (void) use_default_colors ();
18608         (void) use_extended_names (0);
18609         (void) wresize (0, 0, 0);
18610   ;
18611   return 0;
18612 }
18613 _ACEOF
18614 rm -f conftest.$ac_objext conftest$ac_exeext
18615 if { (eval echo "$as_me:18615: \"$ac_link\"") >&5
18616   (eval $ac_link) 2>&5
18617   ac_status=$?
18618   echo "$as_me:18618: \$? = $ac_status" >&5
18619   (exit $ac_status); } &&
18620          { ac_try='test -s conftest$ac_exeext'
18621   { (eval echo "$as_me:18621: \"$ac_try\"") >&5
18622   (eval $ac_try) 2>&5
18623   ac_status=$?
18624   echo "$as_me:18624: \$? = $ac_status" >&5
18625   (exit $ac_status); }; }; then
18626   cf_cv_ncurses_ext_funcs=yes
18627 else
18628   echo "$as_me: failed program was:" >&5
18629 cat conftest.$ac_ext >&5
18630 cf_cv_ncurses_ext_funcs=no
18631 fi
18632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18633
18634 fi
18635 rm -f conftest.$ac_objext conftest.$ac_ext
18636
18637 fi
18638 echo "$as_me:18638: result: $cf_cv_ncurses_ext_funcs" >&5
18639 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
18640 test "$cf_cv_ncurses_ext_funcs" = yes &&
18641 cat >>confdefs.h <<\EOF
18642 #define NCURSES_EXT_FUNCS 1
18643 EOF
18644
18645 if test "$cf_enable_widec" = yes
18646 then
18647         # workaround for systems with ncurses before 20111029, due to change of
18648         # feature test macro from _XPG5 to _XOPEN_SOURCE
18649         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
18650         then
18651                 cf_define_xpg5=no
18652                 echo "$as_me:18652: checking if _XPG5 should be defined to enable wide-characters" >&5
18653 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
18654
18655                 cat >conftest.$ac_ext <<_ACEOF
18656 #line 18656 "configure"
18657 #include "confdefs.h"
18658
18659 #include <${cf_cv_ncurses_header:-curses.h}>
18660 int
18661 main (void)
18662 {
18663 int x = _XPG5
18664   ;
18665   return 0;
18666 }
18667 _ACEOF
18668 rm -f conftest.$ac_objext
18669 if { (eval echo "$as_me:18669: \"$ac_compile\"") >&5
18670   (eval $ac_compile) 2>&5
18671   ac_status=$?
18672   echo "$as_me:18672: \$? = $ac_status" >&5
18673   (exit $ac_status); } &&
18674          { ac_try='test -s conftest.$ac_objext'
18675   { (eval echo "$as_me:18675: \"$ac_try\"") >&5
18676   (eval $ac_try) 2>&5
18677   ac_status=$?
18678   echo "$as_me:18678: \$? = $ac_status" >&5
18679   (exit $ac_status); }; }; then
18680   :
18681 else
18682   echo "$as_me: failed program was:" >&5
18683 cat conftest.$ac_ext >&5
18684 cf_save_cppflags="$CPPFLAGS"
18685                          CPPFLAGS="$CPPFLAGS -D_XPG5"
18686                          cat >conftest.$ac_ext <<_ACEOF
18687 #line 18687 "configure"
18688 #include "confdefs.h"
18689
18690 #include <${cf_cv_ncurses_header:-curses.h}>
18691 int
18692 main (void)
18693 {
18694 int x = _XPG5
18695   ;
18696   return 0;
18697 }
18698 _ACEOF
18699 rm -f conftest.$ac_objext
18700 if { (eval echo "$as_me:18700: \"$ac_compile\"") >&5
18701   (eval $ac_compile) 2>&5
18702   ac_status=$?
18703   echo "$as_me:18703: \$? = $ac_status" >&5
18704   (exit $ac_status); } &&
18705          { ac_try='test -s conftest.$ac_objext'
18706   { (eval echo "$as_me:18706: \"$ac_try\"") >&5
18707   (eval $ac_try) 2>&5
18708   ac_status=$?
18709   echo "$as_me:18709: \$? = $ac_status" >&5
18710   (exit $ac_status); }; }; then
18711   cf_define_xpg5=yes
18712 else
18713   echo "$as_me: failed program was:" >&5
18714 cat conftest.$ac_ext >&5
18715 fi
18716 rm -f conftest.$ac_objext conftest.$ac_ext
18717                          CPPFLAGS="$cf_save_cppflags"
18718 fi
18719 rm -f conftest.$ac_objext conftest.$ac_ext
18720                 echo "$as_me:18720: result: $cf_define_xpg5" >&5
18721 echo "${ECHO_T}$cf_define_xpg5" >&6
18722
18723                 if test "$cf_define_xpg5" = yes
18724                 then
18725                         CPPFLAGS="$CPPFLAGS -D_XPG5"
18726                 fi
18727         fi
18728
18729         echo "$as_me:18729: checking for wide-character functions" >&5
18730 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
18731 if test "${cf_cv_widechar_funcs+set}" = set; then
18732   echo $ECHO_N "(cached) $ECHO_C" >&6
18733 else
18734
18735         cat >conftest.$ac_ext <<_ACEOF
18736 #line 18736 "configure"
18737 #include "confdefs.h"
18738
18739 #include <${cf_cv_ncurses_header:-curses.h}>
18740 int
18741 main (void)
18742 {
18743
18744                 static wchar_t src_wchar[2];
18745                 static cchar_t dst_cchar;
18746                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
18747
18748   ;
18749   return 0;
18750 }
18751 _ACEOF
18752 rm -f conftest.$ac_objext conftest$ac_exeext
18753 if { (eval echo "$as_me:18753: \"$ac_link\"") >&5
18754   (eval $ac_link) 2>&5
18755   ac_status=$?
18756   echo "$as_me:18756: \$? = $ac_status" >&5
18757   (exit $ac_status); } &&
18758          { ac_try='test -s conftest$ac_exeext'
18759   { (eval echo "$as_me:18759: \"$ac_try\"") >&5
18760   (eval $ac_try) 2>&5
18761   ac_status=$?
18762   echo "$as_me:18762: \$? = $ac_status" >&5
18763   (exit $ac_status); }; }; then
18764   cf_cv_widechar_funcs=yes
18765 else
18766   echo "$as_me: failed program was:" >&5
18767 cat conftest.$ac_ext >&5
18768 cf_cv_widechar_funcs=no
18769 fi
18770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18771
18772 fi
18773 echo "$as_me:18773: result: $cf_cv_widechar_funcs" >&5
18774 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
18775         if test "$cf_cv_widechar_funcs" != no ; then
18776
18777 cat >>confdefs.h <<\EOF
18778 #define USE_WIDEC_SUPPORT 1
18779 EOF
18780
18781         else
18782                 cat >>confdefs.h <<\EOF
18783 #define USE_WIDEC_SUPPORT 0
18784 EOF
18785
18786         fi
18787 else
18788         cat >>confdefs.h <<\EOF
18789 #define USE_WIDEC_SUPPORT 0
18790 EOF
18791
18792 fi
18793
18794 echo "$as_me:18794: checking if $cf_cv_screen library uses pthreads" >&5
18795 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
18796 if test "${cf_cv_use_pthreads+set}" = set; then
18797   echo $ECHO_N "(cached) $ECHO_C" >&6
18798 else
18799
18800 cat >conftest.$ac_ext <<_ACEOF
18801 #line 18801 "configure"
18802 #include "confdefs.h"
18803
18804 #include <${cf_cv_ncurses_header:-curses.h}>
18805 extern void _nc_init_pthreads(void);
18806
18807 int
18808 main (void)
18809 {
18810
18811         initscr();
18812         _nc_init_pthreads();
18813
18814   ;
18815   return 0;
18816 }
18817 _ACEOF
18818 rm -f conftest.$ac_objext conftest$ac_exeext
18819 if { (eval echo "$as_me:18819: \"$ac_link\"") >&5
18820   (eval $ac_link) 2>&5
18821   ac_status=$?
18822   echo "$as_me:18822: \$? = $ac_status" >&5
18823   (exit $ac_status); } &&
18824          { ac_try='test -s conftest$ac_exeext'
18825   { (eval echo "$as_me:18825: \"$ac_try\"") >&5
18826   (eval $ac_try) 2>&5
18827   ac_status=$?
18828   echo "$as_me:18828: \$? = $ac_status" >&5
18829   (exit $ac_status); }; }; then
18830   cf_cv_use_pthreads=yes
18831 else
18832   echo "$as_me: failed program was:" >&5
18833 cat conftest.$ac_ext >&5
18834 cf_cv_use_pthreads=no
18835 fi
18836 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18837
18838 fi
18839 echo "$as_me:18839: result: $cf_cv_use_pthreads" >&5
18840 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18841 test $cf_cv_use_pthreads = yes &&
18842 cat >>confdefs.h <<\EOF
18843 #define USE_PTHREADS 1
18844 EOF
18845
18846 echo "$as_me:18846: checking if sys/time.h works with sys/select.h" >&5
18847 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18848 if test "${cf_cv_sys_time_select+set}" = set; then
18849   echo $ECHO_N "(cached) $ECHO_C" >&6
18850 else
18851
18852 cat >conftest.$ac_ext <<_ACEOF
18853 #line 18853 "configure"
18854 #include "confdefs.h"
18855
18856 #include <sys/types.h>
18857 #ifdef HAVE_SYS_TIME_H
18858 #include <sys/time.h>
18859 #endif
18860 #ifdef HAVE_SYS_SELECT_H
18861 #include <sys/select.h>
18862 #endif
18863
18864 int
18865 main (void)
18866 {
18867
18868   ;
18869   return 0;
18870 }
18871 _ACEOF
18872 rm -f conftest.$ac_objext
18873 if { (eval echo "$as_me:18873: \"$ac_compile\"") >&5
18874   (eval $ac_compile) 2>&5
18875   ac_status=$?
18876   echo "$as_me:18876: \$? = $ac_status" >&5
18877   (exit $ac_status); } &&
18878          { ac_try='test -s conftest.$ac_objext'
18879   { (eval echo "$as_me:18879: \"$ac_try\"") >&5
18880   (eval $ac_try) 2>&5
18881   ac_status=$?
18882   echo "$as_me:18882: \$? = $ac_status" >&5
18883   (exit $ac_status); }; }; then
18884   cf_cv_sys_time_select=yes
18885 else
18886   echo "$as_me: failed program was:" >&5
18887 cat conftest.$ac_ext >&5
18888 cf_cv_sys_time_select=no
18889 fi
18890 rm -f conftest.$ac_objext conftest.$ac_ext
18891
18892 fi
18893
18894 echo "$as_me:18894: result: $cf_cv_sys_time_select" >&5
18895 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18896 test "$cf_cv_sys_time_select" = yes &&
18897 cat >>confdefs.h <<\EOF
18898 #define HAVE_SYS_TIME_SELECT 1
18899 EOF
18900
18901 # special check for test/ditto.c
18902
18903 echo "$as_me:18903: checking for openpty in -lutil" >&5
18904 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18905 if test "${ac_cv_lib_util_openpty+set}" = set; then
18906   echo $ECHO_N "(cached) $ECHO_C" >&6
18907 else
18908   ac_check_lib_save_LIBS=$LIBS
18909 LIBS="-lutil  $LIBS"
18910 cat >conftest.$ac_ext <<_ACEOF
18911 #line 18911 "configure"
18912 #include "confdefs.h"
18913
18914 /* Override any gcc2 internal prototype to avoid an error.  */
18915 #ifdef __cplusplus
18916 extern "C"
18917 #endif
18918 /* We use char because int might match the return type of a gcc2
18919    builtin and then its argument prototype would still apply.  */
18920 char openpty ();
18921 int
18922 main (void)
18923 {
18924 openpty ();
18925   ;
18926   return 0;
18927 }
18928 _ACEOF
18929 rm -f conftest.$ac_objext conftest$ac_exeext
18930 if { (eval echo "$as_me:18930: \"$ac_link\"") >&5
18931   (eval $ac_link) 2>&5
18932   ac_status=$?
18933   echo "$as_me:18933: \$? = $ac_status" >&5
18934   (exit $ac_status); } &&
18935          { ac_try='test -s conftest$ac_exeext'
18936   { (eval echo "$as_me:18936: \"$ac_try\"") >&5
18937   (eval $ac_try) 2>&5
18938   ac_status=$?
18939   echo "$as_me:18939: \$? = $ac_status" >&5
18940   (exit $ac_status); }; }; then
18941   ac_cv_lib_util_openpty=yes
18942 else
18943   echo "$as_me: failed program was:" >&5
18944 cat conftest.$ac_ext >&5
18945 ac_cv_lib_util_openpty=no
18946 fi
18947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18948 LIBS=$ac_check_lib_save_LIBS
18949 fi
18950 echo "$as_me:18950: result: $ac_cv_lib_util_openpty" >&5
18951 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18952 if test $ac_cv_lib_util_openpty = yes; then
18953   cf_cv_lib_util=yes
18954 else
18955   cf_cv_lib_util=no
18956 fi
18957
18958 echo "$as_me:18958: checking for openpty header" >&5
18959 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18960 if test "${cf_cv_func_openpty+set}" = set; then
18961   echo $ECHO_N "(cached) $ECHO_C" >&6
18962 else
18963
18964         cf_save_LIBS="$LIBS"
18965         test $cf_cv_lib_util = yes && {
18966 cf_add_libs="$LIBS"
18967 # reverse order
18968 cf_add_0lib=
18969 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
18970 # filter duplicates
18971 for cf_add_1lib in $cf_add_0lib; do
18972         for cf_add_2lib in $cf_add_libs; do
18973                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
18974                         cf_add_1lib=
18975                         break
18976                 fi
18977         done
18978         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
18979 done
18980 LIBS="$cf_add_libs"
18981  }
18982         for cf_header in pty.h libutil.h util.h
18983         do
18984         cat >conftest.$ac_ext <<_ACEOF
18985 #line 18985 "configure"
18986 #include "confdefs.h"
18987
18988 #include <$cf_header>
18989
18990 int
18991 main (void)
18992 {
18993
18994         int x = openpty((int *)0, (int *)0, (char *)0,
18995                                    (struct termios *)0, (struct winsize *)0);
18996
18997   ;
18998   return 0;
18999 }
19000 _ACEOF
19001 rm -f conftest.$ac_objext conftest$ac_exeext
19002 if { (eval echo "$as_me:19002: \"$ac_link\"") >&5
19003   (eval $ac_link) 2>&5
19004   ac_status=$?
19005   echo "$as_me:19005: \$? = $ac_status" >&5
19006   (exit $ac_status); } &&
19007          { ac_try='test -s conftest$ac_exeext'
19008   { (eval echo "$as_me:19008: \"$ac_try\"") >&5
19009   (eval $ac_try) 2>&5
19010   ac_status=$?
19011   echo "$as_me:19011: \$? = $ac_status" >&5
19012   (exit $ac_status); }; }; then
19013
19014                 cf_cv_func_openpty=$cf_header
19015                 break
19016
19017 else
19018   echo "$as_me: failed program was:" >&5
19019 cat conftest.$ac_ext >&5
19020
19021                 cf_cv_func_openpty=no
19022
19023 fi
19024 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19025         done
19026         LIBS="$cf_save_LIBS"
19027
19028 fi
19029 echo "$as_me:19029: result: $cf_cv_func_openpty" >&5
19030 echo "${ECHO_T}$cf_cv_func_openpty" >&6
19031
19032 if test "$cf_cv_func_openpty" != no ; then
19033
19034 cat >>confdefs.h <<EOF
19035 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
19036 EOF
19037
19038 cat >>confdefs.h <<\EOF
19039 #define USE_XTERM_PTY 1
19040 EOF
19041
19042         if test "x$cf_cv_lib_util" = xyes ; then
19043
19044 cf_add_libs="$TEST_LIBS"
19045 # reverse order
19046 cf_add_0lib=
19047 for cf_add_1lib in -lutil; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
19048 # filter duplicates
19049 for cf_add_1lib in $cf_add_0lib; do
19050         for cf_add_2lib in $cf_add_libs; do
19051                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
19052                         cf_add_1lib=
19053                         break
19054                 fi
19055         done
19056         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
19057 done
19058 TEST_LIBS="$cf_add_libs"
19059
19060         fi
19061 fi
19062
19063 echo "$as_me:19063: checking for function curses_version" >&5
19064 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
19065 if test "${cf_cv_func_curses_version+set}" = set; then
19066   echo $ECHO_N "(cached) $ECHO_C" >&6
19067 else
19068
19069 if test "$cross_compiling" = yes; then
19070   cf_cv_func_curses_version=unknown
19071 else
19072   cat >conftest.$ac_ext <<_ACEOF
19073 #line 19073 "configure"
19074 #include "confdefs.h"
19075
19076 #include <${cf_cv_ncurses_header:-curses.h}>
19077 int main(void)
19078 {
19079         char temp[1024];
19080         sprintf(temp, "%s\n", curses_version());
19081         ${cf_cv_main_return:-return}(0);
19082 }
19083
19084 _ACEOF
19085 rm -f conftest$ac_exeext
19086 if { (eval echo "$as_me:19086: \"$ac_link\"") >&5
19087   (eval $ac_link) 2>&5
19088   ac_status=$?
19089   echo "$as_me:19089: \$? = $ac_status" >&5
19090   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19091   { (eval echo "$as_me:19091: \"$ac_try\"") >&5
19092   (eval $ac_try) 2>&5
19093   ac_status=$?
19094   echo "$as_me:19094: \$? = $ac_status" >&5
19095   (exit $ac_status); }; }; then
19096   cf_cv_func_curses_version=yes
19097
19098 else
19099   echo "$as_me: program exited with status $ac_status" >&5
19100 echo "$as_me: failed program was:" >&5
19101 cat conftest.$ac_ext >&5
19102 cf_cv_func_curses_version=no
19103
19104 fi
19105 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19106 fi
19107 rm -f core
19108 fi
19109 echo "$as_me:19109: result: $cf_cv_func_curses_version" >&5
19110 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
19111 test "$cf_cv_func_curses_version" = yes &&
19112 cat >>confdefs.h <<\EOF
19113 #define HAVE_CURSES_VERSION 1
19114 EOF
19115
19116 echo "$as_me:19116: checking for alternate character set array" >&5
19117 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
19118 if test "${cf_cv_curses_acs_map+set}" = set; then
19119   echo $ECHO_N "(cached) $ECHO_C" >&6
19120 else
19121
19122 cf_cv_curses_acs_map=unknown
19123 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
19124 do
19125 cat >conftest.$ac_ext <<_ACEOF
19126 #line 19126 "configure"
19127 #include "confdefs.h"
19128
19129 #include <${cf_cv_ncurses_header:-curses.h}>
19130
19131 int
19132 main (void)
19133 {
19134
19135 $name['k'] = ACS_PLUS
19136
19137   ;
19138   return 0;
19139 }
19140 _ACEOF
19141 rm -f conftest.$ac_objext conftest$ac_exeext
19142 if { (eval echo "$as_me:19142: \"$ac_link\"") >&5
19143   (eval $ac_link) 2>&5
19144   ac_status=$?
19145   echo "$as_me:19145: \$? = $ac_status" >&5
19146   (exit $ac_status); } &&
19147          { ac_try='test -s conftest$ac_exeext'
19148   { (eval echo "$as_me:19148: \"$ac_try\"") >&5
19149   (eval $ac_try) 2>&5
19150   ac_status=$?
19151   echo "$as_me:19151: \$? = $ac_status" >&5
19152   (exit $ac_status); }; }; then
19153   cf_cv_curses_acs_map=$name; break
19154 else
19155   echo "$as_me: failed program was:" >&5
19156 cat conftest.$ac_ext >&5
19157 fi
19158 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19159 done
19160
19161 fi
19162 echo "$as_me:19162: result: $cf_cv_curses_acs_map" >&5
19163 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
19164
19165 test "$cf_cv_curses_acs_map" != unknown &&
19166 cat >>confdefs.h <<EOF
19167 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
19168 EOF
19169
19170 if test "$cf_enable_widec" = yes; then
19171
19172 echo "$as_me:19172: checking for wide alternate character set array" >&5
19173 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
19174 if test "${cf_cv_curses_wacs_map+set}" = set; then
19175   echo $ECHO_N "(cached) $ECHO_C" >&6
19176 else
19177
19178         cf_cv_curses_wacs_map=unknown
19179         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
19180         do
19181         cat >conftest.$ac_ext <<_ACEOF
19182 #line 19182 "configure"
19183 #include "confdefs.h"
19184
19185 #ifndef _XOPEN_SOURCE_EXTENDED
19186 #define _XOPEN_SOURCE_EXTENDED
19187 #endif
19188 #include <${cf_cv_ncurses_header:-curses.h}>
19189 int
19190 main (void)
19191 {
19192 void *foo = &($name['k']); (void)foo
19193   ;
19194   return 0;
19195 }
19196 _ACEOF
19197 rm -f conftest.$ac_objext conftest$ac_exeext
19198 if { (eval echo "$as_me:19198: \"$ac_link\"") >&5
19199   (eval $ac_link) 2>&5
19200   ac_status=$?
19201   echo "$as_me:19201: \$? = $ac_status" >&5
19202   (exit $ac_status); } &&
19203          { ac_try='test -s conftest$ac_exeext'
19204   { (eval echo "$as_me:19204: \"$ac_try\"") >&5
19205   (eval $ac_try) 2>&5
19206   ac_status=$?
19207   echo "$as_me:19207: \$? = $ac_status" >&5
19208   (exit $ac_status); }; }; then
19209   cf_cv_curses_wacs_map=$name
19210          break
19211 else
19212   echo "$as_me: failed program was:" >&5
19213 cat conftest.$ac_ext >&5
19214 fi
19215 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19216         done
19217 fi
19218 echo "$as_me:19218: result: $cf_cv_curses_wacs_map" >&5
19219 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
19220
19221 test "$cf_cv_curses_wacs_map" != unknown &&
19222 cat >>confdefs.h <<EOF
19223 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
19224 EOF
19225
19226 echo "$as_me:19226: checking for wide alternate character constants" >&5
19227 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
19228 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
19229   echo $ECHO_N "(cached) $ECHO_C" >&6
19230 else
19231
19232 cf_cv_curses_wacs_symbols=no
19233 if test "$cf_cv_curses_wacs_map" != unknown
19234 then
19235         cat >conftest.$ac_ext <<_ACEOF
19236 #line 19236 "configure"
19237 #include "confdefs.h"
19238
19239 #ifndef _XOPEN_SOURCE_EXTENDED
19240 #define _XOPEN_SOURCE_EXTENDED
19241 #endif
19242 #include <${cf_cv_ncurses_header:-curses.h}>
19243 int
19244 main (void)
19245 {
19246 cchar_t *foo = WACS_PLUS;
19247          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS; (void)foo
19248   ;
19249   return 0;
19250 }
19251 _ACEOF
19252 rm -f conftest.$ac_objext conftest$ac_exeext
19253 if { (eval echo "$as_me:19253: \"$ac_link\"") >&5
19254   (eval $ac_link) 2>&5
19255   ac_status=$?
19256   echo "$as_me:19256: \$? = $ac_status" >&5
19257   (exit $ac_status); } &&
19258          { ac_try='test -s conftest$ac_exeext'
19259   { (eval echo "$as_me:19259: \"$ac_try\"") >&5
19260   (eval $ac_try) 2>&5
19261   ac_status=$?
19262   echo "$as_me:19262: \$? = $ac_status" >&5
19263   (exit $ac_status); }; }; then
19264   cf_cv_curses_wacs_symbols=yes
19265 else
19266   echo "$as_me: failed program was:" >&5
19267 cat conftest.$ac_ext >&5
19268 fi
19269 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19270 else
19271         cat >conftest.$ac_ext <<_ACEOF
19272 #line 19272 "configure"
19273 #include "confdefs.h"
19274
19275 #ifndef _XOPEN_SOURCE_EXTENDED
19276 #define _XOPEN_SOURCE_EXTENDED
19277 #endif
19278 #include <${cf_cv_ncurses_header:-curses.h}>
19279 int
19280 main (void)
19281 {
19282 cchar_t *foo = WACS_PLUS; (void)foo
19283   ;
19284   return 0;
19285 }
19286 _ACEOF
19287 rm -f conftest.$ac_objext conftest$ac_exeext
19288 if { (eval echo "$as_me:19288: \"$ac_link\"") >&5
19289   (eval $ac_link) 2>&5
19290   ac_status=$?
19291   echo "$as_me:19291: \$? = $ac_status" >&5
19292   (exit $ac_status); } &&
19293          { ac_try='test -s conftest$ac_exeext'
19294   { (eval echo "$as_me:19294: \"$ac_try\"") >&5
19295   (eval $ac_try) 2>&5
19296   ac_status=$?
19297   echo "$as_me:19297: \$? = $ac_status" >&5
19298   (exit $ac_status); }; }; then
19299   cf_cv_curses_wacs_symbols=yes
19300 else
19301   echo "$as_me: failed program was:" >&5
19302 cat conftest.$ac_ext >&5
19303 fi
19304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19305 fi
19306
19307 fi
19308 echo "$as_me:19308: result: $cf_cv_curses_wacs_symbols" >&5
19309 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
19310
19311 test "$cf_cv_curses_wacs_symbols" != no &&
19312 cat >>confdefs.h <<\EOF
19313 #define CURSES_WACS_SYMBOLS 1
19314 EOF
19315
19316 fi
19317
19318 echo "$as_me:19318: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19319 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19320 cat >conftest.$ac_ext <<_ACEOF
19321 #line 19321 "configure"
19322 #include "confdefs.h"
19323
19324 #ifndef _XOPEN_SOURCE_EXTENDED
19325 #define _XOPEN_SOURCE_EXTENDED
19326 #endif
19327 #include <${cf_cv_ncurses_header:-curses.h}>
19328 int
19329 main (void)
19330 {
19331
19332 attr_t foo
19333
19334   ;
19335   return 0;
19336 }
19337 _ACEOF
19338 rm -f conftest.$ac_objext
19339 if { (eval echo "$as_me:19339: \"$ac_compile\"") >&5
19340   (eval $ac_compile) 2>&5
19341   ac_status=$?
19342   echo "$as_me:19342: \$? = $ac_status" >&5
19343   (exit $ac_status); } &&
19344          { ac_try='test -s conftest.$ac_objext'
19345   { (eval echo "$as_me:19345: \"$ac_try\"") >&5
19346   (eval $ac_try) 2>&5
19347   ac_status=$?
19348   echo "$as_me:19348: \$? = $ac_status" >&5
19349   (exit $ac_status); }; }; then
19350   cf_result=yes
19351 else
19352   echo "$as_me: failed program was:" >&5
19353 cat conftest.$ac_ext >&5
19354 cf_result=no
19355 fi
19356 rm -f conftest.$ac_objext conftest.$ac_ext
19357 echo "$as_me:19357: result: $cf_result" >&5
19358 echo "${ECHO_T}$cf_result" >&6
19359 if test $cf_result = yes ; then
19360
19361 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19362
19363 cat >>confdefs.h <<EOF
19364 #define $cf_result 1
19365 EOF
19366
19367 else
19368
19369 cat >>confdefs.h <<EOF
19370 #define attr_t long
19371 EOF
19372
19373 fi
19374
19375 if test "$cf_enable_widec" = yes; then
19376
19377 # This is needed on Tru64 5.0 to declare mbstate_t
19378 echo "$as_me:19378: checking if we must include wchar.h to declare mbstate_t" >&5
19379 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
19380 if test "${cf_cv_mbstate_t+set}" = set; then
19381   echo $ECHO_N "(cached) $ECHO_C" >&6
19382 else
19383
19384 cat >conftest.$ac_ext <<_ACEOF
19385 #line 19385 "configure"
19386 #include "confdefs.h"
19387
19388 #include <stdlib.h>
19389 #include <stdarg.h>
19390 #include <stdio.h>
19391 #ifdef HAVE_LIBUTF8_H
19392 #include <libutf8.h>
19393 #endif
19394 int
19395 main (void)
19396 {
19397 mbstate_t state
19398   ;
19399   return 0;
19400 }
19401 _ACEOF
19402 rm -f conftest.$ac_objext
19403 if { (eval echo "$as_me:19403: \"$ac_compile\"") >&5
19404   (eval $ac_compile) 2>&5
19405   ac_status=$?
19406   echo "$as_me:19406: \$? = $ac_status" >&5
19407   (exit $ac_status); } &&
19408          { ac_try='test -s conftest.$ac_objext'
19409   { (eval echo "$as_me:19409: \"$ac_try\"") >&5
19410   (eval $ac_try) 2>&5
19411   ac_status=$?
19412   echo "$as_me:19412: \$? = $ac_status" >&5
19413   (exit $ac_status); }; }; then
19414   cf_cv_mbstate_t=no
19415 else
19416   echo "$as_me: failed program was:" >&5
19417 cat conftest.$ac_ext >&5
19418 cat >conftest.$ac_ext <<_ACEOF
19419 #line 19419 "configure"
19420 #include "confdefs.h"
19421
19422 #include <stdlib.h>
19423 #include <stdarg.h>
19424 #include <stdio.h>
19425 #include <wchar.h>
19426 #ifdef HAVE_LIBUTF8_H
19427 #include <libutf8.h>
19428 #endif
19429 int
19430 main (void)
19431 {
19432 mbstate_t value
19433   ;
19434   return 0;
19435 }
19436 _ACEOF
19437 rm -f conftest.$ac_objext
19438 if { (eval echo "$as_me:19438: \"$ac_compile\"") >&5
19439   (eval $ac_compile) 2>&5
19440   ac_status=$?
19441   echo "$as_me:19441: \$? = $ac_status" >&5
19442   (exit $ac_status); } &&
19443          { ac_try='test -s conftest.$ac_objext'
19444   { (eval echo "$as_me:19444: \"$ac_try\"") >&5
19445   (eval $ac_try) 2>&5
19446   ac_status=$?
19447   echo "$as_me:19447: \$? = $ac_status" >&5
19448   (exit $ac_status); }; }; then
19449   cf_cv_mbstate_t=yes
19450 else
19451   echo "$as_me: failed program was:" >&5
19452 cat conftest.$ac_ext >&5
19453 cf_cv_mbstate_t=unknown
19454 fi
19455 rm -f conftest.$ac_objext conftest.$ac_ext
19456 fi
19457 rm -f conftest.$ac_objext conftest.$ac_ext
19458 fi
19459 echo "$as_me:19459: result: $cf_cv_mbstate_t" >&5
19460 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
19461
19462 if test "$cf_cv_mbstate_t" = yes ; then
19463
19464 cat >>confdefs.h <<\EOF
19465 #define NEED_WCHAR_H 1
19466 EOF
19467
19468         NEED_WCHAR_H=1
19469 fi
19470
19471 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
19472 if test "$cf_cv_mbstate_t" = unknown ; then
19473         NCURSES_MBSTATE_T=1
19474 fi
19475
19476 # if we find mbstate_t in either place, use substitution to provide a fallback.
19477 if test "$cf_cv_mbstate_t" != unknown ; then
19478         NCURSES_OK_MBSTATE_T=1
19479 fi
19480
19481 # This is needed on Tru64 5.0 to declare wchar_t
19482 echo "$as_me:19482: checking if we must include wchar.h to declare wchar_t" >&5
19483 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
19484 if test "${cf_cv_wchar_t+set}" = set; then
19485   echo $ECHO_N "(cached) $ECHO_C" >&6
19486 else
19487
19488 cat >conftest.$ac_ext <<_ACEOF
19489 #line 19489 "configure"
19490 #include "confdefs.h"
19491
19492 #include <stdlib.h>
19493 #include <stdarg.h>
19494 #include <stdio.h>
19495 #ifdef HAVE_LIBUTF8_H
19496 #include <libutf8.h>
19497 #endif
19498 int
19499 main (void)
19500 {
19501 wchar_t state
19502   ;
19503   return 0;
19504 }
19505 _ACEOF
19506 rm -f conftest.$ac_objext
19507 if { (eval echo "$as_me:19507: \"$ac_compile\"") >&5
19508   (eval $ac_compile) 2>&5
19509   ac_status=$?
19510   echo "$as_me:19510: \$? = $ac_status" >&5
19511   (exit $ac_status); } &&
19512          { ac_try='test -s conftest.$ac_objext'
19513   { (eval echo "$as_me:19513: \"$ac_try\"") >&5
19514   (eval $ac_try) 2>&5
19515   ac_status=$?
19516   echo "$as_me:19516: \$? = $ac_status" >&5
19517   (exit $ac_status); }; }; then
19518   cf_cv_wchar_t=no
19519 else
19520   echo "$as_me: failed program was:" >&5
19521 cat conftest.$ac_ext >&5
19522 cat >conftest.$ac_ext <<_ACEOF
19523 #line 19523 "configure"
19524 #include "confdefs.h"
19525
19526 #include <stdlib.h>
19527 #include <stdarg.h>
19528 #include <stdio.h>
19529 #include <wchar.h>
19530 #ifdef HAVE_LIBUTF8_H
19531 #include <libutf8.h>
19532 #endif
19533 int
19534 main (void)
19535 {
19536 wchar_t value
19537   ;
19538   return 0;
19539 }
19540 _ACEOF
19541 rm -f conftest.$ac_objext
19542 if { (eval echo "$as_me:19542: \"$ac_compile\"") >&5
19543   (eval $ac_compile) 2>&5
19544   ac_status=$?
19545   echo "$as_me:19545: \$? = $ac_status" >&5
19546   (exit $ac_status); } &&
19547          { ac_try='test -s conftest.$ac_objext'
19548   { (eval echo "$as_me:19548: \"$ac_try\"") >&5
19549   (eval $ac_try) 2>&5
19550   ac_status=$?
19551   echo "$as_me:19551: \$? = $ac_status" >&5
19552   (exit $ac_status); }; }; then
19553   cf_cv_wchar_t=yes
19554 else
19555   echo "$as_me: failed program was:" >&5
19556 cat conftest.$ac_ext >&5
19557 cf_cv_wchar_t=unknown
19558 fi
19559 rm -f conftest.$ac_objext conftest.$ac_ext
19560 fi
19561 rm -f conftest.$ac_objext conftest.$ac_ext
19562 fi
19563 echo "$as_me:19563: result: $cf_cv_wchar_t" >&5
19564 echo "${ECHO_T}$cf_cv_wchar_t" >&6
19565
19566 if test "$cf_cv_wchar_t" = yes ; then
19567
19568 cat >>confdefs.h <<\EOF
19569 #define NEED_WCHAR_H 1
19570 EOF
19571
19572         NEED_WCHAR_H=1
19573 fi
19574
19575 # if we do not find wchar_t in either place, use substitution to provide a fallback.
19576 if test "$cf_cv_wchar_t" = unknown ; then
19577         NCURSES_WCHAR_T=1
19578 fi
19579
19580 # if we find wchar_t in either place, use substitution to provide a fallback.
19581 if test "$cf_cv_wchar_t" != unknown ; then
19582         NCURSES_OK_WCHAR_T=1
19583 fi
19584
19585 # This is needed on Tru64 5.0 to declare wint_t
19586 echo "$as_me:19586: checking if we must include wchar.h to declare wint_t" >&5
19587 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
19588 if test "${cf_cv_wint_t+set}" = set; then
19589   echo $ECHO_N "(cached) $ECHO_C" >&6
19590 else
19591
19592 cat >conftest.$ac_ext <<_ACEOF
19593 #line 19593 "configure"
19594 #include "confdefs.h"
19595
19596 #include <stdlib.h>
19597 #include <stdarg.h>
19598 #include <stdio.h>
19599 #ifdef HAVE_LIBUTF8_H
19600 #include <libutf8.h>
19601 #endif
19602 int
19603 main (void)
19604 {
19605 wint_t state
19606   ;
19607   return 0;
19608 }
19609 _ACEOF
19610 rm -f conftest.$ac_objext
19611 if { (eval echo "$as_me:19611: \"$ac_compile\"") >&5
19612   (eval $ac_compile) 2>&5
19613   ac_status=$?
19614   echo "$as_me:19614: \$? = $ac_status" >&5
19615   (exit $ac_status); } &&
19616          { ac_try='test -s conftest.$ac_objext'
19617   { (eval echo "$as_me:19617: \"$ac_try\"") >&5
19618   (eval $ac_try) 2>&5
19619   ac_status=$?
19620   echo "$as_me:19620: \$? = $ac_status" >&5
19621   (exit $ac_status); }; }; then
19622   cf_cv_wint_t=no
19623 else
19624   echo "$as_me: failed program was:" >&5
19625 cat conftest.$ac_ext >&5
19626 cat >conftest.$ac_ext <<_ACEOF
19627 #line 19627 "configure"
19628 #include "confdefs.h"
19629
19630 #include <stdlib.h>
19631 #include <stdarg.h>
19632 #include <stdio.h>
19633 #include <wchar.h>
19634 #ifdef HAVE_LIBUTF8_H
19635 #include <libutf8.h>
19636 #endif
19637 int
19638 main (void)
19639 {
19640 wint_t value
19641   ;
19642   return 0;
19643 }
19644 _ACEOF
19645 rm -f conftest.$ac_objext
19646 if { (eval echo "$as_me:19646: \"$ac_compile\"") >&5
19647   (eval $ac_compile) 2>&5
19648   ac_status=$?
19649   echo "$as_me:19649: \$? = $ac_status" >&5
19650   (exit $ac_status); } &&
19651          { ac_try='test -s conftest.$ac_objext'
19652   { (eval echo "$as_me:19652: \"$ac_try\"") >&5
19653   (eval $ac_try) 2>&5
19654   ac_status=$?
19655   echo "$as_me:19655: \$? = $ac_status" >&5
19656   (exit $ac_status); }; }; then
19657   cf_cv_wint_t=yes
19658 else
19659   echo "$as_me: failed program was:" >&5
19660 cat conftest.$ac_ext >&5
19661 cf_cv_wint_t=unknown
19662 fi
19663 rm -f conftest.$ac_objext conftest.$ac_ext
19664 fi
19665 rm -f conftest.$ac_objext conftest.$ac_ext
19666 fi
19667 echo "$as_me:19667: result: $cf_cv_wint_t" >&5
19668 echo "${ECHO_T}$cf_cv_wint_t" >&6
19669
19670 if test "$cf_cv_wint_t" = yes ; then
19671
19672 cat >>confdefs.h <<\EOF
19673 #define NEED_WCHAR_H 1
19674 EOF
19675
19676         NEED_WCHAR_H=1
19677 fi
19678
19679 # if we do not find wint_t in either place, use substitution to provide a fallback.
19680 if test "$cf_cv_wint_t" = unknown ; then
19681         NCURSES_WINT_T=1
19682 fi
19683
19684 # if we find wint_t in either place, use substitution to provide a fallback.
19685 if test "$cf_cv_wint_t" != unknown ; then
19686         NCURSES_OK_WINT_T=1
19687 fi
19688
19689         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
19690
19691 echo "$as_me:19691: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19692 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19693 cat >conftest.$ac_ext <<_ACEOF
19694 #line 19694 "configure"
19695 #include "confdefs.h"
19696
19697 #ifndef _XOPEN_SOURCE_EXTENDED
19698 #define _XOPEN_SOURCE_EXTENDED
19699 #endif
19700 #include <${cf_cv_ncurses_header:-curses.h}>
19701 int
19702 main (void)
19703 {
19704
19705 mbstate_t foo
19706
19707   ;
19708   return 0;
19709 }
19710 _ACEOF
19711 rm -f conftest.$ac_objext
19712 if { (eval echo "$as_me:19712: \"$ac_compile\"") >&5
19713   (eval $ac_compile) 2>&5
19714   ac_status=$?
19715   echo "$as_me:19715: \$? = $ac_status" >&5
19716   (exit $ac_status); } &&
19717          { ac_try='test -s conftest.$ac_objext'
19718   { (eval echo "$as_me:19718: \"$ac_try\"") >&5
19719   (eval $ac_try) 2>&5
19720   ac_status=$?
19721   echo "$as_me:19721: \$? = $ac_status" >&5
19722   (exit $ac_status); }; }; then
19723   cf_result=yes
19724 else
19725   echo "$as_me: failed program was:" >&5
19726 cat conftest.$ac_ext >&5
19727 cf_result=no
19728 fi
19729 rm -f conftest.$ac_objext conftest.$ac_ext
19730 echo "$as_me:19730: result: $cf_result" >&5
19731 echo "${ECHO_T}$cf_result" >&6
19732 if test $cf_result = yes ; then
19733
19734 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19735
19736 cat >>confdefs.h <<EOF
19737 #define $cf_result 1
19738 EOF
19739
19740 else
19741
19742 cat >>confdefs.h <<EOF
19743 #define mbstate_t long
19744 EOF
19745
19746 fi
19747
19748         fi
19749
19750         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
19751
19752 echo "$as_me:19752: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19753 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19754 cat >conftest.$ac_ext <<_ACEOF
19755 #line 19755 "configure"
19756 #include "confdefs.h"
19757
19758 #ifndef _XOPEN_SOURCE_EXTENDED
19759 #define _XOPEN_SOURCE_EXTENDED
19760 #endif
19761 #include <${cf_cv_ncurses_header:-curses.h}>
19762 int
19763 main (void)
19764 {
19765
19766 wchar_t foo
19767
19768   ;
19769   return 0;
19770 }
19771 _ACEOF
19772 rm -f conftest.$ac_objext
19773 if { (eval echo "$as_me:19773: \"$ac_compile\"") >&5
19774   (eval $ac_compile) 2>&5
19775   ac_status=$?
19776   echo "$as_me:19776: \$? = $ac_status" >&5
19777   (exit $ac_status); } &&
19778          { ac_try='test -s conftest.$ac_objext'
19779   { (eval echo "$as_me:19779: \"$ac_try\"") >&5
19780   (eval $ac_try) 2>&5
19781   ac_status=$?
19782   echo "$as_me:19782: \$? = $ac_status" >&5
19783   (exit $ac_status); }; }; then
19784   cf_result=yes
19785 else
19786   echo "$as_me: failed program was:" >&5
19787 cat conftest.$ac_ext >&5
19788 cf_result=no
19789 fi
19790 rm -f conftest.$ac_objext conftest.$ac_ext
19791 echo "$as_me:19791: result: $cf_result" >&5
19792 echo "${ECHO_T}$cf_result" >&6
19793 if test $cf_result = yes ; then
19794
19795 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19796
19797 cat >>confdefs.h <<EOF
19798 #define $cf_result 1
19799 EOF
19800
19801 else
19802
19803 cat >>confdefs.h <<EOF
19804 #define wchar_t long
19805 EOF
19806
19807 fi
19808
19809         fi
19810
19811         if test "$NCURSES_OK_WINT_T" = 0 ; then
19812
19813 echo "$as_me:19813: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
19814 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19815 cat >conftest.$ac_ext <<_ACEOF
19816 #line 19816 "configure"
19817 #include "confdefs.h"
19818
19819 #ifndef _XOPEN_SOURCE_EXTENDED
19820 #define _XOPEN_SOURCE_EXTENDED
19821 #endif
19822 #include <${cf_cv_ncurses_header:-curses.h}>
19823 int
19824 main (void)
19825 {
19826
19827 wint_t foo
19828
19829   ;
19830   return 0;
19831 }
19832 _ACEOF
19833 rm -f conftest.$ac_objext
19834 if { (eval echo "$as_me:19834: \"$ac_compile\"") >&5
19835   (eval $ac_compile) 2>&5
19836   ac_status=$?
19837   echo "$as_me:19837: \$? = $ac_status" >&5
19838   (exit $ac_status); } &&
19839          { ac_try='test -s conftest.$ac_objext'
19840   { (eval echo "$as_me:19840: \"$ac_try\"") >&5
19841   (eval $ac_try) 2>&5
19842   ac_status=$?
19843   echo "$as_me:19843: \$? = $ac_status" >&5
19844   (exit $ac_status); }; }; then
19845   cf_result=yes
19846 else
19847   echo "$as_me: failed program was:" >&5
19848 cat conftest.$ac_ext >&5
19849 cf_result=no
19850 fi
19851 rm -f conftest.$ac_objext conftest.$ac_ext
19852 echo "$as_me:19852: result: $cf_result" >&5
19853 echo "${ECHO_T}$cf_result" >&6
19854 if test $cf_result = yes ; then
19855
19856 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19857
19858 cat >>confdefs.h <<EOF
19859 #define $cf_result 1
19860 EOF
19861
19862 else
19863
19864 cat >>confdefs.h <<EOF
19865 #define wint_t long
19866 EOF
19867
19868 fi
19869
19870         fi
19871 fi
19872
19873 for cf_data in \
19874 TABSIZE \
19875 curscr \
19876 ospeed \
19877 boolnames \
19878 boolfnames \
19879 ttytype
19880 do
19881 echo "$as_me:19881: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19882 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19883
19884 cat >conftest.$ac_ext <<_ACEOF
19885 #line 19885 "configure"
19886 #include "confdefs.h"
19887
19888 #ifdef HAVE_XCURSES
19889 #include <xcurses.h>
19890 char * XCursesProgramName = "test";
19891 #else
19892 #include <${cf_cv_ncurses_header:-curses.h}>
19893 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19894 #include <ncursesw/term.h>
19895 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19896 #include <ncurses/term.h>
19897 #elif defined(HAVE_TERM_H)
19898 #include <term.h>
19899 #endif
19900 #endif
19901
19902 int
19903 main (void)
19904 {
19905
19906 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19907         const void *foo = (const void *)($cf_data);
19908 #else
19909         const void *foo = &($cf_data);
19910 #endif
19911         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19912
19913   ;
19914   return 0;
19915 }
19916 _ACEOF
19917 rm -f conftest.$ac_objext
19918 if { (eval echo "$as_me:19918: \"$ac_compile\"") >&5
19919   (eval $ac_compile) 2>&5
19920   ac_status=$?
19921   echo "$as_me:19921: \$? = $ac_status" >&5
19922   (exit $ac_status); } &&
19923          { ac_try='test -s conftest.$ac_objext'
19924   { (eval echo "$as_me:19924: \"$ac_try\"") >&5
19925   (eval $ac_try) 2>&5
19926   ac_status=$?
19927   echo "$as_me:19927: \$? = $ac_status" >&5
19928   (exit $ac_status); }; }; then
19929   cf_result=yes
19930
19931 else
19932   echo "$as_me: failed program was:" >&5
19933 cat conftest.$ac_ext >&5
19934 cf_result=no
19935 fi
19936 rm -f conftest.$ac_objext conftest.$ac_ext
19937 echo "$as_me:19937: result: $cf_result" >&5
19938 echo "${ECHO_T}$cf_result" >&6
19939
19940 if test $cf_result = yes ; then
19941
19942 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19943
19944         cat >>confdefs.h <<EOF
19945 #define $cf_result 1
19946 EOF
19947
19948 else
19949         echo "$as_me:19949: checking for data $cf_data in library" >&5
19950 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19951         # BSD linkers insist on making weak linkage, but resolve at runtime.
19952         if test "$cross_compiling" = yes; then
19953
19954         # cross-compiling
19955         cat >conftest.$ac_ext <<_ACEOF
19956 #line 19956 "configure"
19957 #include "confdefs.h"
19958
19959 #ifdef HAVE_XCURSES
19960 #include <xcurses.h>
19961 char * XCursesProgramName = "test";
19962 #else
19963 #include <${cf_cv_ncurses_header:-curses.h}>
19964 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19965 #include <ncursesw/term.h>
19966 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19967 #include <ncurses/term.h>
19968 #elif defined(HAVE_TERM_H)
19969 #include <term.h>
19970 #endif
19971 #endif
19972
19973 extern char $cf_data;
19974 int
19975 main (void)
19976 {
19977
19978         do {
19979
19980 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
19981         const void *foo = (const void *)($cf_data);
19982 #else
19983         const void *foo = &($cf_data);
19984 #endif
19985         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
19986
19987                 ${cf_cv_main_return:-return}(foo == 0);
19988         } while (0)
19989
19990   ;
19991   return 0;
19992 }
19993 _ACEOF
19994 rm -f conftest.$ac_objext conftest$ac_exeext
19995 if { (eval echo "$as_me:19995: \"$ac_link\"") >&5
19996   (eval $ac_link) 2>&5
19997   ac_status=$?
19998   echo "$as_me:19998: \$? = $ac_status" >&5
19999   (exit $ac_status); } &&
20000          { ac_try='test -s conftest$ac_exeext'
20001   { (eval echo "$as_me:20001: \"$ac_try\"") >&5
20002   (eval $ac_try) 2>&5
20003   ac_status=$?
20004   echo "$as_me:20004: \$? = $ac_status" >&5
20005   (exit $ac_status); }; }; then
20006   cf_result=yes
20007 else
20008   echo "$as_me: failed program was:" >&5
20009 cat conftest.$ac_ext >&5
20010 cf_result=no
20011 fi
20012 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20013
20014 else
20015   cat >conftest.$ac_ext <<_ACEOF
20016 #line 20016 "configure"
20017 #include "confdefs.h"
20018
20019 #ifdef HAVE_XCURSES
20020 #include <xcurses.h>
20021 char * XCursesProgramName = "test";
20022 #else
20023 #include <${cf_cv_ncurses_header:-curses.h}>
20024 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
20025 #include <ncursesw/term.h>
20026 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
20027 #include <ncurses/term.h>
20028 #elif defined(HAVE_TERM_H)
20029 #include <term.h>
20030 #endif
20031 #endif
20032
20033 extern char $cf_data;
20034 int main(void)
20035 {
20036
20037 #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT))
20038         const void *foo = (const void *)($cf_data);
20039 #else
20040         const void *foo = &($cf_data);
20041 #endif
20042         fprintf(stderr, "testing linkage of $cf_data:%p\n", (const void *)foo);
20043
20044         ${cf_cv_main_return:-return}(foo == 0);
20045 }
20046 _ACEOF
20047 rm -f conftest$ac_exeext
20048 if { (eval echo "$as_me:20048: \"$ac_link\"") >&5
20049   (eval $ac_link) 2>&5
20050   ac_status=$?
20051   echo "$as_me:20051: \$? = $ac_status" >&5
20052   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
20053   { (eval echo "$as_me:20053: \"$ac_try\"") >&5
20054   (eval $ac_try) 2>&5
20055   ac_status=$?
20056   echo "$as_me:20056: \$? = $ac_status" >&5
20057   (exit $ac_status); }; }; then
20058   cf_result=yes
20059
20060 else
20061   echo "$as_me: program exited with status $ac_status" >&5
20062 echo "$as_me: failed program was:" >&5
20063 cat conftest.$ac_ext >&5
20064 cf_result=no
20065 fi
20066 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
20067 fi
20068         echo "$as_me:20068: result: $cf_result" >&5
20069 echo "${ECHO_T}$cf_result" >&6
20070         if test $cf_result = yes ; then
20071
20072 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
20073
20074                 cat >>confdefs.h <<EOF
20075 #define $cf_result 1
20076 EOF
20077
20078                 # do not exit loop here, since we prefer system's declarations
20079         fi
20080 fi
20081 done
20082
20083 if test -n "$with_screen" && test "x$with_screen" = "xpdcurses"
20084 then
20085         echo "$as_me:20085: checking for X" >&5
20086 echo $ECHO_N "checking for X... $ECHO_C" >&6
20087
20088 # Check whether --with-x or --without-x was given.
20089 if test "${with_x+set}" = set; then
20090   withval="$with_x"
20091
20092 fi;
20093 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
20094 if test "x$with_x" = xno; then
20095   # The user explicitly disabled X.
20096   have_x=disabled
20097 else
20098   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
20099     # Both variables are already set.
20100     have_x=yes
20101   else
20102     if test "${ac_cv_have_x+set}" = set; then
20103   echo $ECHO_N "(cached) $ECHO_C" >&6
20104 else
20105   # One or both of the vars are not set, and there is no cached value.
20106 ac_x_includes=no ac_x_libraries=no
20107 rm -fr conftest.dir
20108 if mkdir conftest.dir; then
20109   cd conftest.dir
20110   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
20111   cat >Imakefile <<'EOF'
20112 acfindx:
20113         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
20114 EOF
20115   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
20116     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
20117     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
20118     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
20119     for ac_extension in a so sl dylib dll; do
20120       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
20121          test -f $ac_im_libdir/libX11.$ac_extension; then
20122         ac_im_usrlibdir=$ac_im_libdir; break
20123       fi
20124     done
20125     # Screen out bogus values from the imake configuration.  They are
20126     # bogus both because they are the default anyway, and because
20127     # using them would break gcc on systems where it needs fixed includes.
20128     case $ac_im_incroot in
20129         /usr/include) ;;
20130         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
20131     esac
20132     case $ac_im_usrlibdir in
20133         /usr/lib | /lib) ;;
20134         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
20135     esac
20136   fi
20137   cd ..
20138   rm -fr conftest.dir
20139 fi
20140
20141 # Standard set of common directories for X headers.
20142 # Check X11 before X11Rn because it is often a symlink to the current release.
20143 ac_x_header_dirs='
20144 /usr/X11/include
20145 /usr/X11R7/include
20146 /usr/X11R6/include
20147 /usr/X11R5/include
20148 /usr/X11R4/include
20149
20150 /opt/local/include
20151 /opt/X11/include
20152
20153 /usr/include/X11
20154 /usr/include/X11R7
20155 /usr/include/X11R6
20156 /usr/include/X11R5
20157 /usr/include/X11R4
20158
20159 /usr/local/X11/include
20160 /usr/local/X11R7/include
20161 /usr/local/X11R6/include
20162 /usr/local/X11R5/include
20163 /usr/local/X11R4/include
20164
20165 /usr/local/include/X11
20166 /usr/local/include/X11R7
20167 /usr/local/include/X11R6
20168 /usr/local/include/X11R5
20169 /usr/local/include/X11R4
20170
20171 /usr/X386/include
20172 /usr/x386/include
20173 /usr/XFree86/include/X11
20174
20175 /usr/include
20176 /usr/local/include
20177 /usr/unsupported/include
20178 /usr/athena/include
20179 /usr/local/x11r5/include
20180 /usr/lpp/Xamples/include
20181
20182 /usr/openwin/include
20183 /usr/openwin/share/include'
20184
20185 if test "$ac_x_includes" = no; then
20186   # Guess where to find include files, by looking for Intrinsic.h.
20187   # First, try using that file with no special directory specified.
20188   cat >conftest.$ac_ext <<_ACEOF
20189 #line 20189 "configure"
20190 #include "confdefs.h"
20191 #include <X11/Intrinsic.h>
20192 _ACEOF
20193 if { (eval echo "$as_me:20193: \"$ac_cpp conftest.$ac_ext\"") >&5
20194   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
20195   ac_status=$?
20196   egrep -v '^ *\+' conftest.er1 >conftest.err
20197   rm -f conftest.er1
20198   cat conftest.err >&5
20199   echo "$as_me:20199: \$? = $ac_status" >&5
20200   (exit $ac_status); } >/dev/null; then
20201   if test -s conftest.err; then
20202     ac_cpp_err=$ac_c_preproc_warn_flag
20203   else
20204     ac_cpp_err=
20205   fi
20206 else
20207   ac_cpp_err=yes
20208 fi
20209 if test -z "$ac_cpp_err"; then
20210   # We can compile using X headers with no special include directory.
20211 ac_x_includes=
20212 else
20213   echo "$as_me: failed program was:" >&5
20214   cat conftest.$ac_ext >&5
20215   for ac_dir in $ac_x_header_dirs; do
20216   if test -r "$ac_dir/X11/Intrinsic.h"; then
20217     ac_x_includes=$ac_dir
20218     break
20219   fi
20220 done
20221 fi
20222 rm -f conftest.err conftest.$ac_ext
20223 fi # $ac_x_includes = no
20224
20225 if test "$ac_x_libraries" = no; then
20226   # Check for the libraries.
20227   # See if we find them without any special options.
20228   # Don't add to $LIBS permanently.
20229   ac_save_LIBS=$LIBS
20230   LIBS="-lXt $LIBS"
20231   cat >conftest.$ac_ext <<_ACEOF
20232 #line 20232 "configure"
20233 #include "confdefs.h"
20234 #include <X11/Intrinsic.h>
20235 int
20236 main (void)
20237 {
20238 XtMalloc (0)
20239   ;
20240   return 0;
20241 }
20242 _ACEOF
20243 rm -f conftest.$ac_objext conftest$ac_exeext
20244 if { (eval echo "$as_me:20244: \"$ac_link\"") >&5
20245   (eval $ac_link) 2>&5
20246   ac_status=$?
20247   echo "$as_me:20247: \$? = $ac_status" >&5
20248   (exit $ac_status); } &&
20249          { ac_try='test -s conftest$ac_exeext'
20250   { (eval echo "$as_me:20250: \"$ac_try\"") >&5
20251   (eval $ac_try) 2>&5
20252   ac_status=$?
20253   echo "$as_me:20253: \$? = $ac_status" >&5
20254   (exit $ac_status); }; }; then
20255   LIBS=$ac_save_LIBS
20256 # We can link X programs with no special library path.
20257 ac_x_libraries=
20258 else
20259   echo "$as_me: failed program was:" >&5
20260 cat conftest.$ac_ext >&5
20261 LIBS=$ac_save_LIBS
20262 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
20263 do
20264   # Don't even attempt the hair of trying to link an X program!
20265   for ac_extension in a so sl dylib dll; do
20266     if test -r $ac_dir/libXt.$ac_extension; then
20267       ac_x_libraries=$ac_dir
20268       break 2
20269     fi
20270   done
20271 done
20272 fi
20273 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20274 fi # $ac_x_libraries = no
20275
20276 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
20277   # Didn't find X anywhere.  Cache the known absence of X.
20278   ac_cv_have_x="have_x=no"
20279 else
20280   # Record where we found X for the cache.
20281   ac_cv_have_x="have_x=yes \
20282                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
20283 fi
20284 fi
20285
20286   fi
20287   eval "$ac_cv_have_x"
20288 fi # $with_x != no
20289
20290 if test "$have_x" != yes; then
20291   echo "$as_me:20291: result: $have_x" >&5
20292 echo "${ECHO_T}$have_x" >&6
20293   no_x=yes
20294 else
20295   # If each of the values was on the command line, it overrides each guess.
20296   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
20297   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
20298   # Update the cache value to reflect the command line values.
20299   ac_cv_have_x="have_x=yes \
20300                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
20301   echo "$as_me:20301: result: libraries $x_libraries, headers $x_includes" >&5
20302 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
20303 fi
20304
20305         if test "$no_x" = yes; then
20306   # Not all programs may use this symbol, but it does not hurt to define it.
20307
20308 cat >>confdefs.h <<\EOF
20309 #define X_DISPLAY_MISSING 1
20310 EOF
20311
20312   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
20313 else
20314   if test -n "$x_includes"; then
20315     X_CFLAGS="$X_CFLAGS -I$x_includes"
20316   fi
20317
20318   # It would also be nice to do this for all -L options, not just this one.
20319   if test -n "$x_libraries"; then
20320     X_LIBS="$X_LIBS -L$x_libraries"
20321     # For Solaris; some versions of Sun CC require a space after -R and
20322     # others require no space.  Words are not sufficient . . . .
20323     case `(uname -sr) 2>/dev/null` in
20324     "SunOS 5"*)
20325       echo "$as_me:20325: checking whether -R must be followed by a space" >&5
20326 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
20327       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
20328       cat >conftest.$ac_ext <<_ACEOF
20329 #line 20329 "configure"
20330 #include "confdefs.h"
20331
20332 int
20333 main (void)
20334 {
20335
20336   ;
20337   return 0;
20338 }
20339 _ACEOF
20340 rm -f conftest.$ac_objext conftest$ac_exeext
20341 if { (eval echo "$as_me:20341: \"$ac_link\"") >&5
20342   (eval $ac_link) 2>&5
20343   ac_status=$?
20344   echo "$as_me:20344: \$? = $ac_status" >&5
20345   (exit $ac_status); } &&
20346          { ac_try='test -s conftest$ac_exeext'
20347   { (eval echo "$as_me:20347: \"$ac_try\"") >&5
20348   (eval $ac_try) 2>&5
20349   ac_status=$?
20350   echo "$as_me:20350: \$? = $ac_status" >&5
20351   (exit $ac_status); }; }; then
20352   ac_R_nospace=yes
20353 else
20354   echo "$as_me: failed program was:" >&5
20355 cat conftest.$ac_ext >&5
20356 ac_R_nospace=no
20357 fi
20358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20359       if test $ac_R_nospace = yes; then
20360         echo "$as_me:20360: result: no" >&5
20361 echo "${ECHO_T}no" >&6
20362         X_LIBS="$X_LIBS -R$x_libraries"
20363       else
20364         LIBS="$ac_xsave_LIBS -R $x_libraries"
20365         cat >conftest.$ac_ext <<_ACEOF
20366 #line 20366 "configure"
20367 #include "confdefs.h"
20368
20369 int
20370 main (void)
20371 {
20372
20373   ;
20374   return 0;
20375 }
20376 _ACEOF
20377 rm -f conftest.$ac_objext conftest$ac_exeext
20378 if { (eval echo "$as_me:20378: \"$ac_link\"") >&5
20379   (eval $ac_link) 2>&5
20380   ac_status=$?
20381   echo "$as_me:20381: \$? = $ac_status" >&5
20382   (exit $ac_status); } &&
20383          { ac_try='test -s conftest$ac_exeext'
20384   { (eval echo "$as_me:20384: \"$ac_try\"") >&5
20385   (eval $ac_try) 2>&5
20386   ac_status=$?
20387   echo "$as_me:20387: \$? = $ac_status" >&5
20388   (exit $ac_status); }; }; then
20389   ac_R_space=yes
20390 else
20391   echo "$as_me: failed program was:" >&5
20392 cat conftest.$ac_ext >&5
20393 ac_R_space=no
20394 fi
20395 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20396         if test $ac_R_space = yes; then
20397           echo "$as_me:20397: result: yes" >&5
20398 echo "${ECHO_T}yes" >&6
20399           X_LIBS="$X_LIBS -R $x_libraries"
20400         else
20401           echo "$as_me:20401: result: neither works" >&5
20402 echo "${ECHO_T}neither works" >&6
20403         fi
20404       fi
20405       LIBS=$ac_xsave_LIBS
20406     esac
20407   fi
20408
20409   # Check for system-dependent libraries X programs must link with.
20410   # Do this before checking for the system-independent R6 libraries
20411   # (-lICE), since we may need -lsocket or whatever for X linking.
20412
20413   if test "$ISC" = yes; then
20414     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
20415   else
20416     # Martyn Johnson says this is needed for Ultrix, if the X
20417     # libraries were built with DECnet support.  And Karl Berry says
20418     # the Alpha needs dnet_stub (dnet does not exist).
20419     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
20420     cat >conftest.$ac_ext <<_ACEOF
20421 #line 20421 "configure"
20422 #include "confdefs.h"
20423
20424 /* Override any gcc2 internal prototype to avoid an error.  */
20425 #ifdef __cplusplus
20426 extern "C"
20427 #endif
20428 /* We use char because int might match the return type of a gcc2
20429    builtin and then its argument prototype would still apply.  */
20430 char XOpenDisplay ();
20431 int
20432 main (void)
20433 {
20434 XOpenDisplay ();
20435   ;
20436   return 0;
20437 }
20438 _ACEOF
20439 rm -f conftest.$ac_objext conftest$ac_exeext
20440 if { (eval echo "$as_me:20440: \"$ac_link\"") >&5
20441   (eval $ac_link) 2>&5
20442   ac_status=$?
20443   echo "$as_me:20443: \$? = $ac_status" >&5
20444   (exit $ac_status); } &&
20445          { ac_try='test -s conftest$ac_exeext'
20446   { (eval echo "$as_me:20446: \"$ac_try\"") >&5
20447   (eval $ac_try) 2>&5
20448   ac_status=$?
20449   echo "$as_me:20449: \$? = $ac_status" >&5
20450   (exit $ac_status); }; }; then
20451   :
20452 else
20453   echo "$as_me: failed program was:" >&5
20454 cat conftest.$ac_ext >&5
20455 echo "$as_me:20455: checking for dnet_ntoa in -ldnet" >&5
20456 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
20457 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
20458   echo $ECHO_N "(cached) $ECHO_C" >&6
20459 else
20460   ac_check_lib_save_LIBS=$LIBS
20461 LIBS="-ldnet  $LIBS"
20462 cat >conftest.$ac_ext <<_ACEOF
20463 #line 20463 "configure"
20464 #include "confdefs.h"
20465
20466 /* Override any gcc2 internal prototype to avoid an error.  */
20467 #ifdef __cplusplus
20468 extern "C"
20469 #endif
20470 /* We use char because int might match the return type of a gcc2
20471    builtin and then its argument prototype would still apply.  */
20472 char dnet_ntoa ();
20473 int
20474 main (void)
20475 {
20476 dnet_ntoa ();
20477   ;
20478   return 0;
20479 }
20480 _ACEOF
20481 rm -f conftest.$ac_objext conftest$ac_exeext
20482 if { (eval echo "$as_me:20482: \"$ac_link\"") >&5
20483   (eval $ac_link) 2>&5
20484   ac_status=$?
20485   echo "$as_me:20485: \$? = $ac_status" >&5
20486   (exit $ac_status); } &&
20487          { ac_try='test -s conftest$ac_exeext'
20488   { (eval echo "$as_me:20488: \"$ac_try\"") >&5
20489   (eval $ac_try) 2>&5
20490   ac_status=$?
20491   echo "$as_me:20491: \$? = $ac_status" >&5
20492   (exit $ac_status); }; }; then
20493   ac_cv_lib_dnet_dnet_ntoa=yes
20494 else
20495   echo "$as_me: failed program was:" >&5
20496 cat conftest.$ac_ext >&5
20497 ac_cv_lib_dnet_dnet_ntoa=no
20498 fi
20499 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20500 LIBS=$ac_check_lib_save_LIBS
20501 fi
20502 echo "$as_me:20502: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
20503 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
20504 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
20505   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
20506 fi
20507
20508     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
20509       echo "$as_me:20509: checking for dnet_ntoa in -ldnet_stub" >&5
20510 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
20511 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
20512   echo $ECHO_N "(cached) $ECHO_C" >&6
20513 else
20514   ac_check_lib_save_LIBS=$LIBS
20515 LIBS="-ldnet_stub  $LIBS"
20516 cat >conftest.$ac_ext <<_ACEOF
20517 #line 20517 "configure"
20518 #include "confdefs.h"
20519
20520 /* Override any gcc2 internal prototype to avoid an error.  */
20521 #ifdef __cplusplus
20522 extern "C"
20523 #endif
20524 /* We use char because int might match the return type of a gcc2
20525    builtin and then its argument prototype would still apply.  */
20526 char dnet_ntoa ();
20527 int
20528 main (void)
20529 {
20530 dnet_ntoa ();
20531   ;
20532   return 0;
20533 }
20534 _ACEOF
20535 rm -f conftest.$ac_objext conftest$ac_exeext
20536 if { (eval echo "$as_me:20536: \"$ac_link\"") >&5
20537   (eval $ac_link) 2>&5
20538   ac_status=$?
20539   echo "$as_me:20539: \$? = $ac_status" >&5
20540   (exit $ac_status); } &&
20541          { ac_try='test -s conftest$ac_exeext'
20542   { (eval echo "$as_me:20542: \"$ac_try\"") >&5
20543   (eval $ac_try) 2>&5
20544   ac_status=$?
20545   echo "$as_me:20545: \$? = $ac_status" >&5
20546   (exit $ac_status); }; }; then
20547   ac_cv_lib_dnet_stub_dnet_ntoa=yes
20548 else
20549   echo "$as_me: failed program was:" >&5
20550 cat conftest.$ac_ext >&5
20551 ac_cv_lib_dnet_stub_dnet_ntoa=no
20552 fi
20553 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20554 LIBS=$ac_check_lib_save_LIBS
20555 fi
20556 echo "$as_me:20556: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
20557 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
20558 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
20559   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
20560 fi
20561
20562     fi
20563 fi
20564 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20565     LIBS="$ac_xsave_LIBS"
20566
20567     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
20568     # to get the SysV transport functions.
20569     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
20570     # needs -lnsl.
20571     # The nsl library prevents programs from opening the X display
20572     # on Irix 5.2, according to T.E. Dickey.
20573     # The functions gethostbyname, getservbyname, and inet_addr are
20574     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
20575     echo "$as_me:20575: checking for gethostbyname" >&5
20576 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
20577 if test "${ac_cv_func_gethostbyname+set}" = set; then
20578   echo $ECHO_N "(cached) $ECHO_C" >&6
20579 else
20580   cat >conftest.$ac_ext <<_ACEOF
20581 #line 20581 "configure"
20582 #include "confdefs.h"
20583 #define gethostbyname autoconf_temporary
20584 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20585 #undef gethostbyname
20586
20587 #ifdef __cplusplus
20588 extern "C"
20589 #endif
20590
20591 /* We use char because int might match the return type of a gcc2
20592    builtin and then its argument prototype would still apply.  */
20593 char gethostbyname (void);
20594
20595 int
20596 main (void)
20597 {
20598
20599 /* The GNU C library defines stubs for functions which it implements
20600     to always fail with ENOSYS.  Some functions are actually named
20601     something starting with __ and the normal name is an alias.  */
20602 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
20603 #error found stub for gethostbyname
20604 #endif
20605
20606         return gethostbyname ();
20607   ;
20608   return 0;
20609 }
20610 _ACEOF
20611 rm -f conftest.$ac_objext conftest$ac_exeext
20612 if { (eval echo "$as_me:20612: \"$ac_link\"") >&5
20613   (eval $ac_link) 2>&5
20614   ac_status=$?
20615   echo "$as_me:20615: \$? = $ac_status" >&5
20616   (exit $ac_status); } &&
20617          { ac_try='test -s conftest$ac_exeext'
20618   { (eval echo "$as_me:20618: \"$ac_try\"") >&5
20619   (eval $ac_try) 2>&5
20620   ac_status=$?
20621   echo "$as_me:20621: \$? = $ac_status" >&5
20622   (exit $ac_status); }; }; then
20623   ac_cv_func_gethostbyname=yes
20624 else
20625   echo "$as_me: failed program was:" >&5
20626 cat conftest.$ac_ext >&5
20627 ac_cv_func_gethostbyname=no
20628 fi
20629 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20630 fi
20631 echo "$as_me:20631: result: $ac_cv_func_gethostbyname" >&5
20632 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
20633
20634     if test $ac_cv_func_gethostbyname = no; then
20635       echo "$as_me:20635: checking for gethostbyname in -lnsl" >&5
20636 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
20637 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
20638   echo $ECHO_N "(cached) $ECHO_C" >&6
20639 else
20640   ac_check_lib_save_LIBS=$LIBS
20641 LIBS="-lnsl  $LIBS"
20642 cat >conftest.$ac_ext <<_ACEOF
20643 #line 20643 "configure"
20644 #include "confdefs.h"
20645
20646 /* Override any gcc2 internal prototype to avoid an error.  */
20647 #ifdef __cplusplus
20648 extern "C"
20649 #endif
20650 /* We use char because int might match the return type of a gcc2
20651    builtin and then its argument prototype would still apply.  */
20652 char gethostbyname ();
20653 int
20654 main (void)
20655 {
20656 gethostbyname ();
20657   ;
20658   return 0;
20659 }
20660 _ACEOF
20661 rm -f conftest.$ac_objext conftest$ac_exeext
20662 if { (eval echo "$as_me:20662: \"$ac_link\"") >&5
20663   (eval $ac_link) 2>&5
20664   ac_status=$?
20665   echo "$as_me:20665: \$? = $ac_status" >&5
20666   (exit $ac_status); } &&
20667          { ac_try='test -s conftest$ac_exeext'
20668   { (eval echo "$as_me:20668: \"$ac_try\"") >&5
20669   (eval $ac_try) 2>&5
20670   ac_status=$?
20671   echo "$as_me:20671: \$? = $ac_status" >&5
20672   (exit $ac_status); }; }; then
20673   ac_cv_lib_nsl_gethostbyname=yes
20674 else
20675   echo "$as_me: failed program was:" >&5
20676 cat conftest.$ac_ext >&5
20677 ac_cv_lib_nsl_gethostbyname=no
20678 fi
20679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20680 LIBS=$ac_check_lib_save_LIBS
20681 fi
20682 echo "$as_me:20682: result: $ac_cv_lib_nsl_gethostbyname" >&5
20683 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
20684 if test $ac_cv_lib_nsl_gethostbyname = yes; then
20685   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
20686 fi
20687
20688       if test $ac_cv_lib_nsl_gethostbyname = no; then
20689         echo "$as_me:20689: checking for gethostbyname in -lbsd" >&5
20690 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
20691 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
20692   echo $ECHO_N "(cached) $ECHO_C" >&6
20693 else
20694   ac_check_lib_save_LIBS=$LIBS
20695 LIBS="-lbsd  $LIBS"
20696 cat >conftest.$ac_ext <<_ACEOF
20697 #line 20697 "configure"
20698 #include "confdefs.h"
20699
20700 /* Override any gcc2 internal prototype to avoid an error.  */
20701 #ifdef __cplusplus
20702 extern "C"
20703 #endif
20704 /* We use char because int might match the return type of a gcc2
20705    builtin and then its argument prototype would still apply.  */
20706 char gethostbyname ();
20707 int
20708 main (void)
20709 {
20710 gethostbyname ();
20711   ;
20712   return 0;
20713 }
20714 _ACEOF
20715 rm -f conftest.$ac_objext conftest$ac_exeext
20716 if { (eval echo "$as_me:20716: \"$ac_link\"") >&5
20717   (eval $ac_link) 2>&5
20718   ac_status=$?
20719   echo "$as_me:20719: \$? = $ac_status" >&5
20720   (exit $ac_status); } &&
20721          { ac_try='test -s conftest$ac_exeext'
20722   { (eval echo "$as_me:20722: \"$ac_try\"") >&5
20723   (eval $ac_try) 2>&5
20724   ac_status=$?
20725   echo "$as_me:20725: \$? = $ac_status" >&5
20726   (exit $ac_status); }; }; then
20727   ac_cv_lib_bsd_gethostbyname=yes
20728 else
20729   echo "$as_me: failed program was:" >&5
20730 cat conftest.$ac_ext >&5
20731 ac_cv_lib_bsd_gethostbyname=no
20732 fi
20733 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20734 LIBS=$ac_check_lib_save_LIBS
20735 fi
20736 echo "$as_me:20736: result: $ac_cv_lib_bsd_gethostbyname" >&5
20737 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
20738 if test $ac_cv_lib_bsd_gethostbyname = yes; then
20739   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
20740 fi
20741
20742       fi
20743     fi
20744
20745     # lieder@skyler.mavd.honeywell.com says without -lsocket,
20746     # socket/setsockopt and other routines are undefined under SCO ODT
20747     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
20748     # on later versions), says Simon Leinen: it contains gethostby*
20749     # variants that don't use the nameserver (or something).  -lsocket
20750     # must be given before -lnsl if both are needed.  We assume that
20751     # if connect needs -lnsl, so does gethostbyname.
20752     echo "$as_me:20752: checking for connect" >&5
20753 echo $ECHO_N "checking for connect... $ECHO_C" >&6
20754 if test "${ac_cv_func_connect+set}" = set; then
20755   echo $ECHO_N "(cached) $ECHO_C" >&6
20756 else
20757   cat >conftest.$ac_ext <<_ACEOF
20758 #line 20758 "configure"
20759 #include "confdefs.h"
20760 #define connect autoconf_temporary
20761 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20762 #undef connect
20763
20764 #ifdef __cplusplus
20765 extern "C"
20766 #endif
20767
20768 /* We use char because int might match the return type of a gcc2
20769    builtin and then its argument prototype would still apply.  */
20770 char connect (void);
20771
20772 int
20773 main (void)
20774 {
20775
20776 /* The GNU C library defines stubs for functions which it implements
20777     to always fail with ENOSYS.  Some functions are actually named
20778     something starting with __ and the normal name is an alias.  */
20779 #if defined (__stub_connect) || defined (__stub___connect)
20780 #error found stub for connect
20781 #endif
20782
20783         return connect ();
20784   ;
20785   return 0;
20786 }
20787 _ACEOF
20788 rm -f conftest.$ac_objext conftest$ac_exeext
20789 if { (eval echo "$as_me:20789: \"$ac_link\"") >&5
20790   (eval $ac_link) 2>&5
20791   ac_status=$?
20792   echo "$as_me:20792: \$? = $ac_status" >&5
20793   (exit $ac_status); } &&
20794          { ac_try='test -s conftest$ac_exeext'
20795   { (eval echo "$as_me:20795: \"$ac_try\"") >&5
20796   (eval $ac_try) 2>&5
20797   ac_status=$?
20798   echo "$as_me:20798: \$? = $ac_status" >&5
20799   (exit $ac_status); }; }; then
20800   ac_cv_func_connect=yes
20801 else
20802   echo "$as_me: failed program was:" >&5
20803 cat conftest.$ac_ext >&5
20804 ac_cv_func_connect=no
20805 fi
20806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20807 fi
20808 echo "$as_me:20808: result: $ac_cv_func_connect" >&5
20809 echo "${ECHO_T}$ac_cv_func_connect" >&6
20810
20811     if test $ac_cv_func_connect = no; then
20812       echo "$as_me:20812: checking for connect in -lsocket" >&5
20813 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
20814 if test "${ac_cv_lib_socket_connect+set}" = set; then
20815   echo $ECHO_N "(cached) $ECHO_C" >&6
20816 else
20817   ac_check_lib_save_LIBS=$LIBS
20818 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
20819 cat >conftest.$ac_ext <<_ACEOF
20820 #line 20820 "configure"
20821 #include "confdefs.h"
20822
20823 /* Override any gcc2 internal prototype to avoid an error.  */
20824 #ifdef __cplusplus
20825 extern "C"
20826 #endif
20827 /* We use char because int might match the return type of a gcc2
20828    builtin and then its argument prototype would still apply.  */
20829 char connect ();
20830 int
20831 main (void)
20832 {
20833 connect ();
20834   ;
20835   return 0;
20836 }
20837 _ACEOF
20838 rm -f conftest.$ac_objext conftest$ac_exeext
20839 if { (eval echo "$as_me:20839: \"$ac_link\"") >&5
20840   (eval $ac_link) 2>&5
20841   ac_status=$?
20842   echo "$as_me:20842: \$? = $ac_status" >&5
20843   (exit $ac_status); } &&
20844          { ac_try='test -s conftest$ac_exeext'
20845   { (eval echo "$as_me:20845: \"$ac_try\"") >&5
20846   (eval $ac_try) 2>&5
20847   ac_status=$?
20848   echo "$as_me:20848: \$? = $ac_status" >&5
20849   (exit $ac_status); }; }; then
20850   ac_cv_lib_socket_connect=yes
20851 else
20852   echo "$as_me: failed program was:" >&5
20853 cat conftest.$ac_ext >&5
20854 ac_cv_lib_socket_connect=no
20855 fi
20856 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20857 LIBS=$ac_check_lib_save_LIBS
20858 fi
20859 echo "$as_me:20859: result: $ac_cv_lib_socket_connect" >&5
20860 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
20861 if test $ac_cv_lib_socket_connect = yes; then
20862   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
20863 fi
20864
20865     fi
20866
20867     # Guillermo Gomez says -lposix is necessary on A/UX.
20868     echo "$as_me:20868: checking for remove" >&5
20869 echo $ECHO_N "checking for remove... $ECHO_C" >&6
20870 if test "${ac_cv_func_remove+set}" = set; then
20871   echo $ECHO_N "(cached) $ECHO_C" >&6
20872 else
20873   cat >conftest.$ac_ext <<_ACEOF
20874 #line 20874 "configure"
20875 #include "confdefs.h"
20876 #define remove autoconf_temporary
20877 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20878 #undef remove
20879
20880 #ifdef __cplusplus
20881 extern "C"
20882 #endif
20883
20884 /* We use char because int might match the return type of a gcc2
20885    builtin and then its argument prototype would still apply.  */
20886 char remove (void);
20887
20888 int
20889 main (void)
20890 {
20891
20892 /* The GNU C library defines stubs for functions which it implements
20893     to always fail with ENOSYS.  Some functions are actually named
20894     something starting with __ and the normal name is an alias.  */
20895 #if defined (__stub_remove) || defined (__stub___remove)
20896 #error found stub for remove
20897 #endif
20898
20899         return remove ();
20900   ;
20901   return 0;
20902 }
20903 _ACEOF
20904 rm -f conftest.$ac_objext conftest$ac_exeext
20905 if { (eval echo "$as_me:20905: \"$ac_link\"") >&5
20906   (eval $ac_link) 2>&5
20907   ac_status=$?
20908   echo "$as_me:20908: \$? = $ac_status" >&5
20909   (exit $ac_status); } &&
20910          { ac_try='test -s conftest$ac_exeext'
20911   { (eval echo "$as_me:20911: \"$ac_try\"") >&5
20912   (eval $ac_try) 2>&5
20913   ac_status=$?
20914   echo "$as_me:20914: \$? = $ac_status" >&5
20915   (exit $ac_status); }; }; then
20916   ac_cv_func_remove=yes
20917 else
20918   echo "$as_me: failed program was:" >&5
20919 cat conftest.$ac_ext >&5
20920 ac_cv_func_remove=no
20921 fi
20922 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20923 fi
20924 echo "$as_me:20924: result: $ac_cv_func_remove" >&5
20925 echo "${ECHO_T}$ac_cv_func_remove" >&6
20926
20927     if test $ac_cv_func_remove = no; then
20928       echo "$as_me:20928: checking for remove in -lposix" >&5
20929 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
20930 if test "${ac_cv_lib_posix_remove+set}" = set; then
20931   echo $ECHO_N "(cached) $ECHO_C" >&6
20932 else
20933   ac_check_lib_save_LIBS=$LIBS
20934 LIBS="-lposix  $LIBS"
20935 cat >conftest.$ac_ext <<_ACEOF
20936 #line 20936 "configure"
20937 #include "confdefs.h"
20938
20939 /* Override any gcc2 internal prototype to avoid an error.  */
20940 #ifdef __cplusplus
20941 extern "C"
20942 #endif
20943 /* We use char because int might match the return type of a gcc2
20944    builtin and then its argument prototype would still apply.  */
20945 char remove ();
20946 int
20947 main (void)
20948 {
20949 remove ();
20950   ;
20951   return 0;
20952 }
20953 _ACEOF
20954 rm -f conftest.$ac_objext conftest$ac_exeext
20955 if { (eval echo "$as_me:20955: \"$ac_link\"") >&5
20956   (eval $ac_link) 2>&5
20957   ac_status=$?
20958   echo "$as_me:20958: \$? = $ac_status" >&5
20959   (exit $ac_status); } &&
20960          { ac_try='test -s conftest$ac_exeext'
20961   { (eval echo "$as_me:20961: \"$ac_try\"") >&5
20962   (eval $ac_try) 2>&5
20963   ac_status=$?
20964   echo "$as_me:20964: \$? = $ac_status" >&5
20965   (exit $ac_status); }; }; then
20966   ac_cv_lib_posix_remove=yes
20967 else
20968   echo "$as_me: failed program was:" >&5
20969 cat conftest.$ac_ext >&5
20970 ac_cv_lib_posix_remove=no
20971 fi
20972 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20973 LIBS=$ac_check_lib_save_LIBS
20974 fi
20975 echo "$as_me:20975: result: $ac_cv_lib_posix_remove" >&5
20976 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
20977 if test $ac_cv_lib_posix_remove = yes; then
20978   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
20979 fi
20980
20981     fi
20982
20983     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
20984     echo "$as_me:20984: checking for shmat" >&5
20985 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
20986 if test "${ac_cv_func_shmat+set}" = set; then
20987   echo $ECHO_N "(cached) $ECHO_C" >&6
20988 else
20989   cat >conftest.$ac_ext <<_ACEOF
20990 #line 20990 "configure"
20991 #include "confdefs.h"
20992 #define shmat autoconf_temporary
20993 #include <limits.h>     /* least-intrusive standard header which defines gcc2 __stub macros */
20994 #undef shmat
20995
20996 #ifdef __cplusplus
20997 extern "C"
20998 #endif
20999
21000 /* We use char because int might match the return type of a gcc2
21001    builtin and then its argument prototype would still apply.  */
21002 char shmat (void);
21003
21004 int
21005 main (void)
21006 {
21007
21008 /* The GNU C library defines stubs for functions which it implements
21009     to always fail with ENOSYS.  Some functions are actually named
21010     something starting with __ and the normal name is an alias.  */
21011 #if defined (__stub_shmat) || defined (__stub___shmat)
21012 #error found stub for shmat
21013 #endif
21014
21015         return shmat ();
21016   ;
21017   return 0;
21018 }
21019 _ACEOF
21020 rm -f conftest.$ac_objext conftest$ac_exeext
21021 if { (eval echo "$as_me:21021: \"$ac_link\"") >&5
21022   (eval $ac_link) 2>&5
21023   ac_status=$?
21024   echo "$as_me:21024: \$? = $ac_status" >&5
21025   (exit $ac_status); } &&
21026          { ac_try='test -s conftest$ac_exeext'
21027   { (eval echo "$as_me:21027: \"$ac_try\"") >&5
21028   (eval $ac_try) 2>&5
21029   ac_status=$?
21030   echo "$as_me:21030: \$? = $ac_status" >&5
21031   (exit $ac_status); }; }; then
21032   ac_cv_func_shmat=yes
21033 else
21034   echo "$as_me: failed program was:" >&5
21035 cat conftest.$ac_ext >&5
21036 ac_cv_func_shmat=no
21037 fi
21038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21039 fi
21040 echo "$as_me:21040: result: $ac_cv_func_shmat" >&5
21041 echo "${ECHO_T}$ac_cv_func_shmat" >&6
21042
21043     if test $ac_cv_func_shmat = no; then
21044       echo "$as_me:21044: checking for shmat in -lipc" >&5
21045 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
21046 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
21047   echo $ECHO_N "(cached) $ECHO_C" >&6
21048 else
21049   ac_check_lib_save_LIBS=$LIBS
21050 LIBS="-lipc  $LIBS"
21051 cat >conftest.$ac_ext <<_ACEOF
21052 #line 21052 "configure"
21053 #include "confdefs.h"
21054
21055 /* Override any gcc2 internal prototype to avoid an error.  */
21056 #ifdef __cplusplus
21057 extern "C"
21058 #endif
21059 /* We use char because int might match the return type of a gcc2
21060    builtin and then its argument prototype would still apply.  */
21061 char shmat ();
21062 int
21063 main (void)
21064 {
21065 shmat ();
21066   ;
21067   return 0;
21068 }
21069 _ACEOF
21070 rm -f conftest.$ac_objext conftest$ac_exeext
21071 if { (eval echo "$as_me:21071: \"$ac_link\"") >&5
21072   (eval $ac_link) 2>&5
21073   ac_status=$?
21074   echo "$as_me:21074: \$? = $ac_status" >&5
21075   (exit $ac_status); } &&
21076          { ac_try='test -s conftest$ac_exeext'
21077   { (eval echo "$as_me:21077: \"$ac_try\"") >&5
21078   (eval $ac_try) 2>&5
21079   ac_status=$?
21080   echo "$as_me:21080: \$? = $ac_status" >&5
21081   (exit $ac_status); }; }; then
21082   ac_cv_lib_ipc_shmat=yes
21083 else
21084   echo "$as_me: failed program was:" >&5
21085 cat conftest.$ac_ext >&5
21086 ac_cv_lib_ipc_shmat=no
21087 fi
21088 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21089 LIBS=$ac_check_lib_save_LIBS
21090 fi
21091 echo "$as_me:21091: result: $ac_cv_lib_ipc_shmat" >&5
21092 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
21093 if test $ac_cv_lib_ipc_shmat = yes; then
21094   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
21095 fi
21096
21097     fi
21098   fi
21099
21100   # Check for libraries that X11R6 Xt/Xaw programs need.
21101   ac_save_LDFLAGS=$LDFLAGS
21102   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
21103   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
21104   # check for ICE first), but we must link in the order -lSM -lICE or
21105   # we get undefined symbols.  So assume we have SM if we have ICE.
21106   # These have to be linked with before -lX11, unlike the other
21107   # libraries we check for below, so use a different variable.
21108   # John Interrante, Karl Berry
21109   echo "$as_me:21109: checking for IceConnectionNumber in -lICE" >&5
21110 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
21111 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
21112   echo $ECHO_N "(cached) $ECHO_C" >&6
21113 else
21114   ac_check_lib_save_LIBS=$LIBS
21115 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
21116 cat >conftest.$ac_ext <<_ACEOF
21117 #line 21117 "configure"
21118 #include "confdefs.h"
21119
21120 /* Override any gcc2 internal prototype to avoid an error.  */
21121 #ifdef __cplusplus
21122 extern "C"
21123 #endif
21124 /* We use char because int might match the return type of a gcc2
21125    builtin and then its argument prototype would still apply.  */
21126 char IceConnectionNumber ();
21127 int
21128 main (void)
21129 {
21130 IceConnectionNumber ();
21131   ;
21132   return 0;
21133 }
21134 _ACEOF
21135 rm -f conftest.$ac_objext conftest$ac_exeext
21136 if { (eval echo "$as_me:21136: \"$ac_link\"") >&5
21137   (eval $ac_link) 2>&5
21138   ac_status=$?
21139   echo "$as_me:21139: \$? = $ac_status" >&5
21140   (exit $ac_status); } &&
21141          { ac_try='test -s conftest$ac_exeext'
21142   { (eval echo "$as_me:21142: \"$ac_try\"") >&5
21143   (eval $ac_try) 2>&5
21144   ac_status=$?
21145   echo "$as_me:21145: \$? = $ac_status" >&5
21146   (exit $ac_status); }; }; then
21147   ac_cv_lib_ICE_IceConnectionNumber=yes
21148 else
21149   echo "$as_me: failed program was:" >&5
21150 cat conftest.$ac_ext >&5
21151 ac_cv_lib_ICE_IceConnectionNumber=no
21152 fi
21153 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21154 LIBS=$ac_check_lib_save_LIBS
21155 fi
21156 echo "$as_me:21156: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
21157 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
21158 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
21159   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
21160 fi
21161
21162   LDFLAGS=$ac_save_LDFLAGS
21163
21164 fi
21165
21166 fi
21167
21168 if ( test "$GCC" = yes || test "$GXX" = yes )
21169 then
21170
21171 if ( test "$GCC" = yes || test "$GXX" = yes )
21172 then
21173         case $CFLAGS in
21174         (*-Werror=*)
21175                 test -n "$verbose" && echo "    repairing CFLAGS: $CFLAGS" 1>&6
21176
21177 echo "${as_me:-configure}:21177: testing repairing CFLAGS: $CFLAGS ..." 1>&5
21178
21179                 cf_temp_flags=
21180                 for cf_temp_scan in $CFLAGS
21181                 do
21182                         case "x$cf_temp_scan" in
21183                         (x-Werror=*)
21184
21185         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21186         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21187
21188                                 ;;
21189                         (*)
21190
21191         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21192         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21193
21194                                 ;;
21195                         esac
21196                 done
21197                 CFLAGS="$cf_temp_flags"
21198                 test -n "$verbose" && echo "    ... fixed $CFLAGS" 1>&6
21199
21200 echo "${as_me:-configure}:21200: testing ... fixed $CFLAGS ..." 1>&5
21201
21202                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21203
21204 echo "${as_me:-configure}:21204: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21205
21206                 ;;
21207         esac
21208 fi
21209
21210 if ( test "$GCC" = yes || test "$GXX" = yes )
21211 then
21212         case $CPPFLAGS in
21213         (*-Werror=*)
21214                 test -n "$verbose" && echo "    repairing CPPFLAGS: $CPPFLAGS" 1>&6
21215
21216 echo "${as_me:-configure}:21216: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5
21217
21218                 cf_temp_flags=
21219                 for cf_temp_scan in $CPPFLAGS
21220                 do
21221                         case "x$cf_temp_scan" in
21222                         (x-Werror=*)
21223
21224         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21225         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21226
21227                                 ;;
21228                         (*)
21229
21230         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21231         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21232
21233                                 ;;
21234                         esac
21235                 done
21236                 CPPFLAGS="$cf_temp_flags"
21237                 test -n "$verbose" && echo "    ... fixed $CPPFLAGS" 1>&6
21238
21239 echo "${as_me:-configure}:21239: testing ... fixed $CPPFLAGS ..." 1>&5
21240
21241                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21242
21243 echo "${as_me:-configure}:21243: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21244
21245                 ;;
21246         esac
21247 fi
21248
21249 if ( test "$GCC" = yes || test "$GXX" = yes )
21250 then
21251         case $LDFLAGS in
21252         (*-Werror=*)
21253                 test -n "$verbose" && echo "    repairing LDFLAGS: $LDFLAGS" 1>&6
21254
21255 echo "${as_me:-configure}:21255: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5
21256
21257                 cf_temp_flags=
21258                 for cf_temp_scan in $LDFLAGS
21259                 do
21260                         case "x$cf_temp_scan" in
21261                         (x-Werror=*)
21262
21263         test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS "
21264         EXTRA_CFLAGS="${EXTRA_CFLAGS}"$cf_temp_scan""
21265
21266                                 ;;
21267                         (*)
21268
21269         test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags "
21270         cf_temp_flags="${cf_temp_flags}"$cf_temp_scan""
21271
21272                                 ;;
21273                         esac
21274                 done
21275                 LDFLAGS="$cf_temp_flags"
21276                 test -n "$verbose" && echo "    ... fixed $LDFLAGS" 1>&6
21277
21278 echo "${as_me:-configure}:21278: testing ... fixed $LDFLAGS ..." 1>&5
21279
21280                 test -n "$verbose" && echo "    ... extra $EXTRA_CFLAGS" 1>&6
21281
21282 echo "${as_me:-configure}:21282: testing ... extra $EXTRA_CFLAGS ..." 1>&5
21283
21284                 ;;
21285         esac
21286 fi
21287
21288 echo "$as_me:21288: checking if you want to turn on gcc warnings" >&5
21289 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
21290
21291 # Check whether --enable-warnings or --disable-warnings was given.
21292 if test "${enable_warnings+set}" = set; then
21293   enableval="$enable_warnings"
21294   test "$enableval" != yes && enableval=no
21295         if test "$enableval" != "no" ; then
21296     with_warnings=yes
21297         else
21298                 with_warnings=no
21299         fi
21300 else
21301   enableval=no
21302         with_warnings=no
21303
21304 fi;
21305 echo "$as_me:21305: result: $with_warnings" >&5
21306 echo "${ECHO_T}$with_warnings" >&6
21307 if test "$with_warnings" = "yes"
21308 then
21309
21310 if ( test "$GCC" = yes || test "$GXX" = yes )
21311 then
21312 cat > conftest.i <<EOF
21313 #ifndef GCC_PRINTF
21314 #define GCC_PRINTF 0
21315 #endif
21316 #ifndef GCC_SCANF
21317 #define GCC_SCANF 0
21318 #endif
21319 #ifndef GCC_NORETURN
21320 #define GCC_NORETURN /* nothing */
21321 #endif
21322 #ifndef GCC_UNUSED
21323 #define GCC_UNUSED /* nothing */
21324 #endif
21325 EOF
21326 if test "$GCC" = yes
21327 then
21328         { echo "$as_me:21328: checking for $CC __attribute__ directives..." >&5
21329 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
21330 cat > conftest.$ac_ext <<EOF
21331 #line 21331 "${as_me:-configure}"
21332 #include "confdefs.h"
21333 #include "conftest.h"
21334 #include "conftest.i"
21335 #if     GCC_PRINTF
21336 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
21337 #else
21338 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
21339 #endif
21340 #if     GCC_SCANF
21341 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
21342 #else
21343 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
21344 #endif
21345 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
21346 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
21347 extern void foo(void) GCC_NORETURN;
21348 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; }
21349 EOF
21350         cf_printf_attribute=no
21351         cf_scanf_attribute=no
21352         for cf_attribute in scanf printf unused noreturn
21353         do
21354
21355 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
21356
21357                 cf_directive="__attribute__(($cf_attribute))"
21358                 echo "checking for $CC $cf_directive" 1>&5
21359
21360                 case $cf_attribute in
21361                 (printf)
21362                         cf_printf_attribute=yes
21363                         cat >conftest.h <<EOF
21364 #define GCC_$cf_ATTRIBUTE 1
21365 EOF
21366                         ;;
21367                 (scanf)
21368                         cf_scanf_attribute=yes
21369                         cat >conftest.h <<EOF
21370 #define GCC_$cf_ATTRIBUTE 1
21371 EOF
21372                         ;;
21373                 (*)
21374                         cat >conftest.h <<EOF
21375 #define GCC_$cf_ATTRIBUTE $cf_directive
21376 EOF
21377                         ;;
21378                 esac
21379
21380                 if { (eval echo "$as_me:21380: \"$ac_compile\"") >&5
21381   (eval $ac_compile) 2>&5
21382   ac_status=$?
21383   echo "$as_me:21383: \$? = $ac_status" >&5
21384   (exit $ac_status); }; then
21385                         test -n "$verbose" && echo "$as_me:21385: result: ... $cf_attribute" >&5
21386 echo "${ECHO_T}... $cf_attribute" >&6
21387                         cat conftest.h >>confdefs.h
21388                         case $cf_attribute in
21389                         (noreturn)
21390
21391 cat >>confdefs.h <<EOF
21392 #define GCC_NORETURN $cf_directive
21393 EOF
21394
21395                                 ;;
21396                         (printf)
21397                                 cf_value='/* nothing */'
21398                                 if test "$cf_printf_attribute" != no ; then
21399                                         cf_value='__attribute__((format(printf,fmt,var)))'
21400
21401 cat >>confdefs.h <<\EOF
21402 #define GCC_PRINTF 1
21403 EOF
21404
21405                                 fi
21406
21407 cat >>confdefs.h <<EOF
21408 #define GCC_PRINTFLIKE(fmt,var) $cf_value
21409 EOF
21410
21411                                 ;;
21412                         (scanf)
21413                                 cf_value='/* nothing */'
21414                                 if test "$cf_scanf_attribute" != no ; then
21415                                         cf_value='__attribute__((format(scanf,fmt,var)))'
21416
21417 cat >>confdefs.h <<\EOF
21418 #define GCC_SCANF 1
21419 EOF
21420
21421                                 fi
21422
21423 cat >>confdefs.h <<EOF
21424 #define GCC_SCANFLIKE(fmt,var) $cf_value
21425 EOF
21426
21427                                 ;;
21428                         (unused)
21429
21430 cat >>confdefs.h <<EOF
21431 #define GCC_UNUSED $cf_directive
21432 EOF
21433
21434                                 ;;
21435                         esac
21436                 fi
21437         done
21438 else
21439         fgrep define conftest.i >>confdefs.h
21440 fi
21441 rm -rf conftest*
21442 fi
21443
21444 if test "x$have_x" = xyes; then
21445
21446 cf_save_LIBS_CF_CONST_X_STRING="$LIBS"
21447 cf_save_CFLAGS_CF_CONST_X_STRING="$CFLAGS"
21448 cf_save_CPPFLAGS_CF_CONST_X_STRING="$CPPFLAGS"
21449 LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}"
21450 for cf_X_CFLAGS in $X_CFLAGS
21451 do
21452         case "x$cf_X_CFLAGS" in
21453         x-[IUD]*)
21454                 CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS"
21455                 ;;
21456         *)
21457                 CFLAGS="$CFLAGS $cf_X_CFLAGS"
21458                 ;;
21459         esac
21460 done
21461
21462 cat >conftest.$ac_ext <<_ACEOF
21463 #line 21463 "configure"
21464 #include "confdefs.h"
21465
21466 #include <stdlib.h>
21467 #include <X11/Intrinsic.h>
21468
21469 int
21470 main (void)
21471 {
21472 String foo = malloc(1); (void)foo
21473   ;
21474   return 0;
21475 }
21476 _ACEOF
21477 rm -f conftest.$ac_objext
21478 if { (eval echo "$as_me:21478: \"$ac_compile\"") >&5
21479   (eval $ac_compile) 2>&5
21480   ac_status=$?
21481   echo "$as_me:21481: \$? = $ac_status" >&5
21482   (exit $ac_status); } &&
21483          { ac_try='test -s conftest.$ac_objext'
21484   { (eval echo "$as_me:21484: \"$ac_try\"") >&5
21485   (eval $ac_try) 2>&5
21486   ac_status=$?
21487   echo "$as_me:21487: \$? = $ac_status" >&5
21488   (exit $ac_status); }; }; then
21489
21490 echo "$as_me:21490: checking for X11/Xt const-feature" >&5
21491 echo $ECHO_N "checking for X11/Xt const-feature... $ECHO_C" >&6
21492 if test "${cf_cv_const_x_string+set}" = set; then
21493   echo $ECHO_N "(cached) $ECHO_C" >&6
21494 else
21495
21496         cat >conftest.$ac_ext <<_ACEOF
21497 #line 21497 "configure"
21498 #include "confdefs.h"
21499
21500 #define _CONST_X_STRING /* X11R7.8 (perhaps) */
21501 #undef  XTSTRINGDEFINES /* X11R5 and later */
21502 #include <stdlib.h>
21503 #include <X11/Intrinsic.h>
21504
21505 int
21506 main (void)
21507 {
21508 String foo = malloc(1); *foo = 0
21509   ;
21510   return 0;
21511 }
21512 _ACEOF
21513 rm -f conftest.$ac_objext
21514 if { (eval echo "$as_me:21514: \"$ac_compile\"") >&5
21515   (eval $ac_compile) 2>&5
21516   ac_status=$?
21517   echo "$as_me:21517: \$? = $ac_status" >&5
21518   (exit $ac_status); } &&
21519          { ac_try='test -s conftest.$ac_objext'
21520   { (eval echo "$as_me:21520: \"$ac_try\"") >&5
21521   (eval $ac_try) 2>&5
21522   ac_status=$?
21523   echo "$as_me:21523: \$? = $ac_status" >&5
21524   (exit $ac_status); }; }; then
21525
21526                         cf_cv_const_x_string=no
21527
21528 else
21529   echo "$as_me: failed program was:" >&5
21530 cat conftest.$ac_ext >&5
21531
21532                         cf_cv_const_x_string=yes
21533
21534 fi
21535 rm -f conftest.$ac_objext conftest.$ac_ext
21536
21537 fi
21538 echo "$as_me:21538: result: $cf_cv_const_x_string" >&5
21539 echo "${ECHO_T}$cf_cv_const_x_string" >&6
21540
21541 LIBS="$cf_save_LIBS_CF_CONST_X_STRING"
21542 CFLAGS="$cf_save_CFLAGS_CF_CONST_X_STRING"
21543 CPPFLAGS="$cf_save_CPPFLAGS_CF_CONST_X_STRING"
21544
21545 case $cf_cv_const_x_string in
21546 (no)
21547
21548         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21549         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
21550
21551         ;;
21552 (*)
21553
21554         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21555         CPPFLAGS="${CPPFLAGS}-D_CONST_X_STRING"
21556
21557         ;;
21558 esac
21559
21560 else
21561   echo "$as_me: failed program was:" >&5
21562 cat conftest.$ac_ext >&5
21563 fi
21564 rm -f conftest.$ac_objext conftest.$ac_ext
21565  fi
21566 cat > conftest.$ac_ext <<EOF
21567 #line 21567 "${as_me:-configure}"
21568 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
21569 EOF
21570 if test "$INTEL_COMPILER" = yes
21571 then
21572 # The "-wdXXX" options suppress warnings:
21573 # remark #1419: external declaration in primary source file
21574 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
21575 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
21576 # remark #193: zero used for undefined preprocessing identifier
21577 # remark #593: variable "curs_sb_left_arrow" was set but never used
21578 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
21579 # remark #869: parameter "tw" was never referenced
21580 # remark #981: operands are evaluated in unspecified order
21581 # warning #279: controlling expression is constant
21582
21583         { echo "$as_me:21583: checking for $CC warning options..." >&5
21584 echo "$as_me: checking for $CC warning options..." >&6;}
21585         cf_save_CFLAGS="$CFLAGS"
21586         EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall"
21587         for cf_opt in \
21588                 wd1419 \
21589                 wd1683 \
21590                 wd1684 \
21591                 wd193 \
21592                 wd593 \
21593                 wd279 \
21594                 wd810 \
21595                 wd869 \
21596                 wd981
21597         do
21598                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21599                 if { (eval echo "$as_me:21599: \"$ac_compile\"") >&5
21600   (eval $ac_compile) 2>&5
21601   ac_status=$?
21602   echo "$as_me:21602: \$? = $ac_status" >&5
21603   (exit $ac_status); }; then
21604                         test -n "$verbose" && echo "$as_me:21604: result: ... -$cf_opt" >&5
21605 echo "${ECHO_T}... -$cf_opt" >&6
21606                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21607                 fi
21608         done
21609         CFLAGS="$cf_save_CFLAGS"
21610 elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown"
21611 then
21612         { echo "$as_me:21612: checking for $CC warning options..." >&5
21613 echo "$as_me: checking for $CC warning options..." >&6;}
21614         cf_save_CFLAGS="$CFLAGS"
21615         cf_warn_CONST=""
21616         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
21617         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
21618         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
21619         for cf_opt in W Wall \
21620                 Wbad-function-cast \
21621                 Wcast-align \
21622                 Wcast-qual \
21623                 Wdeclaration-after-statement \
21624                 Wextra \
21625                 Winline \
21626                 Wmissing-declarations \
21627                 Wmissing-prototypes \
21628                 Wnested-externs \
21629                 Wpointer-arith \
21630                 Wshadow \
21631                 Wstrict-prototypes \
21632                 Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
21633         do
21634                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
21635                 if { (eval echo "$as_me:21635: \"$ac_compile\"") >&5
21636   (eval $ac_compile) 2>&5
21637   ac_status=$?
21638   echo "$as_me:21638: \$? = $ac_status" >&5
21639   (exit $ac_status); }; then
21640                         test -n "$verbose" && echo "$as_me:21640: result: ... -$cf_opt" >&5
21641 echo "${ECHO_T}... -$cf_opt" >&6
21642                         case $cf_opt in
21643                         (Winline)
21644                                 case $GCC_VERSION in
21645                                 ([34].*)
21646                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21647
21648 echo "${as_me:-configure}:21648: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21649
21650                                         continue;;
21651                                 esac
21652                                 ;;
21653                         (Wpointer-arith)
21654                                 case $GCC_VERSION in
21655                                 ([12].*)
21656                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
21657
21658 echo "${as_me:-configure}:21658: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
21659
21660                                         continue;;
21661                                 esac
21662                                 ;;
21663                         esac
21664                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
21665                 fi
21666         done
21667         CFLAGS="$cf_save_CFLAGS"
21668 fi
21669 rm -rf conftest*
21670
21671 fi
21672
21673 fi
21674
21675 echo "$as_me:21675: checking if you want to use dmalloc for testing" >&5
21676 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
21677
21678 # Check whether --with-dmalloc or --without-dmalloc was given.
21679 if test "${with_dmalloc+set}" = set; then
21680   withval="$with_dmalloc"
21681
21682 cat >>confdefs.h <<EOF
21683 #define USE_DMALLOC 1
21684 EOF
21685
21686         : ${with_cflags:=-g}
21687         : ${with_no_leaks:=yes}
21688          with_dmalloc=yes
21689 else
21690   with_dmalloc=
21691 fi;
21692 echo "$as_me:21692: result: ${with_dmalloc:-no}" >&5
21693 echo "${ECHO_T}${with_dmalloc:-no}" >&6
21694
21695 case .$with_cflags in
21696 (.*-g*)
21697         case .$CFLAGS in
21698         (.*-g*)
21699                 ;;
21700         (*)
21701
21702 cf_fix_cppflags=no
21703 cf_new_cflags=
21704 cf_new_cppflags=
21705 cf_new_extra_cppflags=
21706
21707 for cf_add_cflags in -g
21708 do
21709 case $cf_fix_cppflags in
21710 (no)
21711         case $cf_add_cflags in
21712         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21713                 case $cf_add_cflags in
21714                 (-D*)
21715                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21716
21717                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21718                                 && test -z "${cf_tst_cflags}" \
21719                                 && cf_fix_cppflags=yes
21720
21721                         if test $cf_fix_cppflags = yes ; then
21722
21723         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21724         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21725
21726                                 continue
21727                         elif test "${cf_tst_cflags}" = "\"'" ; then
21728
21729         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21730         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21731
21732                                 continue
21733                         fi
21734                         ;;
21735                 esac
21736                 case "$CPPFLAGS" in
21737                 (*$cf_add_cflags)
21738                         ;;
21739                 (*)
21740                         case $cf_add_cflags in
21741                         (-D*)
21742                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21743
21744 CPPFLAGS=`echo "$CPPFLAGS" | \
21745         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21746                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21747
21748                                 ;;
21749                         esac
21750
21751         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21752         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21753
21754                         ;;
21755                 esac
21756                 ;;
21757         (*)
21758
21759         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21760         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21761
21762                 ;;
21763         esac
21764         ;;
21765 (yes)
21766
21767         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21768         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21769
21770         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
21771
21772         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21773                 && test -z "${cf_tst_cflags}" \
21774                 && cf_fix_cppflags=no
21775         ;;
21776 esac
21777 done
21778
21779 if test -n "$cf_new_cflags" ; then
21780
21781         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
21782         CFLAGS="${CFLAGS}$cf_new_cflags"
21783
21784 fi
21785
21786 if test -n "$cf_new_cppflags" ; then
21787
21788         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
21789         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
21790
21791 fi
21792
21793 if test -n "$cf_new_extra_cppflags" ; then
21794
21795         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
21796         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
21797
21798 fi
21799
21800                 ;;
21801         esac
21802         ;;
21803 esac
21804
21805 if test "$with_dmalloc" = yes ; then
21806         echo "$as_me:21806: checking for dmalloc.h" >&5
21807 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
21808 if test "${ac_cv_header_dmalloc_h+set}" = set; then
21809   echo $ECHO_N "(cached) $ECHO_C" >&6
21810 else
21811   cat >conftest.$ac_ext <<_ACEOF
21812 #line 21812 "configure"
21813 #include "confdefs.h"
21814 #include <dmalloc.h>
21815 _ACEOF
21816 if { (eval echo "$as_me:21816: \"$ac_cpp conftest.$ac_ext\"") >&5
21817   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
21818   ac_status=$?
21819   egrep -v '^ *\+' conftest.er1 >conftest.err
21820   rm -f conftest.er1
21821   cat conftest.err >&5
21822   echo "$as_me:21822: \$? = $ac_status" >&5
21823   (exit $ac_status); } >/dev/null; then
21824   if test -s conftest.err; then
21825     ac_cpp_err=$ac_c_preproc_warn_flag
21826   else
21827     ac_cpp_err=
21828   fi
21829 else
21830   ac_cpp_err=yes
21831 fi
21832 if test -z "$ac_cpp_err"; then
21833   ac_cv_header_dmalloc_h=yes
21834 else
21835   echo "$as_me: failed program was:" >&5
21836   cat conftest.$ac_ext >&5
21837   ac_cv_header_dmalloc_h=no
21838 fi
21839 rm -f conftest.err conftest.$ac_ext
21840 fi
21841 echo "$as_me:21841: result: $ac_cv_header_dmalloc_h" >&5
21842 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
21843 if test $ac_cv_header_dmalloc_h = yes; then
21844
21845 echo "$as_me:21845: checking for dmalloc_debug in -ldmalloc" >&5
21846 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
21847 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
21848   echo $ECHO_N "(cached) $ECHO_C" >&6
21849 else
21850   ac_check_lib_save_LIBS=$LIBS
21851 LIBS="-ldmalloc  $LIBS"
21852 cat >conftest.$ac_ext <<_ACEOF
21853 #line 21853 "configure"
21854 #include "confdefs.h"
21855
21856 /* Override any gcc2 internal prototype to avoid an error.  */
21857 #ifdef __cplusplus
21858 extern "C"
21859 #endif
21860 /* We use char because int might match the return type of a gcc2
21861    builtin and then its argument prototype would still apply.  */
21862 char dmalloc_debug ();
21863 int
21864 main (void)
21865 {
21866 dmalloc_debug ();
21867   ;
21868   return 0;
21869 }
21870 _ACEOF
21871 rm -f conftest.$ac_objext conftest$ac_exeext
21872 if { (eval echo "$as_me:21872: \"$ac_link\"") >&5
21873   (eval $ac_link) 2>&5
21874   ac_status=$?
21875   echo "$as_me:21875: \$? = $ac_status" >&5
21876   (exit $ac_status); } &&
21877          { ac_try='test -s conftest$ac_exeext'
21878   { (eval echo "$as_me:21878: \"$ac_try\"") >&5
21879   (eval $ac_try) 2>&5
21880   ac_status=$?
21881   echo "$as_me:21881: \$? = $ac_status" >&5
21882   (exit $ac_status); }; }; then
21883   ac_cv_lib_dmalloc_dmalloc_debug=yes
21884 else
21885   echo "$as_me: failed program was:" >&5
21886 cat conftest.$ac_ext >&5
21887 ac_cv_lib_dmalloc_dmalloc_debug=no
21888 fi
21889 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
21890 LIBS=$ac_check_lib_save_LIBS
21891 fi
21892 echo "$as_me:21892: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
21893 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
21894 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
21895   cat >>confdefs.h <<EOF
21896 #define HAVE_LIBDMALLOC 1
21897 EOF
21898
21899   LIBS="-ldmalloc $LIBS"
21900
21901 fi
21902
21903 fi
21904
21905 fi
21906
21907 echo "$as_me:21907: checking if you want to use dbmalloc for testing" >&5
21908 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
21909
21910 # Check whether --with-dbmalloc or --without-dbmalloc was given.
21911 if test "${with_dbmalloc+set}" = set; then
21912   withval="$with_dbmalloc"
21913
21914 cat >>confdefs.h <<EOF
21915 #define USE_DBMALLOC 1
21916 EOF
21917
21918         : ${with_cflags:=-g}
21919         : ${with_no_leaks:=yes}
21920          with_dbmalloc=yes
21921 else
21922   with_dbmalloc=
21923 fi;
21924 echo "$as_me:21924: result: ${with_dbmalloc:-no}" >&5
21925 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
21926
21927 case .$with_cflags in
21928 (.*-g*)
21929         case .$CFLAGS in
21930         (.*-g*)
21931                 ;;
21932         (*)
21933
21934 cf_fix_cppflags=no
21935 cf_new_cflags=
21936 cf_new_cppflags=
21937 cf_new_extra_cppflags=
21938
21939 for cf_add_cflags in -g
21940 do
21941 case $cf_fix_cppflags in
21942 (no)
21943         case $cf_add_cflags in
21944         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
21945                 case $cf_add_cflags in
21946                 (-D*)
21947                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
21948
21949                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
21950                                 && test -z "${cf_tst_cflags}" \
21951                                 && cf_fix_cppflags=yes
21952
21953                         if test $cf_fix_cppflags = yes ; then
21954
21955         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21956         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21957
21958                                 continue
21959                         elif test "${cf_tst_cflags}" = "\"'" ; then
21960
21961         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
21962         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
21963
21964                                 continue
21965                         fi
21966                         ;;
21967                 esac
21968                 case "$CPPFLAGS" in
21969                 (*$cf_add_cflags)
21970                         ;;
21971                 (*)
21972                         case $cf_add_cflags in
21973                         (-D*)
21974                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
21975
21976 CPPFLAGS=`echo "$CPPFLAGS" | \
21977         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
21978                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
21979
21980                                 ;;
21981                         esac
21982
21983         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
21984         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
21985
21986                         ;;
21987                 esac
21988                 ;;
21989         (*)
21990
21991         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
21992         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
21993
21994                 ;;
21995         esac
21996         ;;
21997 (yes)
21998
21999         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22000         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22001
22002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22003
22004         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22005                 && test -z "${cf_tst_cflags}" \
22006                 && cf_fix_cppflags=no
22007         ;;
22008 esac
22009 done
22010
22011 if test -n "$cf_new_cflags" ; then
22012
22013         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22014         CFLAGS="${CFLAGS}$cf_new_cflags"
22015
22016 fi
22017
22018 if test -n "$cf_new_cppflags" ; then
22019
22020         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22021         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22022
22023 fi
22024
22025 if test -n "$cf_new_extra_cppflags" ; then
22026
22027         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22028         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22029
22030 fi
22031
22032                 ;;
22033         esac
22034         ;;
22035 esac
22036
22037 if test "$with_dbmalloc" = yes ; then
22038         echo "$as_me:22038: checking for dbmalloc.h" >&5
22039 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
22040 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
22041   echo $ECHO_N "(cached) $ECHO_C" >&6
22042 else
22043   cat >conftest.$ac_ext <<_ACEOF
22044 #line 22044 "configure"
22045 #include "confdefs.h"
22046 #include <dbmalloc.h>
22047 _ACEOF
22048 if { (eval echo "$as_me:22048: \"$ac_cpp conftest.$ac_ext\"") >&5
22049   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
22050   ac_status=$?
22051   egrep -v '^ *\+' conftest.er1 >conftest.err
22052   rm -f conftest.er1
22053   cat conftest.err >&5
22054   echo "$as_me:22054: \$? = $ac_status" >&5
22055   (exit $ac_status); } >/dev/null; then
22056   if test -s conftest.err; then
22057     ac_cpp_err=$ac_c_preproc_warn_flag
22058   else
22059     ac_cpp_err=
22060   fi
22061 else
22062   ac_cpp_err=yes
22063 fi
22064 if test -z "$ac_cpp_err"; then
22065   ac_cv_header_dbmalloc_h=yes
22066 else
22067   echo "$as_me: failed program was:" >&5
22068   cat conftest.$ac_ext >&5
22069   ac_cv_header_dbmalloc_h=no
22070 fi
22071 rm -f conftest.err conftest.$ac_ext
22072 fi
22073 echo "$as_me:22073: result: $ac_cv_header_dbmalloc_h" >&5
22074 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
22075 if test $ac_cv_header_dbmalloc_h = yes; then
22076
22077 echo "$as_me:22077: checking for debug_malloc in -ldbmalloc" >&5
22078 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
22079 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
22080   echo $ECHO_N "(cached) $ECHO_C" >&6
22081 else
22082   ac_check_lib_save_LIBS=$LIBS
22083 LIBS="-ldbmalloc  $LIBS"
22084 cat >conftest.$ac_ext <<_ACEOF
22085 #line 22085 "configure"
22086 #include "confdefs.h"
22087
22088 /* Override any gcc2 internal prototype to avoid an error.  */
22089 #ifdef __cplusplus
22090 extern "C"
22091 #endif
22092 /* We use char because int might match the return type of a gcc2
22093    builtin and then its argument prototype would still apply.  */
22094 char debug_malloc ();
22095 int
22096 main (void)
22097 {
22098 debug_malloc ();
22099   ;
22100   return 0;
22101 }
22102 _ACEOF
22103 rm -f conftest.$ac_objext conftest$ac_exeext
22104 if { (eval echo "$as_me:22104: \"$ac_link\"") >&5
22105   (eval $ac_link) 2>&5
22106   ac_status=$?
22107   echo "$as_me:22107: \$? = $ac_status" >&5
22108   (exit $ac_status); } &&
22109          { ac_try='test -s conftest$ac_exeext'
22110   { (eval echo "$as_me:22110: \"$ac_try\"") >&5
22111   (eval $ac_try) 2>&5
22112   ac_status=$?
22113   echo "$as_me:22113: \$? = $ac_status" >&5
22114   (exit $ac_status); }; }; then
22115   ac_cv_lib_dbmalloc_debug_malloc=yes
22116 else
22117   echo "$as_me: failed program was:" >&5
22118 cat conftest.$ac_ext >&5
22119 ac_cv_lib_dbmalloc_debug_malloc=no
22120 fi
22121 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22122 LIBS=$ac_check_lib_save_LIBS
22123 fi
22124 echo "$as_me:22124: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
22125 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
22126 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
22127   cat >>confdefs.h <<EOF
22128 #define HAVE_LIBDBMALLOC 1
22129 EOF
22130
22131   LIBS="-ldbmalloc $LIBS"
22132
22133 fi
22134
22135 fi
22136
22137 fi
22138
22139 echo "$as_me:22139: checking if you want to use valgrind for testing" >&5
22140 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
22141
22142 # Check whether --with-valgrind or --without-valgrind was given.
22143 if test "${with_valgrind+set}" = set; then
22144   withval="$with_valgrind"
22145
22146 cat >>confdefs.h <<EOF
22147 #define USE_VALGRIND 1
22148 EOF
22149
22150         : ${with_cflags:=-g}
22151         : ${with_no_leaks:=yes}
22152          with_valgrind=yes
22153 else
22154   with_valgrind=
22155 fi;
22156 echo "$as_me:22156: result: ${with_valgrind:-no}" >&5
22157 echo "${ECHO_T}${with_valgrind:-no}" >&6
22158
22159 case .$with_cflags in
22160 (.*-g*)
22161         case .$CFLAGS in
22162         (.*-g*)
22163                 ;;
22164         (*)
22165
22166 cf_fix_cppflags=no
22167 cf_new_cflags=
22168 cf_new_cppflags=
22169 cf_new_extra_cppflags=
22170
22171 for cf_add_cflags in -g
22172 do
22173 case $cf_fix_cppflags in
22174 (no)
22175         case $cf_add_cflags in
22176         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
22177                 case $cf_add_cflags in
22178                 (-D*)
22179                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
22180
22181                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22182                                 && test -z "${cf_tst_cflags}" \
22183                                 && cf_fix_cppflags=yes
22184
22185                         if test $cf_fix_cppflags = yes ; then
22186
22187         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22188         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22189
22190                                 continue
22191                         elif test "${cf_tst_cflags}" = "\"'" ; then
22192
22193         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22194         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22195
22196                                 continue
22197                         fi
22198                         ;;
22199                 esac
22200                 case "$CPPFLAGS" in
22201                 (*$cf_add_cflags)
22202                         ;;
22203                 (*)
22204                         case $cf_add_cflags in
22205                         (-D*)
22206                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
22207
22208 CPPFLAGS=`echo "$CPPFLAGS" | \
22209         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
22210                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
22211
22212                                 ;;
22213                         esac
22214
22215         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
22216         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
22217
22218                         ;;
22219                 esac
22220                 ;;
22221         (*)
22222
22223         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
22224         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
22225
22226                 ;;
22227         esac
22228         ;;
22229 (yes)
22230
22231         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
22232         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
22233
22234         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
22235
22236         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
22237                 && test -z "${cf_tst_cflags}" \
22238                 && cf_fix_cppflags=no
22239         ;;
22240 esac
22241 done
22242
22243 if test -n "$cf_new_cflags" ; then
22244
22245         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
22246         CFLAGS="${CFLAGS}$cf_new_cflags"
22247
22248 fi
22249
22250 if test -n "$cf_new_cppflags" ; then
22251
22252         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
22253         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
22254
22255 fi
22256
22257 if test -n "$cf_new_extra_cppflags" ; then
22258
22259         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
22260         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
22261
22262 fi
22263
22264                 ;;
22265         esac
22266         ;;
22267 esac
22268
22269 echo "$as_me:22269: checking if you want to perform memory-leak testing" >&5
22270 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
22271
22272 # Check whether --enable-leaks or --disable-leaks was given.
22273 if test "${enable_leaks+set}" = set; then
22274   enableval="$enable_leaks"
22275   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
22276 else
22277   : ${with_no_leaks:=no}
22278 fi;
22279 echo "$as_me:22279: result: $with_no_leaks" >&5
22280 echo "${ECHO_T}$with_no_leaks" >&6
22281
22282 if test "$with_no_leaks" = yes ; then
22283
22284 cat >>confdefs.h <<\EOF
22285 #define NO_LEAKS 1
22286 EOF
22287
22288 cat >>confdefs.h <<\EOF
22289 #define YY_NO_LEAKS 1
22290 EOF
22291
22292 fi
22293
22294 LD_RPATH_OPT=
22295 if test "x$cf_cv_enable_rpath" != xno
22296 then
22297         echo "$as_me:22297: checking for an rpath option" >&5
22298 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
22299         case $cf_cv_system_name in
22300         (irix*)
22301                 if test "$GCC" = yes; then
22302                         LD_RPATH_OPT="-Wl,-rpath,"
22303                 else
22304                         LD_RPATH_OPT="-rpath "
22305                 fi
22306                 ;;
22307         (linux*|gnu*|k*bsd*-gnu|freebsd*)
22308                 LD_RPATH_OPT="-Wl,-rpath,"
22309                 ;;
22310         (openbsd[2-9].*|mirbsd*)
22311                 LD_RPATH_OPT="-Wl,-rpath,"
22312                 ;;
22313         (dragonfly*)
22314                 LD_RPATH_OPT="-rpath "
22315                 ;;
22316         (netbsd*)
22317                 LD_RPATH_OPT="-Wl,-rpath,"
22318                 ;;
22319         (osf*|mls+*)
22320                 LD_RPATH_OPT="-rpath "
22321                 ;;
22322         (solaris2*)
22323                 LD_RPATH_OPT="-R"
22324                 ;;
22325         (*)
22326                 ;;
22327         esac
22328         echo "$as_me:22328: result: $LD_RPATH_OPT" >&5
22329 echo "${ECHO_T}$LD_RPATH_OPT" >&6
22330
22331         case "x$LD_RPATH_OPT" in
22332         (x-R*)
22333                 echo "$as_me:22333: checking if we need a space after rpath option" >&5
22334 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
22335                 cf_save_LIBS="$LIBS"
22336
22337 cf_add_libs="$LIBS"
22338 # reverse order
22339 cf_add_0lib=
22340 for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done
22341 # filter duplicates
22342 for cf_add_1lib in $cf_add_0lib; do
22343         for cf_add_2lib in $cf_add_libs; do
22344                 if test "x$cf_add_1lib" = "x$cf_add_2lib"; then
22345                         cf_add_1lib=
22346                         break
22347                 fi
22348         done
22349         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs"
22350 done
22351 LIBS="$cf_add_libs"
22352
22353                 cat >conftest.$ac_ext <<_ACEOF
22354 #line 22354 "configure"
22355 #include "confdefs.h"
22356
22357 int
22358 main (void)
22359 {
22360
22361   ;
22362   return 0;
22363 }
22364 _ACEOF
22365 rm -f conftest.$ac_objext conftest$ac_exeext
22366 if { (eval echo "$as_me:22366: \"$ac_link\"") >&5
22367   (eval $ac_link) 2>&5
22368   ac_status=$?
22369   echo "$as_me:22369: \$? = $ac_status" >&5
22370   (exit $ac_status); } &&
22371          { ac_try='test -s conftest$ac_exeext'
22372   { (eval echo "$as_me:22372: \"$ac_try\"") >&5
22373   (eval $ac_try) 2>&5
22374   ac_status=$?
22375   echo "$as_me:22375: \$? = $ac_status" >&5
22376   (exit $ac_status); }; }; then
22377   cf_rpath_space=no
22378 else
22379   echo "$as_me: failed program was:" >&5
22380 cat conftest.$ac_ext >&5
22381 cf_rpath_space=yes
22382 fi
22383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22384                 LIBS="$cf_save_LIBS"
22385                 echo "$as_me:22385: result: $cf_rpath_space" >&5
22386 echo "${ECHO_T}$cf_rpath_space" >&6
22387                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
22388                 ;;
22389         esac
22390 fi
22391
22392 echo "$as_me:22392: checking if rpath-hack should be disabled" >&5
22393 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
22394
22395 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
22396 if test "${enable_rpath_hack+set}" = set; then
22397   enableval="$enable_rpath_hack"
22398   test "$enableval" != no && enableval=yes
22399         if test "$enableval" != "yes" ; then
22400     cf_disable_rpath_hack=yes
22401         else
22402                 cf_disable_rpath_hack=no
22403         fi
22404 else
22405   enableval=yes
22406         cf_disable_rpath_hack=no
22407
22408 fi;
22409 echo "$as_me:22409: result: $cf_disable_rpath_hack" >&5
22410 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
22411 if test "$cf_disable_rpath_hack" = no ; then
22412
22413 echo "$as_me:22413: checking for updated LDFLAGS" >&5
22414 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
22415 if test -n "$LD_RPATH_OPT" ; then
22416         echo "$as_me:22416: result: maybe" >&5
22417 echo "${ECHO_T}maybe" >&6
22418
22419         for ac_prog in ldd
22420 do
22421   # Extract the first word of "$ac_prog", so it can be a program name with args.
22422 set dummy $ac_prog; ac_word=$2
22423 echo "$as_me:22423: checking for $ac_word" >&5
22424 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
22425 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
22426   echo $ECHO_N "(cached) $ECHO_C" >&6
22427 else
22428   if test -n "$cf_ldd_prog"; then
22429   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
22430 else
22431   ac_save_IFS=$IFS; IFS=$ac_path_separator
22432 ac_dummy="$PATH"
22433 for ac_dir in $ac_dummy; do
22434   IFS=$ac_save_IFS
22435   test -z "$ac_dir" && ac_dir=.
22436   $as_executable_p "$ac_dir/$ac_word" || continue
22437 ac_cv_prog_cf_ldd_prog="$ac_prog"
22438 echo "$as_me:22438: found $ac_dir/$ac_word" >&5
22439 break
22440 done
22441
22442 fi
22443 fi
22444 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
22445 if test -n "$cf_ldd_prog"; then
22446   echo "$as_me:22446: result: $cf_ldd_prog" >&5
22447 echo "${ECHO_T}$cf_ldd_prog" >&6
22448 else
22449   echo "$as_me:22449: result: no" >&5
22450 echo "${ECHO_T}no" >&6
22451 fi
22452
22453   test -n "$cf_ldd_prog" && break
22454 done
22455 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
22456
22457         cf_rpath_list="/usr/lib /lib"
22458         if test "$cf_ldd_prog" != no
22459         then
22460                 cf_rpath_oops=
22461
22462 cat >conftest.$ac_ext <<_ACEOF
22463 #line 22463 "configure"
22464 #include "confdefs.h"
22465 #include <stdio.h>
22466 int
22467 main (void)
22468 {
22469 printf("Hello");
22470   ;
22471   return 0;
22472 }
22473 _ACEOF
22474 rm -f conftest.$ac_objext conftest$ac_exeext
22475 if { (eval echo "$as_me:22475: \"$ac_link\"") >&5
22476   (eval $ac_link) 2>&5
22477   ac_status=$?
22478   echo "$as_me:22478: \$? = $ac_status" >&5
22479   (exit $ac_status); } &&
22480          { ac_try='test -s conftest$ac_exeext'
22481   { (eval echo "$as_me:22481: \"$ac_try\"") >&5
22482   (eval $ac_try) 2>&5
22483   ac_status=$?
22484   echo "$as_me:22484: \$? = $ac_status" >&5
22485   (exit $ac_status); }; }; then
22486   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
22487                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
22488 else
22489   echo "$as_me: failed program was:" >&5
22490 cat conftest.$ac_ext >&5
22491 fi
22492 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
22493
22494                 # If we passed the link-test, but get a "not found" on a given library,
22495                 # this could be due to inept reconfiguration of gcc to make it only
22496                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
22497                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
22498                 # /usr/local libraries.
22499                 if test -n "$cf_rpath_oops"
22500                 then
22501                         for cf_rpath_src in $cf_rpath_oops
22502                         do
22503                                 for cf_rpath_dir in \
22504                                         /usr/local \
22505                                         /usr/pkg \
22506                                         /opt/sfw
22507                                 do
22508                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
22509                                         then
22510                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
22511
22512 echo "${as_me:-configure}:22512: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
22513
22514                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
22515                                                 break
22516                                         fi
22517                                 done
22518                         done
22519                 fi
22520         fi
22521
22522         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22523
22524 echo "${as_me:-configure}:22524: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22525
22526 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
22527
22528 echo "${as_me:-configure}:22528: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
22529
22530 cf_rpath_dst=
22531 for cf_rpath_src in $LDFLAGS
22532 do
22533         case $cf_rpath_src in
22534         (-L*)
22535
22536                 # check if this refers to a directory which we will ignore
22537                 cf_rpath_skip=no
22538                 if test -n "$cf_rpath_list"
22539                 then
22540                         for cf_rpath_item in $cf_rpath_list
22541                         do
22542                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22543                                 then
22544                                         cf_rpath_skip=yes
22545                                         break
22546                                 fi
22547                         done
22548                 fi
22549
22550                 if test "$cf_rpath_skip" = no
22551                 then
22552                         # transform the option
22553                         if test "$LD_RPATH_OPT" = "-R " ; then
22554                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22555                         else
22556                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22557                         fi
22558
22559                         # if we have not already added this, add it now
22560                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22561                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22562                         then
22563                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22564
22565 echo "${as_me:-configure}:22565: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22566
22567                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22568                         fi
22569                 fi
22570                 ;;
22571         esac
22572         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22573 done
22574 LDFLAGS=$cf_rpath_dst
22575
22576 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
22577
22578 echo "${as_me:-configure}:22578: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
22579
22580 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
22581
22582 echo "${as_me:-configure}:22582: testing ...checking LIBS $LIBS ..." 1>&5
22583
22584 cf_rpath_dst=
22585 for cf_rpath_src in $LIBS
22586 do
22587         case $cf_rpath_src in
22588         (-L*)
22589
22590                 # check if this refers to a directory which we will ignore
22591                 cf_rpath_skip=no
22592                 if test -n "$cf_rpath_list"
22593                 then
22594                         for cf_rpath_item in $cf_rpath_list
22595                         do
22596                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
22597                                 then
22598                                         cf_rpath_skip=yes
22599                                         break
22600                                 fi
22601                         done
22602                 fi
22603
22604                 if test "$cf_rpath_skip" = no
22605                 then
22606                         # transform the option
22607                         if test "$LD_RPATH_OPT" = "-R " ; then
22608                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
22609                         else
22610                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
22611                         fi
22612
22613                         # if we have not already added this, add it now
22614                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
22615                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
22616                         then
22617                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
22618
22619 echo "${as_me:-configure}:22619: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
22620
22621                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
22622                         fi
22623                 fi
22624                 ;;
22625         esac
22626         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
22627 done
22628 LIBS=$cf_rpath_dst
22629
22630 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
22631
22632 echo "${as_me:-configure}:22632: testing ...checked LIBS $LIBS ..." 1>&5
22633
22634         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
22635
22636 echo "${as_me:-configure}:22636: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
22637
22638 else
22639         echo "$as_me:22639: result: no" >&5
22640 echo "${ECHO_T}no" >&6
22641 fi
22642
22643 fi
22644
22645 TEST_ARGS="$LIBS"
22646 LIBS=
22647
22648 ac_config_files="$ac_config_files Makefile"
22649 ac_config_commands="$ac_config_commands default"
22650 cat >confcache <<\_ACEOF
22651 # This file is a shell script that caches the results of configure
22652 # tests run on this system so they can be shared between configure
22653 # scripts and configure runs, see configure's option --config-cache.
22654 # It is not useful on other systems.  If it contains results you don't
22655 # want to keep, you may remove or edit it.
22656 #
22657 # config.status only pays attention to the cache file if you give it
22658 # the --recheck option to rerun configure.
22659 #
22660 # `ac_cv_env_foo' variables (set or unset) will be overriden when
22661 # loading this file, other *unset* `ac_cv_foo' will be assigned the
22662 # following values.
22663
22664 _ACEOF
22665
22666 # The following way of writing the cache mishandles newlines in values,
22667 # but we know of no workaround that is simple, portable, and efficient.
22668 # So, don't put newlines in cache variables' values.
22669 # Ultrix sh set writes to stderr and can't be redirected directly,
22670 # and sets the high bit in the cache file unless we assign to the vars.
22671 {
22672   (set) 2>&1 |
22673     case `(ac_space=' '; set | grep ac_space) 2>&1` in
22674     *ac_space=\ *)
22675       # `set' does not quote correctly, so add quotes (double-quote
22676       # substitution turns \\\\ into \\, and sed turns \\ into \).
22677       sed -n \
22678         "s/'/'\\\\''/g;
22679           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
22680       ;;
22681     *)
22682       # `set' quotes correctly as required by POSIX, so do not add quotes.
22683       sed -n \
22684         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
22685       ;;
22686     esac;
22687 } |
22688   sed '
22689      t clear
22690      : clear
22691      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
22692      t end
22693      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
22694      : end' >>confcache
22695 if cmp -s $cache_file confcache; then :; else
22696   if test -w $cache_file; then
22697     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
22698     cat confcache >$cache_file
22699   else
22700     echo "not updating unwritable cache $cache_file"
22701   fi
22702 fi
22703 rm -f confcache
22704
22705 test "x$prefix" = xNONE && prefix=$ac_default_prefix
22706 # Let make expand exec_prefix.
22707 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
22708
22709 # VPATH may cause trouble with some makes, so we remove $(srcdir),
22710 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
22711 # trailing colons and then remove the whole line if VPATH becomes empty
22712 # (actually we leave an empty line to preserve line numbers).
22713 if test "x$srcdir" = x.; then
22714   ac_vpsub='/^[         ]*VPATH[        ]*=/{
22715 s/:*\$(srcdir):*/:/;
22716 s/:*\${srcdir}:*/:/;
22717 s/:*@srcdir@:*/:/;
22718 s/^\([^=]*=[    ]*\):*/\1/;
22719 s/:*$//;
22720 s/^[^=]*=[      ]*$//;
22721 }'
22722 fi
22723
22724 DEFS=-DHAVE_CONFIG_H
22725
22726 : ${CONFIG_STATUS=./config.status}
22727 ac_clean_files_save=$ac_clean_files
22728 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
22729 { echo "$as_me:22729: creating $CONFIG_STATUS" >&5
22730 echo "$as_me: creating $CONFIG_STATUS" >&6;}
22731 cat >$CONFIG_STATUS <<_ACEOF
22732 #! $SHELL
22733 # Generated automatically by configure.
22734 # Run this file to recreate the current configuration.
22735 # Compiler output produced by configure, useful for debugging
22736 # configure, is in config.log if it exists.
22737
22738 debug=false
22739 SHELL=\${CONFIG_SHELL-$SHELL}
22740 ac_cs_invocation="\$0 \$@"
22741
22742 CLICOLOR_FORCE= GREP_OPTIONS=
22743 unset CLICOLOR_FORCE GREP_OPTIONS
22744 _ACEOF
22745
22746 cat >>$CONFIG_STATUS <<\_ACEOF
22747 # Be Bourne compatible
22748 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
22749   emulate sh
22750   NULLCMD=:
22751 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
22752   set -o posix
22753 fi
22754
22755 # Name of the executable.
22756 as_me=`echo "$0" |sed 's,.*[\\/],,'`
22757
22758 if expr a : '\(a\)' >/dev/null 2>&1; then
22759   as_expr=expr
22760 else
22761   as_expr=false
22762 fi
22763
22764 rm -f conf$$ conf$$.exe conf$$.file
22765 echo >conf$$.file
22766 if ln -s conf$$.file conf$$ 2>/dev/null; then
22767   # We could just check for DJGPP; but this test a) works b) is more generic
22768   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
22769   if test -f conf$$.exe; then
22770     # Don't use ln at all; we don't have any links
22771     as_ln_s='cp -p'
22772   else
22773     as_ln_s='ln -s'
22774   fi
22775 elif ln conf$$.file conf$$ 2>/dev/null; then
22776   as_ln_s=ln
22777 else
22778   as_ln_s='cp -p'
22779 fi
22780 rm -f conf$$ conf$$.exe conf$$.file
22781
22782 as_executable_p="test -f"
22783
22784 # Support unset when possible.
22785 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
22786   as_unset=unset
22787 else
22788   as_unset=false
22789 fi
22790
22791 # NLS nuisances.
22792 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
22793 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
22794 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
22795 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
22796 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
22797 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
22798 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
22799 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
22800
22801 # IFS
22802 # We need space, tab and new line, in precisely that order.
22803 as_nl='
22804 '
22805 IFS="   $as_nl"
22806
22807 # CDPATH.
22808 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
22809
22810 exec 6>&1
22811
22812 _ACEOF
22813
22814 # Files that config.status was made for.
22815 if test -n "$ac_config_files"; then
22816   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
22817 fi
22818
22819 if test -n "$ac_config_headers"; then
22820   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
22821 fi
22822
22823 if test -n "$ac_config_links"; then
22824   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
22825 fi
22826
22827 if test -n "$ac_config_commands"; then
22828   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
22829 fi
22830
22831 cat >>$CONFIG_STATUS <<\EOF
22832
22833 ac_cs_usage="\
22834 \`$as_me' instantiates files from templates according to the
22835 current configuration.
22836
22837 Usage: $0 [OPTIONS] [FILE]...
22838
22839   -h, --help       print this help, then exit
22840   -V, --version    print version number, then exit
22841   -d, --debug      don't remove temporary files
22842       --recheck    update $as_me by reconfiguring in the same conditions
22843   --file=FILE[:TEMPLATE]
22844                    instantiate the configuration file FILE
22845   --header=FILE[:TEMPLATE]
22846                    instantiate the configuration header FILE
22847
22848 Configuration files:
22849 $config_files
22850
22851 Configuration headers:
22852 $config_headers
22853
22854 Configuration commands:
22855 $config_commands
22856
22857 Report bugs to <dickey@invisible-island.net>."
22858 EOF
22859
22860 cat >>$CONFIG_STATUS <<EOF
22861 ac_cs_version="\\
22862 config.status
22863 configured by $0, generated by GNU Autoconf 2.52.20200802,
22864   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
22865
22866 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
22867 Free Software Foundation, Inc.
22868 This config.status script is free software; the Free Software Foundation
22869 gives unlimited permission to copy, distribute and modify it."
22870 srcdir=$srcdir
22871 INSTALL="$INSTALL"
22872 EOF
22873
22874 cat >>$CONFIG_STATUS <<\EOF
22875 # If no file are specified by the user, then we need to provide default
22876 # value.  By we need to know if files were specified by the user.
22877 ac_need_defaults=:
22878 while test $# != 0
22879 do
22880   case $1 in
22881   --*=*)
22882     ac_option=`expr "x$1" : 'x\([^=]*\)='`
22883     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
22884     shift
22885     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
22886     shift
22887     ;;
22888   -*);;
22889   *) # This is not an option, so the user has probably given explicit
22890      # arguments.
22891      ac_need_defaults=false;;
22892   esac
22893
22894   case $1 in
22895   # Handling of the options.
22896 EOF
22897 cat >>$CONFIG_STATUS <<EOF
22898   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
22899     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
22900     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
22901 EOF
22902 cat >>$CONFIG_STATUS <<\EOF
22903   --version | --vers* | -V )
22904     echo "$ac_cs_version"; exit 0 ;;
22905   --he | --h)
22906     # Conflict between --help and --header
22907     { { echo "$as_me:22907: error: ambiguous option: $1
22908 Try \`$0 --help' for more information." >&5
22909 echo "$as_me: error: ambiguous option: $1
22910 Try \`$0 --help' for more information." >&2;}
22911    { (exit 1); exit 1; }; };;
22912   --help | --hel | -h )
22913     echo "$ac_cs_usage"; exit 0 ;;
22914   --debug | --d* | -d )
22915     debug=: ;;
22916   --file | --fil | --fi | --f )
22917     shift
22918     CONFIG_FILES="$CONFIG_FILES $1"
22919     ac_need_defaults=false;;
22920   --header | --heade | --head | --hea )
22921     shift
22922     CONFIG_HEADERS="$CONFIG_HEADERS $1"
22923     ac_need_defaults=false;;
22924
22925   # This is an error.
22926   -*) { { echo "$as_me:22926: error: unrecognized option: $1
22927 Try \`$0 --help' for more information." >&5
22928 echo "$as_me: error: unrecognized option: $1
22929 Try \`$0 --help' for more information." >&2;}
22930    { (exit 1); exit 1; }; } ;;
22931
22932   *) ac_config_targets="$ac_config_targets $1" ;;
22933
22934   esac
22935   shift
22936 done
22937
22938 exec 5>>config.log
22939 cat >&5 << _ACEOF
22940
22941 ## ----------------------- ##
22942 ## Running config.status.  ##
22943 ## ----------------------- ##
22944
22945 This file was extended by $as_me 2.52.20200802, executed with
22946   CONFIG_FILES    = $CONFIG_FILES
22947   CONFIG_HEADERS  = $CONFIG_HEADERS
22948   CONFIG_LINKS    = $CONFIG_LINKS
22949   CONFIG_COMMANDS = $CONFIG_COMMANDS
22950   > $ac_cs_invocation
22951 on `(hostname || uname -n) 2>/dev/null | sed 1q`
22952
22953 _ACEOF
22954 EOF
22955
22956 cat >>$CONFIG_STATUS <<EOF
22957 #
22958 # INIT-COMMANDS section.
22959 #
22960
22961 AWK="$AWK"
22962 ECHO_CC="$ECHO_CC"
22963 ECHO_LD="$ECHO_LD"
22964 SHOW_CC="$SHOW_LD"
22965
22966 EOF
22967
22968 cat >>$CONFIG_STATUS <<\EOF
22969 for ac_config_target in $ac_config_targets
22970 do
22971   case "$ac_config_target" in
22972   # Handling of arguments.
22973   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
22974   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
22975   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
22976   *) { { echo "$as_me:22976: error: invalid argument: $ac_config_target" >&5
22977 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
22978    { (exit 1); exit 1; }; };;
22979   esac
22980 done
22981
22982 # If the user did not use the arguments to specify the items to instantiate,
22983 # then the envvar interface is used.  Set only those that are not.
22984 # We use the long form for the default assignment because of an extremely
22985 # bizarre bug on SunOS 4.1.3.
22986 if $ac_need_defaults; then
22987   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
22988   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
22989   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
22990 fi
22991
22992 # Create a temporary directory, and hook for its removal unless debugging.
22993 $debug ||
22994 {
22995   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
22996   trap '{ (exit 1); exit 1; }' 1 2 13 15
22997 }
22998
22999 # Create a (secure) tmp directory for tmp files.
23000 : ${TMPDIR=/tmp}
23001 {
23002   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
23003   test -n "$tmp" && test -d "$tmp"
23004 }  ||
23005 {
23006   tmp=$TMPDIR/cs$$-$RANDOM
23007   (umask 077 && mkdir $tmp)
23008 } ||
23009 {
23010    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
23011    { (exit 1); exit 1; }
23012 }
23013
23014 EOF
23015
23016 cat >>$CONFIG_STATUS <<EOF
23017
23018 #
23019 # CONFIG_FILES section.
23020 #
23021
23022 # No need to generate the scripts if there are no CONFIG_FILES.
23023 # This happens for instance when ./config.status config.h
23024 if test -n "\$CONFIG_FILES"; then
23025   # Protect against being on the right side of a sed subst in config.status.
23026   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
23027    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
23028 s,@SHELL@,$SHELL,;t t
23029 s,@exec_prefix@,$exec_prefix,;t t
23030 s,@prefix@,$prefix,;t t
23031 s,@program_transform_name@,$program_transform_name,;t t
23032 s,@bindir@,$bindir,;t t
23033 s,@sbindir@,$sbindir,;t t
23034 s,@libexecdir@,$libexecdir,;t t
23035 s,@datarootdir@,$datarootdir,;t t
23036 s,@datadir@,$datadir,;t t
23037 s,@sysconfdir@,$sysconfdir,;t t
23038 s,@sharedstatedir@,$sharedstatedir,;t t
23039 s,@localstatedir@,$localstatedir,;t t
23040 s,@runstatedir@,$runstatedir,;t t
23041 s,@libdir@,$libdir,;t t
23042 s,@includedir@,$includedir,;t t
23043 s,@oldincludedir@,$oldincludedir,;t t
23044 s,@infodir@,$infodir,;t t
23045 s,@mandir@,$mandir,;t t
23046 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
23047 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
23048 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
23049 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
23050 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
23051 s,@build_alias@,$build_alias,;t t
23052 s,@host_alias@,$host_alias,;t t
23053 s,@target_alias@,$target_alias,;t t
23054 s,@ECHO_C@,$ECHO_C,;t t
23055 s,@ECHO_N@,$ECHO_N,;t t
23056 s,@ECHO_T@,$ECHO_T,;t t
23057 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
23058 s,@DEFS@,$DEFS,;t t
23059 s,@LIBS@,$LIBS,;t t
23060 s,@build@,$build,;t t
23061 s,@build_cpu@,$build_cpu,;t t
23062 s,@build_vendor@,$build_vendor,;t t
23063 s,@build_os@,$build_os,;t t
23064 s,@host@,$host,;t t
23065 s,@host_cpu@,$host_cpu,;t t
23066 s,@host_vendor@,$host_vendor,;t t
23067 s,@host_os@,$host_os,;t t
23068 s,@SET_MAKE@,$SET_MAKE,;t t
23069 s,@CC@,$CC,;t t
23070 s,@CFLAGS@,$CFLAGS,;t t
23071 s,@LDFLAGS@,$LDFLAGS,;t t
23072 s,@CPPFLAGS@,$CPPFLAGS,;t t
23073 s,@ac_ct_CC@,$ac_ct_CC,;t t
23074 s,@EXEEXT@,$EXEEXT,;t t
23075 s,@OBJEXT@,$OBJEXT,;t t
23076 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
23077 s,@CPP@,$CPP,;t t
23078 s,@AWK@,$AWK,;t t
23079 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
23080 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
23081 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
23082 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
23083 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
23084 s,@LINT@,$LINT,;t t
23085 s,@LINT_OPTS@,$LINT_OPTS,;t t
23086 s,@CTAGS@,$CTAGS,;t t
23087 s,@ETAGS@,$ETAGS,;t t
23088 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
23089 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
23090 s,@MATH_LIB@,$MATH_LIB,;t t
23091 s,@top_builddir@,$top_builddir,;t t
23092 s,@CC_G_OPT@,$CC_G_OPT,;t t
23093 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
23094 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
23095 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
23096 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
23097 s,@LD@,$LD,;t t
23098 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
23099 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
23100 s,@LD_MODEL@,$LD_MODEL,;t t
23101 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
23102 s,@LIBTOOL@,$LIBTOOL,;t t
23103 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
23104 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
23105 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
23106 s,@LIB_LINK@,$LIB_LINK,;t t
23107 s,@LINK_TESTS@,$LINK_TESTS,;t t
23108 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
23109 s,@PACKAGE@,$PACKAGE,;t t
23110 s,@PTHREAD@,$PTHREAD,;t t
23111 s,@TEST_ARGS@,$TEST_ARGS,;t t
23112 s,@TEST_DEPS@,$TEST_DEPS,;t t
23113 s,@TEST_LIBS@,$TEST_LIBS,;t t
23114 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
23115 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
23116 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
23117 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
23118 s,@includesubdir@,$includesubdir,;t t
23119 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
23120 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
23121 s,@ECHO_LT@,$ECHO_LT,;t t
23122 s,@ECHO_LD@,$ECHO_LD,;t t
23123 s,@RULE_CC@,$RULE_CC,;t t
23124 s,@SHOW_CC@,$SHOW_CC,;t t
23125 s,@ECHO_CC@,$ECHO_CC,;t t
23126 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
23127 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
23128 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
23129 s,@X_CFLAGS@,$X_CFLAGS,;t t
23130 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
23131 s,@X_LIBS@,$X_LIBS,;t t
23132 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
23133 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
23134 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
23135 s,@RGB_PATH@,$RGB_PATH,;t t
23136 s,@no_x11_rgb@,$no_x11_rgb,;t t
23137 s,@FORM_NAME@,$FORM_NAME,;t t
23138 s,@MENU_NAME@,$MENU_NAME,;t t
23139 s,@PANEL_NAME@,$PANEL_NAME,;t t
23140 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
23141 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
23142 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
23143 CEOF
23144
23145 EOF
23146
23147   cat >>$CONFIG_STATUS <<\EOF
23148   # Split the substitutions into bite-sized pieces for seds with
23149   # small command number limits, like on Digital OSF/1 and HP-UX.
23150   ac_max_sed_lines=48
23151   ac_sed_frag=1 # Number of current file.
23152   ac_beg=1 # First line for current file.
23153   ac_end=$ac_max_sed_lines # Line after last line for current file.
23154   ac_more_lines=:
23155   ac_sed_cmds=
23156   while $ac_more_lines; do
23157     if test $ac_beg -gt 1; then
23158       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23159     else
23160       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
23161     fi
23162     if test ! -s $tmp/subs.frag; then
23163       ac_more_lines=false
23164     else
23165       # The purpose of the label and of the branching condition is to
23166       # speed up the sed processing (if there are no `@' at all, there
23167       # is no need to browse any of the substitutions).
23168       # These are the two extra sed commands mentioned above.
23169       (echo ':t
23170   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
23171       # It is possible to make a multiline substitution using escaped newlines.
23172       # Ensure that we do not split the substitution between script fragments.
23173       ac_BEG=$ac_end
23174       ac_END=`expr $ac_end + $ac_max_sed_lines`
23175       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
23176       if test -s $tmp/subs.next; then
23177         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
23178         if test ! -s $tmp/subs.edit; then
23179           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
23180           if test ! -s $tmp/subs.edit; then
23181             if test $ac_beg -gt 1; then
23182               ac_end=`expr $ac_end - 1`
23183               continue
23184             fi
23185           fi
23186         fi
23187       fi
23188
23189       if test -z "$ac_sed_cmds"; then
23190         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
23191       else
23192         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
23193       fi
23194       ac_sed_frag=`expr $ac_sed_frag + 1`
23195       ac_beg=$ac_end
23196       ac_end=`expr $ac_end + $ac_max_sed_lines`
23197     fi
23198   done
23199   if test -z "$ac_sed_cmds"; then
23200     ac_sed_cmds=cat
23201   fi
23202 fi # test -n "$CONFIG_FILES"
23203
23204 EOF
23205 cat >>$CONFIG_STATUS <<\EOF
23206 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
23207   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23208   case $ac_file in
23209   - | *:- | *:-:* ) # input from stdin
23210         cat >$tmp/stdin
23211         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23212         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23213   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23214         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23215   * )   ac_file_in=$ac_file.in ;;
23216   esac
23217
23218   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
23219   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23220          X"$ac_file" : 'X\(//\)[^/]' \| \
23221          X"$ac_file" : 'X\(//\)$' \| \
23222          X"$ac_file" : 'X\(/\)' \| \
23223          .     : '\(.\)' 2>/dev/null ||
23224 echo X"$ac_file" |
23225     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23226           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23227           /^X\(\/\/\)$/{ s//\1/; q; }
23228           /^X\(\/\).*/{ s//\1/; q; }
23229           s/.*/./; q'`
23230   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23231     { case "$ac_dir" in
23232   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23233   *)                      as_incr_dir=.;;
23234 esac
23235 as_dummy="$ac_dir"
23236 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23237   case $as_mkdir_dir in
23238     # Skip DOS drivespec
23239     ?:) as_incr_dir=$as_mkdir_dir ;;
23240     *)
23241       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23242       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23243     ;;
23244   esac
23245 done; }
23246
23247     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
23248     # A "../" for each directory in $ac_dir_suffix.
23249     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
23250   else
23251     ac_dir_suffix= ac_dots=
23252   fi
23253
23254   case $srcdir in
23255   .)  ac_srcdir=.
23256       if test -z "$ac_dots"; then
23257          ac_top_srcdir=.
23258       else
23259          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
23260       fi ;;
23261   [\\/]* | ?:[\\/]* )
23262       ac_srcdir=$srcdir$ac_dir_suffix;
23263       ac_top_srcdir=$srcdir ;;
23264   *) # Relative path.
23265     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
23266     ac_top_srcdir=$ac_dots$srcdir ;;
23267   esac
23268
23269   case $INSTALL in
23270   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
23271   *) ac_INSTALL=$ac_dots$INSTALL ;;
23272   esac
23273
23274   if test x"$ac_file" != x-; then
23275     { echo "$as_me:23275: creating $ac_file" >&5
23276 echo "$as_me: creating $ac_file" >&6;}
23277     rm -f "$ac_file"
23278   fi
23279   # Let's still pretend it is `configure' which instantiates (i.e., don't
23280   # use $as_me), people would be surprised to read:
23281   #    /* config.h.  Generated automatically by config.status.  */
23282   configure_input="Generated automatically from `echo $ac_file_in |
23283                                                  sed 's,.*/,,'` by configure."
23284
23285   # First look for the input files in the build tree, otherwise in the
23286   # src tree.
23287   ac_file_inputs=`IFS=:
23288     for f in $ac_file_in; do
23289       case $f in
23290       -) echo $tmp/stdin ;;
23291       [\\/$]*)
23292          # Absolute (can't be DOS-style, as IFS=:)
23293          test -f "$f" || { { echo "$as_me:23293: error: cannot find input file: $f" >&5
23294 echo "$as_me: error: cannot find input file: $f" >&2;}
23295    { (exit 1); exit 1; }; }
23296          echo $f;;
23297       *) # Relative
23298          if test -f "$f"; then
23299            # Build tree
23300            echo $f
23301          elif test -f "$srcdir/$f"; then
23302            # Source tree
23303            echo $srcdir/$f
23304          else
23305            # /dev/null tree
23306            { { echo "$as_me:23306: error: cannot find input file: $f" >&5
23307 echo "$as_me: error: cannot find input file: $f" >&2;}
23308    { (exit 1); exit 1; }; }
23309          fi;;
23310       esac
23311     done` || { (exit 1); exit 1; }
23312 EOF
23313 cat >>$CONFIG_STATUS <<\EOF
23314   ac_warn_datarootdir=no
23315   if test x"$ac_file" != x-; then
23316     for ac_item in $ac_file_inputs
23317     do
23318       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
23319       if test -n "$ac_seen"; then
23320         ac_used=`grep '@datarootdir@' $ac_item`
23321         if test -z "$ac_used"; then
23322           { echo "$as_me:23322: WARNING: datarootdir was used implicitly but not set:
23323 $ac_seen" >&5
23324 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
23325 $ac_seen" >&2;}
23326           ac_warn_datarootdir=yes
23327         fi
23328       fi
23329       ac_seen=`grep '${datarootdir}' $ac_item`
23330       if test -n "$ac_seen"; then
23331         { echo "$as_me:23331: WARNING: datarootdir was used explicitly but not set:
23332 $ac_seen" >&5
23333 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
23334 $ac_seen" >&2;}
23335         ac_warn_datarootdir=yes
23336       fi
23337     done
23338   fi
23339
23340 if test "x$ac_warn_datarootdir" = xyes; then
23341   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
23342 fi
23343
23344 EOF
23345 cat >>$CONFIG_STATUS <<EOF
23346   sed "$ac_vpsub
23347 $extrasub
23348 EOF
23349 cat >>$CONFIG_STATUS <<\EOF
23350 :t
23351 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
23352 s,@configure_input@,$configure_input,;t t
23353 s,@srcdir@,$ac_srcdir,;t t
23354 s,@top_srcdir@,$ac_top_srcdir,;t t
23355 s,@INSTALL@,$ac_INSTALL,;t t
23356 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
23357   rm -f $tmp/stdin
23358   if test x"$ac_file" != x-; then
23359     cp $tmp/out $ac_file
23360
23361     for ac_name in prefix exec_prefix datarootdir
23362     do
23363         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
23364         if test -n "$ac_seen"; then
23365             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
23366             if test -z "$ac_init"; then
23367               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
23368               { echo "$as_me:23368: WARNING: Variable $ac_name is used but was not set:
23369 $ac_seen" >&5
23370 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
23371 $ac_seen" >&2;}
23372             fi
23373         fi
23374     done
23375     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
23376     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
23377     if test -s $tmp/out; then
23378       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
23379       { echo "$as_me:23379: WARNING: Some variables may not be substituted:
23380 $ac_seen" >&5
23381 echo "$as_me: WARNING: Some variables may not be substituted:
23382 $ac_seen" >&2;}
23383     fi
23384   else
23385     cat $tmp/out
23386   fi
23387   rm -f $tmp/out
23388
23389 done
23390 EOF
23391 cat >>$CONFIG_STATUS <<\EOF
23392
23393 #
23394 # CONFIG_HEADER section.
23395 #
23396
23397 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
23398 # NAME is the cpp macro being defined and VALUE is the value it is being given.
23399 #
23400 # ac_d sets the value in "#define NAME VALUE" lines.
23401 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
23402 ac_dB='[        ].*$,\1#\2'
23403 ac_dC=' '
23404 ac_dD=',;t'
23405 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
23406 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23407 ac_iB='\([      ]\),\1#\2define\3'
23408 ac_iC=' '
23409 ac_iD='\4,;t'
23410 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
23411 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
23412 ac_uB='$,\1#\2define\3'
23413 ac_uC=' '
23414 ac_uD=',;t'
23415
23416 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
23417   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
23418   case $ac_file in
23419   - | *:- | *:-:* ) # input from stdin
23420         cat >$tmp/stdin
23421         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23422         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23423   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
23424         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
23425   * )   ac_file_in=$ac_file.in ;;
23426   esac
23427
23428   test x"$ac_file" != x- && { echo "$as_me:23428: creating $ac_file" >&5
23429 echo "$as_me: creating $ac_file" >&6;}
23430
23431   # First look for the input files in the build tree, otherwise in the
23432   # src tree.
23433   ac_file_inputs=`IFS=:
23434     for f in $ac_file_in; do
23435       case $f in
23436       -) echo $tmp/stdin ;;
23437       [\\/$]*)
23438          # Absolute (can't be DOS-style, as IFS=:)
23439          test -f "$f" || { { echo "$as_me:23439: error: cannot find input file: $f" >&5
23440 echo "$as_me: error: cannot find input file: $f" >&2;}
23441    { (exit 1); exit 1; }; }
23442          echo $f;;
23443       *) # Relative
23444          if test -f "$f"; then
23445            # Build tree
23446            echo $f
23447          elif test -f "$srcdir/$f"; then
23448            # Source tree
23449            echo $srcdir/$f
23450          else
23451            # /dev/null tree
23452            { { echo "$as_me:23452: error: cannot find input file: $f" >&5
23453 echo "$as_me: error: cannot find input file: $f" >&2;}
23454    { (exit 1); exit 1; }; }
23455          fi;;
23456       esac
23457     done` || { (exit 1); exit 1; }
23458   # Remove the trailing spaces.
23459   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
23460
23461 EOF
23462
23463 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
23464 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
23465 # be either 'cat' or 'sort'.
23466 cat confdefs.h | uniq >conftest.vals
23467
23468 # Break up conftest.vals because some shells have a limit on
23469 # the size of here documents, and old seds have small limits too.
23470
23471 rm -f conftest.tail
23472 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
23473 while grep . conftest.vals >/dev/null
23474 do
23475   # Write chunks of a limited-size here document to conftest.frag.
23476   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
23477   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
23478   echo 'CEOF' >> $CONFIG_STATUS
23479   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
23480   rm -f conftest.vals
23481   mv conftest.tail conftest.vals
23482 done
23483 rm -f conftest.vals
23484
23485 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
23486 # marker @DEFS@.
23487 echo '  cat >> conftest.edit <<CEOF
23488 /@DEFS@/r conftest.frag
23489 /@DEFS@/d
23490 CEOF
23491 sed -f conftest.edit $tmp/in > $tmp/out
23492 rm -f $tmp/in
23493 mv $tmp/out $tmp/in
23494 rm -f conftest.edit conftest.frag
23495 ' >> $CONFIG_STATUS
23496
23497 cat >>$CONFIG_STATUS <<\EOF
23498   # Let's still pretend it is `configure' which instantiates (i.e., don't
23499   # use $as_me), people would be surprised to read:
23500   #    /* config.h.  Generated automatically by config.status.  */
23501   if test x"$ac_file" = x-; then
23502     echo "/* Generated automatically by configure.  */" >$tmp/config.h
23503   else
23504     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
23505   fi
23506   cat $tmp/in >>$tmp/config.h
23507   rm -f $tmp/in
23508   if test x"$ac_file" != x-; then
23509     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
23510       { echo "$as_me:23510: $ac_file is unchanged" >&5
23511 echo "$as_me: $ac_file is unchanged" >&6;}
23512     else
23513       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
23514          X"$ac_file" : 'X\(//\)[^/]' \| \
23515          X"$ac_file" : 'X\(//\)$' \| \
23516          X"$ac_file" : 'X\(/\)' \| \
23517          .     : '\(.\)' 2>/dev/null ||
23518 echo X"$ac_file" |
23519     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
23520           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
23521           /^X\(\/\/\)$/{ s//\1/; q; }
23522           /^X\(\/\).*/{ s//\1/; q; }
23523           s/.*/./; q'`
23524       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
23525         { case "$ac_dir" in
23526   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
23527   *)                      as_incr_dir=.;;
23528 esac
23529 as_dummy="$ac_dir"
23530 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
23531   case $as_mkdir_dir in
23532     # Skip DOS drivespec
23533     ?:) as_incr_dir=$as_mkdir_dir ;;
23534     *)
23535       as_incr_dir=$as_incr_dir/$as_mkdir_dir
23536       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
23537     ;;
23538   esac
23539 done; }
23540
23541       fi
23542       rm -f $ac_file
23543       mv $tmp/config.h $ac_file
23544     fi
23545   else
23546     cat $tmp/config.h
23547     rm -f $tmp/config.h
23548   fi
23549 done
23550 EOF
23551 cat >>$CONFIG_STATUS <<\EOF
23552 #
23553 # CONFIG_COMMANDS section.
23554 #
23555 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
23556   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
23557   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
23558
23559   case $ac_dest in
23560     default )
23561
23562 for cf_dir in .
23563 do
23564         if test ! -d $srcdir/$cf_dir; then
23565                 continue
23566         elif test -f $srcdir/$cf_dir/programs; then
23567                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
23568         fi
23569 done
23570
23571         cat >>Makefile <<TEST_EOF
23572
23573 # These rules are generated so we do not rely on suffix rules, which do not
23574 # work consistently for different make-programs (the '\$(MODEL)/' confuses
23575 # some, and the '\$x' confuses others).
23576 TEST_EOF
23577
23578 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
23579 for N in $LIST
23580 do
23581         cat >>Makefile <<TEST_EOF
23582
23583 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
23584         \$(srcdir)/test.priv.h \\
23585         ncurses_cfg.h
23586         $SHOW_CC
23587         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
23588 TEST_EOF
23589 done
23590
23591 if test -f ../config.guess && test -f ../config.sub
23592 then
23593         cat >>Makefile <<TEST_EOF
23594
23595 # if we used CF_INHERIT for getting these files, we can remove them
23596 distclean::
23597         rm -f config.guess config.sub
23598 TEST_EOF
23599 fi
23600  ;;
23601   esac
23602 done
23603 EOF
23604
23605 cat >>$CONFIG_STATUS <<\EOF
23606
23607 { (exit 0); exit 0; }
23608 EOF
23609 chmod +x $CONFIG_STATUS
23610 ac_clean_files=$ac_clean_files_save
23611
23612 # configure is writing to config.log, and then calls config.status.
23613 # config.status does its own redirection, appending to config.log.
23614 # Unfortunately, on DOS this fails, as config.log is still kept open
23615 # by configure, so config.status won't be able to write to it; its
23616 # output is simply discarded.  So we exec the FD to /dev/null,
23617 # effectively closing config.log, so it can be properly (re)opened and
23618 # appended to by config.status.  When coming back to configure, we
23619 # need to make the FD available again.
23620 if test "$no_create" != yes; then
23621   ac_cs_success=:
23622   exec 5>/dev/null
23623   $SHELL $CONFIG_STATUS || ac_cs_success=false
23624   exec 5>>config.log
23625   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
23626   # would make configure fail if this is the last instruction.
23627   $ac_cs_success || { (exit 1); exit 1; }
23628 fi
23629