]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
5b79162cd0444c946eef583e403f023e3d5acd25
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20180819.
4 #
5 # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
6 # Free Software Foundation, Inc.
7 # This configure script is free software; the Free Software Foundation
8 # gives unlimited permission to copy, distribute and modify it.
9
10 # Avoid depending upon Character Ranges.
11 as_cr_letters='abcdefghijklmnopqrstuvwxyz'
12 as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13 as_cr_Letters=$as_cr_letters$as_cr_LETTERS
14 as_cr_digits='0123456789'
15 as_cr_alnum=$as_cr_Letters$as_cr_digits
16
17 # Sed expression to map a string onto a valid variable name.
18 as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
19
20 # Sed expression to map a string onto a valid CPP name.
21 as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
22
23 # Be Bourne compatible
24 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
25   emulate sh
26   NULLCMD=:
27 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
28   set -o posix
29 fi
30
31 # Name of the executable.
32 as_me=`echo "$0" |sed 's,.*[\\/],,'`
33
34 if expr a : '\(a\)' >/dev/null 2>&1; then
35   as_expr=expr
36 else
37   as_expr=false
38 fi
39
40 rm -f conf$$ conf$$.exe conf$$.file
41 echo >conf$$.file
42 if ln -s conf$$.file conf$$ 2>/dev/null; then
43   # We could just check for DJGPP; but this test a) works b) is more generic
44   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
45   if test -f conf$$.exe; then
46     # Don't use ln at all; we don't have any links
47     as_ln_s='cp -p'
48   else
49     as_ln_s='ln -s'
50   fi
51 elif ln conf$$.file conf$$ 2>/dev/null; then
52   as_ln_s=ln
53 else
54   as_ln_s='cp -p'
55 fi
56 rm -f conf$$ conf$$.exe conf$$.file
57
58 as_executable_p="test -f"
59
60 # Support unset when possible.
61 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
62   as_unset=unset
63 else
64   as_unset=false
65 fi
66
67 # NLS nuisances.
68 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
69 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
70 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
71 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
72 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
73 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
74 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
75 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
76
77 # IFS
78 # We need space, tab and new line, in precisely that order.
79 as_nl='
80 '
81 IFS="   $as_nl"
82
83 # CDPATH.
84 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
85
86 # Name of the host.
87 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
88 # so uname gets run too.
89 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
90
91 exec 6>&1
92
93 #
94 # Initializations.
95 #
96 ac_default_prefix=/usr/local
97 cross_compiling=no
98 subdirs=
99 MFLAGS= MAKEFLAGS=
100 SHELL=${CONFIG_SHELL-/bin/sh}
101
102 # Maximum number of lines to put in a shell here document.
103 # This variable seems obsolete.  It should probably be removed, and
104 # only ac_max_sed_lines should be used.
105 : ${ac_max_here_lines=38}
106
107 ac_unique_file="ncurses.c"
108
109 # Initialize some variables set by options.
110 ac_init_help=
111 ac_init_version=false
112 # The variables have the same names as the options, with
113 # dashes changed to underlines.
114 cache_file=/dev/null
115 exec_prefix=NONE
116 no_create=
117 no_recursion=
118 prefix=NONE
119 program_prefix=NONE
120 program_suffix=NONE
121 program_transform_name=s,x,x,
122 silent=
123 site=
124 srcdir=
125 verbose=
126 x_includes=NONE
127 x_libraries=NONE
128
129 # Installation directory options.
130 # These are left unexpanded so users can "make install exec_prefix=/foo"
131 # and all the variables that are supposed to be based on exec_prefix
132 # by default will actually change.
133 # Use braces instead of parens because sh, perl, etc. also accept them.
134 bindir='${exec_prefix}/bin'
135 sbindir='${exec_prefix}/sbin'
136 libexecdir='${exec_prefix}/libexec'
137 datarootdir='${prefix}/share'
138 datadir='${datarootdir}'
139 sysconfdir='${prefix}/etc'
140 sharedstatedir='${prefix}/com'
141 localstatedir='${prefix}/var'
142 runstatedir='${localstatedir}/run'
143 libdir='${exec_prefix}/lib'
144 includedir='${prefix}/include'
145 oldincludedir='/usr/include'
146 infodir='${datarootdir}/info'
147 mandir='${datarootdir}/man'
148
149 # Identity of this package.
150 PACKAGE_NAME=
151 PACKAGE_TARNAME=
152 PACKAGE_VERSION=
153 PACKAGE_STRING=
154 PACKAGE_BUGREPORT=
155
156 ac_prev=
157 for ac_option
158 do
159   # If the previous option needs an argument, assign it.
160   if test -n "$ac_prev"; then
161     eval "$ac_prev=\$ac_option"
162     ac_prev=
163     continue
164   fi
165
166   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
167
168   # Accept the important Cygnus configure options, so we can diagnose typos.
169
170   case $ac_option in
171
172   -bindir | --bindir | --bindi | --bind | --bin | --bi)
173     ac_prev=bindir ;;
174   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
175     bindir=$ac_optarg ;;
176
177   -build | --build | --buil | --bui | --bu)
178     ac_prev=build_alias ;;
179   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
180     build_alias=$ac_optarg ;;
181
182   -cache-file | --cache-file | --cache-fil | --cache-fi \
183   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
184     ac_prev=cache_file ;;
185   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
186   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
187     cache_file=$ac_optarg ;;
188
189   --config-cache | -C)
190     cache_file=config.cache ;;
191
192   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
193     ac_prev=datadir ;;
194   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
195   | --da=*)
196     datadir=$ac_optarg ;;
197
198   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
199   | --dataroo | --dataro | --datar)
200     ac_prev=datarootdir ;;
201   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
202   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
203     datarootdir=$ac_optarg ;;
204
205   -disable-* | --disable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     eval "enable_$ac_feature=no" ;;
213
214   -enable-* | --enable-*)
215     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
216     # Reject names that are not valid shell variable names.
217     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
218       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
219    { (exit 1); exit 1; }; }
220     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
221     case $ac_option in
222       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
223       *) ac_optarg=yes ;;
224     esac
225     eval "enable_$ac_feature='$ac_optarg'" ;;
226
227   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
228   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
229   | --exec | --exe | --ex)
230     ac_prev=exec_prefix ;;
231   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
232   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
233   | --exec=* | --exe=* | --ex=*)
234     exec_prefix=$ac_optarg ;;
235
236   -gas | --gas | --ga | --g)
237     # Obsolete; use --with-gas.
238     with_gas=yes ;;
239
240   -help | --help | --hel | --he | -h)
241     ac_init_help=long ;;
242   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
243     ac_init_help=recursive ;;
244   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
245     ac_init_help=short ;;
246
247   -host | --host | --hos | --ho)
248     ac_prev=host_alias ;;
249   -host=* | --host=* | --hos=* | --ho=*)
250     host_alias=$ac_optarg ;;
251
252   -includedir | --includedir | --includedi | --included | --include \
253   | --includ | --inclu | --incl | --inc)
254     ac_prev=includedir ;;
255   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
256   | --includ=* | --inclu=* | --incl=* | --inc=*)
257     includedir=$ac_optarg ;;
258
259   -infodir | --infodir | --infodi | --infod | --info | --inf)
260     ac_prev=infodir ;;
261   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
262     infodir=$ac_optarg ;;
263
264   -libdir | --libdir | --libdi | --libd)
265     ac_prev=libdir ;;
266   -libdir=* | --libdir=* | --libdi=* | --libd=*)
267     libdir=$ac_optarg ;;
268
269   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
270   | --libexe | --libex | --libe)
271     ac_prev=libexecdir ;;
272   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
273   | --libexe=* | --libex=* | --libe=*)
274     libexecdir=$ac_optarg ;;
275
276   -localstatedir | --localstatedir | --localstatedi | --localstated \
277   | --localstate | --localstat | --localsta | --localst \
278   | --locals | --local | --loca | --loc | --lo)
279     ac_prev=localstatedir ;;
280   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
281   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
282   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
283     localstatedir=$ac_optarg ;;
284
285   -runstatedir | --runstatedir | --runstatedi | --runstated \
286   | --runstate | --runstat | --runsta | --runst \
287   | --runs | --run | --ru)
288     ac_prev=runstatedir ;;
289   -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
290   | --runstate=* | --runstat=* | --runsta=* | --runst=* \
291   | --runs=* | --run=* | --ru=*)
292     runstatedir=$ac_optarg ;;
293
294   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
295     ac_prev=mandir ;;
296   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
297     mandir=$ac_optarg ;;
298
299   -nfp | --nfp | --nf)
300     # Obsolete; use --without-fp.
301     with_fp=no ;;
302
303   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
304   | --no-cr | --no-c)
305     no_create=yes ;;
306
307   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
308   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
309     no_recursion=yes ;;
310
311   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
312   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
313   | --oldin | --oldi | --old | --ol | --o)
314     ac_prev=oldincludedir ;;
315   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
316   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
317   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
318     oldincludedir=$ac_optarg ;;
319
320   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
321     ac_prev=prefix ;;
322   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
323     prefix=$ac_optarg ;;
324
325   -program-prefix | --program-prefix | --program-prefi | --program-pref \
326   | --program-pre | --program-pr | --program-p)
327     ac_prev=program_prefix ;;
328   -program-prefix=* | --program-prefix=* | --program-prefi=* \
329   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
330     program_prefix=$ac_optarg ;;
331
332   -program-suffix | --program-suffix | --program-suffi | --program-suff \
333   | --program-suf | --program-su | --program-s)
334     ac_prev=program_suffix ;;
335   -program-suffix=* | --program-suffix=* | --program-suffi=* \
336   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
337     program_suffix=$ac_optarg ;;
338
339   -program-transform-name | --program-transform-name \
340   | --program-transform-nam | --program-transform-na \
341   | --program-transform-n | --program-transform- \
342   | --program-transform | --program-transfor \
343   | --program-transfo | --program-transf \
344   | --program-trans | --program-tran \
345   | --progr-tra | --program-tr | --program-t)
346     ac_prev=program_transform_name ;;
347   -program-transform-name=* | --program-transform-name=* \
348   | --program-transform-nam=* | --program-transform-na=* \
349   | --program-transform-n=* | --program-transform-=* \
350   | --program-transform=* | --program-transfor=* \
351   | --program-transfo=* | --program-transf=* \
352   | --program-trans=* | --program-tran=* \
353   | --progr-tra=* | --program-tr=* | --program-t=*)
354     program_transform_name=$ac_optarg ;;
355
356   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
357   | -silent | --silent | --silen | --sile | --sil)
358     silent=yes ;;
359
360   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
361     ac_prev=sbindir ;;
362   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
363   | --sbi=* | --sb=*)
364     sbindir=$ac_optarg ;;
365
366   -sharedstatedir | --sharedstatedir | --sharedstatedi \
367   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
368   | --sharedst | --shareds | --shared | --share | --shar \
369   | --sha | --sh)
370     ac_prev=sharedstatedir ;;
371   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
372   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
373   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
374   | --sha=* | --sh=*)
375     sharedstatedir=$ac_optarg ;;
376
377   -site | --site | --sit)
378     ac_prev=site ;;
379   -site=* | --site=* | --sit=*)
380     site=$ac_optarg ;;
381
382   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
383     ac_prev=srcdir ;;
384   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
385     srcdir=$ac_optarg ;;
386
387   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
388   | --syscon | --sysco | --sysc | --sys | --sy)
389     ac_prev=sysconfdir ;;
390   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
391   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
392     sysconfdir=$ac_optarg ;;
393
394   -target | --target | --targe | --targ | --tar | --ta | --t)
395     ac_prev=target_alias ;;
396   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
397     target_alias=$ac_optarg ;;
398
399   -v | -verbose | --verbose | --verbos | --verbo | --verb)
400     verbose=yes ;;
401
402   -version | --version | --versio | --versi | --vers | -V)
403     ac_init_version=: ;;
404
405   -with-* | --with-*)
406     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
407     # Reject names that are not valid shell variable names.
408     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
409       { echo "$as_me: error: invalid package name: $ac_package" >&2
410    { (exit 1); exit 1; }; }
411     ac_package=`echo $ac_package| sed 's/-/_/g'`
412     case $ac_option in
413       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
414       *) ac_optarg=yes ;;
415     esac
416     eval "with_$ac_package='$ac_optarg'" ;;
417
418   -without-* | --without-*)
419     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
420     # Reject names that are not valid shell variable names.
421     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
422       { echo "$as_me: error: invalid package name: $ac_package" >&2
423    { (exit 1); exit 1; }; }
424     ac_package=`echo $ac_package | sed 's/-/_/g'`
425     eval "with_$ac_package=no" ;;
426
427   --x)
428     # Obsolete; use --with-x.
429     with_x=yes ;;
430
431   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
432   | --x-incl | --x-inc | --x-in | --x-i)
433     ac_prev=x_includes ;;
434   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
435   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
436     x_includes=$ac_optarg ;;
437
438   -x-libraries | --x-libraries | --x-librarie | --x-librari \
439   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
440     ac_prev=x_libraries ;;
441   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
442   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
443     x_libraries=$ac_optarg ;;
444
445   -*) { echo "$as_me: error: unrecognized option: $ac_option
446 Try \`$0 --help' for more information." >&2
447    { (exit 1); exit 1; }; }
448     ;;
449
450   *=*)
451     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
452     # Reject names that are not valid shell variable names.
453     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
454       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
455    { (exit 1); exit 1; }; }
456     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
457     eval "$ac_envvar='$ac_optarg'"
458     export $ac_envvar ;;
459
460   *)
461     # FIXME: should be removed in autoconf 3.0.
462     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
463     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
464       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
465     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
466     ;;
467
468   esac
469 done
470
471 if test -n "$ac_prev"; then
472   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
473   { echo "$as_me: error: missing argument to $ac_option" >&2
474    { (exit 1); exit 1; }; }
475 fi
476
477 # Be sure to have absolute paths.
478 for ac_var in exec_prefix prefix
479 do
480   eval ac_val=$`echo $ac_var`
481   case $ac_val in
482     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
483     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
484    { (exit 1); exit 1; }; };;
485   esac
486 done
487
488 # Be sure to have absolute paths.
489 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
490               localstatedir libdir includedir oldincludedir infodir mandir
491 do
492   eval ac_val=$`echo $ac_var`
493   case $ac_val in
494     [\\/$]* | ?:[\\/]* ) ;;
495     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
496    { (exit 1); exit 1; }; };;
497   esac
498 done
499
500 # There might be people who depend on the old broken behavior: `$host'
501 # used to hold the argument of --host etc.
502 build=$build_alias
503 host=$host_alias
504 target=$target_alias
505
506 # FIXME: should be removed in autoconf 3.0.
507 if test "x$host_alias" != x; then
508   if test "x$build_alias" = x; then
509     cross_compiling=maybe
510     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
511     If a cross compiler is detected then cross compile mode will be used." >&2
512   elif test "x$build_alias" != "x$host_alias"; then
513     cross_compiling=yes
514   fi
515 fi
516
517 ac_tool_prefix=
518 test -n "$host_alias" && ac_tool_prefix=$host_alias-
519
520 test "$silent" = yes && exec 6>/dev/null
521
522 # Find the source files, if location was not specified.
523 if test -z "$srcdir"; then
524   ac_srcdir_defaulted=yes
525   # Try the directory containing this script, then its parent.
526   ac_prog=$0
527   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
528   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
529   srcdir=$ac_confdir
530   if test ! -r $srcdir/$ac_unique_file; then
531     srcdir=..
532   fi
533 else
534   ac_srcdir_defaulted=no
535 fi
536 if test ! -r $srcdir/$ac_unique_file; then
537   if test "$ac_srcdir_defaulted" = yes; then
538     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
539    { (exit 1); exit 1; }; }
540   else
541     { echo "$as_me: error: cannot find sources in $srcdir" >&2
542    { (exit 1); exit 1; }; }
543   fi
544 fi
545 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
546 ac_env_build_alias_set=${build_alias+set}
547 ac_env_build_alias_value=$build_alias
548 ac_cv_env_build_alias_set=${build_alias+set}
549 ac_cv_env_build_alias_value=$build_alias
550 ac_env_host_alias_set=${host_alias+set}
551 ac_env_host_alias_value=$host_alias
552 ac_cv_env_host_alias_set=${host_alias+set}
553 ac_cv_env_host_alias_value=$host_alias
554 ac_env_target_alias_set=${target_alias+set}
555 ac_env_target_alias_value=$target_alias
556 ac_cv_env_target_alias_set=${target_alias+set}
557 ac_cv_env_target_alias_value=$target_alias
558 ac_env_CC_set=${CC+set}
559 ac_env_CC_value=$CC
560 ac_cv_env_CC_set=${CC+set}
561 ac_cv_env_CC_value=$CC
562 ac_env_CFLAGS_set=${CFLAGS+set}
563 ac_env_CFLAGS_value=$CFLAGS
564 ac_cv_env_CFLAGS_set=${CFLAGS+set}
565 ac_cv_env_CFLAGS_value=$CFLAGS
566 ac_env_LDFLAGS_set=${LDFLAGS+set}
567 ac_env_LDFLAGS_value=$LDFLAGS
568 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
569 ac_cv_env_LDFLAGS_value=$LDFLAGS
570 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
571 ac_env_CPPFLAGS_value=$CPPFLAGS
572 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
573 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
574 ac_env_CPP_set=${CPP+set}
575 ac_env_CPP_value=$CPP
576 ac_cv_env_CPP_set=${CPP+set}
577 ac_cv_env_CPP_value=$CPP
578
579 #
580 # Report the --help message.
581 #
582 if test "$ac_init_help" = "long"; then
583   # Omit some internal or obsolete options to make the list less imposing.
584   # This message is too long to be a string in the A/UX 3.1 sh.
585   cat <<EOF
586 \`configure' configures this package to adapt to many kinds of systems.
587
588 Usage: $0 [OPTION]... [VAR=VALUE]...
589
590 To assign environment variables (e.g., CC, CFLAGS...), specify them as
591 VAR=VALUE.  See below for descriptions of some of the useful variables.
592
593 Defaults for the options are specified in brackets.
594
595 Configuration:
596   -h, --help              display this help and exit
597       --help=short        display options specific to this package
598       --help=recursive    display the short help of all the included packages
599   -V, --version           display version information and exit
600   -q, --quiet, --silent   do not print \`checking...' messages
601       --cache-file=FILE   cache test results in FILE [disabled]
602   -C, --config-cache      alias for \`--cache-file=config.cache'
603   -n, --no-create         do not create output files
604       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
605
606 EOF
607
608   cat <<EOF
609 Installation directories:
610   --prefix=PREFIX         install architecture-independent files in PREFIX
611                           [$ac_default_prefix]
612   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
613                           [PREFIX]
614
615 By default, \`make install' will install all the files in
616 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
617 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
618 for instance \`--prefix=\$HOME'.
619
620 For better control, use the options below.
621
622 Fine tuning of the installation directories:
623   --bindir=DIR            user executables [EPREFIX/bin]
624   --sbindir=DIR           system admin executables [EPREFIX/sbin]
625   --libexecdir=DIR        program executables [EPREFIX/libexec]
626   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
627   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
628   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
629   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
630   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
631   --runstatedir=DIR       extra definition of runtime data [LOCALSTATEDIR/run]
632   --libdir=DIR            object code libraries [EPREFIX/lib]
633   --includedir=DIR        C header files [PREFIX/include]
634   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
635   --infodir=DIR           info documentation [DATAROOTDIR/info]
636   --mandir=DIR            man documentation [DATAROOTDIR/man]
637 EOF
638
639   cat <<\EOF
640
641 Program names:
642   --program-prefix=PREFIX            prepend PREFIX to installed program names
643   --program-suffix=SUFFIX            append SUFFIX to installed program names
644   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
645
646 X features:
647   --x-includes=DIR    X include files are in DIR
648   --x-libraries=DIR   X library files are in DIR
649
650 System types:
651   --build=BUILD           configure for building on BUILD [guessed]
652   --host=HOST       build programs to run on HOST [BUILD]
653 EOF
654 fi
655
656 if test -n "$ac_init_help"; then
657
658   cat <<\EOF
659
660 Optional Features:
661   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
662   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
663
664 Optional Packages:
665   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
666   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
667
668 General Options:
669   --disable-stripping     do not strip (debug info) installed executables
670   --enable-string-hacks   work around bogus compiler/loader warnings
671   --with-pkg-config{=path} enable/disable use of pkg-config
672   --disable-echo          do not display "compiling" commands
673 Curses Version-dependent Options:
674   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
675   --disable-widec         disable checks for wide-character functions
676   --with-curses-dir=DIR   directory in which (n)curses is installed
677   --with-screen=XXX       use specified curses-libraries
678   --with-ncursesw         use wide ncurses-libraries
679   --with-ncurses          use ncurses-libraries
680   --with-pdcurses         compile/link with pdcurses X11 library
681   --with-curses-colr      compile/link with HPUX 10.x color-curses
682   --with-curses-5lib      compile/link with SunOS 5lib curses
683   --with-Xaw3d            link with Xaw 3d library
684   --with-Xaw3dxft         link with Xaw 3d xft library
685   --with-neXtaw           link with neXT Athena library
686   --with-XawPlus          link with Athena-Plus library
687   --with-x                use the X Window System
688   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
689   --disable-panel         disable checks for panel functions
690   --disable-menu          disable checks for menu functions
691   --disable-form          disable checks for form functions
692 Testing/development Options:
693   --enable-warnings       test: turn on gcc compiler warnings
694   --with-dmalloc          test: use Gray Watson's dmalloc library
695   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
696   --with-valgrind         test: use valgrind
697   --disable-leaks         test: free permanent memory, analyze leaks
698   --disable-rpath-hack    don't add rpath options for additional libraries
699
700 Some influential environment variables:
701   CC          C compiler command
702   CFLAGS      C compiler flags
703   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
704               nonstandard directory <lib dir>
705   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
706               headers in a nonstandard directory <include dir>
707   CPP         C preprocessor
708
709 Use these variables to override the choices made by `configure' or to help
710 it to find libraries and programs with nonstandard names/locations.
711
712 EOF
713 fi
714
715 if test "$ac_init_help" = "recursive"; then
716   # If there are subdirs, report their specific --help.
717   ac_popdir=`pwd`
718   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
719     cd $ac_subdir
720     # A "../" for each directory in /$ac_subdir.
721     ac_dots=`echo $ac_subdir |
722              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
723
724     case $srcdir in
725     .) # No --srcdir option.  We are building in place.
726       ac_sub_srcdir=$srcdir ;;
727     [\\/]* | ?:[\\/]* ) # Absolute path.
728       ac_sub_srcdir=$srcdir/$ac_subdir ;;
729     *) # Relative path.
730       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
731     esac
732
733     # Check for guested configure; otherwise get Cygnus style configure.
734     if test -f $ac_sub_srcdir/configure.gnu; then
735       echo
736       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
737     elif test -f $ac_sub_srcdir/configure; then
738       echo
739       $SHELL $ac_sub_srcdir/configure  --help=recursive
740     elif test -f $ac_sub_srcdir/configure.ac ||
741            test -f $ac_sub_srcdir/configure.in; then
742       echo
743       $ac_configure --help
744     else
745       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
746     fi
747     cd $ac_popdir
748   done
749 fi
750
751 test -n "$ac_init_help" && exit 0
752 if $ac_init_version; then
753   cat <<\EOF
754
755 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
756 Free Software Foundation, Inc.
757 This configure script is free software; the Free Software Foundation
758 gives unlimited permission to copy, distribute and modify it.
759 EOF
760   exit 0
761 fi
762 exec 5>config.log
763 cat >&5 <<EOF
764 This file contains any messages produced by compilers while
765 running configure, to aid debugging if configure makes a mistake.
766
767 It was created by $as_me, which was
768 generated by GNU Autoconf 2.52.20180819.  Invocation command line was
769
770   $ $0 $@
771
772 EOF
773 {
774 cat <<_ASUNAME
775 ## ---------- ##
776 ## Platform.  ##
777 ## ---------- ##
778
779 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
780 uname -m = `(uname -m) 2>/dev/null || echo unknown`
781 uname -r = `(uname -r) 2>/dev/null || echo unknown`
782 uname -s = `(uname -s) 2>/dev/null || echo unknown`
783 uname -v = `(uname -v) 2>/dev/null || echo unknown`
784
785 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
786 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
787
788 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
789 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
790 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
791 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
792 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
793 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
794 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
795
796 PATH = $PATH
797
798 _ASUNAME
799 } >&5
800
801 cat >&5 <<EOF
802 ## ------------ ##
803 ## Core tests.  ##
804 ## ------------ ##
805
806 EOF
807
808 # Keep a trace of the command line.
809 # Strip out --no-create and --no-recursion so they do not pile up.
810 # Also quote any args containing shell meta-characters.
811 ac_configure_args=
812 ac_sep=
813 for ac_arg
814 do
815   case $ac_arg in
816   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
817   | --no-cr | --no-c) ;;
818   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
819   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
820   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
821     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
822     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
823     ac_sep=" " ;;
824   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
825      ac_sep=" " ;;
826   esac
827   # Get rid of the leading space.
828 done
829
830 # When interrupted or exit'd, cleanup temporary files, and complete
831 # config.log.  We remove comments because anyway the quotes in there
832 # would cause problems or look ugly.
833 trap 'exit_status=$?
834   # Save into config.log some information that might help in debugging.
835   echo >&5
836   echo "## ----------------- ##" >&5
837   echo "## Cache variables.  ##" >&5
838   echo "## ----------------- ##" >&5
839   echo >&5
840   # The following way of writing the cache mishandles newlines in values,
841 {
842   (set) 2>&1 |
843     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
844     *ac_space=\ *)
845       sed -n \
846         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
847           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
848       ;;
849     *)
850       sed -n \
851         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
852       ;;
853     esac;
854 } >&5
855   sed "/^$/d" confdefs.h >conftest.log
856   if test -s conftest.log; then
857     echo >&5
858     echo "## ------------ ##" >&5
859     echo "## confdefs.h.  ##" >&5
860     echo "## ------------ ##" >&5
861     echo >&5
862     cat conftest.log >&5
863   fi
864   (echo; echo) >&5
865   test "$ac_signal" != 0 &&
866     echo "$as_me: caught signal $ac_signal" >&5
867   echo "$as_me: exit $exit_status" >&5
868   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
869     exit $exit_status
870      ' 0
871 for ac_signal in 1 2 13 15; do
872   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
873 done
874 ac_signal=0
875
876 # confdefs.h avoids OS command line length limits that DEFS can exceed.
877 rm -rf conftest* confdefs.h
878 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
879 echo >confdefs.h
880
881 # Let the site file select an alternate cache file if it wants to.
882 # Prefer explicitly selected file to automatically selected ones.
883 if test -z "$CONFIG_SITE"; then
884   if test "x$prefix" != xNONE; then
885     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
886   else
887     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
888   fi
889 fi
890 for ac_site_file in $CONFIG_SITE; do
891   if test -r "$ac_site_file"; then
892     { echo "$as_me:892: loading site script $ac_site_file" >&5
893 echo "$as_me: loading site script $ac_site_file" >&6;}
894     cat "$ac_site_file" >&5
895     . "$ac_site_file"
896   fi
897 done
898
899 if test -r "$cache_file"; then
900   # Some versions of bash will fail to source /dev/null (special
901   # files actually), so we avoid doing that.
902   if test -f "$cache_file"; then
903     { echo "$as_me:903: loading cache $cache_file" >&5
904 echo "$as_me: loading cache $cache_file" >&6;}
905     case $cache_file in
906       [\\/]* | ?:[\\/]* ) . $cache_file;;
907       *)                      . ./$cache_file;;
908     esac
909   fi
910 else
911   { echo "$as_me:911: creating cache $cache_file" >&5
912 echo "$as_me: creating cache $cache_file" >&6;}
913   >$cache_file
914 fi
915
916 # Check that the precious variables saved in the cache have kept the same
917 # value.
918 ac_cache_corrupted=false
919 for ac_var in `(set) 2>&1 |
920                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
921   eval ac_old_set=\$ac_cv_env_${ac_var}_set
922   eval ac_new_set=\$ac_env_${ac_var}_set
923   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
924   eval ac_new_val="\$ac_env_${ac_var}_value"
925   case $ac_old_set,$ac_new_set in
926     set,)
927       { echo "$as_me:927: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
928 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
929       ac_cache_corrupted=: ;;
930     ,set)
931       { echo "$as_me:931: error: \`$ac_var' was not set in the previous run" >&5
932 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
933       ac_cache_corrupted=: ;;
934     ,);;
935     *)
936       if test "x$ac_old_val" != "x$ac_new_val"; then
937         { echo "$as_me:937: error: \`$ac_var' has changed since the previous run:" >&5
938 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
939         { echo "$as_me:939:   former value:  $ac_old_val" >&5
940 echo "$as_me:   former value:  $ac_old_val" >&2;}
941         { echo "$as_me:941:   current value: $ac_new_val" >&5
942 echo "$as_me:   current value: $ac_new_val" >&2;}
943         ac_cache_corrupted=:
944       fi;;
945   esac
946   # Pass precious variables to config.status.  It doesn't matter if
947   # we pass some twice (in addition to the command line arguments).
948   if test "$ac_new_set" = set; then
949     case $ac_new_val in
950     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
951       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
952       ac_configure_args="$ac_configure_args '$ac_arg'"
953       ;;
954     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
955        ;;
956     esac
957   fi
958 done
959 if $ac_cache_corrupted; then
960   { echo "$as_me:960: error: changes in the environment can compromise the build" >&5
961 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
962   { { echo "$as_me:962: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
963 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
964    { (exit 1); exit 1; }; }
965 fi
966
967 ac_ext=c
968 ac_cpp='$CPP $CPPFLAGS'
969 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
970 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
971 ac_compiler_gnu=$ac_cv_c_compiler_gnu
972 ac_main_return=return
973
974 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
975   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
976                    ECHO_T='     ' ;;
977   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
978   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
979 esac
980 echo "#! $SHELL" >conftest.sh
981 echo  "exit 0"   >>conftest.sh
982 chmod +x conftest.sh
983 if { (echo "$as_me:983: PATH=\".;.\"; conftest.sh") >&5
984   (PATH=".;."; conftest.sh) 2>&5
985   ac_status=$?
986   echo "$as_me:986: \$? = $ac_status" >&5
987   (exit $ac_status); }; then
988   ac_path_separator=';'
989 else
990   ac_path_separator=:
991 fi
992 PATH_SEPARATOR="$ac_path_separator"
993 rm -f conftest.sh
994
995 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
996
997 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
998
999 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
1000
1001 ac_aux_dir=
1002 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
1003   if test -f $ac_dir/install-sh; then
1004     ac_aux_dir=$ac_dir
1005     ac_install_sh="$ac_aux_dir/install-sh -c"
1006     break
1007   elif test -f $ac_dir/install.sh; then
1008     ac_aux_dir=$ac_dir
1009     ac_install_sh="$ac_aux_dir/install.sh -c"
1010     break
1011   elif test -f $ac_dir/shtool; then
1012     ac_aux_dir=$ac_dir
1013     ac_install_sh="$ac_aux_dir/shtool install -c"
1014     break
1015   fi
1016 done
1017 if test -z "$ac_aux_dir"; then
1018   { { echo "$as_me:1018: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1019 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1020    { (exit 1); exit 1; }; }
1021 fi
1022 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1023 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1024 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1025
1026 # Make sure we can run config.sub.
1027 $ac_config_sub sun4 >/dev/null 2>&1 ||
1028   { { echo "$as_me:1028: error: cannot run $ac_config_sub" >&5
1029 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1030    { (exit 1); exit 1; }; }
1031
1032 echo "$as_me:1032: checking build system type" >&5
1033 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1034 if test "${ac_cv_build+set}" = set; then
1035   echo $ECHO_N "(cached) $ECHO_C" >&6
1036 else
1037   ac_cv_build_alias=$build_alias
1038 test -z "$ac_cv_build_alias" &&
1039   ac_cv_build_alias=`$ac_config_guess`
1040 test -z "$ac_cv_build_alias" &&
1041   { { echo "$as_me:1041: error: cannot guess build type; you must specify one" >&5
1042 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1043    { (exit 1); exit 1; }; }
1044 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1045   { { echo "$as_me:1045: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1046 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1047    { (exit 1); exit 1; }; }
1048
1049 fi
1050 echo "$as_me:1050: result: $ac_cv_build" >&5
1051 echo "${ECHO_T}$ac_cv_build" >&6
1052 build=$ac_cv_build
1053 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1054 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1055 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1056
1057 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1058         echo "$as_me:1058: checking host system type" >&5
1059 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1060 if test "${ac_cv_host+set}" = set; then
1061   echo $ECHO_N "(cached) $ECHO_C" >&6
1062 else
1063   ac_cv_host_alias=$host_alias
1064 test -z "$ac_cv_host_alias" &&
1065   ac_cv_host_alias=$ac_cv_build_alias
1066 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1067   { { echo "$as_me:1067: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1068 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1069    { (exit 1); exit 1; }; }
1070
1071 fi
1072 echo "$as_me:1072: result: $ac_cv_host" >&5
1073 echo "${ECHO_T}$ac_cv_host" >&6
1074 host=$ac_cv_host
1075 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1076 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1077 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1078
1079         system_name="$host_os"
1080 else
1081         system_name="`(uname -s -r) 2>/dev/null`"
1082         if test -z "$system_name" ; then
1083                 system_name="`(hostname) 2>/dev/null`"
1084         fi
1085 fi
1086 test -n "$system_name" &&
1087 cat >>confdefs.h <<EOF
1088 #define SYSTEM_NAME "$system_name"
1089 EOF
1090
1091 if test "${cf_cv_system_name+set}" = set; then
1092   echo $ECHO_N "(cached) $ECHO_C" >&6
1093 else
1094   cf_cv_system_name="$system_name"
1095 fi
1096
1097 test -z "$system_name" && system_name="$cf_cv_system_name"
1098 test -n "$cf_cv_system_name" && echo "$as_me:1098: result: Configuring for $cf_cv_system_name" >&5
1099 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1100
1101 if test ".$system_name" != ".$cf_cv_system_name" ; then
1102         echo "$as_me:1102: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1103 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1104         { { echo "$as_me:1104: error: \"Please remove config.cache and try again.\"" >&5
1105 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1106    { (exit 1); exit 1; }; }
1107 fi
1108
1109 test "$program_prefix" != NONE &&
1110   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1111 # Use a double $ so make ignores it.
1112 test "$program_suffix" != NONE &&
1113   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1114 # Double any \ or $.  echo might interpret backslashes.
1115 # By default was `s,x,x', remove it if useless.
1116 cat <<\_ACEOF >conftest.sed
1117 s/[\\$]/&&/g;s/;s,x,x,$//
1118 _ACEOF
1119 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1120 rm conftest.sed
1121
1122 echo "$as_me:1122: checking whether ${MAKE-make} sets \${MAKE}" >&5
1123 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1124 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1125 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1126   echo $ECHO_N "(cached) $ECHO_C" >&6
1127 else
1128   cat >conftest.make <<\EOF
1129 all:
1130         @echo 'ac_maketemp="${MAKE}"'
1131 EOF
1132 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1133 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1134 if test -n "$ac_maketemp"; then
1135   eval ac_cv_prog_make_${ac_make}_set=yes
1136 else
1137   eval ac_cv_prog_make_${ac_make}_set=no
1138 fi
1139 rm -f conftest.make
1140 fi
1141 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1142   echo "$as_me:1142: result: yes" >&5
1143 echo "${ECHO_T}yes" >&6
1144   SET_MAKE=
1145 else
1146   echo "$as_me:1146: result: no" >&5
1147 echo "${ECHO_T}no" >&6
1148   SET_MAKE="MAKE=${MAKE-make}"
1149 fi
1150
1151 ac_ext=c
1152 ac_cpp='$CPP $CPPFLAGS'
1153 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1154 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1155 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1156 ac_main_return=return
1157 if test -n "$ac_tool_prefix"; then
1158   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1159 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1160 echo "$as_me:1160: checking for $ac_word" >&5
1161 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1162 if test "${ac_cv_prog_CC+set}" = set; then
1163   echo $ECHO_N "(cached) $ECHO_C" >&6
1164 else
1165   if test -n "$CC"; then
1166   ac_cv_prog_CC="$CC" # Let the user override the test.
1167 else
1168   ac_save_IFS=$IFS; IFS=$ac_path_separator
1169 ac_dummy="$PATH"
1170 for ac_dir in $ac_dummy; do
1171   IFS=$ac_save_IFS
1172   test -z "$ac_dir" && ac_dir=.
1173   $as_executable_p "$ac_dir/$ac_word" || continue
1174 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1175 echo "$as_me:1175: found $ac_dir/$ac_word" >&5
1176 break
1177 done
1178
1179 fi
1180 fi
1181 CC=$ac_cv_prog_CC
1182 if test -n "$CC"; then
1183   echo "$as_me:1183: result: $CC" >&5
1184 echo "${ECHO_T}$CC" >&6
1185 else
1186   echo "$as_me:1186: result: no" >&5
1187 echo "${ECHO_T}no" >&6
1188 fi
1189
1190 fi
1191 if test -z "$ac_cv_prog_CC"; then
1192   ac_ct_CC=$CC
1193   # Extract the first word of "gcc", so it can be a program name with args.
1194 set dummy gcc; ac_word=$2
1195 echo "$as_me:1195: checking for $ac_word" >&5
1196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1197 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1198   echo $ECHO_N "(cached) $ECHO_C" >&6
1199 else
1200   if test -n "$ac_ct_CC"; then
1201   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1202 else
1203   ac_save_IFS=$IFS; IFS=$ac_path_separator
1204 ac_dummy="$PATH"
1205 for ac_dir in $ac_dummy; do
1206   IFS=$ac_save_IFS
1207   test -z "$ac_dir" && ac_dir=.
1208   $as_executable_p "$ac_dir/$ac_word" || continue
1209 ac_cv_prog_ac_ct_CC="gcc"
1210 echo "$as_me:1210: found $ac_dir/$ac_word" >&5
1211 break
1212 done
1213
1214 fi
1215 fi
1216 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1217 if test -n "$ac_ct_CC"; then
1218   echo "$as_me:1218: result: $ac_ct_CC" >&5
1219 echo "${ECHO_T}$ac_ct_CC" >&6
1220 else
1221   echo "$as_me:1221: result: no" >&5
1222 echo "${ECHO_T}no" >&6
1223 fi
1224
1225   CC=$ac_ct_CC
1226 else
1227   CC="$ac_cv_prog_CC"
1228 fi
1229
1230 if test -z "$CC"; then
1231   if test -n "$ac_tool_prefix"; then
1232   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1233 set dummy ${ac_tool_prefix}cc; ac_word=$2
1234 echo "$as_me:1234: checking for $ac_word" >&5
1235 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1236 if test "${ac_cv_prog_CC+set}" = set; then
1237   echo $ECHO_N "(cached) $ECHO_C" >&6
1238 else
1239   if test -n "$CC"; then
1240   ac_cv_prog_CC="$CC" # Let the user override the test.
1241 else
1242   ac_save_IFS=$IFS; IFS=$ac_path_separator
1243 ac_dummy="$PATH"
1244 for ac_dir in $ac_dummy; do
1245   IFS=$ac_save_IFS
1246   test -z "$ac_dir" && ac_dir=.
1247   $as_executable_p "$ac_dir/$ac_word" || continue
1248 ac_cv_prog_CC="${ac_tool_prefix}cc"
1249 echo "$as_me:1249: found $ac_dir/$ac_word" >&5
1250 break
1251 done
1252
1253 fi
1254 fi
1255 CC=$ac_cv_prog_CC
1256 if test -n "$CC"; then
1257   echo "$as_me:1257: result: $CC" >&5
1258 echo "${ECHO_T}$CC" >&6
1259 else
1260   echo "$as_me:1260: result: no" >&5
1261 echo "${ECHO_T}no" >&6
1262 fi
1263
1264 fi
1265 if test -z "$ac_cv_prog_CC"; then
1266   ac_ct_CC=$CC
1267   # Extract the first word of "cc", so it can be a program name with args.
1268 set dummy cc; ac_word=$2
1269 echo "$as_me:1269: checking for $ac_word" >&5
1270 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1271 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1272   echo $ECHO_N "(cached) $ECHO_C" >&6
1273 else
1274   if test -n "$ac_ct_CC"; then
1275   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1276 else
1277   ac_save_IFS=$IFS; IFS=$ac_path_separator
1278 ac_dummy="$PATH"
1279 for ac_dir in $ac_dummy; do
1280   IFS=$ac_save_IFS
1281   test -z "$ac_dir" && ac_dir=.
1282   $as_executable_p "$ac_dir/$ac_word" || continue
1283 ac_cv_prog_ac_ct_CC="cc"
1284 echo "$as_me:1284: found $ac_dir/$ac_word" >&5
1285 break
1286 done
1287
1288 fi
1289 fi
1290 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1291 if test -n "$ac_ct_CC"; then
1292   echo "$as_me:1292: result: $ac_ct_CC" >&5
1293 echo "${ECHO_T}$ac_ct_CC" >&6
1294 else
1295   echo "$as_me:1295: result: no" >&5
1296 echo "${ECHO_T}no" >&6
1297 fi
1298
1299   CC=$ac_ct_CC
1300 else
1301   CC="$ac_cv_prog_CC"
1302 fi
1303
1304 fi
1305 if test -z "$CC"; then
1306   # Extract the first word of "cc", so it can be a program name with args.
1307 set dummy cc; ac_word=$2
1308 echo "$as_me:1308: checking for $ac_word" >&5
1309 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1310 if test "${ac_cv_prog_CC+set}" = set; then
1311   echo $ECHO_N "(cached) $ECHO_C" >&6
1312 else
1313   if test -n "$CC"; then
1314   ac_cv_prog_CC="$CC" # Let the user override the test.
1315 else
1316   ac_prog_rejected=no
1317   ac_save_IFS=$IFS; IFS=$ac_path_separator
1318 ac_dummy="$PATH"
1319 for ac_dir in $ac_dummy; do
1320   IFS=$ac_save_IFS
1321   test -z "$ac_dir" && ac_dir=.
1322   $as_executable_p "$ac_dir/$ac_word" || continue
1323 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1324   ac_prog_rejected=yes
1325   continue
1326 fi
1327 ac_cv_prog_CC="cc"
1328 echo "$as_me:1328: found $ac_dir/$ac_word" >&5
1329 break
1330 done
1331
1332 if test $ac_prog_rejected = yes; then
1333   # We found a bogon in the path, so make sure we never use it.
1334   set dummy $ac_cv_prog_CC
1335   shift
1336   if test $# != 0; then
1337     # We chose a different compiler from the bogus one.
1338     # However, it has the same basename, so the bogon will be chosen
1339     # first if we set CC to just the basename; use the full file name.
1340     shift
1341     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1342     shift
1343     ac_cv_prog_CC="$@"
1344   fi
1345 fi
1346 fi
1347 fi
1348 CC=$ac_cv_prog_CC
1349 if test -n "$CC"; then
1350   echo "$as_me:1350: result: $CC" >&5
1351 echo "${ECHO_T}$CC" >&6
1352 else
1353   echo "$as_me:1353: result: no" >&5
1354 echo "${ECHO_T}no" >&6
1355 fi
1356
1357 fi
1358 if test -z "$CC"; then
1359   if test -n "$ac_tool_prefix"; then
1360   for ac_prog in cl
1361   do
1362     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1363 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1364 echo "$as_me:1364: checking for $ac_word" >&5
1365 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1366 if test "${ac_cv_prog_CC+set}" = set; then
1367   echo $ECHO_N "(cached) $ECHO_C" >&6
1368 else
1369   if test -n "$CC"; then
1370   ac_cv_prog_CC="$CC" # Let the user override the test.
1371 else
1372   ac_save_IFS=$IFS; IFS=$ac_path_separator
1373 ac_dummy="$PATH"
1374 for ac_dir in $ac_dummy; do
1375   IFS=$ac_save_IFS
1376   test -z "$ac_dir" && ac_dir=.
1377   $as_executable_p "$ac_dir/$ac_word" || continue
1378 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1379 echo "$as_me:1379: found $ac_dir/$ac_word" >&5
1380 break
1381 done
1382
1383 fi
1384 fi
1385 CC=$ac_cv_prog_CC
1386 if test -n "$CC"; then
1387   echo "$as_me:1387: result: $CC" >&5
1388 echo "${ECHO_T}$CC" >&6
1389 else
1390   echo "$as_me:1390: result: no" >&5
1391 echo "${ECHO_T}no" >&6
1392 fi
1393
1394     test -n "$CC" && break
1395   done
1396 fi
1397 if test -z "$CC"; then
1398   ac_ct_CC=$CC
1399   for ac_prog in cl
1400 do
1401   # Extract the first word of "$ac_prog", so it can be a program name with args.
1402 set dummy $ac_prog; ac_word=$2
1403 echo "$as_me:1403: checking for $ac_word" >&5
1404 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1405 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1406   echo $ECHO_N "(cached) $ECHO_C" >&6
1407 else
1408   if test -n "$ac_ct_CC"; then
1409   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1410 else
1411   ac_save_IFS=$IFS; IFS=$ac_path_separator
1412 ac_dummy="$PATH"
1413 for ac_dir in $ac_dummy; do
1414   IFS=$ac_save_IFS
1415   test -z "$ac_dir" && ac_dir=.
1416   $as_executable_p "$ac_dir/$ac_word" || continue
1417 ac_cv_prog_ac_ct_CC="$ac_prog"
1418 echo "$as_me:1418: found $ac_dir/$ac_word" >&5
1419 break
1420 done
1421
1422 fi
1423 fi
1424 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1425 if test -n "$ac_ct_CC"; then
1426   echo "$as_me:1426: result: $ac_ct_CC" >&5
1427 echo "${ECHO_T}$ac_ct_CC" >&6
1428 else
1429   echo "$as_me:1429: result: no" >&5
1430 echo "${ECHO_T}no" >&6
1431 fi
1432
1433   test -n "$ac_ct_CC" && break
1434 done
1435
1436   CC=$ac_ct_CC
1437 fi
1438
1439 fi
1440
1441 test -z "$CC" && { { echo "$as_me:1441: error: no acceptable cc found in \$PATH" >&5
1442 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1443    { (exit 1); exit 1; }; }
1444
1445 # Provide some information about the compiler.
1446 echo "$as_me:1446:" \
1447      "checking for C compiler version" >&5
1448 ac_compiler=`set X $ac_compile; echo $2`
1449 { (eval echo "$as_me:1449: \"$ac_compiler --version </dev/null >&5\"") >&5
1450   (eval $ac_compiler --version </dev/null >&5) 2>&5
1451   ac_status=$?
1452   echo "$as_me:1452: \$? = $ac_status" >&5
1453   (exit $ac_status); }
1454 { (eval echo "$as_me:1454: \"$ac_compiler -v </dev/null >&5\"") >&5
1455   (eval $ac_compiler -v </dev/null >&5) 2>&5
1456   ac_status=$?
1457   echo "$as_me:1457: \$? = $ac_status" >&5
1458   (exit $ac_status); }
1459 { (eval echo "$as_me:1459: \"$ac_compiler -V </dev/null >&5\"") >&5
1460   (eval $ac_compiler -V </dev/null >&5) 2>&5
1461   ac_status=$?
1462   echo "$as_me:1462: \$? = $ac_status" >&5
1463   (exit $ac_status); }
1464
1465 cat >conftest.$ac_ext <<_ACEOF
1466 #line 1466 "configure"
1467 #include "confdefs.h"
1468
1469 int
1470 main (void)
1471 {
1472
1473   ;
1474   return 0;
1475 }
1476 _ACEOF
1477 ac_clean_files_save=$ac_clean_files
1478 ac_clean_files="$ac_clean_files a.out a.exe"
1479 # Try to create an executable without -o first, disregard a.out.
1480 # It will help us diagnose broken compilers, and finding out an intuition
1481 # of exeext.
1482 echo "$as_me:1482: checking for C compiler default output" >&5
1483 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1484 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1485 if { (eval echo "$as_me:1485: \"$ac_link_default\"") >&5
1486   (eval $ac_link_default) 2>&5
1487   ac_status=$?
1488   echo "$as_me:1488: \$? = $ac_status" >&5
1489   (exit $ac_status); }; then
1490   # Find the output, starting from the most likely.  This scheme is
1491 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1492 # resort.
1493 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1494                 ls a.out conftest 2>/dev/null;
1495                 ls a.* conftest.* 2>/dev/null`; do
1496   case $ac_file in
1497     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1498     a.out ) # We found the default executable, but exeext='' is most
1499             # certainly right.
1500             break;;
1501     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1502           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1503           export ac_cv_exeext
1504           break;;
1505     * ) break;;
1506   esac
1507 done
1508 else
1509   echo "$as_me: failed program was:" >&5
1510 cat conftest.$ac_ext >&5
1511 { { echo "$as_me:1511: error: C compiler cannot create executables" >&5
1512 echo "$as_me: error: C compiler cannot create executables" >&2;}
1513    { (exit 77); exit 77; }; }
1514 fi
1515
1516 ac_exeext=$ac_cv_exeext
1517 echo "$as_me:1517: result: $ac_file" >&5
1518 echo "${ECHO_T}$ac_file" >&6
1519
1520 # Check the compiler produces executables we can run.  If not, either
1521 # the compiler is broken, or we cross compile.
1522 echo "$as_me:1522: checking whether the C compiler works" >&5
1523 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1524 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1525 # If not cross compiling, check that we can run a simple program.
1526 if test "$cross_compiling" != yes; then
1527   if { ac_try='./$ac_file'
1528   { (eval echo "$as_me:1528: \"$ac_try\"") >&5
1529   (eval $ac_try) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; }; then
1533     cross_compiling=no
1534   else
1535     if test "$cross_compiling" = maybe; then
1536         cross_compiling=yes
1537     else
1538         { { echo "$as_me:1538: error: cannot run C compiled programs.
1539 If you meant to cross compile, use \`--host'." >&5
1540 echo "$as_me: error: cannot run C compiled programs.
1541 If you meant to cross compile, use \`--host'." >&2;}
1542    { (exit 1); exit 1; }; }
1543     fi
1544   fi
1545 fi
1546 echo "$as_me:1546: result: yes" >&5
1547 echo "${ECHO_T}yes" >&6
1548
1549 rm -f a.out a.exe conftest$ac_cv_exeext
1550 ac_clean_files=$ac_clean_files_save
1551 # Check the compiler produces executables we can run.  If not, either
1552 # the compiler is broken, or we cross compile.
1553 echo "$as_me:1553: checking whether we are cross compiling" >&5
1554 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1555 echo "$as_me:1555: result: $cross_compiling" >&5
1556 echo "${ECHO_T}$cross_compiling" >&6
1557
1558 echo "$as_me:1558: checking for executable suffix" >&5
1559 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1560 if { (eval echo "$as_me:1560: \"$ac_link\"") >&5
1561   (eval $ac_link) 2>&5
1562   ac_status=$?
1563   echo "$as_me:1563: \$? = $ac_status" >&5
1564   (exit $ac_status); }; then
1565   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1566 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1567 # work properly (i.e., refer to `conftest.exe'), while it won't with
1568 # `rm'.
1569 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1570   case $ac_file in
1571     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1572     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1573           export ac_cv_exeext
1574           break;;
1575     * ) break;;
1576   esac
1577 done
1578 else
1579   { { echo "$as_me:1579: error: cannot compute EXEEXT: cannot compile and link" >&5
1580 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1581    { (exit 1); exit 1; }; }
1582 fi
1583
1584 rm -f conftest$ac_cv_exeext
1585 echo "$as_me:1585: result: $ac_cv_exeext" >&5
1586 echo "${ECHO_T}$ac_cv_exeext" >&6
1587
1588 rm -f conftest.$ac_ext
1589 EXEEXT=$ac_cv_exeext
1590 ac_exeext=$EXEEXT
1591 echo "$as_me:1591: checking for object suffix" >&5
1592 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1593 if test "${ac_cv_objext+set}" = set; then
1594   echo $ECHO_N "(cached) $ECHO_C" >&6
1595 else
1596   cat >conftest.$ac_ext <<_ACEOF
1597 #line 1597 "configure"
1598 #include "confdefs.h"
1599
1600 int
1601 main (void)
1602 {
1603
1604   ;
1605   return 0;
1606 }
1607 _ACEOF
1608 rm -f conftest.o conftest.obj
1609 if { (eval echo "$as_me:1609: \"$ac_compile\"") >&5
1610   (eval $ac_compile) 2>&5
1611   ac_status=$?
1612   echo "$as_me:1612: \$? = $ac_status" >&5
1613   (exit $ac_status); }; then
1614   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1615   case $ac_file in
1616     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1617     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1618        break;;
1619   esac
1620 done
1621 else
1622   echo "$as_me: failed program was:" >&5
1623 cat conftest.$ac_ext >&5
1624 { { echo "$as_me:1624: error: cannot compute OBJEXT: cannot compile" >&5
1625 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1626    { (exit 1); exit 1; }; }
1627 fi
1628
1629 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1630 fi
1631 echo "$as_me:1631: result: $ac_cv_objext" >&5
1632 echo "${ECHO_T}$ac_cv_objext" >&6
1633 OBJEXT=$ac_cv_objext
1634 ac_objext=$OBJEXT
1635 echo "$as_me:1635: checking whether we are using the GNU C compiler" >&5
1636 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1637 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1638   echo $ECHO_N "(cached) $ECHO_C" >&6
1639 else
1640   cat >conftest.$ac_ext <<_ACEOF
1641 #line 1641 "configure"
1642 #include "confdefs.h"
1643
1644 int
1645 main (void)
1646 {
1647 #ifndef __GNUC__
1648        choke me
1649 #endif
1650
1651   ;
1652   return 0;
1653 }
1654 _ACEOF
1655 rm -f conftest.$ac_objext
1656 if { (eval echo "$as_me:1656: \"$ac_compile\"") >&5
1657   (eval $ac_compile) 2>&5
1658   ac_status=$?
1659   echo "$as_me:1659: \$? = $ac_status" >&5
1660   (exit $ac_status); } &&
1661          { ac_try='test -s conftest.$ac_objext'
1662   { (eval echo "$as_me:1662: \"$ac_try\"") >&5
1663   (eval $ac_try) 2>&5
1664   ac_status=$?
1665   echo "$as_me:1665: \$? = $ac_status" >&5
1666   (exit $ac_status); }; }; then
1667   ac_compiler_gnu=yes
1668 else
1669   echo "$as_me: failed program was:" >&5
1670 cat conftest.$ac_ext >&5
1671 ac_compiler_gnu=no
1672 fi
1673 rm -f conftest.$ac_objext conftest.$ac_ext
1674 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1675
1676 fi
1677 echo "$as_me:1677: result: $ac_cv_c_compiler_gnu" >&5
1678 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1679 GCC=`test $ac_compiler_gnu = yes && echo yes`
1680 ac_test_CFLAGS=${CFLAGS+set}
1681 ac_save_CFLAGS=$CFLAGS
1682 CFLAGS="-g"
1683 echo "$as_me:1683: checking whether $CC accepts -g" >&5
1684 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1685 if test "${ac_cv_prog_cc_g+set}" = set; then
1686   echo $ECHO_N "(cached) $ECHO_C" >&6
1687 else
1688   cat >conftest.$ac_ext <<_ACEOF
1689 #line 1689 "configure"
1690 #include "confdefs.h"
1691
1692 int
1693 main (void)
1694 {
1695
1696   ;
1697   return 0;
1698 }
1699 _ACEOF
1700 rm -f conftest.$ac_objext
1701 if { (eval echo "$as_me:1701: \"$ac_compile\"") >&5
1702   (eval $ac_compile) 2>&5
1703   ac_status=$?
1704   echo "$as_me:1704: \$? = $ac_status" >&5
1705   (exit $ac_status); } &&
1706          { ac_try='test -s conftest.$ac_objext'
1707   { (eval echo "$as_me:1707: \"$ac_try\"") >&5
1708   (eval $ac_try) 2>&5
1709   ac_status=$?
1710   echo "$as_me:1710: \$? = $ac_status" >&5
1711   (exit $ac_status); }; }; then
1712   ac_cv_prog_cc_g=yes
1713 else
1714   echo "$as_me: failed program was:" >&5
1715 cat conftest.$ac_ext >&5
1716 ac_cv_prog_cc_g=no
1717 fi
1718 rm -f conftest.$ac_objext conftest.$ac_ext
1719 fi
1720 echo "$as_me:1720: result: $ac_cv_prog_cc_g" >&5
1721 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1722 if test "$ac_test_CFLAGS" = set; then
1723   CFLAGS=$ac_save_CFLAGS
1724 elif test $ac_cv_prog_cc_g = yes; then
1725   if test "$GCC" = yes; then
1726     CFLAGS="-g -O2"
1727   else
1728     CFLAGS="-g"
1729   fi
1730 else
1731   if test "$GCC" = yes; then
1732     CFLAGS="-O2"
1733   else
1734     CFLAGS=
1735   fi
1736 fi
1737 # Some people use a C++ compiler to compile C.  Since we use `exit',
1738 # in C++ we need to declare it.  In case someone uses the same compiler
1739 # for both compiling C and C++ we need to have the C++ compiler decide
1740 # the declaration of exit, since it's the most demanding environment.
1741 cat >conftest.$ac_ext <<_ACEOF
1742 #ifndef __cplusplus
1743   choke me
1744 #endif
1745 _ACEOF
1746 rm -f conftest.$ac_objext
1747 if { (eval echo "$as_me:1747: \"$ac_compile\"") >&5
1748   (eval $ac_compile) 2>&5
1749   ac_status=$?
1750   echo "$as_me:1750: \$? = $ac_status" >&5
1751   (exit $ac_status); } &&
1752          { ac_try='test -s conftest.$ac_objext'
1753   { (eval echo "$as_me:1753: \"$ac_try\"") >&5
1754   (eval $ac_try) 2>&5
1755   ac_status=$?
1756   echo "$as_me:1756: \$? = $ac_status" >&5
1757   (exit $ac_status); }; }; then
1758   for ac_declaration in \
1759    ''\
1760    '#include <stdlib.h>' \
1761    'extern "C" void std::exit (int) throw (); using std::exit;' \
1762    'extern "C" void std::exit (int); using std::exit;' \
1763    'extern "C" void exit (int) throw ();' \
1764    'extern "C" void exit (int);' \
1765    'void exit (int);'
1766 do
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 #include <stdlib.h>
1771 $ac_declaration
1772 int
1773 main (void)
1774 {
1775 exit (42);
1776   ;
1777   return 0;
1778 }
1779 _ACEOF
1780 rm -f conftest.$ac_objext
1781 if { (eval echo "$as_me:1781: \"$ac_compile\"") >&5
1782   (eval $ac_compile) 2>&5
1783   ac_status=$?
1784   echo "$as_me:1784: \$? = $ac_status" >&5
1785   (exit $ac_status); } &&
1786          { ac_try='test -s conftest.$ac_objext'
1787   { (eval echo "$as_me:1787: \"$ac_try\"") >&5
1788   (eval $ac_try) 2>&5
1789   ac_status=$?
1790   echo "$as_me:1790: \$? = $ac_status" >&5
1791   (exit $ac_status); }; }; then
1792   :
1793 else
1794   echo "$as_me: failed program was:" >&5
1795 cat conftest.$ac_ext >&5
1796 continue
1797 fi
1798 rm -f conftest.$ac_objext conftest.$ac_ext
1799   cat >conftest.$ac_ext <<_ACEOF
1800 #line 1800 "configure"
1801 #include "confdefs.h"
1802 $ac_declaration
1803 int
1804 main (void)
1805 {
1806 exit (42);
1807   ;
1808   return 0;
1809 }
1810 _ACEOF
1811 rm -f conftest.$ac_objext
1812 if { (eval echo "$as_me:1812: \"$ac_compile\"") >&5
1813   (eval $ac_compile) 2>&5
1814   ac_status=$?
1815   echo "$as_me:1815: \$? = $ac_status" >&5
1816   (exit $ac_status); } &&
1817          { ac_try='test -s conftest.$ac_objext'
1818   { (eval echo "$as_me:1818: \"$ac_try\"") >&5
1819   (eval $ac_try) 2>&5
1820   ac_status=$?
1821   echo "$as_me:1821: \$? = $ac_status" >&5
1822   (exit $ac_status); }; }; then
1823   break
1824 else
1825   echo "$as_me: failed program was:" >&5
1826 cat conftest.$ac_ext >&5
1827 fi
1828 rm -f conftest.$ac_objext conftest.$ac_ext
1829 done
1830 rm -rf conftest*
1831 if test -n "$ac_declaration"; then
1832   echo '#ifdef __cplusplus' >>confdefs.h
1833   echo $ac_declaration      >>confdefs.h
1834   echo '#endif'             >>confdefs.h
1835 fi
1836
1837 else
1838   echo "$as_me: failed program was:" >&5
1839 cat conftest.$ac_ext >&5
1840 fi
1841 rm -f conftest.$ac_objext conftest.$ac_ext
1842 ac_ext=c
1843 ac_cpp='$CPP $CPPFLAGS'
1844 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1845 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1846 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1847 ac_main_return=return
1848
1849 GCC_VERSION=none
1850 if test "$GCC" = yes ; then
1851         echo "$as_me:1851: checking version of $CC" >&5
1852 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1853         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
1854         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1855         echo "$as_me:1855: result: $GCC_VERSION" >&5
1856 echo "${ECHO_T}$GCC_VERSION" >&6
1857 fi
1858
1859 echo "$as_me:1859: checking for $CC option to accept ANSI C" >&5
1860 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1861 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1862   echo $ECHO_N "(cached) $ECHO_C" >&6
1863 else
1864   ac_cv_prog_cc_stdc=no
1865 ac_save_CC=$CC
1866 cat >conftest.$ac_ext <<_ACEOF
1867 #line 1867 "configure"
1868 #include "confdefs.h"
1869 #include <stdarg.h>
1870 #include <stdio.h>
1871 #include <sys/types.h>
1872 #include <sys/stat.h>
1873 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1874 struct buf { int x; };
1875 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1876 static char *e (p, i)
1877      char **p;
1878      int i;
1879 {
1880   return p[i];
1881 }
1882 static char *f (char * (*g) (char **, int), char **p, ...)
1883 {
1884   char *s;
1885   va_list v;
1886   va_start (v,p);
1887   s = g (p, va_arg (v,int));
1888   va_end (v);
1889   return s;
1890 }
1891 int test (int i, double x);
1892 struct s1 {int (*f) (int a);};
1893 struct s2 {int (*f) (double a);};
1894 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1895 int argc;
1896 char **argv;
1897 int
1898 main (void)
1899 {
1900 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1901   ;
1902   return 0;
1903 }
1904 _ACEOF
1905 # Don't try gcc -ansi; that turns off useful extensions and
1906 # breaks some systems' header files.
1907 # AIX                   -qlanglvl=ansi
1908 # Ultrix and OSF/1      -std1
1909 # HP-UX 10.20 and later -Ae
1910 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1911 # SVR4                  -Xc -D__EXTENSIONS__
1912 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1913 do
1914   CC="$ac_save_CC $ac_arg"
1915   rm -f conftest.$ac_objext
1916 if { (eval echo "$as_me:1916: \"$ac_compile\"") >&5
1917   (eval $ac_compile) 2>&5
1918   ac_status=$?
1919   echo "$as_me:1919: \$? = $ac_status" >&5
1920   (exit $ac_status); } &&
1921          { ac_try='test -s conftest.$ac_objext'
1922   { (eval echo "$as_me:1922: \"$ac_try\"") >&5
1923   (eval $ac_try) 2>&5
1924   ac_status=$?
1925   echo "$as_me:1925: \$? = $ac_status" >&5
1926   (exit $ac_status); }; }; then
1927   ac_cv_prog_cc_stdc=$ac_arg
1928 break
1929 else
1930   echo "$as_me: failed program was:" >&5
1931 cat conftest.$ac_ext >&5
1932 fi
1933 rm -f conftest.$ac_objext
1934 done
1935 rm -f conftest.$ac_ext conftest.$ac_objext
1936 CC=$ac_save_CC
1937
1938 fi
1939
1940 case "x$ac_cv_prog_cc_stdc" in
1941   x|xno)
1942     echo "$as_me:1942: result: none needed" >&5
1943 echo "${ECHO_T}none needed" >&6 ;;
1944   *)
1945     echo "$as_me:1945: result: $ac_cv_prog_cc_stdc" >&5
1946 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1947     CC="$CC $ac_cv_prog_cc_stdc" ;;
1948 esac
1949
1950 # This should have been defined by AC_PROG_CC
1951 : ${CC:=cc}
1952
1953 echo "$as_me:1953: checking \$CFLAGS variable" >&5
1954 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6
1955 case "x$CFLAGS" in
1956 (*-[IUD]*)
1957         echo "$as_me:1957: result: broken" >&5
1958 echo "${ECHO_T}broken" >&6
1959         { echo "$as_me:1959: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5
1960 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;}
1961         cf_flags="$CFLAGS"
1962         CFLAGS=
1963         for cf_arg in $cf_flags
1964         do
1965
1966 cf_fix_cppflags=no
1967 cf_new_cflags=
1968 cf_new_cppflags=
1969 cf_new_extra_cppflags=
1970
1971 for cf_add_cflags in $cf_arg
1972 do
1973 case $cf_fix_cppflags in
1974 (no)
1975         case $cf_add_cflags in
1976         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1977                 case $cf_add_cflags in
1978                 (-D*)
1979                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1980
1981                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1982                                 && test -z "${cf_tst_cflags}" \
1983                                 && cf_fix_cppflags=yes
1984
1985                         if test $cf_fix_cppflags = yes ; then
1986
1987         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1988         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1989
1990                                 continue
1991                         elif test "${cf_tst_cflags}" = "\"'" ; then
1992
1993         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1994         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1995
1996                                 continue
1997                         fi
1998                         ;;
1999                 esac
2000                 case "$CPPFLAGS" in
2001                 (*$cf_add_cflags)
2002                         ;;
2003                 (*)
2004                         case $cf_add_cflags in
2005                         (-D*)
2006                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2007
2008 CPPFLAGS=`echo "$CPPFLAGS" | \
2009         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2010                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2011
2012                                 ;;
2013                         esac
2014
2015         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2016         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2017
2018                         ;;
2019                 esac
2020                 ;;
2021         (*)
2022
2023         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2024         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2025
2026                 ;;
2027         esac
2028         ;;
2029 (yes)
2030
2031         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2032         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2033
2034         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2035
2036         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2037                 && test -z "${cf_tst_cflags}" \
2038                 && cf_fix_cppflags=no
2039         ;;
2040 esac
2041 done
2042
2043 if test -n "$cf_new_cflags" ; then
2044
2045         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2046         CFLAGS="${CFLAGS}$cf_new_cflags"
2047
2048 fi
2049
2050 if test -n "$cf_new_cppflags" ; then
2051
2052         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2053         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2054
2055 fi
2056
2057 if test -n "$cf_new_extra_cppflags" ; then
2058
2059         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2060         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2061
2062 fi
2063
2064         done
2065         ;;
2066 (*)
2067         echo "$as_me:2067: result: ok" >&5
2068 echo "${ECHO_T}ok" >&6
2069         ;;
2070 esac
2071
2072 echo "$as_me:2072: checking \$CC variable" >&5
2073 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2074 case "$CC" in
2075 (*[\ \  ]-*)
2076         echo "$as_me:2076: result: broken" >&5
2077 echo "${ECHO_T}broken" >&6
2078         { echo "$as_me:2078: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2079 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2080         # humor him...
2081         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
2082         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
2083         CC="$cf_prog"
2084         for cf_arg in $cf_flags
2085         do
2086                 case "x$cf_arg" in
2087                 (x-[IUDfgOW]*)
2088
2089 cf_fix_cppflags=no
2090 cf_new_cflags=
2091 cf_new_cppflags=
2092 cf_new_extra_cppflags=
2093
2094 for cf_add_cflags in $cf_arg
2095 do
2096 case $cf_fix_cppflags in
2097 (no)
2098         case $cf_add_cflags in
2099         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
2100                 case $cf_add_cflags in
2101                 (-D*)
2102                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2103
2104                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2105                                 && test -z "${cf_tst_cflags}" \
2106                                 && cf_fix_cppflags=yes
2107
2108                         if test $cf_fix_cppflags = yes ; then
2109
2110         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2111         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2112
2113                                 continue
2114                         elif test "${cf_tst_cflags}" = "\"'" ; then
2115
2116         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2117         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2118
2119                                 continue
2120                         fi
2121                         ;;
2122                 esac
2123                 case "$CPPFLAGS" in
2124                 (*$cf_add_cflags)
2125                         ;;
2126                 (*)
2127                         case $cf_add_cflags in
2128                         (-D*)
2129                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2130
2131 CPPFLAGS=`echo "$CPPFLAGS" | \
2132         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2133                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2134
2135                                 ;;
2136                         esac
2137
2138         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2139         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2140
2141                         ;;
2142                 esac
2143                 ;;
2144         (*)
2145
2146         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2147         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2148
2149                 ;;
2150         esac
2151         ;;
2152 (yes)
2153
2154         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2155         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2156
2157         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2158
2159         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2160                 && test -z "${cf_tst_cflags}" \
2161                 && cf_fix_cppflags=no
2162         ;;
2163 esac
2164 done
2165
2166 if test -n "$cf_new_cflags" ; then
2167
2168         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2169         CFLAGS="${CFLAGS}$cf_new_cflags"
2170
2171 fi
2172
2173 if test -n "$cf_new_cppflags" ; then
2174
2175         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2176         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2177
2178 fi
2179
2180 if test -n "$cf_new_extra_cppflags" ; then
2181
2182         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2183         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2184
2185 fi
2186
2187                         ;;
2188                 (*)
2189                         CC="$CC $cf_arg"
2190                         ;;
2191                 esac
2192         done
2193         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2194
2195 echo "${as_me:-configure}:2195: testing resulting CC: '$CC' ..." 1>&5
2196
2197         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2198
2199 echo "${as_me:-configure}:2199: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2200
2201         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2202
2203 echo "${as_me:-configure}:2203: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2204
2205         ;;
2206 (*)
2207         echo "$as_me:2207: result: ok" >&5
2208 echo "${ECHO_T}ok" >&6
2209         ;;
2210 esac
2211
2212 echo "$as_me:2212: checking for inline" >&5
2213 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2214 if test "${ac_cv_c_inline+set}" = set; then
2215   echo $ECHO_N "(cached) $ECHO_C" >&6
2216 else
2217   ac_cv_c_inline=no
2218 for ac_kw in inline __inline__ __inline; do
2219   cat >conftest.$ac_ext <<_ACEOF
2220 #line 2220 "configure"
2221 #include "confdefs.h"
2222 #ifndef __cplusplus
2223 static $ac_kw int static_foo () {return 0; }
2224 $ac_kw int foo () {return 0; }
2225 #endif
2226
2227 _ACEOF
2228 rm -f conftest.$ac_objext
2229 if { (eval echo "$as_me:2229: \"$ac_compile\"") >&5
2230   (eval $ac_compile) 2>&5
2231   ac_status=$?
2232   echo "$as_me:2232: \$? = $ac_status" >&5
2233   (exit $ac_status); } &&
2234          { ac_try='test -s conftest.$ac_objext'
2235   { (eval echo "$as_me:2235: \"$ac_try\"") >&5
2236   (eval $ac_try) 2>&5
2237   ac_status=$?
2238   echo "$as_me:2238: \$? = $ac_status" >&5
2239   (exit $ac_status); }; }; then
2240   ac_cv_c_inline=$ac_kw; break
2241 else
2242   echo "$as_me: failed program was:" >&5
2243 cat conftest.$ac_ext >&5
2244 fi
2245 rm -f conftest.$ac_objext conftest.$ac_ext
2246 done
2247
2248 fi
2249 echo "$as_me:2249: result: $ac_cv_c_inline" >&5
2250 echo "${ECHO_T}$ac_cv_c_inline" >&6
2251 case $ac_cv_c_inline in
2252   inline | yes) ;;
2253   no)
2254 cat >>confdefs.h <<\EOF
2255 #define inline
2256 EOF
2257  ;;
2258   *)  cat >>confdefs.h <<EOF
2259 #define inline $ac_cv_c_inline
2260 EOF
2261  ;;
2262 esac
2263
2264 ac_ext=c
2265 ac_cpp='$CPP $CPPFLAGS'
2266 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2267 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2268 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2269 ac_main_return=return
2270 echo "$as_me:2270: checking how to run the C preprocessor" >&5
2271 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2272 # On Suns, sometimes $CPP names a directory.
2273 if test -n "$CPP" && test -d "$CPP"; then
2274   CPP=
2275 fi
2276 if test -z "$CPP"; then
2277   if test "${ac_cv_prog_CPP+set}" = set; then
2278   echo $ECHO_N "(cached) $ECHO_C" >&6
2279 else
2280       # Double quotes because CPP needs to be expanded
2281     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2282     do
2283       ac_preproc_ok=false
2284 for ac_c_preproc_warn_flag in '' yes
2285 do
2286   # Use a header file that comes with gcc, so configuring glibc
2287   # with a fresh cross-compiler works.
2288   # On the NeXT, cc -E runs the code through the compiler's parser,
2289   # not just through cpp. "Syntax error" is here to catch this case.
2290   cat >conftest.$ac_ext <<_ACEOF
2291 #line 2291 "configure"
2292 #include "confdefs.h"
2293 #include <assert.h>
2294                      Syntax error
2295 _ACEOF
2296 if { (eval echo "$as_me:2296: \"$ac_cpp conftest.$ac_ext\"") >&5
2297   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2298   ac_status=$?
2299   egrep -v '^ *\+' conftest.er1 >conftest.err
2300   rm -f conftest.er1
2301   cat conftest.err >&5
2302   echo "$as_me:2302: \$? = $ac_status" >&5
2303   (exit $ac_status); } >/dev/null; then
2304   if test -s conftest.err; then
2305     ac_cpp_err=$ac_c_preproc_warn_flag
2306   else
2307     ac_cpp_err=
2308   fi
2309 else
2310   ac_cpp_err=yes
2311 fi
2312 if test -z "$ac_cpp_err"; then
2313   :
2314 else
2315   echo "$as_me: failed program was:" >&5
2316   cat conftest.$ac_ext >&5
2317   # Broken: fails on valid input.
2318 continue
2319 fi
2320 rm -f conftest.err conftest.$ac_ext
2321
2322   # OK, works on sane cases.  Now check whether non-existent headers
2323   # can be detected and how.
2324   cat >conftest.$ac_ext <<_ACEOF
2325 #line 2325 "configure"
2326 #include "confdefs.h"
2327 #include <ac_nonexistent.h>
2328 _ACEOF
2329 if { (eval echo "$as_me:2329: \"$ac_cpp conftest.$ac_ext\"") >&5
2330   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2331   ac_status=$?
2332   egrep -v '^ *\+' conftest.er1 >conftest.err
2333   rm -f conftest.er1
2334   cat conftest.err >&5
2335   echo "$as_me:2335: \$? = $ac_status" >&5
2336   (exit $ac_status); } >/dev/null; then
2337   if test -s conftest.err; then
2338     ac_cpp_err=$ac_c_preproc_warn_flag
2339   else
2340     ac_cpp_err=
2341   fi
2342 else
2343   ac_cpp_err=yes
2344 fi
2345 if test -z "$ac_cpp_err"; then
2346   # Broken: success on invalid input.
2347 continue
2348 else
2349   echo "$as_me: failed program was:" >&5
2350   cat conftest.$ac_ext >&5
2351   # Passes both tests.
2352 ac_preproc_ok=:
2353 break
2354 fi
2355 rm -f conftest.err conftest.$ac_ext
2356
2357 done
2358 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2359 rm -f conftest.err conftest.$ac_ext
2360 if $ac_preproc_ok; then
2361   break
2362 fi
2363
2364     done
2365     ac_cv_prog_CPP=$CPP
2366
2367 fi
2368   CPP=$ac_cv_prog_CPP
2369 else
2370   ac_cv_prog_CPP=$CPP
2371 fi
2372 echo "$as_me:2372: result: $CPP" >&5
2373 echo "${ECHO_T}$CPP" >&6
2374 ac_preproc_ok=false
2375 for ac_c_preproc_warn_flag in '' yes
2376 do
2377   # Use a header file that comes with gcc, so configuring glibc
2378   # with a fresh cross-compiler works.
2379   # On the NeXT, cc -E runs the code through the compiler's parser,
2380   # not just through cpp. "Syntax error" is here to catch this case.
2381   cat >conftest.$ac_ext <<_ACEOF
2382 #line 2382 "configure"
2383 #include "confdefs.h"
2384 #include <assert.h>
2385                      Syntax error
2386 _ACEOF
2387 if { (eval echo "$as_me:2387: \"$ac_cpp conftest.$ac_ext\"") >&5
2388   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2389   ac_status=$?
2390   egrep -v '^ *\+' conftest.er1 >conftest.err
2391   rm -f conftest.er1
2392   cat conftest.err >&5
2393   echo "$as_me:2393: \$? = $ac_status" >&5
2394   (exit $ac_status); } >/dev/null; then
2395   if test -s conftest.err; then
2396     ac_cpp_err=$ac_c_preproc_warn_flag
2397   else
2398     ac_cpp_err=
2399   fi
2400 else
2401   ac_cpp_err=yes
2402 fi
2403 if test -z "$ac_cpp_err"; then
2404   :
2405 else
2406   echo "$as_me: failed program was:" >&5
2407   cat conftest.$ac_ext >&5
2408   # Broken: fails on valid input.
2409 continue
2410 fi
2411 rm -f conftest.err conftest.$ac_ext
2412
2413   # OK, works on sane cases.  Now check whether non-existent headers
2414   # can be detected and how.
2415   cat >conftest.$ac_ext <<_ACEOF
2416 #line 2416 "configure"
2417 #include "confdefs.h"
2418 #include <ac_nonexistent.h>
2419 _ACEOF
2420 if { (eval echo "$as_me:2420: \"$ac_cpp conftest.$ac_ext\"") >&5
2421   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2422   ac_status=$?
2423   egrep -v '^ *\+' conftest.er1 >conftest.err
2424   rm -f conftest.er1
2425   cat conftest.err >&5
2426   echo "$as_me:2426: \$? = $ac_status" >&5
2427   (exit $ac_status); } >/dev/null; then
2428   if test -s conftest.err; then
2429     ac_cpp_err=$ac_c_preproc_warn_flag
2430   else
2431     ac_cpp_err=
2432   fi
2433 else
2434   ac_cpp_err=yes
2435 fi
2436 if test -z "$ac_cpp_err"; then
2437   # Broken: success on invalid input.
2438 continue
2439 else
2440   echo "$as_me: failed program was:" >&5
2441   cat conftest.$ac_ext >&5
2442   # Passes both tests.
2443 ac_preproc_ok=:
2444 break
2445 fi
2446 rm -f conftest.err conftest.$ac_ext
2447
2448 done
2449 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2450 rm -f conftest.err conftest.$ac_ext
2451 if $ac_preproc_ok; then
2452   :
2453 else
2454   { { echo "$as_me:2454: error: C preprocessor \"$CPP\" fails sanity check" >&5
2455 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2456    { (exit 1); exit 1; }; }
2457 fi
2458
2459 ac_ext=c
2460 ac_cpp='$CPP $CPPFLAGS'
2461 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2462 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2463 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2464 ac_main_return=return
2465
2466 for ac_prog in mawk gawk nawk awk
2467 do
2468   # Extract the first word of "$ac_prog", so it can be a program name with args.
2469 set dummy $ac_prog; ac_word=$2
2470 echo "$as_me:2470: checking for $ac_word" >&5
2471 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2472 if test "${ac_cv_prog_AWK+set}" = set; then
2473   echo $ECHO_N "(cached) $ECHO_C" >&6
2474 else
2475   if test -n "$AWK"; then
2476   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2477 else
2478   ac_save_IFS=$IFS; IFS=$ac_path_separator
2479 ac_dummy="$PATH"
2480 for ac_dir in $ac_dummy; do
2481   IFS=$ac_save_IFS
2482   test -z "$ac_dir" && ac_dir=.
2483   $as_executable_p "$ac_dir/$ac_word" || continue
2484 ac_cv_prog_AWK="$ac_prog"
2485 echo "$as_me:2485: found $ac_dir/$ac_word" >&5
2486 break
2487 done
2488
2489 fi
2490 fi
2491 AWK=$ac_cv_prog_AWK
2492 if test -n "$AWK"; then
2493   echo "$as_me:2493: result: $AWK" >&5
2494 echo "${ECHO_T}$AWK" >&6
2495 else
2496   echo "$as_me:2496: result: no" >&5
2497 echo "${ECHO_T}no" >&6
2498 fi
2499
2500   test -n "$AWK" && break
2501 done
2502
2503 # Find a good install program.  We prefer a C program (faster),
2504 # so one script is as good as another.  But avoid the broken or
2505 # incompatible versions:
2506 # SysV /etc/install, /usr/sbin/install
2507 # SunOS /usr/etc/install
2508 # IRIX /sbin/install
2509 # AIX /bin/install
2510 # AmigaOS /C/install, which installs bootblocks on floppy discs
2511 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2512 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2513 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2514 # ./install, which can be erroneously created by make from ./install.sh.
2515 echo "$as_me:2515: checking for a BSD compatible install" >&5
2516 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2517 if test -z "$INSTALL"; then
2518 if test "${ac_cv_path_install+set}" = set; then
2519   echo $ECHO_N "(cached) $ECHO_C" >&6
2520 else
2521     ac_save_IFS=$IFS; IFS=$ac_path_separator
2522   for ac_dir in $PATH; do
2523     IFS=$ac_save_IFS
2524     # Account for people who put trailing slashes in PATH elements.
2525     case $ac_dir/ in
2526     / | ./ | .// | /cC/* \
2527     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2528     | /usr/ucb/* ) ;;
2529     *)
2530       # OSF1 and SCO ODT 3.0 have their own names for install.
2531       # Don't use installbsd from OSF since it installs stuff as root
2532       # by default.
2533       for ac_prog in ginstall scoinst install; do
2534         if $as_executable_p "$ac_dir/$ac_prog"; then
2535           if test $ac_prog = install &&
2536             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2537             # AIX install.  It has an incompatible calling convention.
2538             :
2539           elif test $ac_prog = install &&
2540             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2541             # program-specific install script used by HP pwplus--don't use.
2542             :
2543           else
2544             ac_cv_path_install="$ac_dir/$ac_prog -c"
2545             break 2
2546           fi
2547         fi
2548       done
2549       ;;
2550     esac
2551   done
2552
2553 fi
2554   if test "${ac_cv_path_install+set}" = set; then
2555     INSTALL=$ac_cv_path_install
2556   else
2557     # As a last resort, use the slow shell script.  We don't cache a
2558     # path for INSTALL within a source directory, because that will
2559     # break other packages using the cache if that directory is
2560     # removed, or if the path is relative.
2561     INSTALL=$ac_install_sh
2562   fi
2563 fi
2564 echo "$as_me:2564: result: $INSTALL" >&5
2565 echo "${ECHO_T}$INSTALL" >&6
2566
2567 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2568 # It thinks the first close brace ends the variable substitution.
2569 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2570
2571 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2572
2573 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2574
2575 case $INSTALL in
2576 (/*)
2577         ;;
2578 (*)
2579         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2580         test -z "$cf_dir" && cf_dir=.
2581         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2582         ;;
2583 esac
2584
2585 echo "$as_me:2585: checking if you want to install stripped executables" >&5
2586 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2587
2588 # Check whether --enable-stripping or --disable-stripping was given.
2589 if test "${enable_stripping+set}" = set; then
2590   enableval="$enable_stripping"
2591   test "$enableval" != no && enableval=yes
2592         if test "$enableval" != "yes" ; then
2593     with_stripping=no
2594         else
2595                 with_stripping=yes
2596         fi
2597 else
2598   enableval=yes
2599         with_stripping=yes
2600
2601 fi;
2602 echo "$as_me:2602: result: $with_stripping" >&5
2603 echo "${ECHO_T}$with_stripping" >&6
2604
2605 if test "$with_stripping" = yes
2606 then
2607         INSTALL_OPT_S="-s"
2608 else
2609         INSTALL_OPT_S=
2610 fi
2611
2612 : ${INSTALL:=install}
2613 echo "$as_me:2613: checking if install accepts -p option" >&5
2614 echo $ECHO_N "checking if install accepts -p option... $ECHO_C" >&6
2615 if test "${cf_cv_install_p+set}" = set; then
2616   echo $ECHO_N "(cached) $ECHO_C" >&6
2617 else
2618
2619         rm -rf conftest*
2620         date >conftest.in
2621         mkdir conftest.out
2622         sleep 3
2623         if $INSTALL -p conftest.in conftest.out 2>/dev/null
2624         then
2625                 if test -f conftest.out/conftest.in
2626                 then
2627                         test conftest.in -nt conftest.out/conftest.in 2>conftest.err && \
2628                         test conftest.out/conftest.in -nt conftest.in 2>conftest.err
2629                         if test -s conftest.err
2630                         then
2631                                 cf_cv_install_p=no
2632                         else
2633                                 cf_cv_install_p=yes
2634                         fi
2635                 else
2636                         cf_cv_install_p=no
2637                 fi
2638         else
2639                 cf_cv_install_p=no
2640         fi
2641         rm -rf conftest*
2642
2643 fi
2644 echo "$as_me:2644: result: $cf_cv_install_p" >&5
2645 echo "${ECHO_T}$cf_cv_install_p" >&6
2646
2647 echo "$as_me:2647: checking if install needs to be told about ownership" >&5
2648 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2649 case `$ac_config_guess` in
2650 (*minix)
2651         with_install_o=yes
2652         ;;
2653 (*)
2654         with_install_o=no
2655         ;;
2656 esac
2657
2658 echo "$as_me:2658: result: $with_install_o" >&5
2659 echo "${ECHO_T}$with_install_o" >&6
2660 if test "x$with_install_o" = xyes
2661 then
2662         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'`
2663 else
2664         INSTALL_OPT_O=
2665 fi
2666
2667 for ac_prog in lint cppcheck splint
2668 do
2669   # Extract the first word of "$ac_prog", so it can be a program name with args.
2670 set dummy $ac_prog; ac_word=$2
2671 echo "$as_me:2671: checking for $ac_word" >&5
2672 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2673 if test "${ac_cv_prog_LINT+set}" = set; then
2674   echo $ECHO_N "(cached) $ECHO_C" >&6
2675 else
2676   if test -n "$LINT"; then
2677   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2678 else
2679   ac_save_IFS=$IFS; IFS=$ac_path_separator
2680 ac_dummy="$PATH"
2681 for ac_dir in $ac_dummy; do
2682   IFS=$ac_save_IFS
2683   test -z "$ac_dir" && ac_dir=.
2684   $as_executable_p "$ac_dir/$ac_word" || continue
2685 ac_cv_prog_LINT="$ac_prog"
2686 echo "$as_me:2686: found $ac_dir/$ac_word" >&5
2687 break
2688 done
2689
2690 fi
2691 fi
2692 LINT=$ac_cv_prog_LINT
2693 if test -n "$LINT"; then
2694   echo "$as_me:2694: result: $LINT" >&5
2695 echo "${ECHO_T}$LINT" >&6
2696 else
2697   echo "$as_me:2697: result: no" >&5
2698 echo "${ECHO_T}no" >&6
2699 fi
2700
2701   test -n "$LINT" && break
2702 done
2703
2704 echo "$as_me:2704: checking if filesystem supports mixed-case filenames" >&5
2705 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2706 if test "${cf_cv_mixedcase+set}" = set; then
2707   echo $ECHO_N "(cached) $ECHO_C" >&6
2708 else
2709
2710 if test "$cross_compiling" = yes ; then
2711         case $target_alias in
2712         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2713                 cf_cv_mixedcase=no
2714                 ;;
2715         (*)
2716                 cf_cv_mixedcase=yes
2717                 ;;
2718         esac
2719 else
2720         rm -f conftest CONFTEST
2721         echo test >conftest
2722         if test -f CONFTEST ; then
2723                 cf_cv_mixedcase=no
2724         else
2725                 cf_cv_mixedcase=yes
2726         fi
2727         rm -f conftest CONFTEST
2728 fi
2729
2730 fi
2731 echo "$as_me:2731: result: $cf_cv_mixedcase" >&5
2732 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2733 test "$cf_cv_mixedcase" = yes &&
2734 cat >>confdefs.h <<\EOF
2735 #define MIXEDCASE_FILENAMES 1
2736 EOF
2737
2738 for ac_prog in exctags ctags
2739 do
2740   # Extract the first word of "$ac_prog", so it can be a program name with args.
2741 set dummy $ac_prog; ac_word=$2
2742 echo "$as_me:2742: checking for $ac_word" >&5
2743 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2744 if test "${ac_cv_prog_CTAGS+set}" = set; then
2745   echo $ECHO_N "(cached) $ECHO_C" >&6
2746 else
2747   if test -n "$CTAGS"; then
2748   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2749 else
2750   ac_save_IFS=$IFS; IFS=$ac_path_separator
2751 ac_dummy="$PATH"
2752 for ac_dir in $ac_dummy; do
2753   IFS=$ac_save_IFS
2754   test -z "$ac_dir" && ac_dir=.
2755   $as_executable_p "$ac_dir/$ac_word" || continue
2756 ac_cv_prog_CTAGS="$ac_prog"
2757 echo "$as_me:2757: found $ac_dir/$ac_word" >&5
2758 break
2759 done
2760
2761 fi
2762 fi
2763 CTAGS=$ac_cv_prog_CTAGS
2764 if test -n "$CTAGS"; then
2765   echo "$as_me:2765: result: $CTAGS" >&5
2766 echo "${ECHO_T}$CTAGS" >&6
2767 else
2768   echo "$as_me:2768: result: no" >&5
2769 echo "${ECHO_T}no" >&6
2770 fi
2771
2772   test -n "$CTAGS" && break
2773 done
2774
2775 for ac_prog in exetags etags
2776 do
2777   # Extract the first word of "$ac_prog", so it can be a program name with args.
2778 set dummy $ac_prog; ac_word=$2
2779 echo "$as_me:2779: checking for $ac_word" >&5
2780 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2781 if test "${ac_cv_prog_ETAGS+set}" = set; then
2782   echo $ECHO_N "(cached) $ECHO_C" >&6
2783 else
2784   if test -n "$ETAGS"; then
2785   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2786 else
2787   ac_save_IFS=$IFS; IFS=$ac_path_separator
2788 ac_dummy="$PATH"
2789 for ac_dir in $ac_dummy; do
2790   IFS=$ac_save_IFS
2791   test -z "$ac_dir" && ac_dir=.
2792   $as_executable_p "$ac_dir/$ac_word" || continue
2793 ac_cv_prog_ETAGS="$ac_prog"
2794 echo "$as_me:2794: found $ac_dir/$ac_word" >&5
2795 break
2796 done
2797
2798 fi
2799 fi
2800 ETAGS=$ac_cv_prog_ETAGS
2801 if test -n "$ETAGS"; then
2802   echo "$as_me:2802: result: $ETAGS" >&5
2803 echo "${ECHO_T}$ETAGS" >&6
2804 else
2805   echo "$as_me:2805: result: no" >&5
2806 echo "${ECHO_T}no" >&6
2807 fi
2808
2809   test -n "$ETAGS" && break
2810 done
2811
2812 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2813 set dummy ${CTAGS:-ctags}; ac_word=$2
2814 echo "$as_me:2814: checking for $ac_word" >&5
2815 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2816 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2817   echo $ECHO_N "(cached) $ECHO_C" >&6
2818 else
2819   if test -n "$MAKE_LOWER_TAGS"; then
2820   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2821 else
2822   ac_save_IFS=$IFS; IFS=$ac_path_separator
2823 ac_dummy="$PATH"
2824 for ac_dir in $ac_dummy; do
2825   IFS=$ac_save_IFS
2826   test -z "$ac_dir" && ac_dir=.
2827   $as_executable_p "$ac_dir/$ac_word" || continue
2828 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2829 echo "$as_me:2829: found $ac_dir/$ac_word" >&5
2830 break
2831 done
2832
2833   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2834 fi
2835 fi
2836 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2837 if test -n "$MAKE_LOWER_TAGS"; then
2838   echo "$as_me:2838: result: $MAKE_LOWER_TAGS" >&5
2839 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2840 else
2841   echo "$as_me:2841: result: no" >&5
2842 echo "${ECHO_T}no" >&6
2843 fi
2844
2845 if test "$cf_cv_mixedcase" = yes ; then
2846         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2847 set dummy ${ETAGS:-etags}; ac_word=$2
2848 echo "$as_me:2848: checking for $ac_word" >&5
2849 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2850 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2851   echo $ECHO_N "(cached) $ECHO_C" >&6
2852 else
2853   if test -n "$MAKE_UPPER_TAGS"; then
2854   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2855 else
2856   ac_save_IFS=$IFS; IFS=$ac_path_separator
2857 ac_dummy="$PATH"
2858 for ac_dir in $ac_dummy; do
2859   IFS=$ac_save_IFS
2860   test -z "$ac_dir" && ac_dir=.
2861   $as_executable_p "$ac_dir/$ac_word" || continue
2862 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2863 echo "$as_me:2863: found $ac_dir/$ac_word" >&5
2864 break
2865 done
2866
2867   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2868 fi
2869 fi
2870 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2871 if test -n "$MAKE_UPPER_TAGS"; then
2872   echo "$as_me:2872: result: $MAKE_UPPER_TAGS" >&5
2873 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2874 else
2875   echo "$as_me:2875: result: no" >&5
2876 echo "${ECHO_T}no" >&6
2877 fi
2878
2879 else
2880         MAKE_UPPER_TAGS=no
2881 fi
2882
2883 if test "$MAKE_UPPER_TAGS" = yes ; then
2884         MAKE_UPPER_TAGS=
2885 else
2886         MAKE_UPPER_TAGS="#"
2887 fi
2888
2889 if test "$MAKE_LOWER_TAGS" = yes ; then
2890         MAKE_LOWER_TAGS=
2891 else
2892         MAKE_LOWER_TAGS="#"
2893 fi
2894
2895 echo "$as_me:2895: checking if -lm needed for math functions" >&5
2896 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2897 if test "${cf_cv_need_libm+set}" = set; then
2898   echo $ECHO_N "(cached) $ECHO_C" >&6
2899 else
2900
2901         cat >conftest.$ac_ext <<_ACEOF
2902 #line 2902 "configure"
2903 #include "confdefs.h"
2904
2905         #include <stdio.h>
2906         #include <stdlib.h>
2907         #include <math.h>
2908
2909 int
2910 main (void)
2911 {
2912 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2913   ;
2914   return 0;
2915 }
2916 _ACEOF
2917 rm -f conftest.$ac_objext conftest$ac_exeext
2918 if { (eval echo "$as_me:2918: \"$ac_link\"") >&5
2919   (eval $ac_link) 2>&5
2920   ac_status=$?
2921   echo "$as_me:2921: \$? = $ac_status" >&5
2922   (exit $ac_status); } &&
2923          { ac_try='test -s conftest$ac_exeext'
2924   { (eval echo "$as_me:2924: \"$ac_try\"") >&5
2925   (eval $ac_try) 2>&5
2926   ac_status=$?
2927   echo "$as_me:2927: \$? = $ac_status" >&5
2928   (exit $ac_status); }; }; then
2929   cf_cv_need_libm=no
2930 else
2931   echo "$as_me: failed program was:" >&5
2932 cat conftest.$ac_ext >&5
2933 cf_cv_need_libm=yes
2934 fi
2935 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2936 fi
2937 echo "$as_me:2937: result: $cf_cv_need_libm" >&5
2938 echo "${ECHO_T}$cf_cv_need_libm" >&6
2939 if test "$cf_cv_need_libm" = yes
2940 then
2941 MATH_LIB=-lm
2942 fi
2943
2944 top_builddir=`pwd`
2945
2946 CC_G_OPT="-g"
2947 CC_SHARED_OPTS=unknown
2948 CPPFLAGS="$CPPFLAGS"
2949 DFT_DEP_SUFFIX=""
2950 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2951 DFT_UPR_MODEL="NORMAL"
2952 LD="ld"
2953 LDFLAGS_SHARED=""
2954 LDFLAGS_STATIC=""
2955 LD_MODEL=""
2956 LD_SHARED_OPTS=""
2957 LIBTOOL=""
2958 LIBTOOL_OPTS=""
2959 LIB_CLEAN=""
2960 LIB_COMPILE=""
2961 LIB_LINK='${CC}'
2962 LINK_TESTS=""
2963 LOCAL_LDFLAGS=""
2964 PACKAGE="ncurses-examples"
2965 PTHREAD="-lm"
2966 TEST_ARGS=""
2967 TEST_DEPS=""
2968 TEST_LIBS=""
2969 TINFO_LDFLAGS=''
2970 TINFO_LIBS='$(LIBS_CURSES)'
2971 cf_cv_abi_version=""
2972 cf_cv_rel_version=""
2973 includesubdir=""
2974
2975 cf_cv_screen=curses
2976 cf_cv_libtype=
2977
2978 if test "$GCC" = yes
2979 then
2980 cat > conftest.i <<EOF
2981 #ifndef GCC_PRINTF
2982 #define GCC_PRINTF 0
2983 #endif
2984 #ifndef GCC_SCANF
2985 #define GCC_SCANF 0
2986 #endif
2987 #ifndef GCC_NORETURN
2988 #define GCC_NORETURN /* nothing */
2989 #endif
2990 #ifndef GCC_UNUSED
2991 #define GCC_UNUSED /* nothing */
2992 #endif
2993 EOF
2994 if test "$GCC" = yes
2995 then
2996         { echo "$as_me:2996: checking for $CC __attribute__ directives..." >&5
2997 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2998 cat > conftest.$ac_ext <<EOF
2999 #line 2999 "${as_me:-configure}"
3000 #include "confdefs.h"
3001 #include "conftest.h"
3002 #include "conftest.i"
3003 #if     GCC_PRINTF
3004 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
3005 #else
3006 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
3007 #endif
3008 #if     GCC_SCANF
3009 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
3010 #else
3011 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
3012 #endif
3013 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
3014 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
3015 extern void foo(void) GCC_NORETURN;
3016 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
3017 EOF
3018         cf_printf_attribute=no
3019         cf_scanf_attribute=no
3020         for cf_attribute in scanf printf unused noreturn
3021         do
3022
3023 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
3024
3025                 cf_directive="__attribute__(($cf_attribute))"
3026                 echo "checking for $CC $cf_directive" 1>&5
3027
3028                 case $cf_attribute in
3029                 (printf)
3030                         cf_printf_attribute=yes
3031                         cat >conftest.h <<EOF
3032 #define GCC_$cf_ATTRIBUTE 1
3033 EOF
3034                         ;;
3035                 (scanf)
3036                         cf_scanf_attribute=yes
3037                         cat >conftest.h <<EOF
3038 #define GCC_$cf_ATTRIBUTE 1
3039 EOF
3040                         ;;
3041                 (*)
3042                         cat >conftest.h <<EOF
3043 #define GCC_$cf_ATTRIBUTE $cf_directive
3044 EOF
3045                         ;;
3046                 esac
3047
3048                 if { (eval echo "$as_me:3048: \"$ac_compile\"") >&5
3049   (eval $ac_compile) 2>&5
3050   ac_status=$?
3051   echo "$as_me:3051: \$? = $ac_status" >&5
3052   (exit $ac_status); }; then
3053                         test -n "$verbose" && echo "$as_me:3053: result: ... $cf_attribute" >&5
3054 echo "${ECHO_T}... $cf_attribute" >&6
3055                         cat conftest.h >>confdefs.h
3056                         case $cf_attribute in
3057                         (noreturn)
3058
3059 cat >>confdefs.h <<EOF
3060 #define GCC_NORETURN $cf_directive
3061 EOF
3062
3063                                 ;;
3064                         (printf)
3065                                 cf_value='/* nothing */'
3066                                 if test "$cf_printf_attribute" != no ; then
3067                                         cf_value='__attribute__((format(printf,fmt,var)))'
3068
3069 cat >>confdefs.h <<\EOF
3070 #define GCC_PRINTF 1
3071 EOF
3072
3073                                 fi
3074
3075 cat >>confdefs.h <<EOF
3076 #define GCC_PRINTFLIKE(fmt,var) $cf_value
3077 EOF
3078
3079                                 ;;
3080                         (scanf)
3081                                 cf_value='/* nothing */'
3082                                 if test "$cf_scanf_attribute" != no ; then
3083                                         cf_value='__attribute__((format(scanf,fmt,var)))'
3084
3085 cat >>confdefs.h <<\EOF
3086 #define GCC_SCANF 1
3087 EOF
3088
3089                                 fi
3090
3091 cat >>confdefs.h <<EOF
3092 #define GCC_SCANFLIKE(fmt,var) $cf_value
3093 EOF
3094
3095                                 ;;
3096                         (unused)
3097
3098 cat >>confdefs.h <<EOF
3099 #define GCC_UNUSED $cf_directive
3100 EOF
3101
3102                                 ;;
3103                         esac
3104                 fi
3105         done
3106 else
3107         fgrep define conftest.i >>confdefs.h
3108 fi
3109 rm -rf conftest*
3110 fi
3111
3112 echo "$as_me:3112: checking if you want to work around bogus compiler/loader warnings" >&5
3113 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
3114
3115 # Check whether --enable-string-hacks or --disable-string-hacks was given.
3116 if test "${enable_string_hacks+set}" = set; then
3117   enableval="$enable_string_hacks"
3118   with_string_hacks=$enableval
3119 else
3120   with_string_hacks=no
3121 fi;
3122 echo "$as_me:3122: result: $with_string_hacks" >&5
3123 echo "${ECHO_T}$with_string_hacks" >&6
3124
3125 if test "x$with_string_hacks" = "xyes"; then
3126
3127 cat >>confdefs.h <<\EOF
3128 #define USE_STRING_HACKS 1
3129 EOF
3130
3131         { echo "$as_me:3131: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
3132 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
3133         echo "$as_me:3133: checking for strlcat" >&5
3134 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
3135 if test "${ac_cv_func_strlcat+set}" = set; then
3136   echo $ECHO_N "(cached) $ECHO_C" >&6
3137 else
3138   cat >conftest.$ac_ext <<_ACEOF
3139 #line 3139 "configure"
3140 #include "confdefs.h"
3141 /* System header to define __stub macros and hopefully few prototypes,
3142     which can conflict with char strlcat (); below.  */
3143 #include <assert.h>
3144 /* Override any gcc2 internal prototype to avoid an error.  */
3145 #ifdef __cplusplus
3146 extern "C"
3147 #endif
3148 /* We use char because int might match the return type of a gcc2
3149    builtin and then its argument prototype would still apply.  */
3150 char strlcat ();
3151 char (*f) ();
3152
3153 int
3154 main (void)
3155 {
3156 /* The GNU C library defines this for functions which it implements
3157     to always fail with ENOSYS.  Some functions are actually named
3158     something starting with __ and the normal name is an alias.  */
3159 #if defined (__stub_strlcat) || defined (__stub___strlcat)
3160 choke me
3161 #else
3162 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3163 #endif
3164
3165   ;
3166   return 0;
3167 }
3168 _ACEOF
3169 rm -f conftest.$ac_objext conftest$ac_exeext
3170 if { (eval echo "$as_me:3170: \"$ac_link\"") >&5
3171   (eval $ac_link) 2>&5
3172   ac_status=$?
3173   echo "$as_me:3173: \$? = $ac_status" >&5
3174   (exit $ac_status); } &&
3175          { ac_try='test -s conftest$ac_exeext'
3176   { (eval echo "$as_me:3176: \"$ac_try\"") >&5
3177   (eval $ac_try) 2>&5
3178   ac_status=$?
3179   echo "$as_me:3179: \$? = $ac_status" >&5
3180   (exit $ac_status); }; }; then
3181   ac_cv_func_strlcat=yes
3182 else
3183   echo "$as_me: failed program was:" >&5
3184 cat conftest.$ac_ext >&5
3185 ac_cv_func_strlcat=no
3186 fi
3187 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3188 fi
3189 echo "$as_me:3189: result: $ac_cv_func_strlcat" >&5
3190 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3191 if test $ac_cv_func_strlcat = yes; then
3192
3193 cat >>confdefs.h <<\EOF
3194 #define HAVE_STRLCAT 1
3195 EOF
3196
3197 else
3198
3199                 echo "$as_me:3199: checking for strlcat in -lbsd" >&5
3200 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3201 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3202   echo $ECHO_N "(cached) $ECHO_C" >&6
3203 else
3204   ac_check_lib_save_LIBS=$LIBS
3205 LIBS="-lbsd  $LIBS"
3206 cat >conftest.$ac_ext <<_ACEOF
3207 #line 3207 "configure"
3208 #include "confdefs.h"
3209
3210 /* Override any gcc2 internal prototype to avoid an error.  */
3211 #ifdef __cplusplus
3212 extern "C"
3213 #endif
3214 /* We use char because int might match the return type of a gcc2
3215    builtin and then its argument prototype would still apply.  */
3216 char strlcat ();
3217 int
3218 main (void)
3219 {
3220 strlcat ();
3221   ;
3222   return 0;
3223 }
3224 _ACEOF
3225 rm -f conftest.$ac_objext conftest$ac_exeext
3226 if { (eval echo "$as_me:3226: \"$ac_link\"") >&5
3227   (eval $ac_link) 2>&5
3228   ac_status=$?
3229   echo "$as_me:3229: \$? = $ac_status" >&5
3230   (exit $ac_status); } &&
3231          { ac_try='test -s conftest$ac_exeext'
3232   { (eval echo "$as_me:3232: \"$ac_try\"") >&5
3233   (eval $ac_try) 2>&5
3234   ac_status=$?
3235   echo "$as_me:3235: \$? = $ac_status" >&5
3236   (exit $ac_status); }; }; then
3237   ac_cv_lib_bsd_strlcat=yes
3238 else
3239   echo "$as_me: failed program was:" >&5
3240 cat conftest.$ac_ext >&5
3241 ac_cv_lib_bsd_strlcat=no
3242 fi
3243 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3244 LIBS=$ac_check_lib_save_LIBS
3245 fi
3246 echo "$as_me:3246: result: $ac_cv_lib_bsd_strlcat" >&5
3247 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3248 if test $ac_cv_lib_bsd_strlcat = yes; then
3249
3250 cf_add_libs="-lbsd"
3251 # Filter out duplicates - this happens with badly-designed ".pc" files...
3252 for cf_add_1lib in $LIBS
3253 do
3254         for cf_add_2lib in $cf_add_libs
3255         do
3256                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3257                 then
3258                         cf_add_1lib=
3259                         break
3260                 fi
3261         done
3262         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3263 done
3264 LIBS="$cf_add_libs"
3265
3266 for ac_header in bsd/string.h
3267 do
3268 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3269 echo "$as_me:3269: checking for $ac_header" >&5
3270 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3271 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3272   echo $ECHO_N "(cached) $ECHO_C" >&6
3273 else
3274   cat >conftest.$ac_ext <<_ACEOF
3275 #line 3275 "configure"
3276 #include "confdefs.h"
3277 #include <$ac_header>
3278 _ACEOF
3279 if { (eval echo "$as_me:3279: \"$ac_cpp conftest.$ac_ext\"") >&5
3280   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3281   ac_status=$?
3282   egrep -v '^ *\+' conftest.er1 >conftest.err
3283   rm -f conftest.er1
3284   cat conftest.err >&5
3285   echo "$as_me:3285: \$? = $ac_status" >&5
3286   (exit $ac_status); } >/dev/null; then
3287   if test -s conftest.err; then
3288     ac_cpp_err=$ac_c_preproc_warn_flag
3289   else
3290     ac_cpp_err=
3291   fi
3292 else
3293   ac_cpp_err=yes
3294 fi
3295 if test -z "$ac_cpp_err"; then
3296   eval "$as_ac_Header=yes"
3297 else
3298   echo "$as_me: failed program was:" >&5
3299   cat conftest.$ac_ext >&5
3300   eval "$as_ac_Header=no"
3301 fi
3302 rm -f conftest.err conftest.$ac_ext
3303 fi
3304 echo "$as_me:3304: result: `eval echo '${'$as_ac_Header'}'`" >&5
3305 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3306 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3307   cat >>confdefs.h <<EOF
3308 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3309 EOF
3310
3311 fi
3312 done
3313
3314 cat >>confdefs.h <<\EOF
3315 #define HAVE_STRLCAT 1
3316 EOF
3317
3318 fi
3319
3320 fi
3321
3322 for ac_func in strlcpy snprintf
3323 do
3324 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3325 echo "$as_me:3325: checking for $ac_func" >&5
3326 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3327 if eval "test \"\${$as_ac_var+set}\" = set"; then
3328   echo $ECHO_N "(cached) $ECHO_C" >&6
3329 else
3330   cat >conftest.$ac_ext <<_ACEOF
3331 #line 3331 "configure"
3332 #include "confdefs.h"
3333 /* System header to define __stub macros and hopefully few prototypes,
3334     which can conflict with char $ac_func (); below.  */
3335 #include <assert.h>
3336 /* Override any gcc2 internal prototype to avoid an error.  */
3337 #ifdef __cplusplus
3338 extern "C"
3339 #endif
3340 /* We use char because int might match the return type of a gcc2
3341    builtin and then its argument prototype would still apply.  */
3342 char $ac_func ();
3343 char (*f) ();
3344
3345 int
3346 main (void)
3347 {
3348 /* The GNU C library defines this for functions which it implements
3349     to always fail with ENOSYS.  Some functions are actually named
3350     something starting with __ and the normal name is an alias.  */
3351 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3352 choke me
3353 #else
3354 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3355 #endif
3356
3357   ;
3358   return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext conftest$ac_exeext
3362 if { (eval echo "$as_me:3362: \"$ac_link\"") >&5
3363   (eval $ac_link) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); } &&
3367          { ac_try='test -s conftest$ac_exeext'
3368   { (eval echo "$as_me:3368: \"$ac_try\"") >&5
3369   (eval $ac_try) 2>&5
3370   ac_status=$?
3371   echo "$as_me:3371: \$? = $ac_status" >&5
3372   (exit $ac_status); }; }; then
3373   eval "$as_ac_var=yes"
3374 else
3375   echo "$as_me: failed program was:" >&5
3376 cat conftest.$ac_ext >&5
3377 eval "$as_ac_var=no"
3378 fi
3379 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3380 fi
3381 echo "$as_me:3381: result: `eval echo '${'$as_ac_var'}'`" >&5
3382 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3383 if test `eval echo '${'$as_ac_var'}'` = yes; then
3384   cat >>confdefs.h <<EOF
3385 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3386 EOF
3387
3388 fi
3389 done
3390
3391 fi
3392
3393 cf_XOPEN_SOURCE=600
3394 cf_POSIX_C_SOURCE=199506L
3395 cf_xopen_source=
3396
3397 case $host_os in
3398 (aix[4-7]*)
3399         cf_xopen_source="-D_ALL_SOURCE"
3400         ;;
3401 (msys)
3402         cf_XOPEN_SOURCE=600
3403         ;;
3404 (darwin[0-8].*)
3405         cf_xopen_source="-D_APPLE_C_SOURCE"
3406         ;;
3407 (darwin*)
3408         cf_xopen_source="-D_DARWIN_C_SOURCE"
3409         cf_XOPEN_SOURCE=
3410         ;;
3411 (freebsd*|dragonfly*)
3412         # 5.x headers associate
3413         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3414         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3415         cf_POSIX_C_SOURCE=200112L
3416         cf_XOPEN_SOURCE=600
3417         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3418         ;;
3419 (hpux11*)
3420         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3421         ;;
3422 (hpux*)
3423         cf_xopen_source="-D_HPUX_SOURCE"
3424         ;;
3425 (irix[56].*)
3426         cf_xopen_source="-D_SGI_SOURCE"
3427         cf_XOPEN_SOURCE=
3428         ;;
3429 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3430
3431 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3432
3433 echo "$as_me:3433: checking if this is the GNU C library" >&5
3434 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3435 if test "${cf_cv_gnu_library+set}" = set; then
3436   echo $ECHO_N "(cached) $ECHO_C" >&6
3437 else
3438
3439 cat >conftest.$ac_ext <<_ACEOF
3440 #line 3440 "configure"
3441 #include "confdefs.h"
3442 #include <sys/types.h>
3443 int
3444 main (void)
3445 {
3446
3447         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3448                 return 0;
3449         #else
3450         #       error not GNU C library
3451         #endif
3452   ;
3453   return 0;
3454 }
3455 _ACEOF
3456 rm -f conftest.$ac_objext
3457 if { (eval echo "$as_me:3457: \"$ac_compile\"") >&5
3458   (eval $ac_compile) 2>&5
3459   ac_status=$?
3460   echo "$as_me:3460: \$? = $ac_status" >&5
3461   (exit $ac_status); } &&
3462          { ac_try='test -s conftest.$ac_objext'
3463   { (eval echo "$as_me:3463: \"$ac_try\"") >&5
3464   (eval $ac_try) 2>&5
3465   ac_status=$?
3466   echo "$as_me:3466: \$? = $ac_status" >&5
3467   (exit $ac_status); }; }; then
3468   cf_cv_gnu_library=yes
3469 else
3470   echo "$as_me: failed program was:" >&5
3471 cat conftest.$ac_ext >&5
3472 cf_cv_gnu_library=no
3473 fi
3474 rm -f conftest.$ac_objext conftest.$ac_ext
3475
3476 fi
3477 echo "$as_me:3477: result: $cf_cv_gnu_library" >&5
3478 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3479
3480 if test x$cf_cv_gnu_library = xyes; then
3481
3482         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3483         # was changed to help a little...
3484         echo "$as_me:3484: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3485 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3486 if test "${cf_cv_gnu_library_219+set}" = set; then
3487   echo $ECHO_N "(cached) $ECHO_C" >&6
3488 else
3489
3490                 cf_save="$CPPFLAGS"
3491
3492         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3493         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3494
3495                 cat >conftest.$ac_ext <<_ACEOF
3496 #line 3496 "configure"
3497 #include "confdefs.h"
3498 #include <sys/types.h>
3499 int
3500 main (void)
3501 {
3502
3503                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3504                                 return 0;
3505                         #else
3506                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3507                         #endif
3508   ;
3509   return 0;
3510 }
3511 _ACEOF
3512 rm -f conftest.$ac_objext
3513 if { (eval echo "$as_me:3513: \"$ac_compile\"") >&5
3514   (eval $ac_compile) 2>&5
3515   ac_status=$?
3516   echo "$as_me:3516: \$? = $ac_status" >&5
3517   (exit $ac_status); } &&
3518          { ac_try='test -s conftest.$ac_objext'
3519   { (eval echo "$as_me:3519: \"$ac_try\"") >&5
3520   (eval $ac_try) 2>&5
3521   ac_status=$?
3522   echo "$as_me:3522: \$? = $ac_status" >&5
3523   (exit $ac_status); }; }; then
3524   cf_cv_gnu_library_219=yes
3525 else
3526   echo "$as_me: failed program was:" >&5
3527 cat conftest.$ac_ext >&5
3528 cf_cv_gnu_library_219=no
3529 fi
3530 rm -f conftest.$ac_objext conftest.$ac_ext
3531                 CPPFLAGS="$cf_save"
3532
3533 fi
3534 echo "$as_me:3534: result: $cf_cv_gnu_library_219" >&5
3535 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3536
3537         if test "x$cf_cv_gnu_library_219" = xyes; then
3538                 cf_save="$CPPFLAGS"
3539                 echo "$as_me:3539: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3540 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3541 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3542   echo $ECHO_N "(cached) $ECHO_C" >&6
3543 else
3544
3545 cf_fix_cppflags=no
3546 cf_new_cflags=
3547 cf_new_cppflags=
3548 cf_new_extra_cppflags=
3549
3550 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3551 do
3552 case $cf_fix_cppflags in
3553 (no)
3554         case $cf_add_cflags in
3555         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3556                 case $cf_add_cflags in
3557                 (-D*)
3558                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3559
3560                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3561                                 && test -z "${cf_tst_cflags}" \
3562                                 && cf_fix_cppflags=yes
3563
3564                         if test $cf_fix_cppflags = yes ; then
3565
3566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3568
3569                                 continue
3570                         elif test "${cf_tst_cflags}" = "\"'" ; then
3571
3572         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3573         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3574
3575                                 continue
3576                         fi
3577                         ;;
3578                 esac
3579                 case "$CPPFLAGS" in
3580                 (*$cf_add_cflags)
3581                         ;;
3582                 (*)
3583                         case $cf_add_cflags in
3584                         (-D*)
3585                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3586
3587 CPPFLAGS=`echo "$CPPFLAGS" | \
3588         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3589                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3590
3591                                 ;;
3592                         esac
3593
3594         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3595         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3596
3597                         ;;
3598                 esac
3599                 ;;
3600         (*)
3601
3602         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3603         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3604
3605                 ;;
3606         esac
3607         ;;
3608 (yes)
3609
3610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3612
3613         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3614
3615         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3616                 && test -z "${cf_tst_cflags}" \
3617                 && cf_fix_cppflags=no
3618         ;;
3619 esac
3620 done
3621
3622 if test -n "$cf_new_cflags" ; then
3623
3624         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3625         CFLAGS="${CFLAGS}$cf_new_cflags"
3626
3627 fi
3628
3629 if test -n "$cf_new_cppflags" ; then
3630
3631         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3632         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3633
3634 fi
3635
3636 if test -n "$cf_new_extra_cppflags" ; then
3637
3638         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3639         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3640
3641 fi
3642
3643                         cat >conftest.$ac_ext <<_ACEOF
3644 #line 3644 "configure"
3645 #include "confdefs.h"
3646
3647                                 #include <limits.h>
3648                                 #include <sys/types.h>
3649
3650 int
3651 main (void)
3652 {
3653
3654                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3655                                         return 0;
3656                                 #else
3657                                 #       error GNU C library is too old
3658                                 #endif
3659   ;
3660   return 0;
3661 }
3662 _ACEOF
3663 rm -f conftest.$ac_objext
3664 if { (eval echo "$as_me:3664: \"$ac_compile\"") >&5
3665   (eval $ac_compile) 2>&5
3666   ac_status=$?
3667   echo "$as_me:3667: \$? = $ac_status" >&5
3668   (exit $ac_status); } &&
3669          { ac_try='test -s conftest.$ac_objext'
3670   { (eval echo "$as_me:3670: \"$ac_try\"") >&5
3671   (eval $ac_try) 2>&5
3672   ac_status=$?
3673   echo "$as_me:3673: \$? = $ac_status" >&5
3674   (exit $ac_status); }; }; then
3675   cf_cv_gnu_dftsrc_219=yes
3676 else
3677   echo "$as_me: failed program was:" >&5
3678 cat conftest.$ac_ext >&5
3679 cf_cv_gnu_dftsrc_219=no
3680 fi
3681 rm -f conftest.$ac_objext conftest.$ac_ext
3682
3683 fi
3684 echo "$as_me:3684: result: $cf_cv_gnu_dftsrc_219" >&5
3685 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3686                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3687         else
3688                 cf_cv_gnu_dftsrc_219=maybe
3689         fi
3690
3691         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3692
3693                 echo "$as_me:3693: checking if we must define _GNU_SOURCE" >&5
3694 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3695 if test "${cf_cv_gnu_source+set}" = set; then
3696   echo $ECHO_N "(cached) $ECHO_C" >&6
3697 else
3698
3699                 cat >conftest.$ac_ext <<_ACEOF
3700 #line 3700 "configure"
3701 #include "confdefs.h"
3702 #include <sys/types.h>
3703 int
3704 main (void)
3705 {
3706
3707                         #ifndef _XOPEN_SOURCE
3708                         #error  expected _XOPEN_SOURCE to be defined
3709                         #endif
3710   ;
3711   return 0;
3712 }
3713 _ACEOF
3714 rm -f conftest.$ac_objext
3715 if { (eval echo "$as_me:3715: \"$ac_compile\"") >&5
3716   (eval $ac_compile) 2>&5
3717   ac_status=$?
3718   echo "$as_me:3718: \$? = $ac_status" >&5
3719   (exit $ac_status); } &&
3720          { ac_try='test -s conftest.$ac_objext'
3721   { (eval echo "$as_me:3721: \"$ac_try\"") >&5
3722   (eval $ac_try) 2>&5
3723   ac_status=$?
3724   echo "$as_me:3724: \$? = $ac_status" >&5
3725   (exit $ac_status); }; }; then
3726   cf_cv_gnu_source=no
3727 else
3728   echo "$as_me: failed program was:" >&5
3729 cat conftest.$ac_ext >&5
3730 cf_save="$CPPFLAGS"
3731
3732 cf_fix_cppflags=no
3733 cf_new_cflags=
3734 cf_new_cppflags=
3735 cf_new_extra_cppflags=
3736
3737 for cf_add_cflags in -D_GNU_SOURCE
3738 do
3739 case $cf_fix_cppflags in
3740 (no)
3741         case $cf_add_cflags in
3742         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3743                 case $cf_add_cflags in
3744                 (-D*)
3745                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3746
3747                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3748                                 && test -z "${cf_tst_cflags}" \
3749                                 && cf_fix_cppflags=yes
3750
3751                         if test $cf_fix_cppflags = yes ; then
3752
3753         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3754         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3755
3756                                 continue
3757                         elif test "${cf_tst_cflags}" = "\"'" ; then
3758
3759         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3760         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3761
3762                                 continue
3763                         fi
3764                         ;;
3765                 esac
3766                 case "$CPPFLAGS" in
3767                 (*$cf_add_cflags)
3768                         ;;
3769                 (*)
3770                         case $cf_add_cflags in
3771                         (-D*)
3772                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3773
3774 CPPFLAGS=`echo "$CPPFLAGS" | \
3775         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3776                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3777
3778                                 ;;
3779                         esac
3780
3781         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3782         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3783
3784                         ;;
3785                 esac
3786                 ;;
3787         (*)
3788
3789         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3790         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3791
3792                 ;;
3793         esac
3794         ;;
3795 (yes)
3796
3797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3799
3800         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3801
3802         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3803                 && test -z "${cf_tst_cflags}" \
3804                 && cf_fix_cppflags=no
3805         ;;
3806 esac
3807 done
3808
3809 if test -n "$cf_new_cflags" ; then
3810
3811         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3812         CFLAGS="${CFLAGS}$cf_new_cflags"
3813
3814 fi
3815
3816 if test -n "$cf_new_cppflags" ; then
3817
3818         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3819         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3820
3821 fi
3822
3823 if test -n "$cf_new_extra_cppflags" ; then
3824
3825         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3826         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3827
3828 fi
3829
3830                          cat >conftest.$ac_ext <<_ACEOF
3831 #line 3831 "configure"
3832 #include "confdefs.h"
3833 #include <sys/types.h>
3834 int
3835 main (void)
3836 {
3837
3838                                 #ifdef _XOPEN_SOURCE
3839                                 #error  expected _XOPEN_SOURCE to be undefined
3840                                 #endif
3841   ;
3842   return 0;
3843 }
3844 _ACEOF
3845 rm -f conftest.$ac_objext
3846 if { (eval echo "$as_me:3846: \"$ac_compile\"") >&5
3847   (eval $ac_compile) 2>&5
3848   ac_status=$?
3849   echo "$as_me:3849: \$? = $ac_status" >&5
3850   (exit $ac_status); } &&
3851          { ac_try='test -s conftest.$ac_objext'
3852   { (eval echo "$as_me:3852: \"$ac_try\"") >&5
3853   (eval $ac_try) 2>&5
3854   ac_status=$?
3855   echo "$as_me:3855: \$? = $ac_status" >&5
3856   (exit $ac_status); }; }; then
3857   cf_cv_gnu_source=no
3858 else
3859   echo "$as_me: failed program was:" >&5
3860 cat conftest.$ac_ext >&5
3861 cf_cv_gnu_source=yes
3862 fi
3863 rm -f conftest.$ac_objext conftest.$ac_ext
3864                         CPPFLAGS="$cf_save"
3865
3866 fi
3867 rm -f conftest.$ac_objext conftest.$ac_ext
3868
3869 fi
3870 echo "$as_me:3870: result: $cf_cv_gnu_source" >&5
3871 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3872
3873                 if test "$cf_cv_gnu_source" = yes
3874                 then
3875                 echo "$as_me:3875: checking if we should also define _DEFAULT_SOURCE" >&5
3876 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3877 if test "${cf_cv_default_source+set}" = set; then
3878   echo $ECHO_N "(cached) $ECHO_C" >&6
3879 else
3880
3881         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3882         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3883
3884                         cat >conftest.$ac_ext <<_ACEOF
3885 #line 3885 "configure"
3886 #include "confdefs.h"
3887 #include <sys/types.h>
3888 int
3889 main (void)
3890 {
3891
3892                                 #ifdef _DEFAULT_SOURCE
3893                                 #error  expected _DEFAULT_SOURCE to be undefined
3894                                 #endif
3895   ;
3896   return 0;
3897 }
3898 _ACEOF
3899 rm -f conftest.$ac_objext
3900 if { (eval echo "$as_me:3900: \"$ac_compile\"") >&5
3901   (eval $ac_compile) 2>&5
3902   ac_status=$?
3903   echo "$as_me:3903: \$? = $ac_status" >&5
3904   (exit $ac_status); } &&
3905          { ac_try='test -s conftest.$ac_objext'
3906   { (eval echo "$as_me:3906: \"$ac_try\"") >&5
3907   (eval $ac_try) 2>&5
3908   ac_status=$?
3909   echo "$as_me:3909: \$? = $ac_status" >&5
3910   (exit $ac_status); }; }; then
3911   cf_cv_default_source=no
3912 else
3913   echo "$as_me: failed program was:" >&5
3914 cat conftest.$ac_ext >&5
3915 cf_cv_default_source=yes
3916 fi
3917 rm -f conftest.$ac_objext conftest.$ac_ext
3918
3919 fi
3920 echo "$as_me:3920: result: $cf_cv_default_source" >&5
3921 echo "${ECHO_T}$cf_cv_default_source" >&6
3922                         if test "$cf_cv_default_source" = yes
3923                         then
3924
3925         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3926         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3927
3928                         fi
3929                 fi
3930         fi
3931
3932 fi
3933
3934         ;;
3935 (minix*)
3936         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3937         ;;
3938 (mirbsd*)
3939         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3940         cf_XOPEN_SOURCE=
3941
3942 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3943
3944 cf_save_CFLAGS="$CFLAGS"
3945 cf_save_CPPFLAGS="$CPPFLAGS"
3946
3947 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3948         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3949                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3950
3951 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3952         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3953                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3954
3955 echo "$as_me:3955: checking if we should define _POSIX_C_SOURCE" >&5
3956 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3957 if test "${cf_cv_posix_c_source+set}" = set; then
3958   echo $ECHO_N "(cached) $ECHO_C" >&6
3959 else
3960
3961 echo "${as_me:-configure}:3961: testing if the symbol is already defined go no further ..." 1>&5
3962
3963         cat >conftest.$ac_ext <<_ACEOF
3964 #line 3964 "configure"
3965 #include "confdefs.h"
3966 #include <sys/types.h>
3967 int
3968 main (void)
3969 {
3970
3971 #ifndef _POSIX_C_SOURCE
3972 make an error
3973 #endif
3974   ;
3975   return 0;
3976 }
3977 _ACEOF
3978 rm -f conftest.$ac_objext
3979 if { (eval echo "$as_me:3979: \"$ac_compile\"") >&5
3980   (eval $ac_compile) 2>&5
3981   ac_status=$?
3982   echo "$as_me:3982: \$? = $ac_status" >&5
3983   (exit $ac_status); } &&
3984          { ac_try='test -s conftest.$ac_objext'
3985   { (eval echo "$as_me:3985: \"$ac_try\"") >&5
3986   (eval $ac_try) 2>&5
3987   ac_status=$?
3988   echo "$as_me:3988: \$? = $ac_status" >&5
3989   (exit $ac_status); }; }; then
3990   cf_cv_posix_c_source=no
3991 else
3992   echo "$as_me: failed program was:" >&5
3993 cat conftest.$ac_ext >&5
3994 cf_want_posix_source=no
3995          case .$cf_POSIX_C_SOURCE in
3996          (.[12]??*)
3997                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3998                 ;;
3999          (.2)
4000                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4001                 cf_want_posix_source=yes
4002                 ;;
4003          (.*)
4004                 cf_want_posix_source=yes
4005                 ;;
4006          esac
4007          if test "$cf_want_posix_source" = yes ; then
4008                 cat >conftest.$ac_ext <<_ACEOF
4009 #line 4009 "configure"
4010 #include "confdefs.h"
4011 #include <sys/types.h>
4012 int
4013 main (void)
4014 {
4015
4016 #ifdef _POSIX_SOURCE
4017 make an error
4018 #endif
4019   ;
4020   return 0;
4021 }
4022 _ACEOF
4023 rm -f conftest.$ac_objext
4024 if { (eval echo "$as_me:4024: \"$ac_compile\"") >&5
4025   (eval $ac_compile) 2>&5
4026   ac_status=$?
4027   echo "$as_me:4027: \$? = $ac_status" >&5
4028   (exit $ac_status); } &&
4029          { ac_try='test -s conftest.$ac_objext'
4030   { (eval echo "$as_me:4030: \"$ac_try\"") >&5
4031   (eval $ac_try) 2>&5
4032   ac_status=$?
4033   echo "$as_me:4033: \$? = $ac_status" >&5
4034   (exit $ac_status); }; }; then
4035   :
4036 else
4037   echo "$as_me: failed program was:" >&5
4038 cat conftest.$ac_ext >&5
4039 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4040 fi
4041 rm -f conftest.$ac_objext conftest.$ac_ext
4042          fi
4043
4044 echo "${as_me:-configure}:4044: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4045
4046          CFLAGS="$cf_trim_CFLAGS"
4047          CPPFLAGS="$cf_trim_CPPFLAGS"
4048
4049         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4050         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4051
4052 echo "${as_me:-configure}:4052: testing if the second compile does not leave our definition intact error ..." 1>&5
4053
4054          cat >conftest.$ac_ext <<_ACEOF
4055 #line 4055 "configure"
4056 #include "confdefs.h"
4057 #include <sys/types.h>
4058 int
4059 main (void)
4060 {
4061
4062 #ifndef _POSIX_C_SOURCE
4063 make an error
4064 #endif
4065   ;
4066   return 0;
4067 }
4068 _ACEOF
4069 rm -f conftest.$ac_objext
4070 if { (eval echo "$as_me:4070: \"$ac_compile\"") >&5
4071   (eval $ac_compile) 2>&5
4072   ac_status=$?
4073   echo "$as_me:4073: \$? = $ac_status" >&5
4074   (exit $ac_status); } &&
4075          { ac_try='test -s conftest.$ac_objext'
4076   { (eval echo "$as_me:4076: \"$ac_try\"") >&5
4077   (eval $ac_try) 2>&5
4078   ac_status=$?
4079   echo "$as_me:4079: \$? = $ac_status" >&5
4080   (exit $ac_status); }; }; then
4081   :
4082 else
4083   echo "$as_me: failed program was:" >&5
4084 cat conftest.$ac_ext >&5
4085 cf_cv_posix_c_source=no
4086 fi
4087 rm -f conftest.$ac_objext conftest.$ac_ext
4088          CFLAGS="$cf_save_CFLAGS"
4089          CPPFLAGS="$cf_save_CPPFLAGS"
4090
4091 fi
4092 rm -f conftest.$ac_objext conftest.$ac_ext
4093
4094 fi
4095 echo "$as_me:4095: result: $cf_cv_posix_c_source" >&5
4096 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4097
4098 if test "$cf_cv_posix_c_source" != no ; then
4099         CFLAGS="$cf_trim_CFLAGS"
4100         CPPFLAGS="$cf_trim_CPPFLAGS"
4101
4102 cf_fix_cppflags=no
4103 cf_new_cflags=
4104 cf_new_cppflags=
4105 cf_new_extra_cppflags=
4106
4107 for cf_add_cflags in $cf_cv_posix_c_source
4108 do
4109 case $cf_fix_cppflags in
4110 (no)
4111         case $cf_add_cflags in
4112         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4113                 case $cf_add_cflags in
4114                 (-D*)
4115                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4116
4117                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4118                                 && test -z "${cf_tst_cflags}" \
4119                                 && cf_fix_cppflags=yes
4120
4121                         if test $cf_fix_cppflags = yes ; then
4122
4123         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4124         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4125
4126                                 continue
4127                         elif test "${cf_tst_cflags}" = "\"'" ; then
4128
4129         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4130         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4131
4132                                 continue
4133                         fi
4134                         ;;
4135                 esac
4136                 case "$CPPFLAGS" in
4137                 (*$cf_add_cflags)
4138                         ;;
4139                 (*)
4140                         case $cf_add_cflags in
4141                         (-D*)
4142                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4143
4144 CPPFLAGS=`echo "$CPPFLAGS" | \
4145         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4146                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4147
4148                                 ;;
4149                         esac
4150
4151         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4152         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4153
4154                         ;;
4155                 esac
4156                 ;;
4157         (*)
4158
4159         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4160         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4161
4162                 ;;
4163         esac
4164         ;;
4165 (yes)
4166
4167         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4168         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4169
4170         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4171
4172         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4173                 && test -z "${cf_tst_cflags}" \
4174                 && cf_fix_cppflags=no
4175         ;;
4176 esac
4177 done
4178
4179 if test -n "$cf_new_cflags" ; then
4180
4181         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4182         CFLAGS="${CFLAGS}$cf_new_cflags"
4183
4184 fi
4185
4186 if test -n "$cf_new_cppflags" ; then
4187
4188         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4189         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4190
4191 fi
4192
4193 if test -n "$cf_new_extra_cppflags" ; then
4194
4195         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4196         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4197
4198 fi
4199
4200 fi
4201
4202         ;;
4203 (netbsd*)
4204         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4205         ;;
4206 (openbsd[4-9]*)
4207         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4208         cf_xopen_source="-D_BSD_SOURCE"
4209         cf_XOPEN_SOURCE=600
4210         ;;
4211 (openbsd*)
4212         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4213         ;;
4214 (osf[45]*)
4215         cf_xopen_source="-D_OSF_SOURCE"
4216         ;;
4217 (nto-qnx*)
4218         cf_xopen_source="-D_QNX_SOURCE"
4219         ;;
4220 (sco*)
4221         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4222         ;;
4223 (solaris2.*)
4224         cf_xopen_source="-D__EXTENSIONS__"
4225         cf_cv_xopen_source=broken
4226         ;;
4227 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4228         cf_XOPEN_SOURCE=
4229         cf_POSIX_C_SOURCE=
4230         ;;
4231 (*)
4232
4233 echo "$as_me:4233: checking if we should define _XOPEN_SOURCE" >&5
4234 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4235 if test "${cf_cv_xopen_source+set}" = set; then
4236   echo $ECHO_N "(cached) $ECHO_C" >&6
4237 else
4238
4239         cat >conftest.$ac_ext <<_ACEOF
4240 #line 4240 "configure"
4241 #include "confdefs.h"
4242
4243 #include <stdlib.h>
4244 #include <string.h>
4245 #include <sys/types.h>
4246
4247 int
4248 main (void)
4249 {
4250
4251 #ifndef _XOPEN_SOURCE
4252 make an error
4253 #endif
4254   ;
4255   return 0;
4256 }
4257 _ACEOF
4258 rm -f conftest.$ac_objext
4259 if { (eval echo "$as_me:4259: \"$ac_compile\"") >&5
4260   (eval $ac_compile) 2>&5
4261   ac_status=$?
4262   echo "$as_me:4262: \$? = $ac_status" >&5
4263   (exit $ac_status); } &&
4264          { ac_try='test -s conftest.$ac_objext'
4265   { (eval echo "$as_me:4265: \"$ac_try\"") >&5
4266   (eval $ac_try) 2>&5
4267   ac_status=$?
4268   echo "$as_me:4268: \$? = $ac_status" >&5
4269   (exit $ac_status); }; }; then
4270   cf_cv_xopen_source=no
4271 else
4272   echo "$as_me: failed program was:" >&5
4273 cat conftest.$ac_ext >&5
4274 cf_save="$CPPFLAGS"
4275
4276         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4277         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4278
4279          cat >conftest.$ac_ext <<_ACEOF
4280 #line 4280 "configure"
4281 #include "confdefs.h"
4282
4283 #include <stdlib.h>
4284 #include <string.h>
4285 #include <sys/types.h>
4286
4287 int
4288 main (void)
4289 {
4290
4291 #ifdef _XOPEN_SOURCE
4292 make an error
4293 #endif
4294   ;
4295   return 0;
4296 }
4297 _ACEOF
4298 rm -f conftest.$ac_objext
4299 if { (eval echo "$as_me:4299: \"$ac_compile\"") >&5
4300   (eval $ac_compile) 2>&5
4301   ac_status=$?
4302   echo "$as_me:4302: \$? = $ac_status" >&5
4303   (exit $ac_status); } &&
4304          { ac_try='test -s conftest.$ac_objext'
4305   { (eval echo "$as_me:4305: \"$ac_try\"") >&5
4306   (eval $ac_try) 2>&5
4307   ac_status=$?
4308   echo "$as_me:4308: \$? = $ac_status" >&5
4309   (exit $ac_status); }; }; then
4310   cf_cv_xopen_source=no
4311 else
4312   echo "$as_me: failed program was:" >&5
4313 cat conftest.$ac_ext >&5
4314 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4315 fi
4316 rm -f conftest.$ac_objext conftest.$ac_ext
4317         CPPFLAGS="$cf_save"
4318
4319 fi
4320 rm -f conftest.$ac_objext conftest.$ac_ext
4321
4322 fi
4323 echo "$as_me:4323: result: $cf_cv_xopen_source" >&5
4324 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4325
4326 if test "$cf_cv_xopen_source" != no ; then
4327
4328 CFLAGS=`echo "$CFLAGS" | \
4329         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4330                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4331
4332 CPPFLAGS=`echo "$CPPFLAGS" | \
4333         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4334                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4335
4336         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4337
4338 cf_fix_cppflags=no
4339 cf_new_cflags=
4340 cf_new_cppflags=
4341 cf_new_extra_cppflags=
4342
4343 for cf_add_cflags in $cf_temp_xopen_source
4344 do
4345 case $cf_fix_cppflags in
4346 (no)
4347         case $cf_add_cflags in
4348         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4349                 case $cf_add_cflags in
4350                 (-D*)
4351                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4352
4353                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4354                                 && test -z "${cf_tst_cflags}" \
4355                                 && cf_fix_cppflags=yes
4356
4357                         if test $cf_fix_cppflags = yes ; then
4358
4359         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4360         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4361
4362                                 continue
4363                         elif test "${cf_tst_cflags}" = "\"'" ; then
4364
4365         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4366         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4367
4368                                 continue
4369                         fi
4370                         ;;
4371                 esac
4372                 case "$CPPFLAGS" in
4373                 (*$cf_add_cflags)
4374                         ;;
4375                 (*)
4376                         case $cf_add_cflags in
4377                         (-D*)
4378                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4379
4380 CPPFLAGS=`echo "$CPPFLAGS" | \
4381         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4382                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4383
4384                                 ;;
4385                         esac
4386
4387         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4388         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4389
4390                         ;;
4391                 esac
4392                 ;;
4393         (*)
4394
4395         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4396         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4397
4398                 ;;
4399         esac
4400         ;;
4401 (yes)
4402
4403         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4404         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4405
4406         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4407
4408         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4409                 && test -z "${cf_tst_cflags}" \
4410                 && cf_fix_cppflags=no
4411         ;;
4412 esac
4413 done
4414
4415 if test -n "$cf_new_cflags" ; then
4416
4417         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4418         CFLAGS="${CFLAGS}$cf_new_cflags"
4419
4420 fi
4421
4422 if test -n "$cf_new_cppflags" ; then
4423
4424         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4425         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4426
4427 fi
4428
4429 if test -n "$cf_new_extra_cppflags" ; then
4430
4431         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4432         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4433
4434 fi
4435
4436 fi
4437
4438 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4439
4440 cf_save_CFLAGS="$CFLAGS"
4441 cf_save_CPPFLAGS="$CPPFLAGS"
4442
4443 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4444         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4445                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4446
4447 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4448         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4449                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4450
4451 echo "$as_me:4451: checking if we should define _POSIX_C_SOURCE" >&5
4452 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4453 if test "${cf_cv_posix_c_source+set}" = set; then
4454   echo $ECHO_N "(cached) $ECHO_C" >&6
4455 else
4456
4457 echo "${as_me:-configure}:4457: testing if the symbol is already defined go no further ..." 1>&5
4458
4459         cat >conftest.$ac_ext <<_ACEOF
4460 #line 4460 "configure"
4461 #include "confdefs.h"
4462 #include <sys/types.h>
4463 int
4464 main (void)
4465 {
4466
4467 #ifndef _POSIX_C_SOURCE
4468 make an error
4469 #endif
4470   ;
4471   return 0;
4472 }
4473 _ACEOF
4474 rm -f conftest.$ac_objext
4475 if { (eval echo "$as_me:4475: \"$ac_compile\"") >&5
4476   (eval $ac_compile) 2>&5
4477   ac_status=$?
4478   echo "$as_me:4478: \$? = $ac_status" >&5
4479   (exit $ac_status); } &&
4480          { ac_try='test -s conftest.$ac_objext'
4481   { (eval echo "$as_me:4481: \"$ac_try\"") >&5
4482   (eval $ac_try) 2>&5
4483   ac_status=$?
4484   echo "$as_me:4484: \$? = $ac_status" >&5
4485   (exit $ac_status); }; }; then
4486   cf_cv_posix_c_source=no
4487 else
4488   echo "$as_me: failed program was:" >&5
4489 cat conftest.$ac_ext >&5
4490 cf_want_posix_source=no
4491          case .$cf_POSIX_C_SOURCE in
4492          (.[12]??*)
4493                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4494                 ;;
4495          (.2)
4496                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4497                 cf_want_posix_source=yes
4498                 ;;
4499          (.*)
4500                 cf_want_posix_source=yes
4501                 ;;
4502          esac
4503          if test "$cf_want_posix_source" = yes ; then
4504                 cat >conftest.$ac_ext <<_ACEOF
4505 #line 4505 "configure"
4506 #include "confdefs.h"
4507 #include <sys/types.h>
4508 int
4509 main (void)
4510 {
4511
4512 #ifdef _POSIX_SOURCE
4513 make an error
4514 #endif
4515   ;
4516   return 0;
4517 }
4518 _ACEOF
4519 rm -f conftest.$ac_objext
4520 if { (eval echo "$as_me:4520: \"$ac_compile\"") >&5
4521   (eval $ac_compile) 2>&5
4522   ac_status=$?
4523   echo "$as_me:4523: \$? = $ac_status" >&5
4524   (exit $ac_status); } &&
4525          { ac_try='test -s conftest.$ac_objext'
4526   { (eval echo "$as_me:4526: \"$ac_try\"") >&5
4527   (eval $ac_try) 2>&5
4528   ac_status=$?
4529   echo "$as_me:4529: \$? = $ac_status" >&5
4530   (exit $ac_status); }; }; then
4531   :
4532 else
4533   echo "$as_me: failed program was:" >&5
4534 cat conftest.$ac_ext >&5
4535 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4536 fi
4537 rm -f conftest.$ac_objext conftest.$ac_ext
4538          fi
4539
4540 echo "${as_me:-configure}:4540: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4541
4542          CFLAGS="$cf_trim_CFLAGS"
4543          CPPFLAGS="$cf_trim_CPPFLAGS"
4544
4545         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4546         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4547
4548 echo "${as_me:-configure}:4548: testing if the second compile does not leave our definition intact error ..." 1>&5
4549
4550          cat >conftest.$ac_ext <<_ACEOF
4551 #line 4551 "configure"
4552 #include "confdefs.h"
4553 #include <sys/types.h>
4554 int
4555 main (void)
4556 {
4557
4558 #ifndef _POSIX_C_SOURCE
4559 make an error
4560 #endif
4561   ;
4562   return 0;
4563 }
4564 _ACEOF
4565 rm -f conftest.$ac_objext
4566 if { (eval echo "$as_me:4566: \"$ac_compile\"") >&5
4567   (eval $ac_compile) 2>&5
4568   ac_status=$?
4569   echo "$as_me:4569: \$? = $ac_status" >&5
4570   (exit $ac_status); } &&
4571          { ac_try='test -s conftest.$ac_objext'
4572   { (eval echo "$as_me:4572: \"$ac_try\"") >&5
4573   (eval $ac_try) 2>&5
4574   ac_status=$?
4575   echo "$as_me:4575: \$? = $ac_status" >&5
4576   (exit $ac_status); }; }; then
4577   :
4578 else
4579   echo "$as_me: failed program was:" >&5
4580 cat conftest.$ac_ext >&5
4581 cf_cv_posix_c_source=no
4582 fi
4583 rm -f conftest.$ac_objext conftest.$ac_ext
4584          CFLAGS="$cf_save_CFLAGS"
4585          CPPFLAGS="$cf_save_CPPFLAGS"
4586
4587 fi
4588 rm -f conftest.$ac_objext conftest.$ac_ext
4589
4590 fi
4591 echo "$as_me:4591: result: $cf_cv_posix_c_source" >&5
4592 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4593
4594 if test "$cf_cv_posix_c_source" != no ; then
4595         CFLAGS="$cf_trim_CFLAGS"
4596         CPPFLAGS="$cf_trim_CPPFLAGS"
4597
4598 cf_fix_cppflags=no
4599 cf_new_cflags=
4600 cf_new_cppflags=
4601 cf_new_extra_cppflags=
4602
4603 for cf_add_cflags in $cf_cv_posix_c_source
4604 do
4605 case $cf_fix_cppflags in
4606 (no)
4607         case $cf_add_cflags in
4608         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4609                 case $cf_add_cflags in
4610                 (-D*)
4611                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4612
4613                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4614                                 && test -z "${cf_tst_cflags}" \
4615                                 && cf_fix_cppflags=yes
4616
4617                         if test $cf_fix_cppflags = yes ; then
4618
4619         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4620         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4621
4622                                 continue
4623                         elif test "${cf_tst_cflags}" = "\"'" ; then
4624
4625         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4626         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4627
4628                                 continue
4629                         fi
4630                         ;;
4631                 esac
4632                 case "$CPPFLAGS" in
4633                 (*$cf_add_cflags)
4634                         ;;
4635                 (*)
4636                         case $cf_add_cflags in
4637                         (-D*)
4638                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4639
4640 CPPFLAGS=`echo "$CPPFLAGS" | \
4641         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4642                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4643
4644                                 ;;
4645                         esac
4646
4647         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4648         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4649
4650                         ;;
4651                 esac
4652                 ;;
4653         (*)
4654
4655         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4656         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4657
4658                 ;;
4659         esac
4660         ;;
4661 (yes)
4662
4663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4665
4666         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4667
4668         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4669                 && test -z "${cf_tst_cflags}" \
4670                 && cf_fix_cppflags=no
4671         ;;
4672 esac
4673 done
4674
4675 if test -n "$cf_new_cflags" ; then
4676
4677         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4678         CFLAGS="${CFLAGS}$cf_new_cflags"
4679
4680 fi
4681
4682 if test -n "$cf_new_cppflags" ; then
4683
4684         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4685         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4686
4687 fi
4688
4689 if test -n "$cf_new_extra_cppflags" ; then
4690
4691         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4692         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4693
4694 fi
4695
4696 fi
4697
4698         ;;
4699 esac
4700
4701 if test -n "$cf_xopen_source" ; then
4702
4703 cf_fix_cppflags=no
4704 cf_new_cflags=
4705 cf_new_cppflags=
4706 cf_new_extra_cppflags=
4707
4708 for cf_add_cflags in $cf_xopen_source
4709 do
4710 case $cf_fix_cppflags in
4711 (no)
4712         case $cf_add_cflags in
4713         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4714                 case $cf_add_cflags in
4715                 (-D*)
4716                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4717
4718                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4719                                 && test -z "${cf_tst_cflags}" \
4720                                 && cf_fix_cppflags=yes
4721
4722                         if test $cf_fix_cppflags = yes ; then
4723
4724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4726
4727                                 continue
4728                         elif test "${cf_tst_cflags}" = "\"'" ; then
4729
4730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4732
4733                                 continue
4734                         fi
4735                         ;;
4736                 esac
4737                 case "$CPPFLAGS" in
4738                 (*$cf_add_cflags)
4739                         ;;
4740                 (*)
4741                         case $cf_add_cflags in
4742                         (-D*)
4743                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4744
4745 CPPFLAGS=`echo "$CPPFLAGS" | \
4746         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4747                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4748
4749                                 ;;
4750                         esac
4751
4752         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4753         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4754
4755                         ;;
4756                 esac
4757                 ;;
4758         (*)
4759
4760         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4761         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4762
4763                 ;;
4764         esac
4765         ;;
4766 (yes)
4767
4768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4770
4771         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4772
4773         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4774                 && test -z "${cf_tst_cflags}" \
4775                 && cf_fix_cppflags=no
4776         ;;
4777 esac
4778 done
4779
4780 if test -n "$cf_new_cflags" ; then
4781         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4782
4783 echo "${as_me:-configure}:4783: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4784
4785         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4786         CFLAGS="${CFLAGS}$cf_new_cflags"
4787
4788 fi
4789
4790 if test -n "$cf_new_cppflags" ; then
4791         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4792
4793 echo "${as_me:-configure}:4793: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4794
4795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4796         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4797
4798 fi
4799
4800 if test -n "$cf_new_extra_cppflags" ; then
4801         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4802
4803 echo "${as_me:-configure}:4803: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4804
4805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4807
4808 fi
4809
4810 fi
4811
4812 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4813         echo "$as_me:4813: checking if _XOPEN_SOURCE really is set" >&5
4814 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4815         cat >conftest.$ac_ext <<_ACEOF
4816 #line 4816 "configure"
4817 #include "confdefs.h"
4818 #include <stdlib.h>
4819 int
4820 main (void)
4821 {
4822
4823 #ifndef _XOPEN_SOURCE
4824 make an error
4825 #endif
4826   ;
4827   return 0;
4828 }
4829 _ACEOF
4830 rm -f conftest.$ac_objext
4831 if { (eval echo "$as_me:4831: \"$ac_compile\"") >&5
4832   (eval $ac_compile) 2>&5
4833   ac_status=$?
4834   echo "$as_me:4834: \$? = $ac_status" >&5
4835   (exit $ac_status); } &&
4836          { ac_try='test -s conftest.$ac_objext'
4837   { (eval echo "$as_me:4837: \"$ac_try\"") >&5
4838   (eval $ac_try) 2>&5
4839   ac_status=$?
4840   echo "$as_me:4840: \$? = $ac_status" >&5
4841   (exit $ac_status); }; }; then
4842   cf_XOPEN_SOURCE_set=yes
4843 else
4844   echo "$as_me: failed program was:" >&5
4845 cat conftest.$ac_ext >&5
4846 cf_XOPEN_SOURCE_set=no
4847 fi
4848 rm -f conftest.$ac_objext conftest.$ac_ext
4849         echo "$as_me:4849: result: $cf_XOPEN_SOURCE_set" >&5
4850 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4851         if test $cf_XOPEN_SOURCE_set = yes
4852         then
4853                 cat >conftest.$ac_ext <<_ACEOF
4854 #line 4854 "configure"
4855 #include "confdefs.h"
4856 #include <stdlib.h>
4857 int
4858 main (void)
4859 {
4860
4861 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4862 make an error
4863 #endif
4864   ;
4865   return 0;
4866 }
4867 _ACEOF
4868 rm -f conftest.$ac_objext
4869 if { (eval echo "$as_me:4869: \"$ac_compile\"") >&5
4870   (eval $ac_compile) 2>&5
4871   ac_status=$?
4872   echo "$as_me:4872: \$? = $ac_status" >&5
4873   (exit $ac_status); } &&
4874          { ac_try='test -s conftest.$ac_objext'
4875   { (eval echo "$as_me:4875: \"$ac_try\"") >&5
4876   (eval $ac_try) 2>&5
4877   ac_status=$?
4878   echo "$as_me:4878: \$? = $ac_status" >&5
4879   (exit $ac_status); }; }; then
4880   cf_XOPEN_SOURCE_set_ok=yes
4881 else
4882   echo "$as_me: failed program was:" >&5
4883 cat conftest.$ac_ext >&5
4884 cf_XOPEN_SOURCE_set_ok=no
4885 fi
4886 rm -f conftest.$ac_objext conftest.$ac_ext
4887                 if test $cf_XOPEN_SOURCE_set_ok = no
4888                 then
4889                         { echo "$as_me:4889: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4890 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4891                 fi
4892         else
4893
4894 echo "$as_me:4894: checking if we should define _XOPEN_SOURCE" >&5
4895 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4896 if test "${cf_cv_xopen_source+set}" = set; then
4897   echo $ECHO_N "(cached) $ECHO_C" >&6
4898 else
4899
4900         cat >conftest.$ac_ext <<_ACEOF
4901 #line 4901 "configure"
4902 #include "confdefs.h"
4903
4904 #include <stdlib.h>
4905 #include <string.h>
4906 #include <sys/types.h>
4907
4908 int
4909 main (void)
4910 {
4911
4912 #ifndef _XOPEN_SOURCE
4913 make an error
4914 #endif
4915   ;
4916   return 0;
4917 }
4918 _ACEOF
4919 rm -f conftest.$ac_objext
4920 if { (eval echo "$as_me:4920: \"$ac_compile\"") >&5
4921   (eval $ac_compile) 2>&5
4922   ac_status=$?
4923   echo "$as_me:4923: \$? = $ac_status" >&5
4924   (exit $ac_status); } &&
4925          { ac_try='test -s conftest.$ac_objext'
4926   { (eval echo "$as_me:4926: \"$ac_try\"") >&5
4927   (eval $ac_try) 2>&5
4928   ac_status=$?
4929   echo "$as_me:4929: \$? = $ac_status" >&5
4930   (exit $ac_status); }; }; then
4931   cf_cv_xopen_source=no
4932 else
4933   echo "$as_me: failed program was:" >&5
4934 cat conftest.$ac_ext >&5
4935 cf_save="$CPPFLAGS"
4936
4937         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4938         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4939
4940          cat >conftest.$ac_ext <<_ACEOF
4941 #line 4941 "configure"
4942 #include "confdefs.h"
4943
4944 #include <stdlib.h>
4945 #include <string.h>
4946 #include <sys/types.h>
4947
4948 int
4949 main (void)
4950 {
4951
4952 #ifdef _XOPEN_SOURCE
4953 make an error
4954 #endif
4955   ;
4956   return 0;
4957 }
4958 _ACEOF
4959 rm -f conftest.$ac_objext
4960 if { (eval echo "$as_me:4960: \"$ac_compile\"") >&5
4961   (eval $ac_compile) 2>&5
4962   ac_status=$?
4963   echo "$as_me:4963: \$? = $ac_status" >&5
4964   (exit $ac_status); } &&
4965          { ac_try='test -s conftest.$ac_objext'
4966   { (eval echo "$as_me:4966: \"$ac_try\"") >&5
4967   (eval $ac_try) 2>&5
4968   ac_status=$?
4969   echo "$as_me:4969: \$? = $ac_status" >&5
4970   (exit $ac_status); }; }; then
4971   cf_cv_xopen_source=no
4972 else
4973   echo "$as_me: failed program was:" >&5
4974 cat conftest.$ac_ext >&5
4975 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4976 fi
4977 rm -f conftest.$ac_objext conftest.$ac_ext
4978         CPPFLAGS="$cf_save"
4979
4980 fi
4981 rm -f conftest.$ac_objext conftest.$ac_ext
4982
4983 fi
4984 echo "$as_me:4984: result: $cf_cv_xopen_source" >&5
4985 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4986
4987 if test "$cf_cv_xopen_source" != no ; then
4988
4989 CFLAGS=`echo "$CFLAGS" | \
4990         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4991                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4992
4993 CPPFLAGS=`echo "$CPPFLAGS" | \
4994         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4995                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4996
4997         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4998
4999 cf_fix_cppflags=no
5000 cf_new_cflags=
5001 cf_new_cppflags=
5002 cf_new_extra_cppflags=
5003
5004 for cf_add_cflags in $cf_temp_xopen_source
5005 do
5006 case $cf_fix_cppflags in
5007 (no)
5008         case $cf_add_cflags in
5009         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
5010                 case $cf_add_cflags in
5011                 (-D*)
5012                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5013
5014                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5015                                 && test -z "${cf_tst_cflags}" \
5016                                 && cf_fix_cppflags=yes
5017
5018                         if test $cf_fix_cppflags = yes ; then
5019
5020         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5021         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5022
5023                                 continue
5024                         elif test "${cf_tst_cflags}" = "\"'" ; then
5025
5026         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5027         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5028
5029                                 continue
5030                         fi
5031                         ;;
5032                 esac
5033                 case "$CPPFLAGS" in
5034                 (*$cf_add_cflags)
5035                         ;;
5036                 (*)
5037                         case $cf_add_cflags in
5038                         (-D*)
5039                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5040
5041 CPPFLAGS=`echo "$CPPFLAGS" | \
5042         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5043                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5044
5045                                 ;;
5046                         esac
5047
5048         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
5049         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
5050
5051                         ;;
5052                 esac
5053                 ;;
5054         (*)
5055
5056         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
5057         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
5058
5059                 ;;
5060         esac
5061         ;;
5062 (yes)
5063
5064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
5065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
5066
5067         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5068
5069         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
5070                 && test -z "${cf_tst_cflags}" \
5071                 && cf_fix_cppflags=no
5072         ;;
5073 esac
5074 done
5075
5076 if test -n "$cf_new_cflags" ; then
5077
5078         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
5079         CFLAGS="${CFLAGS}$cf_new_cflags"
5080
5081 fi
5082
5083 if test -n "$cf_new_cppflags" ; then
5084
5085         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5086         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
5087
5088 fi
5089
5090 if test -n "$cf_new_extra_cppflags" ; then
5091
5092         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
5093         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
5094
5095 fi
5096
5097 fi
5098
5099         fi
5100 fi
5101
5102 echo "$as_me:5102: checking for signal global datatype" >&5
5103 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
5104 if test "${cf_cv_sig_atomic_t+set}" = set; then
5105   echo $ECHO_N "(cached) $ECHO_C" >&6
5106 else
5107
5108         for cf_type in \
5109                 "volatile sig_atomic_t" \
5110                 "sig_atomic_t" \
5111                 "int"
5112         do
5113         cat >conftest.$ac_ext <<_ACEOF
5114 #line 5114 "configure"
5115 #include "confdefs.h"
5116
5117 #include <sys/types.h>
5118 #include <signal.h>
5119 #include <stdio.h>
5120
5121 extern $cf_type x;
5122 $cf_type x;
5123 static void handler(int sig)
5124 {
5125         x = 5;
5126 }
5127 int
5128 main (void)
5129 {
5130 signal(SIGINT, handler);
5131                  x = 1
5132   ;
5133   return 0;
5134 }
5135 _ACEOF
5136 rm -f conftest.$ac_objext
5137 if { (eval echo "$as_me:5137: \"$ac_compile\"") >&5
5138   (eval $ac_compile) 2>&5
5139   ac_status=$?
5140   echo "$as_me:5140: \$? = $ac_status" >&5
5141   (exit $ac_status); } &&
5142          { ac_try='test -s conftest.$ac_objext'
5143   { (eval echo "$as_me:5143: \"$ac_try\"") >&5
5144   (eval $ac_try) 2>&5
5145   ac_status=$?
5146   echo "$as_me:5146: \$? = $ac_status" >&5
5147   (exit $ac_status); }; }; then
5148   cf_cv_sig_atomic_t=$cf_type
5149 else
5150   echo "$as_me: failed program was:" >&5
5151 cat conftest.$ac_ext >&5
5152 cf_cv_sig_atomic_t=no
5153 fi
5154 rm -f conftest.$ac_objext conftest.$ac_ext
5155                 test "$cf_cv_sig_atomic_t" != no && break
5156         done
5157
5158 fi
5159
5160 echo "$as_me:5160: result: $cf_cv_sig_atomic_t" >&5
5161 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
5162 test "$cf_cv_sig_atomic_t" != no &&
5163 cat >>confdefs.h <<EOF
5164 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5165 EOF
5166
5167 # Work around breakage on OS X
5168
5169 echo "$as_me:5169: checking if SIGWINCH is defined" >&5
5170 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5171 if test "${cf_cv_define_sigwinch+set}" = set; then
5172   echo $ECHO_N "(cached) $ECHO_C" >&6
5173 else
5174
5175         cat >conftest.$ac_ext <<_ACEOF
5176 #line 5176 "configure"
5177 #include "confdefs.h"
5178
5179 #include <sys/types.h>
5180 #include <sys/signal.h>
5181
5182 int
5183 main (void)
5184 {
5185 int x = SIGWINCH
5186   ;
5187   return 0;
5188 }
5189 _ACEOF
5190 rm -f conftest.$ac_objext
5191 if { (eval echo "$as_me:5191: \"$ac_compile\"") >&5
5192   (eval $ac_compile) 2>&5
5193   ac_status=$?
5194   echo "$as_me:5194: \$? = $ac_status" >&5
5195   (exit $ac_status); } &&
5196          { ac_try='test -s conftest.$ac_objext'
5197   { (eval echo "$as_me:5197: \"$ac_try\"") >&5
5198   (eval $ac_try) 2>&5
5199   ac_status=$?
5200   echo "$as_me:5200: \$? = $ac_status" >&5
5201   (exit $ac_status); }; }; then
5202   cf_cv_define_sigwinch=yes
5203 else
5204   echo "$as_me: failed program was:" >&5
5205 cat conftest.$ac_ext >&5
5206 cat >conftest.$ac_ext <<_ACEOF
5207 #line 5207 "configure"
5208 #include "confdefs.h"
5209
5210 #undef _XOPEN_SOURCE
5211 #undef _POSIX_SOURCE
5212 #undef _POSIX_C_SOURCE
5213 #include <sys/types.h>
5214 #include <sys/signal.h>
5215
5216 int
5217 main (void)
5218 {
5219 int x = SIGWINCH
5220   ;
5221   return 0;
5222 }
5223 _ACEOF
5224 rm -f conftest.$ac_objext
5225 if { (eval echo "$as_me:5225: \"$ac_compile\"") >&5
5226   (eval $ac_compile) 2>&5
5227   ac_status=$?
5228   echo "$as_me:5228: \$? = $ac_status" >&5
5229   (exit $ac_status); } &&
5230          { ac_try='test -s conftest.$ac_objext'
5231   { (eval echo "$as_me:5231: \"$ac_try\"") >&5
5232   (eval $ac_try) 2>&5
5233   ac_status=$?
5234   echo "$as_me:5234: \$? = $ac_status" >&5
5235   (exit $ac_status); }; }; then
5236   cf_cv_define_sigwinch=maybe
5237 else
5238   echo "$as_me: failed program was:" >&5
5239 cat conftest.$ac_ext >&5
5240 cf_cv_define_sigwinch=no
5241 fi
5242 rm -f conftest.$ac_objext conftest.$ac_ext
5243
5244 fi
5245 rm -f conftest.$ac_objext conftest.$ac_ext
5246
5247 fi
5248 echo "$as_me:5248: result: $cf_cv_define_sigwinch" >&5
5249 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5250
5251 if test "$cf_cv_define_sigwinch" = maybe ; then
5252 echo "$as_me:5252: checking for actual SIGWINCH definition" >&5
5253 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5254 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5255   echo $ECHO_N "(cached) $ECHO_C" >&6
5256 else
5257
5258 cf_cv_fixup_sigwinch=unknown
5259 cf_sigwinch=32
5260 while test $cf_sigwinch != 1
5261 do
5262         cat >conftest.$ac_ext <<_ACEOF
5263 #line 5263 "configure"
5264 #include "confdefs.h"
5265
5266 #undef _XOPEN_SOURCE
5267 #undef _POSIX_SOURCE
5268 #undef _POSIX_C_SOURCE
5269 #include <sys/types.h>
5270 #include <sys/signal.h>
5271
5272 int
5273 main (void)
5274 {
5275
5276 #if SIGWINCH != $cf_sigwinch
5277 make an error
5278 #endif
5279 int x = SIGWINCH
5280   ;
5281   return 0;
5282 }
5283 _ACEOF
5284 rm -f conftest.$ac_objext
5285 if { (eval echo "$as_me:5285: \"$ac_compile\"") >&5
5286   (eval $ac_compile) 2>&5
5287   ac_status=$?
5288   echo "$as_me:5288: \$? = $ac_status" >&5
5289   (exit $ac_status); } &&
5290          { ac_try='test -s conftest.$ac_objext'
5291   { (eval echo "$as_me:5291: \"$ac_try\"") >&5
5292   (eval $ac_try) 2>&5
5293   ac_status=$?
5294   echo "$as_me:5294: \$? = $ac_status" >&5
5295   (exit $ac_status); }; }; then
5296   cf_cv_fixup_sigwinch=$cf_sigwinch
5297          break
5298 else
5299   echo "$as_me: failed program was:" >&5
5300 cat conftest.$ac_ext >&5
5301 fi
5302 rm -f conftest.$ac_objext conftest.$ac_ext
5303
5304 cf_sigwinch=`expr $cf_sigwinch - 1`
5305 done
5306
5307 fi
5308 echo "$as_me:5308: result: $cf_cv_fixup_sigwinch" >&5
5309 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5310
5311         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5312                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5313         fi
5314 fi
5315
5316 # Checks for CODESET support.
5317
5318 echo "$as_me:5318: checking for nl_langinfo and CODESET" >&5
5319 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5320 if test "${am_cv_langinfo_codeset+set}" = set; then
5321   echo $ECHO_N "(cached) $ECHO_C" >&6
5322 else
5323   cat >conftest.$ac_ext <<_ACEOF
5324 #line 5324 "configure"
5325 #include "confdefs.h"
5326 #include <langinfo.h>
5327 int
5328 main (void)
5329 {
5330 char* cs = nl_langinfo(CODESET);
5331   ;
5332   return 0;
5333 }
5334 _ACEOF
5335 rm -f conftest.$ac_objext conftest$ac_exeext
5336 if { (eval echo "$as_me:5336: \"$ac_link\"") >&5
5337   (eval $ac_link) 2>&5
5338   ac_status=$?
5339   echo "$as_me:5339: \$? = $ac_status" >&5
5340   (exit $ac_status); } &&
5341          { ac_try='test -s conftest$ac_exeext'
5342   { (eval echo "$as_me:5342: \"$ac_try\"") >&5
5343   (eval $ac_try) 2>&5
5344   ac_status=$?
5345   echo "$as_me:5345: \$? = $ac_status" >&5
5346   (exit $ac_status); }; }; then
5347   am_cv_langinfo_codeset=yes
5348 else
5349   echo "$as_me: failed program was:" >&5
5350 cat conftest.$ac_ext >&5
5351 am_cv_langinfo_codeset=no
5352 fi
5353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5354
5355 fi
5356 echo "$as_me:5356: result: $am_cv_langinfo_codeset" >&5
5357 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5358         if test $am_cv_langinfo_codeset = yes; then
5359
5360 cat >>confdefs.h <<\EOF
5361 #define HAVE_LANGINFO_CODESET 1
5362 EOF
5363
5364         fi
5365
5366 echo "$as_me:5366: checking if you want to use pkg-config" >&5
5367 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5368
5369 # Check whether --with-pkg-config or --without-pkg-config was given.
5370 if test "${with_pkg_config+set}" = set; then
5371   withval="$with_pkg_config"
5372   cf_pkg_config=$withval
5373 else
5374   cf_pkg_config=yes
5375 fi;
5376 echo "$as_me:5376: result: $cf_pkg_config" >&5
5377 echo "${ECHO_T}$cf_pkg_config" >&6
5378
5379 case $cf_pkg_config in
5380 (no)
5381         PKG_CONFIG=none
5382         ;;
5383 (yes)
5384
5385 if test -n "$ac_tool_prefix"; then
5386   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5387 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5388 echo "$as_me:5388: checking for $ac_word" >&5
5389 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5390 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5391   echo $ECHO_N "(cached) $ECHO_C" >&6
5392 else
5393   case $PKG_CONFIG in
5394   [\\/]* | ?:[\\/]*)
5395   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5396   ;;
5397   *)
5398   ac_save_IFS=$IFS; IFS=$ac_path_separator
5399 ac_dummy="$PATH"
5400 for ac_dir in $ac_dummy; do
5401   IFS=$ac_save_IFS
5402   test -z "$ac_dir" && ac_dir=.
5403   if $as_executable_p "$ac_dir/$ac_word"; then
5404    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5405    echo "$as_me:5405: found $ac_dir/$ac_word" >&5
5406    break
5407 fi
5408 done
5409
5410   ;;
5411 esac
5412 fi
5413 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5414
5415 if test -n "$PKG_CONFIG"; then
5416   echo "$as_me:5416: result: $PKG_CONFIG" >&5
5417 echo "${ECHO_T}$PKG_CONFIG" >&6
5418 else
5419   echo "$as_me:5419: result: no" >&5
5420 echo "${ECHO_T}no" >&6
5421 fi
5422
5423 fi
5424 if test -z "$ac_cv_path_PKG_CONFIG"; then
5425   ac_pt_PKG_CONFIG=$PKG_CONFIG
5426   # Extract the first word of "pkg-config", so it can be a program name with args.
5427 set dummy pkg-config; ac_word=$2
5428 echo "$as_me:5428: checking for $ac_word" >&5
5429 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5430 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5431   echo $ECHO_N "(cached) $ECHO_C" >&6
5432 else
5433   case $ac_pt_PKG_CONFIG in
5434   [\\/]* | ?:[\\/]*)
5435   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5436   ;;
5437   *)
5438   ac_save_IFS=$IFS; IFS=$ac_path_separator
5439 ac_dummy="$PATH"
5440 for ac_dir in $ac_dummy; do
5441   IFS=$ac_save_IFS
5442   test -z "$ac_dir" && ac_dir=.
5443   if $as_executable_p "$ac_dir/$ac_word"; then
5444    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5445    echo "$as_me:5445: found $ac_dir/$ac_word" >&5
5446    break
5447 fi
5448 done
5449
5450   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5451   ;;
5452 esac
5453 fi
5454 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5455
5456 if test -n "$ac_pt_PKG_CONFIG"; then
5457   echo "$as_me:5457: result: $ac_pt_PKG_CONFIG" >&5
5458 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5459 else
5460   echo "$as_me:5460: result: no" >&5
5461 echo "${ECHO_T}no" >&6
5462 fi
5463
5464   PKG_CONFIG=$ac_pt_PKG_CONFIG
5465 else
5466   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5467 fi
5468
5469         ;;
5470 (*)
5471         PKG_CONFIG=$withval
5472         ;;
5473 esac
5474
5475 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5476 if test "$PKG_CONFIG" != none ; then
5477
5478 if test "x$prefix" != xNONE; then
5479         cf_path_syntax="$prefix"
5480 else
5481         cf_path_syntax="$ac_default_prefix"
5482 fi
5483
5484 case ".$PKG_CONFIG" in
5485 (.\$\(*\)*|.\'*\'*)
5486         ;;
5487 (..|./*|.\\*)
5488         ;;
5489 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5490         ;;
5491 (.\${*prefix}*|.\${*dir}*)
5492         eval PKG_CONFIG="$PKG_CONFIG"
5493         case ".$PKG_CONFIG" in
5494         (.NONE/*)
5495                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5496                 ;;
5497         esac
5498         ;;
5499 (.no|.NONE/*)
5500         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5501         ;;
5502 (*)
5503         { { echo "$as_me:5503: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5504 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5505    { (exit 1); exit 1; }; }
5506         ;;
5507 esac
5508
5509 elif test "x$cf_pkg_config" != xno ; then
5510         { echo "$as_me:5510: WARNING: pkg-config is not installed" >&5
5511 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5512 fi
5513
5514 echo "$as_me:5514: checking if you want to see long compiling messages" >&5
5515 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5516
5517 # Check whether --enable-echo or --disable-echo was given.
5518 if test "${enable_echo+set}" = set; then
5519   enableval="$enable_echo"
5520   test "$enableval" != no && enableval=yes
5521         if test "$enableval" != "yes" ; then
5522
5523         ECHO_LT='--silent'
5524         ECHO_LD='@echo linking $@;'
5525         RULE_CC='@echo compiling $<'
5526         SHOW_CC='@echo compiling $@'
5527         ECHO_CC='@'
5528
5529         else
5530
5531         ECHO_LT=''
5532         ECHO_LD=''
5533         RULE_CC=''
5534         SHOW_CC=''
5535         ECHO_CC=''
5536
5537         fi
5538 else
5539   enableval=yes
5540
5541         ECHO_LT=''
5542         ECHO_LD=''
5543         RULE_CC=''
5544         SHOW_CC=''
5545         ECHO_CC=''
5546
5547 fi;
5548 echo "$as_me:5548: result: $enableval" >&5
5549 echo "${ECHO_T}$enableval" >&6
5550
5551 echo "$as_me:5551: checking for ncurses wrap-prefix" >&5
5552 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5553
5554 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5555 if test "${with_ncurses_wrap_prefix+set}" = set; then
5556   withval="$with_ncurses_wrap_prefix"
5557   NCURSES_WRAP_PREFIX=$withval
5558 else
5559   NCURSES_WRAP_PREFIX=_nc_
5560 fi;
5561 echo "$as_me:5561: result: $NCURSES_WRAP_PREFIX" >&5
5562 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5563
5564 echo "$as_me:5564: checking if you want to check for wide-character functions" >&5
5565 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5566
5567 # Check whether --enable-widec or --disable-widec was given.
5568 if test "${enable_widec+set}" = set; then
5569   enableval="$enable_widec"
5570   test "$enableval" != no && enableval=yes
5571         if test "$enableval" != "yes" ; then
5572     cf_enable_widec=no
5573         else
5574                 cf_enable_widec=yes
5575         fi
5576 else
5577   enableval=yes
5578         cf_enable_widec=yes
5579
5580 fi;
5581 echo "$as_me:5581: result: $cf_enable_widec" >&5
5582 echo "${ECHO_T}$cf_enable_widec" >&6
5583
5584 echo "$as_me:5584: checking for specific curses-directory" >&5
5585 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5586
5587 # Check whether --with-curses-dir or --without-curses-dir was given.
5588 if test "${with_curses_dir+set}" = set; then
5589   withval="$with_curses_dir"
5590   cf_cv_curses_dir=$withval
5591 else
5592   cf_cv_curses_dir=no
5593 fi;
5594 echo "$as_me:5594: result: $cf_cv_curses_dir" >&5
5595 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5596
5597 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5598 then
5599
5600 if test "x$prefix" != xNONE; then
5601         cf_path_syntax="$prefix"
5602 else
5603         cf_path_syntax="$ac_default_prefix"
5604 fi
5605
5606 case ".$withval" in
5607 (.\$\(*\)*|.\'*\'*)
5608         ;;
5609 (..|./*|.\\*)
5610         ;;
5611 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5612         ;;
5613 (.\${*prefix}*|.\${*dir}*)
5614         eval withval="$withval"
5615         case ".$withval" in
5616         (.NONE/*)
5617                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5618                 ;;
5619         esac
5620         ;;
5621 (.no|.NONE/*)
5622         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5623         ;;
5624 (*)
5625         { { echo "$as_me:5625: error: expected a pathname, not \"$withval\"" >&5
5626 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5627    { (exit 1); exit 1; }; }
5628         ;;
5629 esac
5630
5631         if test -d "$cf_cv_curses_dir"
5632         then
5633
5634 if test -n "$cf_cv_curses_dir/include" ; then
5635   for cf_add_incdir in $cf_cv_curses_dir/include
5636   do
5637         while test $cf_add_incdir != /usr/include
5638         do
5639           if test -d $cf_add_incdir
5640           then
5641                 cf_have_incdir=no
5642                 if test -n "$CFLAGS$CPPFLAGS" ; then
5643                   # a loop is needed to ensure we can add subdirs of existing dirs
5644                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5645                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5646                           cf_have_incdir=yes; break
5647                         fi
5648                   done
5649                 fi
5650
5651                 if test "$cf_have_incdir" = no ; then
5652                   if test "$cf_add_incdir" = /usr/local/include ; then
5653                         if test "$GCC" = yes
5654                         then
5655                           cf_save_CPPFLAGS=$CPPFLAGS
5656
5657         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5658         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5659
5660                           cat >conftest.$ac_ext <<_ACEOF
5661 #line 5661 "configure"
5662 #include "confdefs.h"
5663 #include <stdio.h>
5664 int
5665 main (void)
5666 {
5667 printf("Hello")
5668   ;
5669   return 0;
5670 }
5671 _ACEOF
5672 rm -f conftest.$ac_objext
5673 if { (eval echo "$as_me:5673: \"$ac_compile\"") >&5
5674   (eval $ac_compile) 2>&5
5675   ac_status=$?
5676   echo "$as_me:5676: \$? = $ac_status" >&5
5677   (exit $ac_status); } &&
5678          { ac_try='test -s conftest.$ac_objext'
5679   { (eval echo "$as_me:5679: \"$ac_try\"") >&5
5680   (eval $ac_try) 2>&5
5681   ac_status=$?
5682   echo "$as_me:5682: \$? = $ac_status" >&5
5683   (exit $ac_status); }; }; then
5684   :
5685 else
5686   echo "$as_me: failed program was:" >&5
5687 cat conftest.$ac_ext >&5
5688 cf_have_incdir=yes
5689 fi
5690 rm -f conftest.$ac_objext conftest.$ac_ext
5691                           CPPFLAGS=$cf_save_CPPFLAGS
5692                         fi
5693                   fi
5694                 fi
5695
5696                 if test "$cf_have_incdir" = no ; then
5697                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5698
5699 echo "${as_me:-configure}:5699: testing adding $cf_add_incdir to include-path ..." 1>&5
5700
5701                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5702
5703                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5704                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5705                   cf_add_incdir="$cf_top_incdir"
5706                 else
5707                   break
5708                 fi
5709           else
5710                 break
5711           fi
5712         done
5713   done
5714 fi
5715
5716 if test -n "$cf_cv_curses_dir/lib" ; then
5717         for cf_add_libdir in $cf_cv_curses_dir/lib
5718         do
5719                 if test $cf_add_libdir = /usr/lib ; then
5720                         :
5721                 elif test -d $cf_add_libdir
5722                 then
5723                         cf_have_libdir=no
5724                         if test -n "$LDFLAGS$LIBS" ; then
5725                                 # a loop is needed to ensure we can add subdirs of existing dirs
5726                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5727                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5728                                                 cf_have_libdir=yes; break
5729                                         fi
5730                                 done
5731                         fi
5732                         if test "$cf_have_libdir" = no ; then
5733                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5734
5735 echo "${as_me:-configure}:5735: testing adding $cf_add_libdir to library-path ..." 1>&5
5736
5737                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5738                         fi
5739                 fi
5740         done
5741 fi
5742
5743         fi
5744 fi
5745
5746 cf_cv_screen=curses
5747
5748 echo "$as_me:5748: checking for specified curses library type" >&5
5749 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5750
5751 # Check whether --with-screen or --without-screen was given.
5752 if test "${with_screen+set}" = set; then
5753   withval="$with_screen"
5754   cf_cv_screen=$withval
5755 else
5756
5757 # Check whether --with-ncursesw or --without-ncursesw was given.
5758 if test "${with_ncursesw+set}" = set; then
5759   withval="$with_ncursesw"
5760   cf_cv_screen=ncursesw
5761 else
5762
5763 # Check whether --with-ncurses or --without-ncurses was given.
5764 if test "${with_ncurses+set}" = set; then
5765   withval="$with_ncurses"
5766   cf_cv_screen=ncurses
5767 else
5768
5769 # Check whether --with-pdcurses or --without-pdcurses was given.
5770 if test "${with_pdcurses+set}" = set; then
5771   withval="$with_pdcurses"
5772   cf_cv_screen=pdcurses
5773 else
5774
5775 # Check whether --with-curses-colr or --without-curses-colr was given.
5776 if test "${with_curses_colr+set}" = set; then
5777   withval="$with_curses_colr"
5778   cf_cv_screen=curses_colr
5779 else
5780
5781 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5782 if test "${with_curses_5lib+set}" = set; then
5783   withval="$with_curses_5lib"
5784   cf_cv_screen=curses_5lib
5785 fi;
5786 fi;
5787 fi;
5788 fi;
5789 fi;
5790 fi;
5791
5792 echo "$as_me:5792: result: $cf_cv_screen" >&5
5793 echo "${ECHO_T}$cf_cv_screen" >&6
5794
5795 case $cf_cv_screen in
5796 (curses|curses_*)
5797
5798 echo "$as_me:5798: checking for extra include directories" >&5
5799 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5800 if test "${cf_cv_curses_incdir+set}" = set; then
5801   echo $ECHO_N "(cached) $ECHO_C" >&6
5802 else
5803
5804 cf_cv_curses_incdir=no
5805 case $host_os in
5806 (hpux10.*)
5807         if test "x$cf_cv_screen" = "xcurses_colr"
5808         then
5809                 test -d /usr/include/curses_colr && \
5810                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5811         fi
5812         ;;
5813 (sunos3*|sunos4*)
5814         if test "x$cf_cv_screen" = "xcurses_5lib"
5815         then
5816                 test -d /usr/5lib && \
5817                 test -d /usr/5include && \
5818                 cf_cv_curses_incdir="-I/usr/5include"
5819         fi
5820         ;;
5821 esac
5822
5823 fi
5824 echo "$as_me:5824: result: $cf_cv_curses_incdir" >&5
5825 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5826 if test "$cf_cv_curses_incdir" != no
5827 then
5828
5829         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5830         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5831
5832 fi
5833
5834 echo "$as_me:5834: checking if we have identified curses headers" >&5
5835 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5836 if test "${cf_cv_ncurses_header+set}" = set; then
5837   echo $ECHO_N "(cached) $ECHO_C" >&6
5838 else
5839
5840 cf_cv_ncurses_header=none
5841 for cf_header in \
5842         ncurses.h  \
5843         curses.h  ncurses/ncurses.h ncurses/curses.h
5844 do
5845 cat >conftest.$ac_ext <<_ACEOF
5846 #line 5846 "configure"
5847 #include "confdefs.h"
5848 #include <${cf_header}>
5849 int
5850 main (void)
5851 {
5852 initscr(); tgoto("?", 0,0)
5853   ;
5854   return 0;
5855 }
5856 _ACEOF
5857 rm -f conftest.$ac_objext
5858 if { (eval echo "$as_me:5858: \"$ac_compile\"") >&5
5859   (eval $ac_compile) 2>&5
5860   ac_status=$?
5861   echo "$as_me:5861: \$? = $ac_status" >&5
5862   (exit $ac_status); } &&
5863          { ac_try='test -s conftest.$ac_objext'
5864   { (eval echo "$as_me:5864: \"$ac_try\"") >&5
5865   (eval $ac_try) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); }; }; then
5869   cf_cv_ncurses_header=$cf_header; break
5870 else
5871   echo "$as_me: failed program was:" >&5
5872 cat conftest.$ac_ext >&5
5873 fi
5874 rm -f conftest.$ac_objext conftest.$ac_ext
5875 done
5876
5877 fi
5878 echo "$as_me:5878: result: $cf_cv_ncurses_header" >&5
5879 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5880
5881 if test "$cf_cv_ncurses_header" = none ; then
5882         { { echo "$as_me:5882: error: No curses header-files found" >&5
5883 echo "$as_me: error: No curses header-files found" >&2;}
5884    { (exit 1); exit 1; }; }
5885 fi
5886
5887 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5888
5889 for ac_header in $cf_cv_ncurses_header
5890 do
5891 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5892 echo "$as_me:5892: checking for $ac_header" >&5
5893 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5894 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5895   echo $ECHO_N "(cached) $ECHO_C" >&6
5896 else
5897   cat >conftest.$ac_ext <<_ACEOF
5898 #line 5898 "configure"
5899 #include "confdefs.h"
5900 #include <$ac_header>
5901 _ACEOF
5902 if { (eval echo "$as_me:5902: \"$ac_cpp conftest.$ac_ext\"") >&5
5903   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5904   ac_status=$?
5905   egrep -v '^ *\+' conftest.er1 >conftest.err
5906   rm -f conftest.er1
5907   cat conftest.err >&5
5908   echo "$as_me:5908: \$? = $ac_status" >&5
5909   (exit $ac_status); } >/dev/null; then
5910   if test -s conftest.err; then
5911     ac_cpp_err=$ac_c_preproc_warn_flag
5912   else
5913     ac_cpp_err=
5914   fi
5915 else
5916   ac_cpp_err=yes
5917 fi
5918 if test -z "$ac_cpp_err"; then
5919   eval "$as_ac_Header=yes"
5920 else
5921   echo "$as_me: failed program was:" >&5
5922   cat conftest.$ac_ext >&5
5923   eval "$as_ac_Header=no"
5924 fi
5925 rm -f conftest.err conftest.$ac_ext
5926 fi
5927 echo "$as_me:5927: result: `eval echo '${'$as_ac_Header'}'`" >&5
5928 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5929 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5930   cat >>confdefs.h <<EOF
5931 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5932 EOF
5933
5934 fi
5935 done
5936
5937 echo "$as_me:5937: checking for terminfo header" >&5
5938 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5939 if test "${cf_cv_term_header+set}" = set; then
5940   echo $ECHO_N "(cached) $ECHO_C" >&6
5941 else
5942
5943 case ${cf_cv_ncurses_header} in
5944 (*/ncurses.h|*/ncursesw.h)
5945         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5946         ;;
5947 (*)
5948         cf_term_header=term.h
5949         ;;
5950 esac
5951
5952 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5953 do
5954 cat >conftest.$ac_ext <<_ACEOF
5955 #line 5955 "configure"
5956 #include "confdefs.h"
5957 #include <stdio.h>
5958 #include <${cf_cv_ncurses_header:-curses.h}>
5959 #include <$cf_test>
5960
5961 int
5962 main (void)
5963 {
5964 int x = auto_left_margin
5965   ;
5966   return 0;
5967 }
5968 _ACEOF
5969 rm -f conftest.$ac_objext
5970 if { (eval echo "$as_me:5970: \"$ac_compile\"") >&5
5971   (eval $ac_compile) 2>&5
5972   ac_status=$?
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } &&
5975          { ac_try='test -s conftest.$ac_objext'
5976   { (eval echo "$as_me:5976: \"$ac_try\"") >&5
5977   (eval $ac_try) 2>&5
5978   ac_status=$?
5979   echo "$as_me:5979: \$? = $ac_status" >&5
5980   (exit $ac_status); }; }; then
5981
5982         cf_cv_term_header="$cf_test"
5983 else
5984   echo "$as_me: failed program was:" >&5
5985 cat conftest.$ac_ext >&5
5986
5987         cf_cv_term_header=unknown
5988
5989 fi
5990 rm -f conftest.$ac_objext conftest.$ac_ext
5991         test "$cf_cv_term_header" != unknown && break
5992 done
5993
5994 fi
5995 echo "$as_me:5995: result: $cf_cv_term_header" >&5
5996 echo "${ECHO_T}$cf_cv_term_header" >&6
5997
5998 # Set definitions to allow ifdef'ing to accommodate subdirectories
5999
6000 case $cf_cv_term_header in
6001 (*term.h)
6002
6003 cat >>confdefs.h <<\EOF
6004 #define HAVE_TERM_H 1
6005 EOF
6006
6007         ;;
6008 esac
6009
6010 case $cf_cv_term_header in
6011 (ncurses/term.h)
6012
6013 cat >>confdefs.h <<\EOF
6014 #define HAVE_NCURSES_TERM_H 1
6015 EOF
6016
6017         ;;
6018 (ncursesw/term.h)
6019
6020 cat >>confdefs.h <<\EOF
6021 #define HAVE_NCURSESW_TERM_H 1
6022 EOF
6023
6024         ;;
6025 esac
6026
6027 echo "$as_me:6027: checking for ncurses version" >&5
6028 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
6029 if test "${cf_cv_ncurses_version+set}" = set; then
6030   echo $ECHO_N "(cached) $ECHO_C" >&6
6031 else
6032
6033         cf_cv_ncurses_version=no
6034         cf_tempfile=out$$
6035         rm -f $cf_tempfile
6036         if test "$cross_compiling" = yes; then
6037
6038         # This will not work if the preprocessor splits the line after the
6039         # Autoconf token.  The 'unproto' program does that.
6040         cat > conftest.$ac_ext <<EOF
6041 #include <${cf_cv_ncurses_header:-curses.h}>
6042 #undef Autoconf
6043 #ifdef NCURSES_VERSION
6044 Autoconf NCURSES_VERSION
6045 #else
6046 #ifdef __NCURSES_H
6047 Autoconf "old"
6048 #endif
6049 ;
6050 #endif
6051 EOF
6052         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
6053         { (eval echo "$as_me:6053: \"$cf_try\"") >&5
6054   (eval $cf_try) 2>&5
6055   ac_status=$?
6056   echo "$as_me:6056: \$? = $ac_status" >&5
6057   (exit $ac_status); }
6058         if test -f conftest.out ; then
6059                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
6060                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
6061                 rm -f conftest.out
6062         fi
6063
6064 else
6065   cat >conftest.$ac_ext <<_ACEOF
6066 #line 6066 "configure"
6067 #include "confdefs.h"
6068
6069 #include <${cf_cv_ncurses_header:-curses.h}>
6070 #include <stdio.h>
6071 int main(void)
6072 {
6073         FILE *fp = fopen("$cf_tempfile", "w");
6074 #ifdef NCURSES_VERSION
6075 # ifdef NCURSES_VERSION_PATCH
6076         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
6077 # else
6078         fprintf(fp, "%s\n", NCURSES_VERSION);
6079 # endif
6080 #else
6081 # ifdef __NCURSES_H
6082         fprintf(fp, "old\n");
6083 # else
6084         make an error
6085 # endif
6086 #endif
6087         ${cf_cv_main_return:-return}(0);
6088 }
6089 _ACEOF
6090 rm -f conftest$ac_exeext
6091 if { (eval echo "$as_me:6091: \"$ac_link\"") >&5
6092   (eval $ac_link) 2>&5
6093   ac_status=$?
6094   echo "$as_me:6094: \$? = $ac_status" >&5
6095   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
6096   { (eval echo "$as_me:6096: \"$ac_try\"") >&5
6097   (eval $ac_try) 2>&5
6098   ac_status=$?
6099   echo "$as_me:6099: \$? = $ac_status" >&5
6100   (exit $ac_status); }; }; then
6101
6102         cf_cv_ncurses_version=`cat $cf_tempfile`
6103 else
6104   echo "$as_me: program exited with status $ac_status" >&5
6105 echo "$as_me: failed program was:" >&5
6106 cat conftest.$ac_ext >&5
6107 fi
6108 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
6109 fi
6110         rm -f $cf_tempfile
6111
6112 fi
6113 echo "$as_me:6113: result: $cf_cv_ncurses_version" >&5
6114 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
6115 test "$cf_cv_ncurses_version" = no ||
6116 cat >>confdefs.h <<\EOF
6117 #define NCURSES 1
6118 EOF
6119
6120 echo "$as_me:6120: checking if we have identified curses libraries" >&5
6121 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
6122 cat >conftest.$ac_ext <<_ACEOF
6123 #line 6123 "configure"
6124 #include "confdefs.h"
6125 #include <${cf_cv_ncurses_header:-curses.h}>
6126 int
6127 main (void)
6128 {
6129 initscr(); tgoto("?", 0,0)
6130   ;
6131   return 0;
6132 }
6133 _ACEOF
6134 rm -f conftest.$ac_objext conftest$ac_exeext
6135 if { (eval echo "$as_me:6135: \"$ac_link\"") >&5
6136   (eval $ac_link) 2>&5
6137   ac_status=$?
6138   echo "$as_me:6138: \$? = $ac_status" >&5
6139   (exit $ac_status); } &&
6140          { ac_try='test -s conftest$ac_exeext'
6141   { (eval echo "$as_me:6141: \"$ac_try\"") >&5
6142   (eval $ac_try) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit $ac_status); }; }; then
6146   cf_result=yes
6147 else
6148   echo "$as_me: failed program was:" >&5
6149 cat conftest.$ac_ext >&5
6150 cf_result=no
6151 fi
6152 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6153 echo "$as_me:6153: result: $cf_result" >&5
6154 echo "${ECHO_T}$cf_result" >&6
6155
6156 if test "$cf_result" = no ; then
6157 case $host_os in
6158 (freebsd*)
6159         echo "$as_me:6159: checking for tgoto in -lmytinfo" >&5
6160 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
6161 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
6162   echo $ECHO_N "(cached) $ECHO_C" >&6
6163 else
6164   ac_check_lib_save_LIBS=$LIBS
6165 LIBS="-lmytinfo  $LIBS"
6166 cat >conftest.$ac_ext <<_ACEOF
6167 #line 6167 "configure"
6168 #include "confdefs.h"
6169
6170 /* Override any gcc2 internal prototype to avoid an error.  */
6171 #ifdef __cplusplus
6172 extern "C"
6173 #endif
6174 /* We use char because int might match the return type of a gcc2
6175    builtin and then its argument prototype would still apply.  */
6176 char tgoto ();
6177 int
6178 main (void)
6179 {
6180 tgoto ();
6181   ;
6182   return 0;
6183 }
6184 _ACEOF
6185 rm -f conftest.$ac_objext conftest$ac_exeext
6186 if { (eval echo "$as_me:6186: \"$ac_link\"") >&5
6187   (eval $ac_link) 2>&5
6188   ac_status=$?
6189   echo "$as_me:6189: \$? = $ac_status" >&5
6190   (exit $ac_status); } &&
6191          { ac_try='test -s conftest$ac_exeext'
6192   { (eval echo "$as_me:6192: \"$ac_try\"") >&5
6193   (eval $ac_try) 2>&5
6194   ac_status=$?
6195   echo "$as_me:6195: \$? = $ac_status" >&5
6196   (exit $ac_status); }; }; then
6197   ac_cv_lib_mytinfo_tgoto=yes
6198 else
6199   echo "$as_me: failed program was:" >&5
6200 cat conftest.$ac_ext >&5
6201 ac_cv_lib_mytinfo_tgoto=no
6202 fi
6203 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6204 LIBS=$ac_check_lib_save_LIBS
6205 fi
6206 echo "$as_me:6206: result: $ac_cv_lib_mytinfo_tgoto" >&5
6207 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6208 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6209
6210 cf_add_libs="-lmytinfo"
6211 # Filter out duplicates - this happens with badly-designed ".pc" files...
6212 for cf_add_1lib in $LIBS
6213 do
6214         for cf_add_2lib in $cf_add_libs
6215         do
6216                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6217                 then
6218                         cf_add_1lib=
6219                         break
6220                 fi
6221         done
6222         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6223 done
6224 LIBS="$cf_add_libs"
6225
6226 fi
6227
6228         ;;
6229 (hpux10.*)
6230         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6231         # next (1998), and xcurses "newer" (2000).  There is no header file for
6232         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6233         # term.h) for cur_colr
6234         if test "x$cf_cv_screen" = "xcurses_colr"
6235         then
6236                 echo "$as_me:6236: checking for initscr in -lcur_colr" >&5
6237 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6238 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6239   echo $ECHO_N "(cached) $ECHO_C" >&6
6240 else
6241   ac_check_lib_save_LIBS=$LIBS
6242 LIBS="-lcur_colr  $LIBS"
6243 cat >conftest.$ac_ext <<_ACEOF
6244 #line 6244 "configure"
6245 #include "confdefs.h"
6246
6247 /* Override any gcc2 internal prototype to avoid an error.  */
6248 #ifdef __cplusplus
6249 extern "C"
6250 #endif
6251 /* We use char because int might match the return type of a gcc2
6252    builtin and then its argument prototype would still apply.  */
6253 char initscr ();
6254 int
6255 main (void)
6256 {
6257 initscr ();
6258   ;
6259   return 0;
6260 }
6261 _ACEOF
6262 rm -f conftest.$ac_objext conftest$ac_exeext
6263 if { (eval echo "$as_me:6263: \"$ac_link\"") >&5
6264   (eval $ac_link) 2>&5
6265   ac_status=$?
6266   echo "$as_me:6266: \$? = $ac_status" >&5
6267   (exit $ac_status); } &&
6268          { ac_try='test -s conftest$ac_exeext'
6269   { (eval echo "$as_me:6269: \"$ac_try\"") >&5
6270   (eval $ac_try) 2>&5
6271   ac_status=$?
6272   echo "$as_me:6272: \$? = $ac_status" >&5
6273   (exit $ac_status); }; }; then
6274   ac_cv_lib_cur_colr_initscr=yes
6275 else
6276   echo "$as_me: failed program was:" >&5
6277 cat conftest.$ac_ext >&5
6278 ac_cv_lib_cur_colr_initscr=no
6279 fi
6280 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6281 LIBS=$ac_check_lib_save_LIBS
6282 fi
6283 echo "$as_me:6283: result: $ac_cv_lib_cur_colr_initscr" >&5
6284 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6285 if test $ac_cv_lib_cur_colr_initscr = yes; then
6286
6287 cf_add_libs="-lcur_colr"
6288 # Filter out duplicates - this happens with badly-designed ".pc" files...
6289 for cf_add_1lib in $LIBS
6290 do
6291         for cf_add_2lib in $cf_add_libs
6292         do
6293                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6294                 then
6295                         cf_add_1lib=
6296                         break
6297                 fi
6298         done
6299         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6300 done
6301 LIBS="$cf_add_libs"
6302
6303                         ac_cv_func_initscr=yes
6304
6305 else
6306
6307                 echo "$as_me:6307: checking for initscr in -lHcurses" >&5
6308 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6309 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6310   echo $ECHO_N "(cached) $ECHO_C" >&6
6311 else
6312   ac_check_lib_save_LIBS=$LIBS
6313 LIBS="-lHcurses  $LIBS"
6314 cat >conftest.$ac_ext <<_ACEOF
6315 #line 6315 "configure"
6316 #include "confdefs.h"
6317
6318 /* Override any gcc2 internal prototype to avoid an error.  */
6319 #ifdef __cplusplus
6320 extern "C"
6321 #endif
6322 /* We use char because int might match the return type of a gcc2
6323    builtin and then its argument prototype would still apply.  */
6324 char initscr ();
6325 int
6326 main (void)
6327 {
6328 initscr ();
6329   ;
6330   return 0;
6331 }
6332 _ACEOF
6333 rm -f conftest.$ac_objext conftest$ac_exeext
6334 if { (eval echo "$as_me:6334: \"$ac_link\"") >&5
6335   (eval $ac_link) 2>&5
6336   ac_status=$?
6337   echo "$as_me:6337: \$? = $ac_status" >&5
6338   (exit $ac_status); } &&
6339          { ac_try='test -s conftest$ac_exeext'
6340   { (eval echo "$as_me:6340: \"$ac_try\"") >&5
6341   (eval $ac_try) 2>&5
6342   ac_status=$?
6343   echo "$as_me:6343: \$? = $ac_status" >&5
6344   (exit $ac_status); }; }; then
6345   ac_cv_lib_Hcurses_initscr=yes
6346 else
6347   echo "$as_me: failed program was:" >&5
6348 cat conftest.$ac_ext >&5
6349 ac_cv_lib_Hcurses_initscr=no
6350 fi
6351 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6352 LIBS=$ac_check_lib_save_LIBS
6353 fi
6354 echo "$as_me:6354: result: $ac_cv_lib_Hcurses_initscr" >&5
6355 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6356 if test $ac_cv_lib_Hcurses_initscr = yes; then
6357
6358                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6359
6360 cf_add_libs="-lHcurses"
6361 # Filter out duplicates - this happens with badly-designed ".pc" files...
6362 for cf_add_1lib in $LIBS
6363 do
6364         for cf_add_2lib in $cf_add_libs
6365         do
6366                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6367                 then
6368                         cf_add_1lib=
6369                         break
6370                 fi
6371         done
6372         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6373 done
6374 LIBS="$cf_add_libs"
6375
6376         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6377         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6378
6379                         ac_cv_func_initscr=yes
6380
6381 fi
6382
6383 fi
6384
6385         fi
6386         ;;
6387 (linux*)
6388         case `arch 2>/dev/null` in
6389         (x86_64)
6390                 if test -d /lib64
6391                 then
6392
6393 if test -n "/lib64" ; then
6394         for cf_add_libdir in /lib64
6395         do
6396                 if test $cf_add_libdir = /usr/lib ; then
6397                         :
6398                 elif test -d $cf_add_libdir
6399                 then
6400                         cf_have_libdir=no
6401                         if test -n "$LDFLAGS$LIBS" ; then
6402                                 # a loop is needed to ensure we can add subdirs of existing dirs
6403                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6404                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6405                                                 cf_have_libdir=yes; break
6406                                         fi
6407                                 done
6408                         fi
6409                         if test "$cf_have_libdir" = no ; then
6410                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6411
6412 echo "${as_me:-configure}:6412: testing adding $cf_add_libdir to library-path ..." 1>&5
6413
6414                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6415                         fi
6416                 fi
6417         done
6418 fi
6419
6420                 else
6421
6422 if test -n "/lib" ; then
6423         for cf_add_libdir in /lib
6424         do
6425                 if test $cf_add_libdir = /usr/lib ; then
6426                         :
6427                 elif test -d $cf_add_libdir
6428                 then
6429                         cf_have_libdir=no
6430                         if test -n "$LDFLAGS$LIBS" ; then
6431                                 # a loop is needed to ensure we can add subdirs of existing dirs
6432                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6433                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6434                                                 cf_have_libdir=yes; break
6435                                         fi
6436                                 done
6437                         fi
6438                         if test "$cf_have_libdir" = no ; then
6439                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6440
6441 echo "${as_me:-configure}:6441: testing adding $cf_add_libdir to library-path ..." 1>&5
6442
6443                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6444                         fi
6445                 fi
6446         done
6447 fi
6448
6449                 fi
6450                 ;;
6451         (*)
6452
6453 if test -n "/lib" ; then
6454         for cf_add_libdir in /lib
6455         do
6456                 if test $cf_add_libdir = /usr/lib ; then
6457                         :
6458                 elif test -d $cf_add_libdir
6459                 then
6460                         cf_have_libdir=no
6461                         if test -n "$LDFLAGS$LIBS" ; then
6462                                 # a loop is needed to ensure we can add subdirs of existing dirs
6463                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6464                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6465                                                 cf_have_libdir=yes; break
6466                                         fi
6467                                 done
6468                         fi
6469                         if test "$cf_have_libdir" = no ; then
6470                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6471
6472 echo "${as_me:-configure}:6472: testing adding $cf_add_libdir to library-path ..." 1>&5
6473
6474                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6475                         fi
6476                 fi
6477         done
6478 fi
6479
6480                 ;;
6481         esac
6482         ;;
6483 (sunos3*|sunos4*)
6484         if test "x$cf_cv_screen" = "xcurses_5lib"
6485         then
6486                 if test -d /usr/5lib ; then
6487
6488 if test -n "/usr/5lib" ; then
6489         for cf_add_libdir in /usr/5lib
6490         do
6491                 if test $cf_add_libdir = /usr/lib ; then
6492                         :
6493                 elif test -d $cf_add_libdir
6494                 then
6495                         cf_have_libdir=no
6496                         if test -n "$LDFLAGS$LIBS" ; then
6497                                 # a loop is needed to ensure we can add subdirs of existing dirs
6498                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6499                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6500                                                 cf_have_libdir=yes; break
6501                                         fi
6502                                 done
6503                         fi
6504                         if test "$cf_have_libdir" = no ; then
6505                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6506
6507 echo "${as_me:-configure}:6507: testing adding $cf_add_libdir to library-path ..." 1>&5
6508
6509                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6510                         fi
6511                 fi
6512         done
6513 fi
6514
6515 cf_add_libs="-lcurses -ltermcap"
6516 # Filter out duplicates - this happens with badly-designed ".pc" files...
6517 for cf_add_1lib in $LIBS
6518 do
6519         for cf_add_2lib in $cf_add_libs
6520         do
6521                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6522                 then
6523                         cf_add_1lib=
6524                         break
6525                 fi
6526         done
6527         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6528 done
6529 LIBS="$cf_add_libs"
6530
6531                 fi
6532         fi
6533         ac_cv_func_initscr=yes
6534         ;;
6535 esac
6536
6537 if test ".$ac_cv_func_initscr" != .yes ; then
6538         cf_save_LIBS="$LIBS"
6539
6540         if test ".${cf_cv_ncurses_version:-no}" != .no
6541         then
6542                 cf_check_list="ncurses curses cursesX"
6543         else
6544                 cf_check_list="cursesX curses ncurses"
6545         fi
6546
6547         # Check for library containing tgoto.  Do this before curses library
6548         # because it may be needed to link the test-case for initscr.
6549         if test "x$cf_term_lib" = x
6550         then
6551                 echo "$as_me:6551: checking for tgoto" >&5
6552 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6553 if test "${ac_cv_func_tgoto+set}" = set; then
6554   echo $ECHO_N "(cached) $ECHO_C" >&6
6555 else
6556   cat >conftest.$ac_ext <<_ACEOF
6557 #line 6557 "configure"
6558 #include "confdefs.h"
6559 /* System header to define __stub macros and hopefully few prototypes,
6560     which can conflict with char tgoto (); below.  */
6561 #include <assert.h>
6562 /* Override any gcc2 internal prototype to avoid an error.  */
6563 #ifdef __cplusplus
6564 extern "C"
6565 #endif
6566 /* We use char because int might match the return type of a gcc2
6567    builtin and then its argument prototype would still apply.  */
6568 char tgoto ();
6569 char (*f) ();
6570
6571 int
6572 main (void)
6573 {
6574 /* The GNU C library defines this for functions which it implements
6575     to always fail with ENOSYS.  Some functions are actually named
6576     something starting with __ and the normal name is an alias.  */
6577 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6578 choke me
6579 #else
6580 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6581 #endif
6582
6583   ;
6584   return 0;
6585 }
6586 _ACEOF
6587 rm -f conftest.$ac_objext conftest$ac_exeext
6588 if { (eval echo "$as_me:6588: \"$ac_link\"") >&5
6589   (eval $ac_link) 2>&5
6590   ac_status=$?
6591   echo "$as_me:6591: \$? = $ac_status" >&5
6592   (exit $ac_status); } &&
6593          { ac_try='test -s conftest$ac_exeext'
6594   { (eval echo "$as_me:6594: \"$ac_try\"") >&5
6595   (eval $ac_try) 2>&5
6596   ac_status=$?
6597   echo "$as_me:6597: \$? = $ac_status" >&5
6598   (exit $ac_status); }; }; then
6599   ac_cv_func_tgoto=yes
6600 else
6601   echo "$as_me: failed program was:" >&5
6602 cat conftest.$ac_ext >&5
6603 ac_cv_func_tgoto=no
6604 fi
6605 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6606 fi
6607 echo "$as_me:6607: result: $ac_cv_func_tgoto" >&5
6608 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6609 if test $ac_cv_func_tgoto = yes; then
6610   cf_term_lib=predefined
6611 else
6612
6613                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6614                         do
6615                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6616 echo "$as_me:6616: checking for tgoto in -l$cf_term_lib" >&5
6617 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6618 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6619   echo $ECHO_N "(cached) $ECHO_C" >&6
6620 else
6621   ac_check_lib_save_LIBS=$LIBS
6622 LIBS="-l$cf_term_lib  $LIBS"
6623 cat >conftest.$ac_ext <<_ACEOF
6624 #line 6624 "configure"
6625 #include "confdefs.h"
6626
6627 /* Override any gcc2 internal prototype to avoid an error.  */
6628 #ifdef __cplusplus
6629 extern "C"
6630 #endif
6631 /* We use char because int might match the return type of a gcc2
6632    builtin and then its argument prototype would still apply.  */
6633 char tgoto ();
6634 int
6635 main (void)
6636 {
6637 tgoto ();
6638   ;
6639   return 0;
6640 }
6641 _ACEOF
6642 rm -f conftest.$ac_objext conftest$ac_exeext
6643 if { (eval echo "$as_me:6643: \"$ac_link\"") >&5
6644   (eval $ac_link) 2>&5
6645   ac_status=$?
6646   echo "$as_me:6646: \$? = $ac_status" >&5
6647   (exit $ac_status); } &&
6648          { ac_try='test -s conftest$ac_exeext'
6649   { (eval echo "$as_me:6649: \"$ac_try\"") >&5
6650   (eval $ac_try) 2>&5
6651   ac_status=$?
6652   echo "$as_me:6652: \$? = $ac_status" >&5
6653   (exit $ac_status); }; }; then
6654   eval "$as_ac_Lib=yes"
6655 else
6656   echo "$as_me: failed program was:" >&5
6657 cat conftest.$ac_ext >&5
6658 eval "$as_ac_Lib=no"
6659 fi
6660 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6661 LIBS=$ac_check_lib_save_LIBS
6662 fi
6663 echo "$as_me:6663: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6664 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6665 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6666
6667                                         : ${cf_nculib_root:=$cf_term_lib}
6668                                         break
6669
6670 fi
6671
6672                         done
6673
6674 fi
6675
6676         fi
6677
6678         # Check for library containing initscr
6679         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6680         if test "x$cf_curs_lib" = x
6681         then
6682                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6683                 do
6684                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6685                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6686                                 echo "$as_me:6686: checking if we can link with $cf_curs_lib library" >&5
6687 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6688                                 cat >conftest.$ac_ext <<_ACEOF
6689 #line 6689 "configure"
6690 #include "confdefs.h"
6691 #include <${cf_cv_ncurses_header:-curses.h}>
6692 int
6693 main (void)
6694 {
6695 initscr()
6696   ;
6697   return 0;
6698 }
6699 _ACEOF
6700 rm -f conftest.$ac_objext conftest$ac_exeext
6701 if { (eval echo "$as_me:6701: \"$ac_link\"") >&5
6702   (eval $ac_link) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); } &&
6706          { ac_try='test -s conftest$ac_exeext'
6707   { (eval echo "$as_me:6707: \"$ac_try\"") >&5
6708   (eval $ac_try) 2>&5
6709   ac_status=$?
6710   echo "$as_me:6710: \$? = $ac_status" >&5
6711   (exit $ac_status); }; }; then
6712   cf_result=yes
6713 else
6714   echo "$as_me: failed program was:" >&5
6715 cat conftest.$ac_ext >&5
6716 cf_result=no
6717 fi
6718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6719                                 echo "$as_me:6719: result: $cf_result" >&5
6720 echo "${ECHO_T}$cf_result" >&6
6721                                 test $cf_result = yes && break
6722                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6723                                 cf_result=no
6724                         elif test "$cf_term_lib" != predefined ; then
6725                                 echo "$as_me:6725: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6726 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6727                                 cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730 #include <${cf_cv_ncurses_header:-curses.h}>
6731 int
6732 main (void)
6733 {
6734 initscr(); tgoto((char *)0, 0, 0);
6735   ;
6736   return 0;
6737 }
6738 _ACEOF
6739 rm -f conftest.$ac_objext conftest$ac_exeext
6740 if { (eval echo "$as_me:6740: \"$ac_link\"") >&5
6741   (eval $ac_link) 2>&5
6742   ac_status=$?
6743   echo "$as_me:6743: \$? = $ac_status" >&5
6744   (exit $ac_status); } &&
6745          { ac_try='test -s conftest$ac_exeext'
6746   { (eval echo "$as_me:6746: \"$ac_try\"") >&5
6747   (eval $ac_try) 2>&5
6748   ac_status=$?
6749   echo "$as_me:6749: \$? = $ac_status" >&5
6750   (exit $ac_status); }; }; then
6751   cf_result=no
6752 else
6753   echo "$as_me: failed program was:" >&5
6754 cat conftest.$ac_ext >&5
6755
6756                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6757                                         cat >conftest.$ac_ext <<_ACEOF
6758 #line 6758 "configure"
6759 #include "confdefs.h"
6760 #include <${cf_cv_ncurses_header:-curses.h}>
6761 int
6762 main (void)
6763 {
6764 initscr()
6765   ;
6766   return 0;
6767 }
6768 _ACEOF
6769 rm -f conftest.$ac_objext conftest$ac_exeext
6770 if { (eval echo "$as_me:6770: \"$ac_link\"") >&5
6771   (eval $ac_link) 2>&5
6772   ac_status=$?
6773   echo "$as_me:6773: \$? = $ac_status" >&5
6774   (exit $ac_status); } &&
6775          { ac_try='test -s conftest$ac_exeext'
6776   { (eval echo "$as_me:6776: \"$ac_try\"") >&5
6777   (eval $ac_try) 2>&5
6778   ac_status=$?
6779   echo "$as_me:6779: \$? = $ac_status" >&5
6780   (exit $ac_status); }; }; then
6781   cf_result=yes
6782 else
6783   echo "$as_me: failed program was:" >&5
6784 cat conftest.$ac_ext >&5
6785 cf_result=error
6786 fi
6787 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6788
6789 fi
6790 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6791                                 echo "$as_me:6791: result: $cf_result" >&5
6792 echo "${ECHO_T}$cf_result" >&6
6793                                 test $cf_result != error && break
6794                         fi
6795                 done
6796         fi
6797         test $cf_curs_lib = unknown && { { echo "$as_me:6797: error: no curses library found" >&5
6798 echo "$as_me: error: no curses library found" >&2;}
6799    { (exit 1); exit 1; }; }
6800 fi
6801 fi
6802
6803         ;;
6804 (ncursesw*)
6805
6806 echo "$as_me:6806: checking for multibyte character support" >&5
6807 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6808 if test "${cf_cv_utf8_lib+set}" = set; then
6809   echo $ECHO_N "(cached) $ECHO_C" >&6
6810 else
6811
6812         cf_save_LIBS="$LIBS"
6813         cat >conftest.$ac_ext <<_ACEOF
6814 #line 6814 "configure"
6815 #include "confdefs.h"
6816
6817 #include <stdlib.h>
6818 int
6819 main (void)
6820 {
6821 putwc(0,0);
6822   ;
6823   return 0;
6824 }
6825 _ACEOF
6826 rm -f conftest.$ac_objext conftest$ac_exeext
6827 if { (eval echo "$as_me:6827: \"$ac_link\"") >&5
6828   (eval $ac_link) 2>&5
6829   ac_status=$?
6830   echo "$as_me:6830: \$? = $ac_status" >&5
6831   (exit $ac_status); } &&
6832          { ac_try='test -s conftest$ac_exeext'
6833   { (eval echo "$as_me:6833: \"$ac_try\"") >&5
6834   (eval $ac_try) 2>&5
6835   ac_status=$?
6836   echo "$as_me:6836: \$? = $ac_status" >&5
6837   (exit $ac_status); }; }; then
6838   cf_cv_utf8_lib=yes
6839 else
6840   echo "$as_me: failed program was:" >&5
6841 cat conftest.$ac_ext >&5
6842
6843 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6844 # will be set on completion of the AC_TRY_LINK below.
6845 cf_cv_header_path_utf8=
6846 cf_cv_library_path_utf8=
6847
6848 echo "${as_me:-configure}:6848: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6849
6850 cf_save_LIBS="$LIBS"
6851
6852 cat >conftest.$ac_ext <<_ACEOF
6853 #line 6853 "configure"
6854 #include "confdefs.h"
6855
6856 #include <libutf8.h>
6857 int
6858 main (void)
6859 {
6860 putwc(0,0);
6861   ;
6862   return 0;
6863 }
6864 _ACEOF
6865 rm -f conftest.$ac_objext conftest$ac_exeext
6866 if { (eval echo "$as_me:6866: \"$ac_link\"") >&5
6867   (eval $ac_link) 2>&5
6868   ac_status=$?
6869   echo "$as_me:6869: \$? = $ac_status" >&5
6870   (exit $ac_status); } &&
6871          { ac_try='test -s conftest$ac_exeext'
6872   { (eval echo "$as_me:6872: \"$ac_try\"") >&5
6873   (eval $ac_try) 2>&5
6874   ac_status=$?
6875   echo "$as_me:6875: \$? = $ac_status" >&5
6876   (exit $ac_status); }; }; then
6877
6878         cf_cv_find_linkage_utf8=yes
6879         cf_cv_header_path_utf8=/usr/include
6880         cf_cv_library_path_utf8=/usr/lib
6881
6882 else
6883   echo "$as_me: failed program was:" >&5
6884 cat conftest.$ac_ext >&5
6885
6886 LIBS="-lutf8  $cf_save_LIBS"
6887
6888 cat >conftest.$ac_ext <<_ACEOF
6889 #line 6889 "configure"
6890 #include "confdefs.h"
6891
6892 #include <libutf8.h>
6893 int
6894 main (void)
6895 {
6896 putwc(0,0);
6897   ;
6898   return 0;
6899 }
6900 _ACEOF
6901 rm -f conftest.$ac_objext conftest$ac_exeext
6902 if { (eval echo "$as_me:6902: \"$ac_link\"") >&5
6903   (eval $ac_link) 2>&5
6904   ac_status=$?
6905   echo "$as_me:6905: \$? = $ac_status" >&5
6906   (exit $ac_status); } &&
6907          { ac_try='test -s conftest$ac_exeext'
6908   { (eval echo "$as_me:6908: \"$ac_try\"") >&5
6909   (eval $ac_try) 2>&5
6910   ac_status=$?
6911   echo "$as_me:6911: \$? = $ac_status" >&5
6912   (exit $ac_status); }; }; then
6913
6914         cf_cv_find_linkage_utf8=yes
6915         cf_cv_header_path_utf8=/usr/include
6916         cf_cv_library_path_utf8=/usr/lib
6917         cf_cv_library_file_utf8="-lutf8"
6918
6919 else
6920   echo "$as_me: failed program was:" >&5
6921 cat conftest.$ac_ext >&5
6922
6923         cf_cv_find_linkage_utf8=no
6924         LIBS="$cf_save_LIBS"
6925
6926         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6927
6928 echo "${as_me:-configure}:6928: testing find linkage for utf8 library ..." 1>&5
6929
6930 echo "${as_me:-configure}:6930: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6931
6932         cf_save_CPPFLAGS="$CPPFLAGS"
6933         cf_test_CPPFLAGS="$CPPFLAGS"
6934
6935 cf_search=
6936
6937 # collect the current set of include-directories from compiler flags
6938 cf_header_path_list=""
6939 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6940         for cf_header_path in $CPPFLAGS $CFLAGS
6941         do
6942                 case $cf_header_path in
6943                 (-I*)
6944                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6945
6946 test "x$cf_header_path" != "xNONE" && \
6947 test -d "$cf_header_path" && \
6948  {
6949         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6950         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6951         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6952         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6953         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6954         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6955 }
6956
6957                         cf_header_path_list="$cf_header_path_list $cf_search"
6958                         ;;
6959                 esac
6960         done
6961 fi
6962
6963 # add the variations for the package we are looking for
6964
6965 cf_search=
6966
6967 test "x$prefix" != "xNONE" && \
6968 test -d "$prefix" && \
6969  {
6970         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6971         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6972         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6973         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6974         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6975         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6976 }
6977
6978 for cf_subdir_prefix in \
6979         /usr \
6980         /usr/local \
6981         /usr/pkg \
6982         /opt \
6983         /opt/local \
6984         $HOME
6985 do
6986
6987 test "x$cf_subdir_prefix" != "x$prefix" && \
6988 test -d "$cf_subdir_prefix" && \
6989 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6990         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6991         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6992         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6993         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6994         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6995         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6996 }
6997
6998 done
6999
7000 test "$includedir" != NONE && \
7001 test "$includedir" != "/usr/include" && \
7002 test -d "$includedir" && {
7003         test -d $includedir &&    cf_search="$cf_search $includedir"
7004         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
7005 }
7006
7007 test "$oldincludedir" != NONE && \
7008 test "$oldincludedir" != "/usr/include" && \
7009 test -d "$oldincludedir" && {
7010         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7011         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
7012 }
7013
7014 cf_search="$cf_search $cf_header_path_list"
7015
7016         for cf_cv_header_path_utf8 in $cf_search
7017         do
7018                 if test -d $cf_cv_header_path_utf8 ; then
7019                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
7020
7021 echo "${as_me:-configure}:7021: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
7022
7023                         CPPFLAGS="$cf_save_CPPFLAGS"
7024
7025         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7026         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
7027
7028                         cat >conftest.$ac_ext <<_ACEOF
7029 #line 7029 "configure"
7030 #include "confdefs.h"
7031
7032 #include <libutf8.h>
7033 int
7034 main (void)
7035 {
7036 putwc(0,0);
7037   ;
7038   return 0;
7039 }
7040 _ACEOF
7041 rm -f conftest.$ac_objext
7042 if { (eval echo "$as_me:7042: \"$ac_compile\"") >&5
7043   (eval $ac_compile) 2>&5
7044   ac_status=$?
7045   echo "$as_me:7045: \$? = $ac_status" >&5
7046   (exit $ac_status); } &&
7047          { ac_try='test -s conftest.$ac_objext'
7048   { (eval echo "$as_me:7048: \"$ac_try\"") >&5
7049   (eval $ac_try) 2>&5
7050   ac_status=$?
7051   echo "$as_me:7051: \$? = $ac_status" >&5
7052   (exit $ac_status); }; }; then
7053
7054                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
7055
7056 echo "${as_me:-configure}:7056: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
7057
7058                                 cf_cv_find_linkage_utf8=maybe
7059                                 cf_test_CPPFLAGS="$CPPFLAGS"
7060                                 break
7061 else
7062   echo "$as_me: failed program was:" >&5
7063 cat conftest.$ac_ext >&5
7064
7065                                 CPPFLAGS="$cf_save_CPPFLAGS"
7066
7067 fi
7068 rm -f conftest.$ac_objext conftest.$ac_ext
7069                 fi
7070         done
7071
7072         if test "$cf_cv_find_linkage_utf8" = maybe ; then
7073
7074 echo "${as_me:-configure}:7074: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
7075
7076                 cf_save_LIBS="$LIBS"
7077                 cf_save_LDFLAGS="$LDFLAGS"
7078
7079                 if test "$cf_cv_find_linkage_utf8" != yes ; then
7080
7081 cf_search=
7082 cf_library_path_list=""
7083 if test -n "${LDFLAGS}${LIBS}" ; then
7084         for cf_library_path in $LDFLAGS $LIBS
7085         do
7086                 case $cf_library_path in
7087                 (-L*)
7088                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7089
7090 test "x$cf_library_path" != "xNONE" && \
7091 test -d "$cf_library_path" && \
7092  {
7093         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7094         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7095         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
7096         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
7097         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
7098         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
7099 }
7100
7101                         cf_library_path_list="$cf_library_path_list $cf_search"
7102                         ;;
7103                 esac
7104         done
7105 fi
7106
7107 cf_search=
7108
7109 test "x$prefix" != "xNONE" && \
7110 test -d "$prefix" && \
7111  {
7112         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7113         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7114         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
7115         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
7116         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
7117         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
7118 }
7119
7120 for cf_subdir_prefix in \
7121         /usr \
7122         /usr/local \
7123         /usr/pkg \
7124         /opt \
7125         /opt/local \
7126         $HOME
7127 do
7128
7129 test "x$cf_subdir_prefix" != "x$prefix" && \
7130 test -d "$cf_subdir_prefix" && \
7131 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7132         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
7133         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
7134         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
7135         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
7136         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
7137         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
7138 }
7139
7140 done
7141
7142 cf_search="$cf_library_path_list $cf_search"
7143
7144                         for cf_cv_library_path_utf8 in $cf_search
7145                         do
7146                                 if test -d $cf_cv_library_path_utf8 ; then
7147                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
7148
7149 echo "${as_me:-configure}:7149: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
7150
7151                                         CPPFLAGS="$cf_test_CPPFLAGS"
7152                                         LIBS="-lutf8  $cf_save_LIBS"
7153                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
7154                                         cat >conftest.$ac_ext <<_ACEOF
7155 #line 7155 "configure"
7156 #include "confdefs.h"
7157
7158 #include <libutf8.h>
7159 int
7160 main (void)
7161 {
7162 putwc(0,0);
7163   ;
7164   return 0;
7165 }
7166 _ACEOF
7167 rm -f conftest.$ac_objext conftest$ac_exeext
7168 if { (eval echo "$as_me:7168: \"$ac_link\"") >&5
7169   (eval $ac_link) 2>&5
7170   ac_status=$?
7171   echo "$as_me:7171: \$? = $ac_status" >&5
7172   (exit $ac_status); } &&
7173          { ac_try='test -s conftest$ac_exeext'
7174   { (eval echo "$as_me:7174: \"$ac_try\"") >&5
7175   (eval $ac_try) 2>&5
7176   ac_status=$?
7177   echo "$as_me:7177: \$? = $ac_status" >&5
7178   (exit $ac_status); }; }; then
7179
7180                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7181
7182 echo "${as_me:-configure}:7182: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7183
7184                                         cf_cv_find_linkage_utf8=yes
7185                                         cf_cv_library_file_utf8="-lutf8"
7186                                         break
7187 else
7188   echo "$as_me: failed program was:" >&5
7189 cat conftest.$ac_ext >&5
7190
7191                                         CPPFLAGS="$cf_save_CPPFLAGS"
7192                                         LIBS="$cf_save_LIBS"
7193                                         LDFLAGS="$cf_save_LDFLAGS"
7194
7195 fi
7196 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7197                                 fi
7198                         done
7199                         CPPFLAGS="$cf_save_CPPFLAGS"
7200                         LDFLAGS="$cf_save_LDFLAGS"
7201                 fi
7202
7203         else
7204                 cf_cv_find_linkage_utf8=no
7205         fi
7206
7207 fi
7208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7209
7210 fi
7211 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7212
7213 LIBS="$cf_save_LIBS"
7214
7215 if test "$cf_cv_find_linkage_utf8" = yes ; then
7216 cf_cv_utf8_lib=add-on
7217 else
7218 cf_cv_utf8_lib=no
7219 fi
7220
7221 fi
7222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7223 fi
7224 echo "$as_me:7224: result: $cf_cv_utf8_lib" >&5
7225 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7226
7227 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7228 # ncurses/ncursesw:
7229 if test "$cf_cv_utf8_lib" = "add-on" ; then
7230
7231 cat >>confdefs.h <<\EOF
7232 #define HAVE_LIBUTF8_H 1
7233 EOF
7234
7235 if test -n "$cf_cv_header_path_utf8" ; then
7236   for cf_add_incdir in $cf_cv_header_path_utf8
7237   do
7238         while test $cf_add_incdir != /usr/include
7239         do
7240           if test -d $cf_add_incdir
7241           then
7242                 cf_have_incdir=no
7243                 if test -n "$CFLAGS$CPPFLAGS" ; then
7244                   # a loop is needed to ensure we can add subdirs of existing dirs
7245                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7246                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7247                           cf_have_incdir=yes; break
7248                         fi
7249                   done
7250                 fi
7251
7252                 if test "$cf_have_incdir" = no ; then
7253                   if test "$cf_add_incdir" = /usr/local/include ; then
7254                         if test "$GCC" = yes
7255                         then
7256                           cf_save_CPPFLAGS=$CPPFLAGS
7257
7258         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7259         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7260
7261                           cat >conftest.$ac_ext <<_ACEOF
7262 #line 7262 "configure"
7263 #include "confdefs.h"
7264 #include <stdio.h>
7265 int
7266 main (void)
7267 {
7268 printf("Hello")
7269   ;
7270   return 0;
7271 }
7272 _ACEOF
7273 rm -f conftest.$ac_objext
7274 if { (eval echo "$as_me:7274: \"$ac_compile\"") >&5
7275   (eval $ac_compile) 2>&5
7276   ac_status=$?
7277   echo "$as_me:7277: \$? = $ac_status" >&5
7278   (exit $ac_status); } &&
7279          { ac_try='test -s conftest.$ac_objext'
7280   { (eval echo "$as_me:7280: \"$ac_try\"") >&5
7281   (eval $ac_try) 2>&5
7282   ac_status=$?
7283   echo "$as_me:7283: \$? = $ac_status" >&5
7284   (exit $ac_status); }; }; then
7285   :
7286 else
7287   echo "$as_me: failed program was:" >&5
7288 cat conftest.$ac_ext >&5
7289 cf_have_incdir=yes
7290 fi
7291 rm -f conftest.$ac_objext conftest.$ac_ext
7292                           CPPFLAGS=$cf_save_CPPFLAGS
7293                         fi
7294                   fi
7295                 fi
7296
7297                 if test "$cf_have_incdir" = no ; then
7298                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7299
7300 echo "${as_me:-configure}:7300: testing adding $cf_add_incdir to include-path ..." 1>&5
7301
7302                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7303
7304                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7305                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7306                   cf_add_incdir="$cf_top_incdir"
7307                 else
7308                   break
7309                 fi
7310           else
7311                 break
7312           fi
7313         done
7314   done
7315 fi
7316
7317 if test -n "$cf_cv_library_path_utf8" ; then
7318         for cf_add_libdir in $cf_cv_library_path_utf8
7319         do
7320                 if test $cf_add_libdir = /usr/lib ; then
7321                         :
7322                 elif test -d $cf_add_libdir
7323                 then
7324                         cf_have_libdir=no
7325                         if test -n "$LDFLAGS$LIBS" ; then
7326                                 # a loop is needed to ensure we can add subdirs of existing dirs
7327                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7328                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7329                                                 cf_have_libdir=yes; break
7330                                         fi
7331                                 done
7332                         fi
7333                         if test "$cf_have_libdir" = no ; then
7334                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7335
7336 echo "${as_me:-configure}:7336: testing adding $cf_add_libdir to library-path ..." 1>&5
7337
7338                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7339                         fi
7340                 fi
7341         done
7342 fi
7343
7344 cf_add_libs="$cf_cv_library_file_utf8"
7345 # Filter out duplicates - this happens with badly-designed ".pc" files...
7346 for cf_add_1lib in $LIBS
7347 do
7348         for cf_add_2lib in $cf_add_libs
7349         do
7350                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7351                 then
7352                         cf_add_1lib=
7353                         break
7354                 fi
7355         done
7356         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7357 done
7358 LIBS="$cf_add_libs"
7359
7360 fi
7361
7362 cf_ncuconfig_root=$cf_cv_screen
7363 cf_have_ncuconfig=no
7364
7365 if test "x${PKG_CONFIG:=none}" != xnone; then
7366         echo "$as_me:7366: checking pkg-config for $cf_ncuconfig_root" >&5
7367 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7368         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7369                 echo "$as_me:7369: result: yes" >&5
7370 echo "${ECHO_T}yes" >&6
7371
7372                 echo "$as_me:7372: checking if the $cf_ncuconfig_root package files work" >&5
7373 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7374                 cf_have_ncuconfig=unknown
7375
7376                 cf_save_CPPFLAGS="$CPPFLAGS"
7377                 cf_save_LIBS="$LIBS"
7378
7379 cf_fix_cppflags=no
7380 cf_new_cflags=
7381 cf_new_cppflags=
7382 cf_new_extra_cppflags=
7383
7384 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7385 do
7386 case $cf_fix_cppflags in
7387 (no)
7388         case $cf_add_cflags in
7389         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7390                 case $cf_add_cflags in
7391                 (-D*)
7392                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7393
7394                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7395                                 && test -z "${cf_tst_cflags}" \
7396                                 && cf_fix_cppflags=yes
7397
7398                         if test $cf_fix_cppflags = yes ; then
7399
7400         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7401         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7402
7403                                 continue
7404                         elif test "${cf_tst_cflags}" = "\"'" ; then
7405
7406         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7407         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7408
7409                                 continue
7410                         fi
7411                         ;;
7412                 esac
7413                 case "$CPPFLAGS" in
7414                 (*$cf_add_cflags)
7415                         ;;
7416                 (*)
7417                         case $cf_add_cflags in
7418                         (-D*)
7419                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7420
7421 CPPFLAGS=`echo "$CPPFLAGS" | \
7422         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7423                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7424
7425                                 ;;
7426                         esac
7427
7428         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7429         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7430
7431                         ;;
7432                 esac
7433                 ;;
7434         (*)
7435
7436         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7437         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7438
7439                 ;;
7440         esac
7441         ;;
7442 (yes)
7443
7444         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7445         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7446
7447         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7448
7449         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7450                 && test -z "${cf_tst_cflags}" \
7451                 && cf_fix_cppflags=no
7452         ;;
7453 esac
7454 done
7455
7456 if test -n "$cf_new_cflags" ; then
7457
7458         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7459         CFLAGS="${CFLAGS}$cf_new_cflags"
7460
7461 fi
7462
7463 if test -n "$cf_new_cppflags" ; then
7464
7465         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7466         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7467
7468 fi
7469
7470 if test -n "$cf_new_extra_cppflags" ; then
7471
7472         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7473         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7474
7475 fi
7476
7477 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7478 # Filter out duplicates - this happens with badly-designed ".pc" files...
7479 for cf_add_1lib in $LIBS
7480 do
7481         for cf_add_2lib in $cf_add_libs
7482         do
7483                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7484                 then
7485                         cf_add_1lib=
7486                         break
7487                 fi
7488         done
7489         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7490 done
7491 LIBS="$cf_add_libs"
7492
7493                 cat >conftest.$ac_ext <<_ACEOF
7494 #line 7494 "configure"
7495 #include "confdefs.h"
7496 #include <${cf_cv_ncurses_header:-curses.h}>
7497 int
7498 main (void)
7499 {
7500 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7501   ;
7502   return 0;
7503 }
7504 _ACEOF
7505 rm -f conftest.$ac_objext conftest$ac_exeext
7506 if { (eval echo "$as_me:7506: \"$ac_link\"") >&5
7507   (eval $ac_link) 2>&5
7508   ac_status=$?
7509   echo "$as_me:7509: \$? = $ac_status" >&5
7510   (exit $ac_status); } &&
7511          { ac_try='test -s conftest$ac_exeext'
7512   { (eval echo "$as_me:7512: \"$ac_try\"") >&5
7513   (eval $ac_try) 2>&5
7514   ac_status=$?
7515   echo "$as_me:7515: \$? = $ac_status" >&5
7516   (exit $ac_status); }; }; then
7517   if test "$cross_compiling" = yes; then
7518   cf_have_ncuconfig=maybe
7519 else
7520   cat >conftest.$ac_ext <<_ACEOF
7521 #line 7521 "configure"
7522 #include "confdefs.h"
7523 #include <${cf_cv_ncurses_header:-curses.h}>
7524                                 int main(void)
7525                                 { char *xx = curses_version(); return (xx == 0); }
7526 _ACEOF
7527 rm -f conftest$ac_exeext
7528 if { (eval echo "$as_me:7528: \"$ac_link\"") >&5
7529   (eval $ac_link) 2>&5
7530   ac_status=$?
7531   echo "$as_me:7531: \$? = $ac_status" >&5
7532   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7533   { (eval echo "$as_me:7533: \"$ac_try\"") >&5
7534   (eval $ac_try) 2>&5
7535   ac_status=$?
7536   echo "$as_me:7536: \$? = $ac_status" >&5
7537   (exit $ac_status); }; }; then
7538   cf_have_ncuconfig=yes
7539 else
7540   echo "$as_me: program exited with status $ac_status" >&5
7541 echo "$as_me: failed program was:" >&5
7542 cat conftest.$ac_ext >&5
7543 cf_have_ncuconfig=no
7544 fi
7545 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7546 fi
7547 else
7548   echo "$as_me: failed program was:" >&5
7549 cat conftest.$ac_ext >&5
7550 cf_have_ncuconfig=no
7551 fi
7552 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7553                 echo "$as_me:7553: result: $cf_have_ncuconfig" >&5
7554 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7555                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7556                 if test "$cf_have_ncuconfig" != "yes"
7557                 then
7558                         CPPFLAGS="$cf_save_CPPFLAGS"
7559                         LIBS="$cf_save_LIBS"
7560                         NCURSES_CONFIG_PKG=none
7561                 else
7562
7563 cat >>confdefs.h <<\EOF
7564 #define NCURSES 1
7565 EOF
7566
7567                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7568
7569 echo "$as_me:7569: checking for terminfo header" >&5
7570 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7571 if test "${cf_cv_term_header+set}" = set; then
7572   echo $ECHO_N "(cached) $ECHO_C" >&6
7573 else
7574
7575 case ${cf_cv_ncurses_header} in
7576 (*/ncurses.h|*/ncursesw.h)
7577         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7578         ;;
7579 (*)
7580         cf_term_header=term.h
7581         ;;
7582 esac
7583
7584 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7585 do
7586 cat >conftest.$ac_ext <<_ACEOF
7587 #line 7587 "configure"
7588 #include "confdefs.h"
7589 #include <stdio.h>
7590 #include <${cf_cv_ncurses_header:-curses.h}>
7591 #include <$cf_test>
7592
7593 int
7594 main (void)
7595 {
7596 int x = auto_left_margin
7597   ;
7598   return 0;
7599 }
7600 _ACEOF
7601 rm -f conftest.$ac_objext
7602 if { (eval echo "$as_me:7602: \"$ac_compile\"") >&5
7603   (eval $ac_compile) 2>&5
7604   ac_status=$?
7605   echo "$as_me:7605: \$? = $ac_status" >&5
7606   (exit $ac_status); } &&
7607          { ac_try='test -s conftest.$ac_objext'
7608   { (eval echo "$as_me:7608: \"$ac_try\"") >&5
7609   (eval $ac_try) 2>&5
7610   ac_status=$?
7611   echo "$as_me:7611: \$? = $ac_status" >&5
7612   (exit $ac_status); }; }; then
7613
7614         cf_cv_term_header="$cf_test"
7615 else
7616   echo "$as_me: failed program was:" >&5
7617 cat conftest.$ac_ext >&5
7618
7619         cf_cv_term_header=unknown
7620
7621 fi
7622 rm -f conftest.$ac_objext conftest.$ac_ext
7623         test "$cf_cv_term_header" != unknown && break
7624 done
7625
7626 fi
7627 echo "$as_me:7627: result: $cf_cv_term_header" >&5
7628 echo "${ECHO_T}$cf_cv_term_header" >&6
7629
7630 # Set definitions to allow ifdef'ing to accommodate subdirectories
7631
7632 case $cf_cv_term_header in
7633 (*term.h)
7634
7635 cat >>confdefs.h <<\EOF
7636 #define HAVE_TERM_H 1
7637 EOF
7638
7639         ;;
7640 esac
7641
7642 case $cf_cv_term_header in
7643 (ncurses/term.h)
7644
7645 cat >>confdefs.h <<\EOF
7646 #define HAVE_NCURSES_TERM_H 1
7647 EOF
7648
7649         ;;
7650 (ncursesw/term.h)
7651
7652 cat >>confdefs.h <<\EOF
7653 #define HAVE_NCURSESW_TERM_H 1
7654 EOF
7655
7656         ;;
7657 esac
7658
7659                 fi
7660
7661         else
7662                 echo "$as_me:7662: result: no" >&5
7663 echo "${ECHO_T}no" >&6
7664                 NCURSES_CONFIG_PKG=none
7665         fi
7666 else
7667         NCURSES_CONFIG_PKG=none
7668 fi
7669
7670 if test "x$cf_have_ncuconfig" = "xno"; then
7671         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7672
7673 if test -n "$ac_tool_prefix"; then
7674   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7675   do
7676     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7677 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7678 echo "$as_me:7678: checking for $ac_word" >&5
7679 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7680 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7681   echo $ECHO_N "(cached) $ECHO_C" >&6
7682 else
7683   if test -n "$NCURSES_CONFIG"; then
7684   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7685 else
7686   ac_save_IFS=$IFS; IFS=$ac_path_separator
7687 ac_dummy="$PATH"
7688 for ac_dir in $ac_dummy; do
7689   IFS=$ac_save_IFS
7690   test -z "$ac_dir" && ac_dir=.
7691   $as_executable_p "$ac_dir/$ac_word" || continue
7692 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7693 echo "$as_me:7693: found $ac_dir/$ac_word" >&5
7694 break
7695 done
7696
7697 fi
7698 fi
7699 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7700 if test -n "$NCURSES_CONFIG"; then
7701   echo "$as_me:7701: result: $NCURSES_CONFIG" >&5
7702 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7703 else
7704   echo "$as_me:7704: result: no" >&5
7705 echo "${ECHO_T}no" >&6
7706 fi
7707
7708     test -n "$NCURSES_CONFIG" && break
7709   done
7710 fi
7711 if test -z "$NCURSES_CONFIG"; then
7712   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7713   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7714 do
7715   # Extract the first word of "$ac_prog", so it can be a program name with args.
7716 set dummy $ac_prog; ac_word=$2
7717 echo "$as_me:7717: checking for $ac_word" >&5
7718 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7719 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7720   echo $ECHO_N "(cached) $ECHO_C" >&6
7721 else
7722   if test -n "$ac_ct_NCURSES_CONFIG"; then
7723   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7724 else
7725   ac_save_IFS=$IFS; IFS=$ac_path_separator
7726 ac_dummy="$PATH"
7727 for ac_dir in $ac_dummy; do
7728   IFS=$ac_save_IFS
7729   test -z "$ac_dir" && ac_dir=.
7730   $as_executable_p "$ac_dir/$ac_word" || continue
7731 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7732 echo "$as_me:7732: found $ac_dir/$ac_word" >&5
7733 break
7734 done
7735
7736 fi
7737 fi
7738 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7739 if test -n "$ac_ct_NCURSES_CONFIG"; then
7740   echo "$as_me:7740: result: $ac_ct_NCURSES_CONFIG" >&5
7741 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7742 else
7743   echo "$as_me:7743: result: no" >&5
7744 echo "${ECHO_T}no" >&6
7745 fi
7746
7747   test -n "$ac_ct_NCURSES_CONFIG" && break
7748 done
7749 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7750
7751   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7752 fi
7753
7754         if test "$NCURSES_CONFIG" != none ; then
7755
7756 cf_fix_cppflags=no
7757 cf_new_cflags=
7758 cf_new_cppflags=
7759 cf_new_extra_cppflags=
7760
7761 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7762 do
7763 case $cf_fix_cppflags in
7764 (no)
7765         case $cf_add_cflags in
7766         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7767                 case $cf_add_cflags in
7768                 (-D*)
7769                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7770
7771                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7772                                 && test -z "${cf_tst_cflags}" \
7773                                 && cf_fix_cppflags=yes
7774
7775                         if test $cf_fix_cppflags = yes ; then
7776
7777         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7778         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7779
7780                                 continue
7781                         elif test "${cf_tst_cflags}" = "\"'" ; then
7782
7783         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7784         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7785
7786                                 continue
7787                         fi
7788                         ;;
7789                 esac
7790                 case "$CPPFLAGS" in
7791                 (*$cf_add_cflags)
7792                         ;;
7793                 (*)
7794                         case $cf_add_cflags in
7795                         (-D*)
7796                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7797
7798 CPPFLAGS=`echo "$CPPFLAGS" | \
7799         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7800                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7801
7802                                 ;;
7803                         esac
7804
7805         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7806         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7807
7808                         ;;
7809                 esac
7810                 ;;
7811         (*)
7812
7813         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7814         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7815
7816                 ;;
7817         esac
7818         ;;
7819 (yes)
7820
7821         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7822         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7823
7824         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7825
7826         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7827                 && test -z "${cf_tst_cflags}" \
7828                 && cf_fix_cppflags=no
7829         ;;
7830 esac
7831 done
7832
7833 if test -n "$cf_new_cflags" ; then
7834
7835         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7836         CFLAGS="${CFLAGS}$cf_new_cflags"
7837
7838 fi
7839
7840 if test -n "$cf_new_cppflags" ; then
7841
7842         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7843         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7844
7845 fi
7846
7847 if test -n "$cf_new_extra_cppflags" ; then
7848
7849         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7850         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7851
7852 fi
7853
7854 cf_add_libs="`$NCURSES_CONFIG --libs`"
7855 # Filter out duplicates - this happens with badly-designed ".pc" files...
7856 for cf_add_1lib in $LIBS
7857 do
7858         for cf_add_2lib in $cf_add_libs
7859         do
7860                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7861                 then
7862                         cf_add_1lib=
7863                         break
7864                 fi
7865         done
7866         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7867 done
7868 LIBS="$cf_add_libs"
7869
7870                 # even with config script, some packages use no-override for curses.h
7871
7872 echo "$as_me:7872: checking if we have identified curses headers" >&5
7873 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7874 if test "${cf_cv_ncurses_header+set}" = set; then
7875   echo $ECHO_N "(cached) $ECHO_C" >&6
7876 else
7877
7878 cf_cv_ncurses_header=none
7879 for cf_header in \
7880         ncurses.h $cf_cv_screen/ncurses.h \
7881         curses.h $cf_cv_screen/curses.h
7882 do
7883 cat >conftest.$ac_ext <<_ACEOF
7884 #line 7884 "configure"
7885 #include "confdefs.h"
7886 #include <${cf_header}>
7887 int
7888 main (void)
7889 {
7890 initscr(); tgoto("?", 0,0)
7891   ;
7892   return 0;
7893 }
7894 _ACEOF
7895 rm -f conftest.$ac_objext
7896 if { (eval echo "$as_me:7896: \"$ac_compile\"") >&5
7897   (eval $ac_compile) 2>&5
7898   ac_status=$?
7899   echo "$as_me:7899: \$? = $ac_status" >&5
7900   (exit $ac_status); } &&
7901          { ac_try='test -s conftest.$ac_objext'
7902   { (eval echo "$as_me:7902: \"$ac_try\"") >&5
7903   (eval $ac_try) 2>&5
7904   ac_status=$?
7905   echo "$as_me:7905: \$? = $ac_status" >&5
7906   (exit $ac_status); }; }; then
7907   cf_cv_ncurses_header=$cf_header; break
7908 else
7909   echo "$as_me: failed program was:" >&5
7910 cat conftest.$ac_ext >&5
7911 fi
7912 rm -f conftest.$ac_objext conftest.$ac_ext
7913 done
7914
7915 fi
7916 echo "$as_me:7916: result: $cf_cv_ncurses_header" >&5
7917 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7918
7919 if test "$cf_cv_ncurses_header" = none ; then
7920         { { echo "$as_me:7920: error: No curses header-files found" >&5
7921 echo "$as_me: error: No curses header-files found" >&2;}
7922    { (exit 1); exit 1; }; }
7923 fi
7924
7925 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7926
7927 for ac_header in $cf_cv_ncurses_header
7928 do
7929 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7930 echo "$as_me:7930: checking for $ac_header" >&5
7931 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7932 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7933   echo $ECHO_N "(cached) $ECHO_C" >&6
7934 else
7935   cat >conftest.$ac_ext <<_ACEOF
7936 #line 7936 "configure"
7937 #include "confdefs.h"
7938 #include <$ac_header>
7939 _ACEOF
7940 if { (eval echo "$as_me:7940: \"$ac_cpp conftest.$ac_ext\"") >&5
7941   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7942   ac_status=$?
7943   egrep -v '^ *\+' conftest.er1 >conftest.err
7944   rm -f conftest.er1
7945   cat conftest.err >&5
7946   echo "$as_me:7946: \$? = $ac_status" >&5
7947   (exit $ac_status); } >/dev/null; then
7948   if test -s conftest.err; then
7949     ac_cpp_err=$ac_c_preproc_warn_flag
7950   else
7951     ac_cpp_err=
7952   fi
7953 else
7954   ac_cpp_err=yes
7955 fi
7956 if test -z "$ac_cpp_err"; then
7957   eval "$as_ac_Header=yes"
7958 else
7959   echo "$as_me: failed program was:" >&5
7960   cat conftest.$ac_ext >&5
7961   eval "$as_ac_Header=no"
7962 fi
7963 rm -f conftest.err conftest.$ac_ext
7964 fi
7965 echo "$as_me:7965: result: `eval echo '${'$as_ac_Header'}'`" >&5
7966 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7967 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7968   cat >>confdefs.h <<EOF
7969 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7970 EOF
7971
7972 fi
7973 done
7974
7975 cat >>confdefs.h <<\EOF
7976 #define NCURSES 1
7977 EOF
7978
7979 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7980
7981                 cat >>confdefs.h <<EOF
7982 #define $cf_nculib_ROOT 1
7983 EOF
7984
7985                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7986
7987         else
7988
7989 cf_ncuhdr_root=$cf_cv_screen
7990
7991 test -n "$cf_cv_curses_dir" && \
7992 test "$cf_cv_curses_dir" != "no" && { \
7993
7994 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7995   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7996   do
7997         while test $cf_add_incdir != /usr/include
7998         do
7999           if test -d $cf_add_incdir
8000           then
8001                 cf_have_incdir=no
8002                 if test -n "$CFLAGS$CPPFLAGS" ; then
8003                   # a loop is needed to ensure we can add subdirs of existing dirs
8004                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8005                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8006                           cf_have_incdir=yes; break
8007                         fi
8008                   done
8009                 fi
8010
8011                 if test "$cf_have_incdir" = no ; then
8012                   if test "$cf_add_incdir" = /usr/local/include ; then
8013                         if test "$GCC" = yes
8014                         then
8015                           cf_save_CPPFLAGS=$CPPFLAGS
8016
8017         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8018         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8019
8020                           cat >conftest.$ac_ext <<_ACEOF
8021 #line 8021 "configure"
8022 #include "confdefs.h"
8023 #include <stdio.h>
8024 int
8025 main (void)
8026 {
8027 printf("Hello")
8028   ;
8029   return 0;
8030 }
8031 _ACEOF
8032 rm -f conftest.$ac_objext
8033 if { (eval echo "$as_me:8033: \"$ac_compile\"") >&5
8034   (eval $ac_compile) 2>&5
8035   ac_status=$?
8036   echo "$as_me:8036: \$? = $ac_status" >&5
8037   (exit $ac_status); } &&
8038          { ac_try='test -s conftest.$ac_objext'
8039   { (eval echo "$as_me:8039: \"$ac_try\"") >&5
8040   (eval $ac_try) 2>&5
8041   ac_status=$?
8042   echo "$as_me:8042: \$? = $ac_status" >&5
8043   (exit $ac_status); }; }; then
8044   :
8045 else
8046   echo "$as_me: failed program was:" >&5
8047 cat conftest.$ac_ext >&5
8048 cf_have_incdir=yes
8049 fi
8050 rm -f conftest.$ac_objext conftest.$ac_ext
8051                           CPPFLAGS=$cf_save_CPPFLAGS
8052                         fi
8053                   fi
8054                 fi
8055
8056                 if test "$cf_have_incdir" = no ; then
8057                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8058
8059 echo "${as_me:-configure}:8059: testing adding $cf_add_incdir to include-path ..." 1>&5
8060
8061                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8062
8063                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8064                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8065                   cf_add_incdir="$cf_top_incdir"
8066                 else
8067                   break
8068                 fi
8069           else
8070                 break
8071           fi
8072         done
8073   done
8074 fi
8075
8076 }
8077
8078 echo "$as_me:8078: checking for $cf_ncuhdr_root header in include-path" >&5
8079 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8080 if test "${cf_cv_ncurses_h+set}" = set; then
8081   echo $ECHO_N "(cached) $ECHO_C" >&6
8082 else
8083
8084         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8085         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8086         for cf_header in $cf_header_list
8087         do
8088
8089         cat >conftest.$ac_ext <<_ACEOF
8090 #line 8090 "configure"
8091 #include "confdefs.h"
8092
8093 #include <$cf_header>
8094 int
8095 main (void)
8096 {
8097
8098 #ifdef NCURSES_VERSION
8099
8100 printf("%s\n", NCURSES_VERSION);
8101 #else
8102 #ifdef __NCURSES_H
8103 printf("old\n");
8104 #else
8105         make an error
8106 #endif
8107 #endif
8108
8109   ;
8110   return 0;
8111 }
8112 _ACEOF
8113 rm -f conftest.$ac_objext
8114 if { (eval echo "$as_me:8114: \"$ac_compile\"") >&5
8115   (eval $ac_compile) 2>&5
8116   ac_status=$?
8117   echo "$as_me:8117: \$? = $ac_status" >&5
8118   (exit $ac_status); } &&
8119          { ac_try='test -s conftest.$ac_objext'
8120   { (eval echo "$as_me:8120: \"$ac_try\"") >&5
8121   (eval $ac_try) 2>&5
8122   ac_status=$?
8123   echo "$as_me:8123: \$? = $ac_status" >&5
8124   (exit $ac_status); }; }; then
8125   cf_cv_ncurses_h=$cf_header
8126
8127 else
8128   echo "$as_me: failed program was:" >&5
8129 cat conftest.$ac_ext >&5
8130 cf_cv_ncurses_h=no
8131 fi
8132 rm -f conftest.$ac_objext conftest.$ac_ext
8133
8134                 test "$cf_cv_ncurses_h" != no && break
8135         done
8136
8137 fi
8138 echo "$as_me:8138: result: $cf_cv_ncurses_h" >&5
8139 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8140
8141 if test "$cf_cv_ncurses_h" != no ; then
8142         cf_cv_ncurses_header=$cf_cv_ncurses_h
8143 else
8144
8145 echo "$as_me:8145: checking for $cf_ncuhdr_root include-path" >&5
8146 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8147 if test "${cf_cv_ncurses_h2+set}" = set; then
8148   echo $ECHO_N "(cached) $ECHO_C" >&6
8149 else
8150
8151         test -n "$verbose" && echo
8152
8153 cf_search=
8154
8155 # collect the current set of include-directories from compiler flags
8156 cf_header_path_list=""
8157 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8158         for cf_header_path in $CPPFLAGS $CFLAGS
8159         do
8160                 case $cf_header_path in
8161                 (-I*)
8162                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8163
8164 test "x$cf_header_path" != "xNONE" && \
8165 test -d "$cf_header_path" && \
8166  {
8167         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8168         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8169         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8170         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8171         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8172         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"
8173 }
8174
8175                         cf_header_path_list="$cf_header_path_list $cf_search"
8176                         ;;
8177                 esac
8178         done
8179 fi
8180
8181 # add the variations for the package we are looking for
8182
8183 cf_search=
8184
8185 test "x$prefix" != "xNONE" && \
8186 test -d "$prefix" && \
8187  {
8188         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8189         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8190         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8191         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8192         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8193         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8194 }
8195
8196 for cf_subdir_prefix in \
8197         /usr \
8198         /usr/local \
8199         /usr/pkg \
8200         /opt \
8201         /opt/local \
8202         $HOME
8203 do
8204
8205 test "x$cf_subdir_prefix" != "x$prefix" && \
8206 test -d "$cf_subdir_prefix" && \
8207 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8208         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8209         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8210         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8211         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8212         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8213         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"
8214 }
8215
8216 done
8217
8218 test "$includedir" != NONE && \
8219 test "$includedir" != "/usr/include" && \
8220 test -d "$includedir" && {
8221         test -d $includedir &&    cf_search="$cf_search $includedir"
8222         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8223 }
8224
8225 test "$oldincludedir" != NONE && \
8226 test "$oldincludedir" != "/usr/include" && \
8227 test -d "$oldincludedir" && {
8228         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8229         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8230 }
8231
8232 cf_search="$cf_search $cf_header_path_list"
8233
8234         test -n "$verbose" && echo search path $cf_search
8235         cf_save2_CPPFLAGS="$CPPFLAGS"
8236         for cf_incdir in $cf_search
8237         do
8238
8239 if test -n "$cf_incdir" ; then
8240   for cf_add_incdir in $cf_incdir
8241   do
8242         while test $cf_add_incdir != /usr/include
8243         do
8244           if test -d $cf_add_incdir
8245           then
8246                 cf_have_incdir=no
8247                 if test -n "$CFLAGS$CPPFLAGS" ; then
8248                   # a loop is needed to ensure we can add subdirs of existing dirs
8249                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8250                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8251                           cf_have_incdir=yes; break
8252                         fi
8253                   done
8254                 fi
8255
8256                 if test "$cf_have_incdir" = no ; then
8257                   if test "$cf_add_incdir" = /usr/local/include ; then
8258                         if test "$GCC" = yes
8259                         then
8260                           cf_save_CPPFLAGS=$CPPFLAGS
8261
8262         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8263         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8264
8265                           cat >conftest.$ac_ext <<_ACEOF
8266 #line 8266 "configure"
8267 #include "confdefs.h"
8268 #include <stdio.h>
8269 int
8270 main (void)
8271 {
8272 printf("Hello")
8273   ;
8274   return 0;
8275 }
8276 _ACEOF
8277 rm -f conftest.$ac_objext
8278 if { (eval echo "$as_me:8278: \"$ac_compile\"") >&5
8279   (eval $ac_compile) 2>&5
8280   ac_status=$?
8281   echo "$as_me:8281: \$? = $ac_status" >&5
8282   (exit $ac_status); } &&
8283          { ac_try='test -s conftest.$ac_objext'
8284   { (eval echo "$as_me:8284: \"$ac_try\"") >&5
8285   (eval $ac_try) 2>&5
8286   ac_status=$?
8287   echo "$as_me:8287: \$? = $ac_status" >&5
8288   (exit $ac_status); }; }; then
8289   :
8290 else
8291   echo "$as_me: failed program was:" >&5
8292 cat conftest.$ac_ext >&5
8293 cf_have_incdir=yes
8294 fi
8295 rm -f conftest.$ac_objext conftest.$ac_ext
8296                           CPPFLAGS=$cf_save_CPPFLAGS
8297                         fi
8298                   fi
8299                 fi
8300
8301                 if test "$cf_have_incdir" = no ; then
8302                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8303
8304 echo "${as_me:-configure}:8304: testing adding $cf_add_incdir to include-path ..." 1>&5
8305
8306                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8307
8308                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8309                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8310                   cf_add_incdir="$cf_top_incdir"
8311                 else
8312                   break
8313                 fi
8314           else
8315                 break
8316           fi
8317         done
8318   done
8319 fi
8320
8321                 for cf_header in \
8322                         ncurses.h \
8323                         curses.h
8324                 do
8325
8326         cat >conftest.$ac_ext <<_ACEOF
8327 #line 8327 "configure"
8328 #include "confdefs.h"
8329
8330 #include <$cf_header>
8331 int
8332 main (void)
8333 {
8334
8335 #ifdef NCURSES_VERSION
8336
8337 printf("%s\n", NCURSES_VERSION);
8338 #else
8339 #ifdef __NCURSES_H
8340 printf("old\n");
8341 #else
8342         make an error
8343 #endif
8344 #endif
8345
8346   ;
8347   return 0;
8348 }
8349 _ACEOF
8350 rm -f conftest.$ac_objext
8351 if { (eval echo "$as_me:8351: \"$ac_compile\"") >&5
8352   (eval $ac_compile) 2>&5
8353   ac_status=$?
8354   echo "$as_me:8354: \$? = $ac_status" >&5
8355   (exit $ac_status); } &&
8356          { ac_try='test -s conftest.$ac_objext'
8357   { (eval echo "$as_me:8357: \"$ac_try\"") >&5
8358   (eval $ac_try) 2>&5
8359   ac_status=$?
8360   echo "$as_me:8360: \$? = $ac_status" >&5
8361   (exit $ac_status); }; }; then
8362   cf_cv_ncurses_h2=$cf_header
8363
8364 else
8365   echo "$as_me: failed program was:" >&5
8366 cat conftest.$ac_ext >&5
8367 cf_cv_ncurses_h2=no
8368 fi
8369 rm -f conftest.$ac_objext conftest.$ac_ext
8370
8371                         if test "$cf_cv_ncurses_h2" != no ; then
8372                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8373                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8374                                 break
8375                         fi
8376                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8377                 done
8378                 CPPFLAGS="$cf_save2_CPPFLAGS"
8379                 test "$cf_cv_ncurses_h2" != no && break
8380         done
8381         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8381: error: not found" >&5
8382 echo "$as_me: error: not found" >&2;}
8383    { (exit 1); exit 1; }; }
8384
8385 fi
8386 echo "$as_me:8386: result: $cf_cv_ncurses_h2" >&5
8387 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8388
8389         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8390         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8391         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8392                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8393         fi
8394
8395 if test -n "$cf_1st_incdir" ; then
8396   for cf_add_incdir in $cf_1st_incdir
8397   do
8398         while test $cf_add_incdir != /usr/include
8399         do
8400           if test -d $cf_add_incdir
8401           then
8402                 cf_have_incdir=no
8403                 if test -n "$CFLAGS$CPPFLAGS" ; then
8404                   # a loop is needed to ensure we can add subdirs of existing dirs
8405                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8406                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8407                           cf_have_incdir=yes; break
8408                         fi
8409                   done
8410                 fi
8411
8412                 if test "$cf_have_incdir" = no ; then
8413                   if test "$cf_add_incdir" = /usr/local/include ; then
8414                         if test "$GCC" = yes
8415                         then
8416                           cf_save_CPPFLAGS=$CPPFLAGS
8417
8418         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8419         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8420
8421                           cat >conftest.$ac_ext <<_ACEOF
8422 #line 8422 "configure"
8423 #include "confdefs.h"
8424 #include <stdio.h>
8425 int
8426 main (void)
8427 {
8428 printf("Hello")
8429   ;
8430   return 0;
8431 }
8432 _ACEOF
8433 rm -f conftest.$ac_objext
8434 if { (eval echo "$as_me:8434: \"$ac_compile\"") >&5
8435   (eval $ac_compile) 2>&5
8436   ac_status=$?
8437   echo "$as_me:8437: \$? = $ac_status" >&5
8438   (exit $ac_status); } &&
8439          { ac_try='test -s conftest.$ac_objext'
8440   { (eval echo "$as_me:8440: \"$ac_try\"") >&5
8441   (eval $ac_try) 2>&5
8442   ac_status=$?
8443   echo "$as_me:8443: \$? = $ac_status" >&5
8444   (exit $ac_status); }; }; then
8445   :
8446 else
8447   echo "$as_me: failed program was:" >&5
8448 cat conftest.$ac_ext >&5
8449 cf_have_incdir=yes
8450 fi
8451 rm -f conftest.$ac_objext conftest.$ac_ext
8452                           CPPFLAGS=$cf_save_CPPFLAGS
8453                         fi
8454                   fi
8455                 fi
8456
8457                 if test "$cf_have_incdir" = no ; then
8458                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8459
8460 echo "${as_me:-configure}:8460: testing adding $cf_add_incdir to include-path ..." 1>&5
8461
8462                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8463
8464                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8465                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8466                   cf_add_incdir="$cf_top_incdir"
8467                 else
8468                   break
8469                 fi
8470           else
8471                 break
8472           fi
8473         done
8474   done
8475 fi
8476
8477 fi
8478
8479 # Set definitions to allow ifdef'ing for ncurses.h
8480
8481 case $cf_cv_ncurses_header in
8482 (*ncurses.h)
8483
8484 cat >>confdefs.h <<\EOF
8485 #define HAVE_NCURSES_H 1
8486 EOF
8487
8488         ;;
8489 esac
8490
8491 case $cf_cv_ncurses_header in
8492 (ncurses/curses.h|ncurses/ncurses.h)
8493
8494 cat >>confdefs.h <<\EOF
8495 #define HAVE_NCURSES_NCURSES_H 1
8496 EOF
8497
8498         ;;
8499 (ncursesw/curses.h|ncursesw/ncurses.h)
8500
8501 cat >>confdefs.h <<\EOF
8502 #define HAVE_NCURSESW_NCURSES_H 1
8503 EOF
8504
8505         ;;
8506 esac
8507
8508 echo "$as_me:8508: checking for terminfo header" >&5
8509 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8510 if test "${cf_cv_term_header+set}" = set; then
8511   echo $ECHO_N "(cached) $ECHO_C" >&6
8512 else
8513
8514 case ${cf_cv_ncurses_header} in
8515 (*/ncurses.h|*/ncursesw.h)
8516         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8517         ;;
8518 (*)
8519         cf_term_header=term.h
8520         ;;
8521 esac
8522
8523 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8524 do
8525 cat >conftest.$ac_ext <<_ACEOF
8526 #line 8526 "configure"
8527 #include "confdefs.h"
8528 #include <stdio.h>
8529 #include <${cf_cv_ncurses_header:-curses.h}>
8530 #include <$cf_test>
8531
8532 int
8533 main (void)
8534 {
8535 int x = auto_left_margin
8536   ;
8537   return 0;
8538 }
8539 _ACEOF
8540 rm -f conftest.$ac_objext
8541 if { (eval echo "$as_me:8541: \"$ac_compile\"") >&5
8542   (eval $ac_compile) 2>&5
8543   ac_status=$?
8544   echo "$as_me:8544: \$? = $ac_status" >&5
8545   (exit $ac_status); } &&
8546          { ac_try='test -s conftest.$ac_objext'
8547   { (eval echo "$as_me:8547: \"$ac_try\"") >&5
8548   (eval $ac_try) 2>&5
8549   ac_status=$?
8550   echo "$as_me:8550: \$? = $ac_status" >&5
8551   (exit $ac_status); }; }; then
8552
8553         cf_cv_term_header="$cf_test"
8554 else
8555   echo "$as_me: failed program was:" >&5
8556 cat conftest.$ac_ext >&5
8557
8558         cf_cv_term_header=unknown
8559
8560 fi
8561 rm -f conftest.$ac_objext conftest.$ac_ext
8562         test "$cf_cv_term_header" != unknown && break
8563 done
8564
8565 fi
8566 echo "$as_me:8566: result: $cf_cv_term_header" >&5
8567 echo "${ECHO_T}$cf_cv_term_header" >&6
8568
8569 # Set definitions to allow ifdef'ing to accommodate subdirectories
8570
8571 case $cf_cv_term_header in
8572 (*term.h)
8573
8574 cat >>confdefs.h <<\EOF
8575 #define HAVE_TERM_H 1
8576 EOF
8577
8578         ;;
8579 esac
8580
8581 case $cf_cv_term_header in
8582 (ncurses/term.h)
8583
8584 cat >>confdefs.h <<\EOF
8585 #define HAVE_NCURSES_TERM_H 1
8586 EOF
8587
8588         ;;
8589 (ncursesw/term.h)
8590
8591 cat >>confdefs.h <<\EOF
8592 #define HAVE_NCURSESW_TERM_H 1
8593 EOF
8594
8595         ;;
8596 esac
8597
8598 # some applications need this, but should check for NCURSES_VERSION
8599
8600 cat >>confdefs.h <<\EOF
8601 #define NCURSES 1
8602 EOF
8603
8604 echo "$as_me:8604: checking for ncurses version" >&5
8605 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8606 if test "${cf_cv_ncurses_version+set}" = set; then
8607   echo $ECHO_N "(cached) $ECHO_C" >&6
8608 else
8609
8610         cf_cv_ncurses_version=no
8611         cf_tempfile=out$$
8612         rm -f $cf_tempfile
8613         if test "$cross_compiling" = yes; then
8614
8615         # This will not work if the preprocessor splits the line after the
8616         # Autoconf token.  The 'unproto' program does that.
8617         cat > conftest.$ac_ext <<EOF
8618 #include <${cf_cv_ncurses_header:-curses.h}>
8619 #undef Autoconf
8620 #ifdef NCURSES_VERSION
8621 Autoconf NCURSES_VERSION
8622 #else
8623 #ifdef __NCURSES_H
8624 Autoconf "old"
8625 #endif
8626 ;
8627 #endif
8628 EOF
8629         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8630         { (eval echo "$as_me:8630: \"$cf_try\"") >&5
8631   (eval $cf_try) 2>&5
8632   ac_status=$?
8633   echo "$as_me:8633: \$? = $ac_status" >&5
8634   (exit $ac_status); }
8635         if test -f conftest.out ; then
8636                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8637                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8638                 rm -f conftest.out
8639         fi
8640
8641 else
8642   cat >conftest.$ac_ext <<_ACEOF
8643 #line 8643 "configure"
8644 #include "confdefs.h"
8645
8646 #include <${cf_cv_ncurses_header:-curses.h}>
8647 #include <stdio.h>
8648 int main(void)
8649 {
8650         FILE *fp = fopen("$cf_tempfile", "w");
8651 #ifdef NCURSES_VERSION
8652 # ifdef NCURSES_VERSION_PATCH
8653         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8654 # else
8655         fprintf(fp, "%s\n", NCURSES_VERSION);
8656 # endif
8657 #else
8658 # ifdef __NCURSES_H
8659         fprintf(fp, "old\n");
8660 # else
8661         make an error
8662 # endif
8663 #endif
8664         ${cf_cv_main_return:-return}(0);
8665 }
8666 _ACEOF
8667 rm -f conftest$ac_exeext
8668 if { (eval echo "$as_me:8668: \"$ac_link\"") >&5
8669   (eval $ac_link) 2>&5
8670   ac_status=$?
8671   echo "$as_me:8671: \$? = $ac_status" >&5
8672   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8673   { (eval echo "$as_me:8673: \"$ac_try\"") >&5
8674   (eval $ac_try) 2>&5
8675   ac_status=$?
8676   echo "$as_me:8676: \$? = $ac_status" >&5
8677   (exit $ac_status); }; }; then
8678
8679         cf_cv_ncurses_version=`cat $cf_tempfile`
8680 else
8681   echo "$as_me: program exited with status $ac_status" >&5
8682 echo "$as_me: failed program was:" >&5
8683 cat conftest.$ac_ext >&5
8684 fi
8685 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8686 fi
8687         rm -f $cf_tempfile
8688
8689 fi
8690 echo "$as_me:8690: result: $cf_cv_ncurses_version" >&5
8691 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8692 test "$cf_cv_ncurses_version" = no ||
8693 cat >>confdefs.h <<\EOF
8694 #define NCURSES 1
8695 EOF
8696
8697 cf_nculib_root=$cf_cv_screen
8698         # This works, except for the special case where we find gpm, but
8699         # ncurses is in a nonstandard location via $LIBS, and we really want
8700         # to link gpm.
8701 cf_ncurses_LIBS=""
8702 cf_ncurses_SAVE="$LIBS"
8703 echo "$as_me:8703: checking for Gpm_Open in -lgpm" >&5
8704 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8705 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8706   echo $ECHO_N "(cached) $ECHO_C" >&6
8707 else
8708   ac_check_lib_save_LIBS=$LIBS
8709 LIBS="-lgpm  $LIBS"
8710 cat >conftest.$ac_ext <<_ACEOF
8711 #line 8711 "configure"
8712 #include "confdefs.h"
8713
8714 /* Override any gcc2 internal prototype to avoid an error.  */
8715 #ifdef __cplusplus
8716 extern "C"
8717 #endif
8718 /* We use char because int might match the return type of a gcc2
8719    builtin and then its argument prototype would still apply.  */
8720 char Gpm_Open ();
8721 int
8722 main (void)
8723 {
8724 Gpm_Open ();
8725   ;
8726   return 0;
8727 }
8728 _ACEOF
8729 rm -f conftest.$ac_objext conftest$ac_exeext
8730 if { (eval echo "$as_me:8730: \"$ac_link\"") >&5
8731   (eval $ac_link) 2>&5
8732   ac_status=$?
8733   echo "$as_me:8733: \$? = $ac_status" >&5
8734   (exit $ac_status); } &&
8735          { ac_try='test -s conftest$ac_exeext'
8736   { (eval echo "$as_me:8736: \"$ac_try\"") >&5
8737   (eval $ac_try) 2>&5
8738   ac_status=$?
8739   echo "$as_me:8739: \$? = $ac_status" >&5
8740   (exit $ac_status); }; }; then
8741   ac_cv_lib_gpm_Gpm_Open=yes
8742 else
8743   echo "$as_me: failed program was:" >&5
8744 cat conftest.$ac_ext >&5
8745 ac_cv_lib_gpm_Gpm_Open=no
8746 fi
8747 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8748 LIBS=$ac_check_lib_save_LIBS
8749 fi
8750 echo "$as_me:8750: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8751 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8752 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8753   echo "$as_me:8753: checking for initscr in -lgpm" >&5
8754 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8755 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8756   echo $ECHO_N "(cached) $ECHO_C" >&6
8757 else
8758   ac_check_lib_save_LIBS=$LIBS
8759 LIBS="-lgpm  $LIBS"
8760 cat >conftest.$ac_ext <<_ACEOF
8761 #line 8761 "configure"
8762 #include "confdefs.h"
8763
8764 /* Override any gcc2 internal prototype to avoid an error.  */
8765 #ifdef __cplusplus
8766 extern "C"
8767 #endif
8768 /* We use char because int might match the return type of a gcc2
8769    builtin and then its argument prototype would still apply.  */
8770 char initscr ();
8771 int
8772 main (void)
8773 {
8774 initscr ();
8775   ;
8776   return 0;
8777 }
8778 _ACEOF
8779 rm -f conftest.$ac_objext conftest$ac_exeext
8780 if { (eval echo "$as_me:8780: \"$ac_link\"") >&5
8781   (eval $ac_link) 2>&5
8782   ac_status=$?
8783   echo "$as_me:8783: \$? = $ac_status" >&5
8784   (exit $ac_status); } &&
8785          { ac_try='test -s conftest$ac_exeext'
8786   { (eval echo "$as_me:8786: \"$ac_try\"") >&5
8787   (eval $ac_try) 2>&5
8788   ac_status=$?
8789   echo "$as_me:8789: \$? = $ac_status" >&5
8790   (exit $ac_status); }; }; then
8791   ac_cv_lib_gpm_initscr=yes
8792 else
8793   echo "$as_me: failed program was:" >&5
8794 cat conftest.$ac_ext >&5
8795 ac_cv_lib_gpm_initscr=no
8796 fi
8797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8798 LIBS=$ac_check_lib_save_LIBS
8799 fi
8800 echo "$as_me:8800: result: $ac_cv_lib_gpm_initscr" >&5
8801 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8802 if test $ac_cv_lib_gpm_initscr = yes; then
8803   LIBS="$cf_ncurses_SAVE"
8804 else
8805   cf_ncurses_LIBS="-lgpm"
8806 fi
8807
8808 fi
8809
8810 case $host_os in
8811 (freebsd*)
8812         # This is only necessary if you are linking against an obsolete
8813         # version of ncurses (but it should do no harm, since it's static).
8814         if test "$cf_nculib_root" = ncurses ; then
8815                 echo "$as_me:8815: checking for tgoto in -lmytinfo" >&5
8816 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8817 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8818   echo $ECHO_N "(cached) $ECHO_C" >&6
8819 else
8820   ac_check_lib_save_LIBS=$LIBS
8821 LIBS="-lmytinfo  $LIBS"
8822 cat >conftest.$ac_ext <<_ACEOF
8823 #line 8823 "configure"
8824 #include "confdefs.h"
8825
8826 /* Override any gcc2 internal prototype to avoid an error.  */
8827 #ifdef __cplusplus
8828 extern "C"
8829 #endif
8830 /* We use char because int might match the return type of a gcc2
8831    builtin and then its argument prototype would still apply.  */
8832 char tgoto ();
8833 int
8834 main (void)
8835 {
8836 tgoto ();
8837   ;
8838   return 0;
8839 }
8840 _ACEOF
8841 rm -f conftest.$ac_objext conftest$ac_exeext
8842 if { (eval echo "$as_me:8842: \"$ac_link\"") >&5
8843   (eval $ac_link) 2>&5
8844   ac_status=$?
8845   echo "$as_me:8845: \$? = $ac_status" >&5
8846   (exit $ac_status); } &&
8847          { ac_try='test -s conftest$ac_exeext'
8848   { (eval echo "$as_me:8848: \"$ac_try\"") >&5
8849   (eval $ac_try) 2>&5
8850   ac_status=$?
8851   echo "$as_me:8851: \$? = $ac_status" >&5
8852   (exit $ac_status); }; }; then
8853   ac_cv_lib_mytinfo_tgoto=yes
8854 else
8855   echo "$as_me: failed program was:" >&5
8856 cat conftest.$ac_ext >&5
8857 ac_cv_lib_mytinfo_tgoto=no
8858 fi
8859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8860 LIBS=$ac_check_lib_save_LIBS
8861 fi
8862 echo "$as_me:8862: result: $ac_cv_lib_mytinfo_tgoto" >&5
8863 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8864 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8865   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8866 fi
8867
8868         fi
8869         ;;
8870 esac
8871
8872 cf_add_libs="$cf_ncurses_LIBS"
8873 # Filter out duplicates - this happens with badly-designed ".pc" files...
8874 for cf_add_1lib in $LIBS
8875 do
8876         for cf_add_2lib in $cf_add_libs
8877         do
8878                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8879                 then
8880                         cf_add_1lib=
8881                         break
8882                 fi
8883         done
8884         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8885 done
8886 LIBS="$cf_add_libs"
8887
8888 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8889 then
8890
8891 cf_add_libs="-l$cf_nculib_root"
8892 # Filter out duplicates - this happens with badly-designed ".pc" files...
8893 for cf_add_1lib in $LIBS
8894 do
8895         for cf_add_2lib in $cf_add_libs
8896         do
8897                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8898                 then
8899                         cf_add_1lib=
8900                         break
8901                 fi
8902         done
8903         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8904 done
8905 LIBS="$cf_add_libs"
8906
8907 else
8908
8909         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8910         cf_libdir=""
8911         echo "$as_me:8911: checking for initscr" >&5
8912 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8913 if test "${ac_cv_func_initscr+set}" = set; then
8914   echo $ECHO_N "(cached) $ECHO_C" >&6
8915 else
8916   cat >conftest.$ac_ext <<_ACEOF
8917 #line 8917 "configure"
8918 #include "confdefs.h"
8919 /* System header to define __stub macros and hopefully few prototypes,
8920     which can conflict with char initscr (); below.  */
8921 #include <assert.h>
8922 /* Override any gcc2 internal prototype to avoid an error.  */
8923 #ifdef __cplusplus
8924 extern "C"
8925 #endif
8926 /* We use char because int might match the return type of a gcc2
8927    builtin and then its argument prototype would still apply.  */
8928 char initscr ();
8929 char (*f) ();
8930
8931 int
8932 main (void)
8933 {
8934 /* The GNU C library defines this for functions which it implements
8935     to always fail with ENOSYS.  Some functions are actually named
8936     something starting with __ and the normal name is an alias.  */
8937 #if defined (__stub_initscr) || defined (__stub___initscr)
8938 choke me
8939 #else
8940 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8941 #endif
8942
8943   ;
8944   return 0;
8945 }
8946 _ACEOF
8947 rm -f conftest.$ac_objext conftest$ac_exeext
8948 if { (eval echo "$as_me:8948: \"$ac_link\"") >&5
8949   (eval $ac_link) 2>&5
8950   ac_status=$?
8951   echo "$as_me:8951: \$? = $ac_status" >&5
8952   (exit $ac_status); } &&
8953          { ac_try='test -s conftest$ac_exeext'
8954   { (eval echo "$as_me:8954: \"$ac_try\"") >&5
8955   (eval $ac_try) 2>&5
8956   ac_status=$?
8957   echo "$as_me:8957: \$? = $ac_status" >&5
8958   (exit $ac_status); }; }; then
8959   ac_cv_func_initscr=yes
8960 else
8961   echo "$as_me: failed program was:" >&5
8962 cat conftest.$ac_ext >&5
8963 ac_cv_func_initscr=no
8964 fi
8965 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8966 fi
8967 echo "$as_me:8967: result: $ac_cv_func_initscr" >&5
8968 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8969 if test $ac_cv_func_initscr = yes; then
8970   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8971 else
8972
8973                 cf_save_LIBS="$LIBS"
8974                 echo "$as_me:8974: checking for initscr in -l$cf_nculib_root" >&5
8975 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8976                 LIBS="-l$cf_nculib_root $LIBS"
8977                 cat >conftest.$ac_ext <<_ACEOF
8978 #line 8978 "configure"
8979 #include "confdefs.h"
8980 #include <${cf_cv_ncurses_header:-curses.h}>
8981 int
8982 main (void)
8983 {
8984 initscr()
8985   ;
8986   return 0;
8987 }
8988 _ACEOF
8989 rm -f conftest.$ac_objext conftest$ac_exeext
8990 if { (eval echo "$as_me:8990: \"$ac_link\"") >&5
8991   (eval $ac_link) 2>&5
8992   ac_status=$?
8993   echo "$as_me:8993: \$? = $ac_status" >&5
8994   (exit $ac_status); } &&
8995          { ac_try='test -s conftest$ac_exeext'
8996   { (eval echo "$as_me:8996: \"$ac_try\"") >&5
8997   (eval $ac_try) 2>&5
8998   ac_status=$?
8999   echo "$as_me:8999: \$? = $ac_status" >&5
9000   (exit $ac_status); }; }; then
9001   echo "$as_me:9001: result: yes" >&5
9002 echo "${ECHO_T}yes" >&6
9003                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9004
9005 else
9006   echo "$as_me: failed program was:" >&5
9007 cat conftest.$ac_ext >&5
9008 echo "$as_me:9008: result: no" >&5
9009 echo "${ECHO_T}no" >&6
9010
9011 cf_search=
9012 cf_library_path_list=""
9013 if test -n "${LDFLAGS}${LIBS}" ; then
9014         for cf_library_path in $LDFLAGS $LIBS
9015         do
9016                 case $cf_library_path in
9017                 (-L*)
9018                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9019
9020 test "x$cf_library_path" != "xNONE" && \
9021 test -d "$cf_library_path" && \
9022  {
9023         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9024         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9025         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9026         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9027         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9028         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"
9029 }
9030
9031                         cf_library_path_list="$cf_library_path_list $cf_search"
9032                         ;;
9033                 esac
9034         done
9035 fi
9036
9037 cf_search=
9038
9039 test "x$prefix" != "xNONE" && \
9040 test -d "$prefix" && \
9041  {
9042         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9043         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9044         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9045         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9046         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9047         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9048 }
9049
9050 for cf_subdir_prefix in \
9051         /usr \
9052         /usr/local \
9053         /usr/pkg \
9054         /opt \
9055         /opt/local \
9056         $HOME
9057 do
9058
9059 test "x$cf_subdir_prefix" != "x$prefix" && \
9060 test -d "$cf_subdir_prefix" && \
9061 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9062         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
9063         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
9064         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
9065         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
9066         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
9067         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"
9068 }
9069
9070 done
9071
9072 cf_search="$cf_library_path_list $cf_search"
9073
9074                         for cf_libdir in $cf_search
9075                         do
9076                                 echo "$as_me:9076: checking for -l$cf_nculib_root in $cf_libdir" >&5
9077 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9078                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9079                                 cat >conftest.$ac_ext <<_ACEOF
9080 #line 9080 "configure"
9081 #include "confdefs.h"
9082 #include <${cf_cv_ncurses_header:-curses.h}>
9083 int
9084 main (void)
9085 {
9086 initscr()
9087   ;
9088   return 0;
9089 }
9090 _ACEOF
9091 rm -f conftest.$ac_objext conftest$ac_exeext
9092 if { (eval echo "$as_me:9092: \"$ac_link\"") >&5
9093   (eval $ac_link) 2>&5
9094   ac_status=$?
9095   echo "$as_me:9095: \$? = $ac_status" >&5
9096   (exit $ac_status); } &&
9097          { ac_try='test -s conftest$ac_exeext'
9098   { (eval echo "$as_me:9098: \"$ac_try\"") >&5
9099   (eval $ac_try) 2>&5
9100   ac_status=$?
9101   echo "$as_me:9101: \$? = $ac_status" >&5
9102   (exit $ac_status); }; }; then
9103   echo "$as_me:9103: result: yes" >&5
9104 echo "${ECHO_T}yes" >&6
9105                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9106                                          break
9107 else
9108   echo "$as_me: failed program was:" >&5
9109 cat conftest.$ac_ext >&5
9110 echo "$as_me:9110: result: no" >&5
9111 echo "${ECHO_T}no" >&6
9112                                          LIBS="$cf_save_LIBS"
9113 fi
9114 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9115                         done
9116
9117 fi
9118 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9119
9120 fi
9121
9122 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9123
9124 if test $cf_found_library = no ; then
9125         { { echo "$as_me:9125: error: Cannot link $cf_nculib_root library" >&5
9126 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9127    { (exit 1); exit 1; }; }
9128 fi
9129
9130 fi
9131
9132 if test -n "$cf_ncurses_LIBS" ; then
9133         echo "$as_me:9133: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9134 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9135         cf_ncurses_SAVE="$LIBS"
9136         for p in $cf_ncurses_LIBS ; do
9137                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9138                 if test "$q" != "$LIBS" ; then
9139                         LIBS="$q"
9140                 fi
9141         done
9142         cat >conftest.$ac_ext <<_ACEOF
9143 #line 9143 "configure"
9144 #include "confdefs.h"
9145 #include <${cf_cv_ncurses_header:-curses.h}>
9146 int
9147 main (void)
9148 {
9149 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9150   ;
9151   return 0;
9152 }
9153 _ACEOF
9154 rm -f conftest.$ac_objext conftest$ac_exeext
9155 if { (eval echo "$as_me:9155: \"$ac_link\"") >&5
9156   (eval $ac_link) 2>&5
9157   ac_status=$?
9158   echo "$as_me:9158: \$? = $ac_status" >&5
9159   (exit $ac_status); } &&
9160          { ac_try='test -s conftest$ac_exeext'
9161   { (eval echo "$as_me:9161: \"$ac_try\"") >&5
9162   (eval $ac_try) 2>&5
9163   ac_status=$?
9164   echo "$as_me:9164: \$? = $ac_status" >&5
9165   (exit $ac_status); }; }; then
9166   echo "$as_me:9166: result: yes" >&5
9167 echo "${ECHO_T}yes" >&6
9168 else
9169   echo "$as_me: failed program was:" >&5
9170 cat conftest.$ac_ext >&5
9171 echo "$as_me:9171: result: no" >&5
9172 echo "${ECHO_T}no" >&6
9173                  LIBS="$cf_ncurses_SAVE"
9174 fi
9175 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9176 fi
9177
9178 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9179
9180 cat >>confdefs.h <<EOF
9181 #define $cf_nculib_ROOT 1
9182 EOF
9183
9184         fi
9185 else
9186         NCURSES_CONFIG=none
9187 fi
9188
9189         ;;
9190 (ncurses*)
9191
9192 cf_ncuconfig_root=$cf_cv_screen
9193 cf_have_ncuconfig=no
9194
9195 if test "x${PKG_CONFIG:=none}" != xnone; then
9196         echo "$as_me:9196: checking pkg-config for $cf_ncuconfig_root" >&5
9197 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9198         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9199                 echo "$as_me:9199: result: yes" >&5
9200 echo "${ECHO_T}yes" >&6
9201
9202                 echo "$as_me:9202: checking if the $cf_ncuconfig_root package files work" >&5
9203 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9204                 cf_have_ncuconfig=unknown
9205
9206                 cf_save_CPPFLAGS="$CPPFLAGS"
9207                 cf_save_LIBS="$LIBS"
9208
9209 cf_fix_cppflags=no
9210 cf_new_cflags=
9211 cf_new_cppflags=
9212 cf_new_extra_cppflags=
9213
9214 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9215 do
9216 case $cf_fix_cppflags in
9217 (no)
9218         case $cf_add_cflags in
9219         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9220                 case $cf_add_cflags in
9221                 (-D*)
9222                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9223
9224                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9225                                 && test -z "${cf_tst_cflags}" \
9226                                 && cf_fix_cppflags=yes
9227
9228                         if test $cf_fix_cppflags = yes ; then
9229
9230         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9231         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9232
9233                                 continue
9234                         elif test "${cf_tst_cflags}" = "\"'" ; then
9235
9236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9238
9239                                 continue
9240                         fi
9241                         ;;
9242                 esac
9243                 case "$CPPFLAGS" in
9244                 (*$cf_add_cflags)
9245                         ;;
9246                 (*)
9247                         case $cf_add_cflags in
9248                         (-D*)
9249                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9250
9251 CPPFLAGS=`echo "$CPPFLAGS" | \
9252         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9253                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9254
9255                                 ;;
9256                         esac
9257
9258         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9259         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9260
9261                         ;;
9262                 esac
9263                 ;;
9264         (*)
9265
9266         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9267         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9268
9269                 ;;
9270         esac
9271         ;;
9272 (yes)
9273
9274         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9275         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9276
9277         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9278
9279         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9280                 && test -z "${cf_tst_cflags}" \
9281                 && cf_fix_cppflags=no
9282         ;;
9283 esac
9284 done
9285
9286 if test -n "$cf_new_cflags" ; then
9287
9288         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9289         CFLAGS="${CFLAGS}$cf_new_cflags"
9290
9291 fi
9292
9293 if test -n "$cf_new_cppflags" ; then
9294
9295         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9296         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9297
9298 fi
9299
9300 if test -n "$cf_new_extra_cppflags" ; then
9301
9302         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9303         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9304
9305 fi
9306
9307 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9308 # Filter out duplicates - this happens with badly-designed ".pc" files...
9309 for cf_add_1lib in $LIBS
9310 do
9311         for cf_add_2lib in $cf_add_libs
9312         do
9313                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9314                 then
9315                         cf_add_1lib=
9316                         break
9317                 fi
9318         done
9319         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9320 done
9321 LIBS="$cf_add_libs"
9322
9323                 cat >conftest.$ac_ext <<_ACEOF
9324 #line 9324 "configure"
9325 #include "confdefs.h"
9326 #include <${cf_cv_ncurses_header:-curses.h}>
9327 int
9328 main (void)
9329 {
9330 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9331   ;
9332   return 0;
9333 }
9334 _ACEOF
9335 rm -f conftest.$ac_objext conftest$ac_exeext
9336 if { (eval echo "$as_me:9336: \"$ac_link\"") >&5
9337   (eval $ac_link) 2>&5
9338   ac_status=$?
9339   echo "$as_me:9339: \$? = $ac_status" >&5
9340   (exit $ac_status); } &&
9341          { ac_try='test -s conftest$ac_exeext'
9342   { (eval echo "$as_me:9342: \"$ac_try\"") >&5
9343   (eval $ac_try) 2>&5
9344   ac_status=$?
9345   echo "$as_me:9345: \$? = $ac_status" >&5
9346   (exit $ac_status); }; }; then
9347   if test "$cross_compiling" = yes; then
9348   cf_have_ncuconfig=maybe
9349 else
9350   cat >conftest.$ac_ext <<_ACEOF
9351 #line 9351 "configure"
9352 #include "confdefs.h"
9353 #include <${cf_cv_ncurses_header:-curses.h}>
9354                                 int main(void)
9355                                 { char *xx = curses_version(); return (xx == 0); }
9356 _ACEOF
9357 rm -f conftest$ac_exeext
9358 if { (eval echo "$as_me:9358: \"$ac_link\"") >&5
9359   (eval $ac_link) 2>&5
9360   ac_status=$?
9361   echo "$as_me:9361: \$? = $ac_status" >&5
9362   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9363   { (eval echo "$as_me:9363: \"$ac_try\"") >&5
9364   (eval $ac_try) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); }; }; then
9368   cf_have_ncuconfig=yes
9369 else
9370   echo "$as_me: program exited with status $ac_status" >&5
9371 echo "$as_me: failed program was:" >&5
9372 cat conftest.$ac_ext >&5
9373 cf_have_ncuconfig=no
9374 fi
9375 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9376 fi
9377 else
9378   echo "$as_me: failed program was:" >&5
9379 cat conftest.$ac_ext >&5
9380 cf_have_ncuconfig=no
9381 fi
9382 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9383                 echo "$as_me:9383: result: $cf_have_ncuconfig" >&5
9384 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9385                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9386                 if test "$cf_have_ncuconfig" != "yes"
9387                 then
9388                         CPPFLAGS="$cf_save_CPPFLAGS"
9389                         LIBS="$cf_save_LIBS"
9390                         NCURSES_CONFIG_PKG=none
9391                 else
9392
9393 cat >>confdefs.h <<\EOF
9394 #define NCURSES 1
9395 EOF
9396
9397                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9398
9399 echo "$as_me:9399: checking for terminfo header" >&5
9400 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9401 if test "${cf_cv_term_header+set}" = set; then
9402   echo $ECHO_N "(cached) $ECHO_C" >&6
9403 else
9404
9405 case ${cf_cv_ncurses_header} in
9406 (*/ncurses.h|*/ncursesw.h)
9407         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9408         ;;
9409 (*)
9410         cf_term_header=term.h
9411         ;;
9412 esac
9413
9414 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9415 do
9416 cat >conftest.$ac_ext <<_ACEOF
9417 #line 9417 "configure"
9418 #include "confdefs.h"
9419 #include <stdio.h>
9420 #include <${cf_cv_ncurses_header:-curses.h}>
9421 #include <$cf_test>
9422
9423 int
9424 main (void)
9425 {
9426 int x = auto_left_margin
9427   ;
9428   return 0;
9429 }
9430 _ACEOF
9431 rm -f conftest.$ac_objext
9432 if { (eval echo "$as_me:9432: \"$ac_compile\"") >&5
9433   (eval $ac_compile) 2>&5
9434   ac_status=$?
9435   echo "$as_me:9435: \$? = $ac_status" >&5
9436   (exit $ac_status); } &&
9437          { ac_try='test -s conftest.$ac_objext'
9438   { (eval echo "$as_me:9438: \"$ac_try\"") >&5
9439   (eval $ac_try) 2>&5
9440   ac_status=$?
9441   echo "$as_me:9441: \$? = $ac_status" >&5
9442   (exit $ac_status); }; }; then
9443
9444         cf_cv_term_header="$cf_test"
9445 else
9446   echo "$as_me: failed program was:" >&5
9447 cat conftest.$ac_ext >&5
9448
9449         cf_cv_term_header=unknown
9450
9451 fi
9452 rm -f conftest.$ac_objext conftest.$ac_ext
9453         test "$cf_cv_term_header" != unknown && break
9454 done
9455
9456 fi
9457 echo "$as_me:9457: result: $cf_cv_term_header" >&5
9458 echo "${ECHO_T}$cf_cv_term_header" >&6
9459
9460 # Set definitions to allow ifdef'ing to accommodate subdirectories
9461
9462 case $cf_cv_term_header in
9463 (*term.h)
9464
9465 cat >>confdefs.h <<\EOF
9466 #define HAVE_TERM_H 1
9467 EOF
9468
9469         ;;
9470 esac
9471
9472 case $cf_cv_term_header in
9473 (ncurses/term.h)
9474
9475 cat >>confdefs.h <<\EOF
9476 #define HAVE_NCURSES_TERM_H 1
9477 EOF
9478
9479         ;;
9480 (ncursesw/term.h)
9481
9482 cat >>confdefs.h <<\EOF
9483 #define HAVE_NCURSESW_TERM_H 1
9484 EOF
9485
9486         ;;
9487 esac
9488
9489                 fi
9490
9491         else
9492                 echo "$as_me:9492: result: no" >&5
9493 echo "${ECHO_T}no" >&6
9494                 NCURSES_CONFIG_PKG=none
9495         fi
9496 else
9497         NCURSES_CONFIG_PKG=none
9498 fi
9499
9500 if test "x$cf_have_ncuconfig" = "xno"; then
9501         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9502
9503 if test -n "$ac_tool_prefix"; then
9504   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9505   do
9506     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9507 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9508 echo "$as_me:9508: checking for $ac_word" >&5
9509 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9510 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9511   echo $ECHO_N "(cached) $ECHO_C" >&6
9512 else
9513   if test -n "$NCURSES_CONFIG"; then
9514   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9515 else
9516   ac_save_IFS=$IFS; IFS=$ac_path_separator
9517 ac_dummy="$PATH"
9518 for ac_dir in $ac_dummy; do
9519   IFS=$ac_save_IFS
9520   test -z "$ac_dir" && ac_dir=.
9521   $as_executable_p "$ac_dir/$ac_word" || continue
9522 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9523 echo "$as_me:9523: found $ac_dir/$ac_word" >&5
9524 break
9525 done
9526
9527 fi
9528 fi
9529 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9530 if test -n "$NCURSES_CONFIG"; then
9531   echo "$as_me:9531: result: $NCURSES_CONFIG" >&5
9532 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9533 else
9534   echo "$as_me:9534: result: no" >&5
9535 echo "${ECHO_T}no" >&6
9536 fi
9537
9538     test -n "$NCURSES_CONFIG" && break
9539   done
9540 fi
9541 if test -z "$NCURSES_CONFIG"; then
9542   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9543   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9544 do
9545   # Extract the first word of "$ac_prog", so it can be a program name with args.
9546 set dummy $ac_prog; ac_word=$2
9547 echo "$as_me:9547: checking for $ac_word" >&5
9548 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9549 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9550   echo $ECHO_N "(cached) $ECHO_C" >&6
9551 else
9552   if test -n "$ac_ct_NCURSES_CONFIG"; then
9553   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9554 else
9555   ac_save_IFS=$IFS; IFS=$ac_path_separator
9556 ac_dummy="$PATH"
9557 for ac_dir in $ac_dummy; do
9558   IFS=$ac_save_IFS
9559   test -z "$ac_dir" && ac_dir=.
9560   $as_executable_p "$ac_dir/$ac_word" || continue
9561 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9562 echo "$as_me:9562: found $ac_dir/$ac_word" >&5
9563 break
9564 done
9565
9566 fi
9567 fi
9568 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9569 if test -n "$ac_ct_NCURSES_CONFIG"; then
9570   echo "$as_me:9570: result: $ac_ct_NCURSES_CONFIG" >&5
9571 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9572 else
9573   echo "$as_me:9573: result: no" >&5
9574 echo "${ECHO_T}no" >&6
9575 fi
9576
9577   test -n "$ac_ct_NCURSES_CONFIG" && break
9578 done
9579 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9580
9581   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9582 fi
9583
9584         if test "$NCURSES_CONFIG" != none ; then
9585
9586 cf_fix_cppflags=no
9587 cf_new_cflags=
9588 cf_new_cppflags=
9589 cf_new_extra_cppflags=
9590
9591 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9592 do
9593 case $cf_fix_cppflags in
9594 (no)
9595         case $cf_add_cflags in
9596         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9597                 case $cf_add_cflags in
9598                 (-D*)
9599                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9600
9601                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9602                                 && test -z "${cf_tst_cflags}" \
9603                                 && cf_fix_cppflags=yes
9604
9605                         if test $cf_fix_cppflags = yes ; then
9606
9607         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9608         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9609
9610                                 continue
9611                         elif test "${cf_tst_cflags}" = "\"'" ; then
9612
9613         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9614         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9615
9616                                 continue
9617                         fi
9618                         ;;
9619                 esac
9620                 case "$CPPFLAGS" in
9621                 (*$cf_add_cflags)
9622                         ;;
9623                 (*)
9624                         case $cf_add_cflags in
9625                         (-D*)
9626                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9627
9628 CPPFLAGS=`echo "$CPPFLAGS" | \
9629         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9630                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9631
9632                                 ;;
9633                         esac
9634
9635         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9636         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9637
9638                         ;;
9639                 esac
9640                 ;;
9641         (*)
9642
9643         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9644         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9645
9646                 ;;
9647         esac
9648         ;;
9649 (yes)
9650
9651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9653
9654         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9655
9656         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9657                 && test -z "${cf_tst_cflags}" \
9658                 && cf_fix_cppflags=no
9659         ;;
9660 esac
9661 done
9662
9663 if test -n "$cf_new_cflags" ; then
9664
9665         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9666         CFLAGS="${CFLAGS}$cf_new_cflags"
9667
9668 fi
9669
9670 if test -n "$cf_new_cppflags" ; then
9671
9672         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9673         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9674
9675 fi
9676
9677 if test -n "$cf_new_extra_cppflags" ; then
9678
9679         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9680         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9681
9682 fi
9683
9684 cf_add_libs="`$NCURSES_CONFIG --libs`"
9685 # Filter out duplicates - this happens with badly-designed ".pc" files...
9686 for cf_add_1lib in $LIBS
9687 do
9688         for cf_add_2lib in $cf_add_libs
9689         do
9690                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9691                 then
9692                         cf_add_1lib=
9693                         break
9694                 fi
9695         done
9696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9697 done
9698 LIBS="$cf_add_libs"
9699
9700                 # even with config script, some packages use no-override for curses.h
9701
9702 echo "$as_me:9702: checking if we have identified curses headers" >&5
9703 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9704 if test "${cf_cv_ncurses_header+set}" = set; then
9705   echo $ECHO_N "(cached) $ECHO_C" >&6
9706 else
9707
9708 cf_cv_ncurses_header=none
9709 for cf_header in \
9710         ncurses.h $cf_cv_screen/ncurses.h \
9711         curses.h $cf_cv_screen/curses.h
9712 do
9713 cat >conftest.$ac_ext <<_ACEOF
9714 #line 9714 "configure"
9715 #include "confdefs.h"
9716 #include <${cf_header}>
9717 int
9718 main (void)
9719 {
9720 initscr(); tgoto("?", 0,0)
9721   ;
9722   return 0;
9723 }
9724 _ACEOF
9725 rm -f conftest.$ac_objext
9726 if { (eval echo "$as_me:9726: \"$ac_compile\"") >&5
9727   (eval $ac_compile) 2>&5
9728   ac_status=$?
9729   echo "$as_me:9729: \$? = $ac_status" >&5
9730   (exit $ac_status); } &&
9731          { ac_try='test -s conftest.$ac_objext'
9732   { (eval echo "$as_me:9732: \"$ac_try\"") >&5
9733   (eval $ac_try) 2>&5
9734   ac_status=$?
9735   echo "$as_me:9735: \$? = $ac_status" >&5
9736   (exit $ac_status); }; }; then
9737   cf_cv_ncurses_header=$cf_header; break
9738 else
9739   echo "$as_me: failed program was:" >&5
9740 cat conftest.$ac_ext >&5
9741 fi
9742 rm -f conftest.$ac_objext conftest.$ac_ext
9743 done
9744
9745 fi
9746 echo "$as_me:9746: result: $cf_cv_ncurses_header" >&5
9747 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9748
9749 if test "$cf_cv_ncurses_header" = none ; then
9750         { { echo "$as_me:9750: error: No curses header-files found" >&5
9751 echo "$as_me: error: No curses header-files found" >&2;}
9752    { (exit 1); exit 1; }; }
9753 fi
9754
9755 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9756
9757 for ac_header in $cf_cv_ncurses_header
9758 do
9759 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9760 echo "$as_me:9760: checking for $ac_header" >&5
9761 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9762 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9763   echo $ECHO_N "(cached) $ECHO_C" >&6
9764 else
9765   cat >conftest.$ac_ext <<_ACEOF
9766 #line 9766 "configure"
9767 #include "confdefs.h"
9768 #include <$ac_header>
9769 _ACEOF
9770 if { (eval echo "$as_me:9770: \"$ac_cpp conftest.$ac_ext\"") >&5
9771   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9772   ac_status=$?
9773   egrep -v '^ *\+' conftest.er1 >conftest.err
9774   rm -f conftest.er1
9775   cat conftest.err >&5
9776   echo "$as_me:9776: \$? = $ac_status" >&5
9777   (exit $ac_status); } >/dev/null; then
9778   if test -s conftest.err; then
9779     ac_cpp_err=$ac_c_preproc_warn_flag
9780   else
9781     ac_cpp_err=
9782   fi
9783 else
9784   ac_cpp_err=yes
9785 fi
9786 if test -z "$ac_cpp_err"; then
9787   eval "$as_ac_Header=yes"
9788 else
9789   echo "$as_me: failed program was:" >&5
9790   cat conftest.$ac_ext >&5
9791   eval "$as_ac_Header=no"
9792 fi
9793 rm -f conftest.err conftest.$ac_ext
9794 fi
9795 echo "$as_me:9795: result: `eval echo '${'$as_ac_Header'}'`" >&5
9796 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9797 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9798   cat >>confdefs.h <<EOF
9799 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9800 EOF
9801
9802 fi
9803 done
9804
9805 cat >>confdefs.h <<\EOF
9806 #define NCURSES 1
9807 EOF
9808
9809 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9810
9811                 cat >>confdefs.h <<EOF
9812 #define $cf_nculib_ROOT 1
9813 EOF
9814
9815                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9816
9817         else
9818
9819 cf_ncuhdr_root=$cf_cv_screen
9820
9821 test -n "$cf_cv_curses_dir" && \
9822 test "$cf_cv_curses_dir" != "no" && { \
9823
9824 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9825   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9826   do
9827         while test $cf_add_incdir != /usr/include
9828         do
9829           if test -d $cf_add_incdir
9830           then
9831                 cf_have_incdir=no
9832                 if test -n "$CFLAGS$CPPFLAGS" ; then
9833                   # a loop is needed to ensure we can add subdirs of existing dirs
9834                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9835                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9836                           cf_have_incdir=yes; break
9837                         fi
9838                   done
9839                 fi
9840
9841                 if test "$cf_have_incdir" = no ; then
9842                   if test "$cf_add_incdir" = /usr/local/include ; then
9843                         if test "$GCC" = yes
9844                         then
9845                           cf_save_CPPFLAGS=$CPPFLAGS
9846
9847         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9848         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9849
9850                           cat >conftest.$ac_ext <<_ACEOF
9851 #line 9851 "configure"
9852 #include "confdefs.h"
9853 #include <stdio.h>
9854 int
9855 main (void)
9856 {
9857 printf("Hello")
9858   ;
9859   return 0;
9860 }
9861 _ACEOF
9862 rm -f conftest.$ac_objext
9863 if { (eval echo "$as_me:9863: \"$ac_compile\"") >&5
9864   (eval $ac_compile) 2>&5
9865   ac_status=$?
9866   echo "$as_me:9866: \$? = $ac_status" >&5
9867   (exit $ac_status); } &&
9868          { ac_try='test -s conftest.$ac_objext'
9869   { (eval echo "$as_me:9869: \"$ac_try\"") >&5
9870   (eval $ac_try) 2>&5
9871   ac_status=$?
9872   echo "$as_me:9872: \$? = $ac_status" >&5
9873   (exit $ac_status); }; }; then
9874   :
9875 else
9876   echo "$as_me: failed program was:" >&5
9877 cat conftest.$ac_ext >&5
9878 cf_have_incdir=yes
9879 fi
9880 rm -f conftest.$ac_objext conftest.$ac_ext
9881                           CPPFLAGS=$cf_save_CPPFLAGS
9882                         fi
9883                   fi
9884                 fi
9885
9886                 if test "$cf_have_incdir" = no ; then
9887                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9888
9889 echo "${as_me:-configure}:9889: testing adding $cf_add_incdir to include-path ..." 1>&5
9890
9891                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9892
9893                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9894                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9895                   cf_add_incdir="$cf_top_incdir"
9896                 else
9897                   break
9898                 fi
9899           else
9900                 break
9901           fi
9902         done
9903   done
9904 fi
9905
9906 }
9907
9908 echo "$as_me:9908: checking for $cf_ncuhdr_root header in include-path" >&5
9909 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9910 if test "${cf_cv_ncurses_h+set}" = set; then
9911   echo $ECHO_N "(cached) $ECHO_C" >&6
9912 else
9913
9914         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9915         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9916         for cf_header in $cf_header_list
9917         do
9918
9919         cat >conftest.$ac_ext <<_ACEOF
9920 #line 9920 "configure"
9921 #include "confdefs.h"
9922
9923 #include <$cf_header>
9924 int
9925 main (void)
9926 {
9927
9928 #ifdef NCURSES_VERSION
9929
9930 printf("%s\n", NCURSES_VERSION);
9931 #else
9932 #ifdef __NCURSES_H
9933 printf("old\n");
9934 #else
9935         make an error
9936 #endif
9937 #endif
9938
9939   ;
9940   return 0;
9941 }
9942 _ACEOF
9943 rm -f conftest.$ac_objext
9944 if { (eval echo "$as_me:9944: \"$ac_compile\"") >&5
9945   (eval $ac_compile) 2>&5
9946   ac_status=$?
9947   echo "$as_me:9947: \$? = $ac_status" >&5
9948   (exit $ac_status); } &&
9949          { ac_try='test -s conftest.$ac_objext'
9950   { (eval echo "$as_me:9950: \"$ac_try\"") >&5
9951   (eval $ac_try) 2>&5
9952   ac_status=$?
9953   echo "$as_me:9953: \$? = $ac_status" >&5
9954   (exit $ac_status); }; }; then
9955   cf_cv_ncurses_h=$cf_header
9956
9957 else
9958   echo "$as_me: failed program was:" >&5
9959 cat conftest.$ac_ext >&5
9960 cf_cv_ncurses_h=no
9961 fi
9962 rm -f conftest.$ac_objext conftest.$ac_ext
9963
9964                 test "$cf_cv_ncurses_h" != no && break
9965         done
9966
9967 fi
9968 echo "$as_me:9968: result: $cf_cv_ncurses_h" >&5
9969 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9970
9971 if test "$cf_cv_ncurses_h" != no ; then
9972         cf_cv_ncurses_header=$cf_cv_ncurses_h
9973 else
9974
9975 echo "$as_me:9975: checking for $cf_ncuhdr_root include-path" >&5
9976 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9977 if test "${cf_cv_ncurses_h2+set}" = set; then
9978   echo $ECHO_N "(cached) $ECHO_C" >&6
9979 else
9980
9981         test -n "$verbose" && echo
9982
9983 cf_search=
9984
9985 # collect the current set of include-directories from compiler flags
9986 cf_header_path_list=""
9987 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9988         for cf_header_path in $CPPFLAGS $CFLAGS
9989         do
9990                 case $cf_header_path in
9991                 (-I*)
9992                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9993
9994 test "x$cf_header_path" != "xNONE" && \
9995 test -d "$cf_header_path" && \
9996  {
9997         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9998         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9999         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
10000         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
10001         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
10002         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"
10003 }
10004
10005                         cf_header_path_list="$cf_header_path_list $cf_search"
10006                         ;;
10007                 esac
10008         done
10009 fi
10010
10011 # add the variations for the package we are looking for
10012
10013 cf_search=
10014
10015 test "x$prefix" != "xNONE" && \
10016 test -d "$prefix" && \
10017  {
10018         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
10019         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
10020         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
10021         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
10022         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
10023         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
10024 }
10025
10026 for cf_subdir_prefix in \
10027         /usr \
10028         /usr/local \
10029         /usr/pkg \
10030         /opt \
10031         /opt/local \
10032         $HOME
10033 do
10034
10035 test "x$cf_subdir_prefix" != "x$prefix" && \
10036 test -d "$cf_subdir_prefix" && \
10037 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10038         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
10039         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
10040         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
10041         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
10042         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
10043         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"
10044 }
10045
10046 done
10047
10048 test "$includedir" != NONE && \
10049 test "$includedir" != "/usr/include" && \
10050 test -d "$includedir" && {
10051         test -d $includedir &&    cf_search="$cf_search $includedir"
10052         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
10053 }
10054
10055 test "$oldincludedir" != NONE && \
10056 test "$oldincludedir" != "/usr/include" && \
10057 test -d "$oldincludedir" && {
10058         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
10059         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
10060 }
10061
10062 cf_search="$cf_search $cf_header_path_list"
10063
10064         test -n "$verbose" && echo search path $cf_search
10065         cf_save2_CPPFLAGS="$CPPFLAGS"
10066         for cf_incdir in $cf_search
10067         do
10068
10069 if test -n "$cf_incdir" ; then
10070   for cf_add_incdir in $cf_incdir
10071   do
10072         while test $cf_add_incdir != /usr/include
10073         do
10074           if test -d $cf_add_incdir
10075           then
10076                 cf_have_incdir=no
10077                 if test -n "$CFLAGS$CPPFLAGS" ; then
10078                   # a loop is needed to ensure we can add subdirs of existing dirs
10079                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10080                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10081                           cf_have_incdir=yes; break
10082                         fi
10083                   done
10084                 fi
10085
10086                 if test "$cf_have_incdir" = no ; then
10087                   if test "$cf_add_incdir" = /usr/local/include ; then
10088                         if test "$GCC" = yes
10089                         then
10090                           cf_save_CPPFLAGS=$CPPFLAGS
10091
10092         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10093         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10094
10095                           cat >conftest.$ac_ext <<_ACEOF
10096 #line 10096 "configure"
10097 #include "confdefs.h"
10098 #include <stdio.h>
10099 int
10100 main (void)
10101 {
10102 printf("Hello")
10103   ;
10104   return 0;
10105 }
10106 _ACEOF
10107 rm -f conftest.$ac_objext
10108 if { (eval echo "$as_me:10108: \"$ac_compile\"") >&5
10109   (eval $ac_compile) 2>&5
10110   ac_status=$?
10111   echo "$as_me:10111: \$? = $ac_status" >&5
10112   (exit $ac_status); } &&
10113          { ac_try='test -s conftest.$ac_objext'
10114   { (eval echo "$as_me:10114: \"$ac_try\"") >&5
10115   (eval $ac_try) 2>&5
10116   ac_status=$?
10117   echo "$as_me:10117: \$? = $ac_status" >&5
10118   (exit $ac_status); }; }; then
10119   :
10120 else
10121   echo "$as_me: failed program was:" >&5
10122 cat conftest.$ac_ext >&5
10123 cf_have_incdir=yes
10124 fi
10125 rm -f conftest.$ac_objext conftest.$ac_ext
10126                           CPPFLAGS=$cf_save_CPPFLAGS
10127                         fi
10128                   fi
10129                 fi
10130
10131                 if test "$cf_have_incdir" = no ; then
10132                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10133
10134 echo "${as_me:-configure}:10134: testing adding $cf_add_incdir to include-path ..." 1>&5
10135
10136                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10137
10138                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10139                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10140                   cf_add_incdir="$cf_top_incdir"
10141                 else
10142                   break
10143                 fi
10144           else
10145                 break
10146           fi
10147         done
10148   done
10149 fi
10150
10151                 for cf_header in \
10152                         ncurses.h \
10153                         curses.h
10154                 do
10155
10156         cat >conftest.$ac_ext <<_ACEOF
10157 #line 10157 "configure"
10158 #include "confdefs.h"
10159
10160 #include <$cf_header>
10161 int
10162 main (void)
10163 {
10164
10165 #ifdef NCURSES_VERSION
10166
10167 printf("%s\n", NCURSES_VERSION);
10168 #else
10169 #ifdef __NCURSES_H
10170 printf("old\n");
10171 #else
10172         make an error
10173 #endif
10174 #endif
10175
10176   ;
10177   return 0;
10178 }
10179 _ACEOF
10180 rm -f conftest.$ac_objext
10181 if { (eval echo "$as_me:10181: \"$ac_compile\"") >&5
10182   (eval $ac_compile) 2>&5
10183   ac_status=$?
10184   echo "$as_me:10184: \$? = $ac_status" >&5
10185   (exit $ac_status); } &&
10186          { ac_try='test -s conftest.$ac_objext'
10187   { (eval echo "$as_me:10187: \"$ac_try\"") >&5
10188   (eval $ac_try) 2>&5
10189   ac_status=$?
10190   echo "$as_me:10190: \$? = $ac_status" >&5
10191   (exit $ac_status); }; }; then
10192   cf_cv_ncurses_h2=$cf_header
10193
10194 else
10195   echo "$as_me: failed program was:" >&5
10196 cat conftest.$ac_ext >&5
10197 cf_cv_ncurses_h2=no
10198 fi
10199 rm -f conftest.$ac_objext conftest.$ac_ext
10200
10201                         if test "$cf_cv_ncurses_h2" != no ; then
10202                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10203                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10204                                 break
10205                         fi
10206                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10207                 done
10208                 CPPFLAGS="$cf_save2_CPPFLAGS"
10209                 test "$cf_cv_ncurses_h2" != no && break
10210         done
10211         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10211: error: not found" >&5
10212 echo "$as_me: error: not found" >&2;}
10213    { (exit 1); exit 1; }; }
10214
10215 fi
10216 echo "$as_me:10216: result: $cf_cv_ncurses_h2" >&5
10217 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10218
10219         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10220         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10221         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10222                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10223         fi
10224
10225 if test -n "$cf_1st_incdir" ; then
10226   for cf_add_incdir in $cf_1st_incdir
10227   do
10228         while test $cf_add_incdir != /usr/include
10229         do
10230           if test -d $cf_add_incdir
10231           then
10232                 cf_have_incdir=no
10233                 if test -n "$CFLAGS$CPPFLAGS" ; then
10234                   # a loop is needed to ensure we can add subdirs of existing dirs
10235                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10236                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10237                           cf_have_incdir=yes; break
10238                         fi
10239                   done
10240                 fi
10241
10242                 if test "$cf_have_incdir" = no ; then
10243                   if test "$cf_add_incdir" = /usr/local/include ; then
10244                         if test "$GCC" = yes
10245                         then
10246                           cf_save_CPPFLAGS=$CPPFLAGS
10247
10248         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10249         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10250
10251                           cat >conftest.$ac_ext <<_ACEOF
10252 #line 10252 "configure"
10253 #include "confdefs.h"
10254 #include <stdio.h>
10255 int
10256 main (void)
10257 {
10258 printf("Hello")
10259   ;
10260   return 0;
10261 }
10262 _ACEOF
10263 rm -f conftest.$ac_objext
10264 if { (eval echo "$as_me:10264: \"$ac_compile\"") >&5
10265   (eval $ac_compile) 2>&5
10266   ac_status=$?
10267   echo "$as_me:10267: \$? = $ac_status" >&5
10268   (exit $ac_status); } &&
10269          { ac_try='test -s conftest.$ac_objext'
10270   { (eval echo "$as_me:10270: \"$ac_try\"") >&5
10271   (eval $ac_try) 2>&5
10272   ac_status=$?
10273   echo "$as_me:10273: \$? = $ac_status" >&5
10274   (exit $ac_status); }; }; then
10275   :
10276 else
10277   echo "$as_me: failed program was:" >&5
10278 cat conftest.$ac_ext >&5
10279 cf_have_incdir=yes
10280 fi
10281 rm -f conftest.$ac_objext conftest.$ac_ext
10282                           CPPFLAGS=$cf_save_CPPFLAGS
10283                         fi
10284                   fi
10285                 fi
10286
10287                 if test "$cf_have_incdir" = no ; then
10288                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10289
10290 echo "${as_me:-configure}:10290: testing adding $cf_add_incdir to include-path ..." 1>&5
10291
10292                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10293
10294                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10295                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10296                   cf_add_incdir="$cf_top_incdir"
10297                 else
10298                   break
10299                 fi
10300           else
10301                 break
10302           fi
10303         done
10304   done
10305 fi
10306
10307 fi
10308
10309 # Set definitions to allow ifdef'ing for ncurses.h
10310
10311 case $cf_cv_ncurses_header in
10312 (*ncurses.h)
10313
10314 cat >>confdefs.h <<\EOF
10315 #define HAVE_NCURSES_H 1
10316 EOF
10317
10318         ;;
10319 esac
10320
10321 case $cf_cv_ncurses_header in
10322 (ncurses/curses.h|ncurses/ncurses.h)
10323
10324 cat >>confdefs.h <<\EOF
10325 #define HAVE_NCURSES_NCURSES_H 1
10326 EOF
10327
10328         ;;
10329 (ncursesw/curses.h|ncursesw/ncurses.h)
10330
10331 cat >>confdefs.h <<\EOF
10332 #define HAVE_NCURSESW_NCURSES_H 1
10333 EOF
10334
10335         ;;
10336 esac
10337
10338 echo "$as_me:10338: checking for terminfo header" >&5
10339 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10340 if test "${cf_cv_term_header+set}" = set; then
10341   echo $ECHO_N "(cached) $ECHO_C" >&6
10342 else
10343
10344 case ${cf_cv_ncurses_header} in
10345 (*/ncurses.h|*/ncursesw.h)
10346         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10347         ;;
10348 (*)
10349         cf_term_header=term.h
10350         ;;
10351 esac
10352
10353 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10354 do
10355 cat >conftest.$ac_ext <<_ACEOF
10356 #line 10356 "configure"
10357 #include "confdefs.h"
10358 #include <stdio.h>
10359 #include <${cf_cv_ncurses_header:-curses.h}>
10360 #include <$cf_test>
10361
10362 int
10363 main (void)
10364 {
10365 int x = auto_left_margin
10366   ;
10367   return 0;
10368 }
10369 _ACEOF
10370 rm -f conftest.$ac_objext
10371 if { (eval echo "$as_me:10371: \"$ac_compile\"") >&5
10372   (eval $ac_compile) 2>&5
10373   ac_status=$?
10374   echo "$as_me:10374: \$? = $ac_status" >&5
10375   (exit $ac_status); } &&
10376          { ac_try='test -s conftest.$ac_objext'
10377   { (eval echo "$as_me:10377: \"$ac_try\"") >&5
10378   (eval $ac_try) 2>&5
10379   ac_status=$?
10380   echo "$as_me:10380: \$? = $ac_status" >&5
10381   (exit $ac_status); }; }; then
10382
10383         cf_cv_term_header="$cf_test"
10384 else
10385   echo "$as_me: failed program was:" >&5
10386 cat conftest.$ac_ext >&5
10387
10388         cf_cv_term_header=unknown
10389
10390 fi
10391 rm -f conftest.$ac_objext conftest.$ac_ext
10392         test "$cf_cv_term_header" != unknown && break
10393 done
10394
10395 fi
10396 echo "$as_me:10396: result: $cf_cv_term_header" >&5
10397 echo "${ECHO_T}$cf_cv_term_header" >&6
10398
10399 # Set definitions to allow ifdef'ing to accommodate subdirectories
10400
10401 case $cf_cv_term_header in
10402 (*term.h)
10403
10404 cat >>confdefs.h <<\EOF
10405 #define HAVE_TERM_H 1
10406 EOF
10407
10408         ;;
10409 esac
10410
10411 case $cf_cv_term_header in
10412 (ncurses/term.h)
10413
10414 cat >>confdefs.h <<\EOF
10415 #define HAVE_NCURSES_TERM_H 1
10416 EOF
10417
10418         ;;
10419 (ncursesw/term.h)
10420
10421 cat >>confdefs.h <<\EOF
10422 #define HAVE_NCURSESW_TERM_H 1
10423 EOF
10424
10425         ;;
10426 esac
10427
10428 # some applications need this, but should check for NCURSES_VERSION
10429
10430 cat >>confdefs.h <<\EOF
10431 #define NCURSES 1
10432 EOF
10433
10434 echo "$as_me:10434: checking for ncurses version" >&5
10435 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10436 if test "${cf_cv_ncurses_version+set}" = set; then
10437   echo $ECHO_N "(cached) $ECHO_C" >&6
10438 else
10439
10440         cf_cv_ncurses_version=no
10441         cf_tempfile=out$$
10442         rm -f $cf_tempfile
10443         if test "$cross_compiling" = yes; then
10444
10445         # This will not work if the preprocessor splits the line after the
10446         # Autoconf token.  The 'unproto' program does that.
10447         cat > conftest.$ac_ext <<EOF
10448 #include <${cf_cv_ncurses_header:-curses.h}>
10449 #undef Autoconf
10450 #ifdef NCURSES_VERSION
10451 Autoconf NCURSES_VERSION
10452 #else
10453 #ifdef __NCURSES_H
10454 Autoconf "old"
10455 #endif
10456 ;
10457 #endif
10458 EOF
10459         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10460         { (eval echo "$as_me:10460: \"$cf_try\"") >&5
10461   (eval $cf_try) 2>&5
10462   ac_status=$?
10463   echo "$as_me:10463: \$? = $ac_status" >&5
10464   (exit $ac_status); }
10465         if test -f conftest.out ; then
10466                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10467                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10468                 rm -f conftest.out
10469         fi
10470
10471 else
10472   cat >conftest.$ac_ext <<_ACEOF
10473 #line 10473 "configure"
10474 #include "confdefs.h"
10475
10476 #include <${cf_cv_ncurses_header:-curses.h}>
10477 #include <stdio.h>
10478 int main(void)
10479 {
10480         FILE *fp = fopen("$cf_tempfile", "w");
10481 #ifdef NCURSES_VERSION
10482 # ifdef NCURSES_VERSION_PATCH
10483         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10484 # else
10485         fprintf(fp, "%s\n", NCURSES_VERSION);
10486 # endif
10487 #else
10488 # ifdef __NCURSES_H
10489         fprintf(fp, "old\n");
10490 # else
10491         make an error
10492 # endif
10493 #endif
10494         ${cf_cv_main_return:-return}(0);
10495 }
10496 _ACEOF
10497 rm -f conftest$ac_exeext
10498 if { (eval echo "$as_me:10498: \"$ac_link\"") >&5
10499   (eval $ac_link) 2>&5
10500   ac_status=$?
10501   echo "$as_me:10501: \$? = $ac_status" >&5
10502   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10503   { (eval echo "$as_me:10503: \"$ac_try\"") >&5
10504   (eval $ac_try) 2>&5
10505   ac_status=$?
10506   echo "$as_me:10506: \$? = $ac_status" >&5
10507   (exit $ac_status); }; }; then
10508
10509         cf_cv_ncurses_version=`cat $cf_tempfile`
10510 else
10511   echo "$as_me: program exited with status $ac_status" >&5
10512 echo "$as_me: failed program was:" >&5
10513 cat conftest.$ac_ext >&5
10514 fi
10515 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10516 fi
10517         rm -f $cf_tempfile
10518
10519 fi
10520 echo "$as_me:10520: result: $cf_cv_ncurses_version" >&5
10521 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10522 test "$cf_cv_ncurses_version" = no ||
10523 cat >>confdefs.h <<\EOF
10524 #define NCURSES 1
10525 EOF
10526
10527 cf_nculib_root=$cf_cv_screen
10528         # This works, except for the special case where we find gpm, but
10529         # ncurses is in a nonstandard location via $LIBS, and we really want
10530         # to link gpm.
10531 cf_ncurses_LIBS=""
10532 cf_ncurses_SAVE="$LIBS"
10533 echo "$as_me:10533: checking for Gpm_Open in -lgpm" >&5
10534 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10535 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10536   echo $ECHO_N "(cached) $ECHO_C" >&6
10537 else
10538   ac_check_lib_save_LIBS=$LIBS
10539 LIBS="-lgpm  $LIBS"
10540 cat >conftest.$ac_ext <<_ACEOF
10541 #line 10541 "configure"
10542 #include "confdefs.h"
10543
10544 /* Override any gcc2 internal prototype to avoid an error.  */
10545 #ifdef __cplusplus
10546 extern "C"
10547 #endif
10548 /* We use char because int might match the return type of a gcc2
10549    builtin and then its argument prototype would still apply.  */
10550 char Gpm_Open ();
10551 int
10552 main (void)
10553 {
10554 Gpm_Open ();
10555   ;
10556   return 0;
10557 }
10558 _ACEOF
10559 rm -f conftest.$ac_objext conftest$ac_exeext
10560 if { (eval echo "$as_me:10560: \"$ac_link\"") >&5
10561   (eval $ac_link) 2>&5
10562   ac_status=$?
10563   echo "$as_me:10563: \$? = $ac_status" >&5
10564   (exit $ac_status); } &&
10565          { ac_try='test -s conftest$ac_exeext'
10566   { (eval echo "$as_me:10566: \"$ac_try\"") >&5
10567   (eval $ac_try) 2>&5
10568   ac_status=$?
10569   echo "$as_me:10569: \$? = $ac_status" >&5
10570   (exit $ac_status); }; }; then
10571   ac_cv_lib_gpm_Gpm_Open=yes
10572 else
10573   echo "$as_me: failed program was:" >&5
10574 cat conftest.$ac_ext >&5
10575 ac_cv_lib_gpm_Gpm_Open=no
10576 fi
10577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10578 LIBS=$ac_check_lib_save_LIBS
10579 fi
10580 echo "$as_me:10580: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10581 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10582 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10583   echo "$as_me:10583: checking for initscr in -lgpm" >&5
10584 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10585 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10586   echo $ECHO_N "(cached) $ECHO_C" >&6
10587 else
10588   ac_check_lib_save_LIBS=$LIBS
10589 LIBS="-lgpm  $LIBS"
10590 cat >conftest.$ac_ext <<_ACEOF
10591 #line 10591 "configure"
10592 #include "confdefs.h"
10593
10594 /* Override any gcc2 internal prototype to avoid an error.  */
10595 #ifdef __cplusplus
10596 extern "C"
10597 #endif
10598 /* We use char because int might match the return type of a gcc2
10599    builtin and then its argument prototype would still apply.  */
10600 char initscr ();
10601 int
10602 main (void)
10603 {
10604 initscr ();
10605   ;
10606   return 0;
10607 }
10608 _ACEOF
10609 rm -f conftest.$ac_objext conftest$ac_exeext
10610 if { (eval echo "$as_me:10610: \"$ac_link\"") >&5
10611   (eval $ac_link) 2>&5
10612   ac_status=$?
10613   echo "$as_me:10613: \$? = $ac_status" >&5
10614   (exit $ac_status); } &&
10615          { ac_try='test -s conftest$ac_exeext'
10616   { (eval echo "$as_me:10616: \"$ac_try\"") >&5
10617   (eval $ac_try) 2>&5
10618   ac_status=$?
10619   echo "$as_me:10619: \$? = $ac_status" >&5
10620   (exit $ac_status); }; }; then
10621   ac_cv_lib_gpm_initscr=yes
10622 else
10623   echo "$as_me: failed program was:" >&5
10624 cat conftest.$ac_ext >&5
10625 ac_cv_lib_gpm_initscr=no
10626 fi
10627 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10628 LIBS=$ac_check_lib_save_LIBS
10629 fi
10630 echo "$as_me:10630: result: $ac_cv_lib_gpm_initscr" >&5
10631 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10632 if test $ac_cv_lib_gpm_initscr = yes; then
10633   LIBS="$cf_ncurses_SAVE"
10634 else
10635   cf_ncurses_LIBS="-lgpm"
10636 fi
10637
10638 fi
10639
10640 case $host_os in
10641 (freebsd*)
10642         # This is only necessary if you are linking against an obsolete
10643         # version of ncurses (but it should do no harm, since it's static).
10644         if test "$cf_nculib_root" = ncurses ; then
10645                 echo "$as_me:10645: checking for tgoto in -lmytinfo" >&5
10646 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10647 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10648   echo $ECHO_N "(cached) $ECHO_C" >&6
10649 else
10650   ac_check_lib_save_LIBS=$LIBS
10651 LIBS="-lmytinfo  $LIBS"
10652 cat >conftest.$ac_ext <<_ACEOF
10653 #line 10653 "configure"
10654 #include "confdefs.h"
10655
10656 /* Override any gcc2 internal prototype to avoid an error.  */
10657 #ifdef __cplusplus
10658 extern "C"
10659 #endif
10660 /* We use char because int might match the return type of a gcc2
10661    builtin and then its argument prototype would still apply.  */
10662 char tgoto ();
10663 int
10664 main (void)
10665 {
10666 tgoto ();
10667   ;
10668   return 0;
10669 }
10670 _ACEOF
10671 rm -f conftest.$ac_objext conftest$ac_exeext
10672 if { (eval echo "$as_me:10672: \"$ac_link\"") >&5
10673   (eval $ac_link) 2>&5
10674   ac_status=$?
10675   echo "$as_me:10675: \$? = $ac_status" >&5
10676   (exit $ac_status); } &&
10677          { ac_try='test -s conftest$ac_exeext'
10678   { (eval echo "$as_me:10678: \"$ac_try\"") >&5
10679   (eval $ac_try) 2>&5
10680   ac_status=$?
10681   echo "$as_me:10681: \$? = $ac_status" >&5
10682   (exit $ac_status); }; }; then
10683   ac_cv_lib_mytinfo_tgoto=yes
10684 else
10685   echo "$as_me: failed program was:" >&5
10686 cat conftest.$ac_ext >&5
10687 ac_cv_lib_mytinfo_tgoto=no
10688 fi
10689 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10690 LIBS=$ac_check_lib_save_LIBS
10691 fi
10692 echo "$as_me:10692: result: $ac_cv_lib_mytinfo_tgoto" >&5
10693 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10694 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10695   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10696 fi
10697
10698         fi
10699         ;;
10700 esac
10701
10702 cf_add_libs="$cf_ncurses_LIBS"
10703 # Filter out duplicates - this happens with badly-designed ".pc" files...
10704 for cf_add_1lib in $LIBS
10705 do
10706         for cf_add_2lib in $cf_add_libs
10707         do
10708                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10709                 then
10710                         cf_add_1lib=
10711                         break
10712                 fi
10713         done
10714         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10715 done
10716 LIBS="$cf_add_libs"
10717
10718 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10719 then
10720
10721 cf_add_libs="-l$cf_nculib_root"
10722 # Filter out duplicates - this happens with badly-designed ".pc" files...
10723 for cf_add_1lib in $LIBS
10724 do
10725         for cf_add_2lib in $cf_add_libs
10726         do
10727                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10728                 then
10729                         cf_add_1lib=
10730                         break
10731                 fi
10732         done
10733         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10734 done
10735 LIBS="$cf_add_libs"
10736
10737 else
10738
10739         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10740         cf_libdir=""
10741         echo "$as_me:10741: checking for initscr" >&5
10742 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10743 if test "${ac_cv_func_initscr+set}" = set; then
10744   echo $ECHO_N "(cached) $ECHO_C" >&6
10745 else
10746   cat >conftest.$ac_ext <<_ACEOF
10747 #line 10747 "configure"
10748 #include "confdefs.h"
10749 /* System header to define __stub macros and hopefully few prototypes,
10750     which can conflict with char initscr (); below.  */
10751 #include <assert.h>
10752 /* Override any gcc2 internal prototype to avoid an error.  */
10753 #ifdef __cplusplus
10754 extern "C"
10755 #endif
10756 /* We use char because int might match the return type of a gcc2
10757    builtin and then its argument prototype would still apply.  */
10758 char initscr ();
10759 char (*f) ();
10760
10761 int
10762 main (void)
10763 {
10764 /* The GNU C library defines this for functions which it implements
10765     to always fail with ENOSYS.  Some functions are actually named
10766     something starting with __ and the normal name is an alias.  */
10767 #if defined (__stub_initscr) || defined (__stub___initscr)
10768 choke me
10769 #else
10770 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10771 #endif
10772
10773   ;
10774   return 0;
10775 }
10776 _ACEOF
10777 rm -f conftest.$ac_objext conftest$ac_exeext
10778 if { (eval echo "$as_me:10778: \"$ac_link\"") >&5
10779   (eval $ac_link) 2>&5
10780   ac_status=$?
10781   echo "$as_me:10781: \$? = $ac_status" >&5
10782   (exit $ac_status); } &&
10783          { ac_try='test -s conftest$ac_exeext'
10784   { (eval echo "$as_me:10784: \"$ac_try\"") >&5
10785   (eval $ac_try) 2>&5
10786   ac_status=$?
10787   echo "$as_me:10787: \$? = $ac_status" >&5
10788   (exit $ac_status); }; }; then
10789   ac_cv_func_initscr=yes
10790 else
10791   echo "$as_me: failed program was:" >&5
10792 cat conftest.$ac_ext >&5
10793 ac_cv_func_initscr=no
10794 fi
10795 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10796 fi
10797 echo "$as_me:10797: result: $ac_cv_func_initscr" >&5
10798 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10799 if test $ac_cv_func_initscr = yes; then
10800   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10801 else
10802
10803                 cf_save_LIBS="$LIBS"
10804                 echo "$as_me:10804: checking for initscr in -l$cf_nculib_root" >&5
10805 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10806                 LIBS="-l$cf_nculib_root $LIBS"
10807                 cat >conftest.$ac_ext <<_ACEOF
10808 #line 10808 "configure"
10809 #include "confdefs.h"
10810 #include <${cf_cv_ncurses_header:-curses.h}>
10811 int
10812 main (void)
10813 {
10814 initscr()
10815   ;
10816   return 0;
10817 }
10818 _ACEOF
10819 rm -f conftest.$ac_objext conftest$ac_exeext
10820 if { (eval echo "$as_me:10820: \"$ac_link\"") >&5
10821   (eval $ac_link) 2>&5
10822   ac_status=$?
10823   echo "$as_me:10823: \$? = $ac_status" >&5
10824   (exit $ac_status); } &&
10825          { ac_try='test -s conftest$ac_exeext'
10826   { (eval echo "$as_me:10826: \"$ac_try\"") >&5
10827   (eval $ac_try) 2>&5
10828   ac_status=$?
10829   echo "$as_me:10829: \$? = $ac_status" >&5
10830   (exit $ac_status); }; }; then
10831   echo "$as_me:10831: result: yes" >&5
10832 echo "${ECHO_T}yes" >&6
10833                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10834
10835 else
10836   echo "$as_me: failed program was:" >&5
10837 cat conftest.$ac_ext >&5
10838 echo "$as_me:10838: result: no" >&5
10839 echo "${ECHO_T}no" >&6
10840
10841 cf_search=
10842 cf_library_path_list=""
10843 if test -n "${LDFLAGS}${LIBS}" ; then
10844         for cf_library_path in $LDFLAGS $LIBS
10845         do
10846                 case $cf_library_path in
10847                 (-L*)
10848                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10849
10850 test "x$cf_library_path" != "xNONE" && \
10851 test -d "$cf_library_path" && \
10852  {
10853         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10854         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10855         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10856         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10857         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10858         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"
10859 }
10860
10861                         cf_library_path_list="$cf_library_path_list $cf_search"
10862                         ;;
10863                 esac
10864         done
10865 fi
10866
10867 cf_search=
10868
10869 test "x$prefix" != "xNONE" && \
10870 test -d "$prefix" && \
10871  {
10872         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10873         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10874         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10875         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10876         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10877         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10878 }
10879
10880 for cf_subdir_prefix in \
10881         /usr \
10882         /usr/local \
10883         /usr/pkg \
10884         /opt \
10885         /opt/local \
10886         $HOME
10887 do
10888
10889 test "x$cf_subdir_prefix" != "x$prefix" && \
10890 test -d "$cf_subdir_prefix" && \
10891 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10892         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10893         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10894         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10895         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10896         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10897         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"
10898 }
10899
10900 done
10901
10902 cf_search="$cf_library_path_list $cf_search"
10903
10904                         for cf_libdir in $cf_search
10905                         do
10906                                 echo "$as_me:10906: checking for -l$cf_nculib_root in $cf_libdir" >&5
10907 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10908                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10909                                 cat >conftest.$ac_ext <<_ACEOF
10910 #line 10910 "configure"
10911 #include "confdefs.h"
10912 #include <${cf_cv_ncurses_header:-curses.h}>
10913 int
10914 main (void)
10915 {
10916 initscr()
10917   ;
10918   return 0;
10919 }
10920 _ACEOF
10921 rm -f conftest.$ac_objext conftest$ac_exeext
10922 if { (eval echo "$as_me:10922: \"$ac_link\"") >&5
10923   (eval $ac_link) 2>&5
10924   ac_status=$?
10925   echo "$as_me:10925: \$? = $ac_status" >&5
10926   (exit $ac_status); } &&
10927          { ac_try='test -s conftest$ac_exeext'
10928   { (eval echo "$as_me:10928: \"$ac_try\"") >&5
10929   (eval $ac_try) 2>&5
10930   ac_status=$?
10931   echo "$as_me:10931: \$? = $ac_status" >&5
10932   (exit $ac_status); }; }; then
10933   echo "$as_me:10933: result: yes" >&5
10934 echo "${ECHO_T}yes" >&6
10935                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10936                                          break
10937 else
10938   echo "$as_me: failed program was:" >&5
10939 cat conftest.$ac_ext >&5
10940 echo "$as_me:10940: result: no" >&5
10941 echo "${ECHO_T}no" >&6
10942                                          LIBS="$cf_save_LIBS"
10943 fi
10944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10945                         done
10946
10947 fi
10948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10949
10950 fi
10951
10952 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10953
10954 if test $cf_found_library = no ; then
10955         { { echo "$as_me:10955: error: Cannot link $cf_nculib_root library" >&5
10956 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10957    { (exit 1); exit 1; }; }
10958 fi
10959
10960 fi
10961
10962 if test -n "$cf_ncurses_LIBS" ; then
10963         echo "$as_me:10963: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10964 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10965         cf_ncurses_SAVE="$LIBS"
10966         for p in $cf_ncurses_LIBS ; do
10967                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10968                 if test "$q" != "$LIBS" ; then
10969                         LIBS="$q"
10970                 fi
10971         done
10972         cat >conftest.$ac_ext <<_ACEOF
10973 #line 10973 "configure"
10974 #include "confdefs.h"
10975 #include <${cf_cv_ncurses_header:-curses.h}>
10976 int
10977 main (void)
10978 {
10979 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10980   ;
10981   return 0;
10982 }
10983 _ACEOF
10984 rm -f conftest.$ac_objext conftest$ac_exeext
10985 if { (eval echo "$as_me:10985: \"$ac_link\"") >&5
10986   (eval $ac_link) 2>&5
10987   ac_status=$?
10988   echo "$as_me:10988: \$? = $ac_status" >&5
10989   (exit $ac_status); } &&
10990          { ac_try='test -s conftest$ac_exeext'
10991   { (eval echo "$as_me:10991: \"$ac_try\"") >&5
10992   (eval $ac_try) 2>&5
10993   ac_status=$?
10994   echo "$as_me:10994: \$? = $ac_status" >&5
10995   (exit $ac_status); }; }; then
10996   echo "$as_me:10996: result: yes" >&5
10997 echo "${ECHO_T}yes" >&6
10998 else
10999   echo "$as_me: failed program was:" >&5
11000 cat conftest.$ac_ext >&5
11001 echo "$as_me:11001: result: no" >&5
11002 echo "${ECHO_T}no" >&6
11003                  LIBS="$cf_ncurses_SAVE"
11004 fi
11005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11006 fi
11007
11008 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11009
11010 cat >>confdefs.h <<EOF
11011 #define $cf_nculib_ROOT 1
11012 EOF
11013
11014         fi
11015 else
11016         NCURSES_CONFIG=none
11017 fi
11018
11019         ;;
11020 (pdcurses)
11021         echo "$as_me:11021: checking for X" >&5
11022 echo $ECHO_N "checking for X... $ECHO_C" >&6
11023
11024 # Check whether --with-x or --without-x was given.
11025 if test "${with_x+set}" = set; then
11026   withval="$with_x"
11027
11028 fi;
11029 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
11030 if test "x$with_x" = xno; then
11031   # The user explicitly disabled X.
11032   have_x=disabled
11033 else
11034   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
11035     # Both variables are already set.
11036     have_x=yes
11037   else
11038     if test "${ac_cv_have_x+set}" = set; then
11039   echo $ECHO_N "(cached) $ECHO_C" >&6
11040 else
11041   # One or both of the vars are not set, and there is no cached value.
11042 ac_x_includes=no ac_x_libraries=no
11043 rm -fr conftest.dir
11044 if mkdir conftest.dir; then
11045   cd conftest.dir
11046   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
11047   cat >Imakefile <<'EOF'
11048 acfindx:
11049         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
11050 EOF
11051   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
11052     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
11053     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
11054     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
11055     for ac_extension in a so sl dylib dll; do
11056       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
11057          test -f $ac_im_libdir/libX11.$ac_extension; then
11058         ac_im_usrlibdir=$ac_im_libdir; break
11059       fi
11060     done
11061     # Screen out bogus values from the imake configuration.  They are
11062     # bogus both because they are the default anyway, and because
11063     # using them would break gcc on systems where it needs fixed includes.
11064     case $ac_im_incroot in
11065         /usr/include) ;;
11066         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
11067     esac
11068     case $ac_im_usrlibdir in
11069         /usr/lib | /lib) ;;
11070         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
11071     esac
11072   fi
11073   cd ..
11074   rm -fr conftest.dir
11075 fi
11076
11077 # Standard set of common directories for X headers.
11078 # Check X11 before X11Rn because it is often a symlink to the current release.
11079 ac_x_header_dirs='
11080 /usr/X11/include
11081 /usr/X11R6/include
11082 /usr/X11R5/include
11083 /usr/X11R4/include
11084
11085 /usr/include/X11
11086 /usr/include/X11R6
11087 /usr/include/X11R5
11088 /usr/include/X11R4
11089
11090 /usr/local/X11/include
11091 /usr/local/X11R6/include
11092 /usr/local/X11R5/include
11093 /usr/local/X11R4/include
11094
11095 /usr/local/include/X11
11096 /usr/local/include/X11R6
11097 /usr/local/include/X11R5
11098 /usr/local/include/X11R4
11099
11100 /usr/X386/include
11101 /usr/x386/include
11102 /usr/XFree86/include/X11
11103
11104 /usr/include
11105 /usr/local/include
11106 /usr/unsupported/include
11107 /usr/athena/include
11108 /usr/local/x11r5/include
11109 /usr/lpp/Xamples/include
11110
11111 /usr/openwin/include
11112 /usr/openwin/share/include'
11113
11114 if test "$ac_x_includes" = no; then
11115   # Guess where to find include files, by looking for Intrinsic.h.
11116   # First, try using that file with no special directory specified.
11117   cat >conftest.$ac_ext <<_ACEOF
11118 #line 11118 "configure"
11119 #include "confdefs.h"
11120 #include <X11/Intrinsic.h>
11121 _ACEOF
11122 if { (eval echo "$as_me:11122: \"$ac_cpp conftest.$ac_ext\"") >&5
11123   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
11124   ac_status=$?
11125   egrep -v '^ *\+' conftest.er1 >conftest.err
11126   rm -f conftest.er1
11127   cat conftest.err >&5
11128   echo "$as_me:11128: \$? = $ac_status" >&5
11129   (exit $ac_status); } >/dev/null; then
11130   if test -s conftest.err; then
11131     ac_cpp_err=$ac_c_preproc_warn_flag
11132   else
11133     ac_cpp_err=
11134   fi
11135 else
11136   ac_cpp_err=yes
11137 fi
11138 if test -z "$ac_cpp_err"; then
11139   # We can compile using X headers with no special include directory.
11140 ac_x_includes=
11141 else
11142   echo "$as_me: failed program was:" >&5
11143   cat conftest.$ac_ext >&5
11144   for ac_dir in $ac_x_header_dirs; do
11145   if test -r "$ac_dir/X11/Intrinsic.h"; then
11146     ac_x_includes=$ac_dir
11147     break
11148   fi
11149 done
11150 fi
11151 rm -f conftest.err conftest.$ac_ext
11152 fi # $ac_x_includes = no
11153
11154 if test "$ac_x_libraries" = no; then
11155   # Check for the libraries.
11156   # See if we find them without any special options.
11157   # Don't add to $LIBS permanently.
11158   ac_save_LIBS=$LIBS
11159   LIBS="-lXt $LIBS"
11160   cat >conftest.$ac_ext <<_ACEOF
11161 #line 11161 "configure"
11162 #include "confdefs.h"
11163 #include <X11/Intrinsic.h>
11164 int
11165 main (void)
11166 {
11167 XtMalloc (0)
11168   ;
11169   return 0;
11170 }
11171 _ACEOF
11172 rm -f conftest.$ac_objext conftest$ac_exeext
11173 if { (eval echo "$as_me:11173: \"$ac_link\"") >&5
11174   (eval $ac_link) 2>&5
11175   ac_status=$?
11176   echo "$as_me:11176: \$? = $ac_status" >&5
11177   (exit $ac_status); } &&
11178          { ac_try='test -s conftest$ac_exeext'
11179   { (eval echo "$as_me:11179: \"$ac_try\"") >&5
11180   (eval $ac_try) 2>&5
11181   ac_status=$?
11182   echo "$as_me:11182: \$? = $ac_status" >&5
11183   (exit $ac_status); }; }; then
11184   LIBS=$ac_save_LIBS
11185 # We can link X programs with no special library path.
11186 ac_x_libraries=
11187 else
11188   echo "$as_me: failed program was:" >&5
11189 cat conftest.$ac_ext >&5
11190 LIBS=$ac_save_LIBS
11191 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11192 do
11193   # Don't even attempt the hair of trying to link an X program!
11194   for ac_extension in a so sl dylib dll; do
11195     if test -r $ac_dir/libXt.$ac_extension; then
11196       ac_x_libraries=$ac_dir
11197       break 2
11198     fi
11199   done
11200 done
11201 fi
11202 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11203 fi # $ac_x_libraries = no
11204
11205 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11206   # Didn't find X anywhere.  Cache the known absence of X.
11207   ac_cv_have_x="have_x=no"
11208 else
11209   # Record where we found X for the cache.
11210   ac_cv_have_x="have_x=yes \
11211                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11212 fi
11213 fi
11214
11215   fi
11216   eval "$ac_cv_have_x"
11217 fi # $with_x != no
11218
11219 if test "$have_x" != yes; then
11220   echo "$as_me:11220: result: $have_x" >&5
11221 echo "${ECHO_T}$have_x" >&6
11222   no_x=yes
11223 else
11224   # If each of the values was on the command line, it overrides each guess.
11225   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11226   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11227   # Update the cache value to reflect the command line values.
11228   ac_cv_have_x="have_x=yes \
11229                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11230   echo "$as_me:11230: result: libraries $x_libraries, headers $x_includes" >&5
11231 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11232 fi
11233
11234 if test "$no_x" = yes; then
11235   # Not all programs may use this symbol, but it does not hurt to define it.
11236
11237 cat >>confdefs.h <<\EOF
11238 #define X_DISPLAY_MISSING 1
11239 EOF
11240
11241   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11242 else
11243   if test -n "$x_includes"; then
11244     X_CFLAGS="$X_CFLAGS -I$x_includes"
11245   fi
11246
11247   # It would also be nice to do this for all -L options, not just this one.
11248   if test -n "$x_libraries"; then
11249     X_LIBS="$X_LIBS -L$x_libraries"
11250     # For Solaris; some versions of Sun CC require a space after -R and
11251     # others require no space.  Words are not sufficient . . . .
11252     case `(uname -sr) 2>/dev/null` in
11253     "SunOS 5"*)
11254       echo "$as_me:11254: checking whether -R must be followed by a space" >&5
11255 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11256       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11257       cat >conftest.$ac_ext <<_ACEOF
11258 #line 11258 "configure"
11259 #include "confdefs.h"
11260
11261 int
11262 main (void)
11263 {
11264
11265   ;
11266   return 0;
11267 }
11268 _ACEOF
11269 rm -f conftest.$ac_objext conftest$ac_exeext
11270 if { (eval echo "$as_me:11270: \"$ac_link\"") >&5
11271   (eval $ac_link) 2>&5
11272   ac_status=$?
11273   echo "$as_me:11273: \$? = $ac_status" >&5
11274   (exit $ac_status); } &&
11275          { ac_try='test -s conftest$ac_exeext'
11276   { (eval echo "$as_me:11276: \"$ac_try\"") >&5
11277   (eval $ac_try) 2>&5
11278   ac_status=$?
11279   echo "$as_me:11279: \$? = $ac_status" >&5
11280   (exit $ac_status); }; }; then
11281   ac_R_nospace=yes
11282 else
11283   echo "$as_me: failed program was:" >&5
11284 cat conftest.$ac_ext >&5
11285 ac_R_nospace=no
11286 fi
11287 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11288       if test $ac_R_nospace = yes; then
11289         echo "$as_me:11289: result: no" >&5
11290 echo "${ECHO_T}no" >&6
11291         X_LIBS="$X_LIBS -R$x_libraries"
11292       else
11293         LIBS="$ac_xsave_LIBS -R $x_libraries"
11294         cat >conftest.$ac_ext <<_ACEOF
11295 #line 11295 "configure"
11296 #include "confdefs.h"
11297
11298 int
11299 main (void)
11300 {
11301
11302   ;
11303   return 0;
11304 }
11305 _ACEOF
11306 rm -f conftest.$ac_objext conftest$ac_exeext
11307 if { (eval echo "$as_me:11307: \"$ac_link\"") >&5
11308   (eval $ac_link) 2>&5
11309   ac_status=$?
11310   echo "$as_me:11310: \$? = $ac_status" >&5
11311   (exit $ac_status); } &&
11312          { ac_try='test -s conftest$ac_exeext'
11313   { (eval echo "$as_me:11313: \"$ac_try\"") >&5
11314   (eval $ac_try) 2>&5
11315   ac_status=$?
11316   echo "$as_me:11316: \$? = $ac_status" >&5
11317   (exit $ac_status); }; }; then
11318   ac_R_space=yes
11319 else
11320   echo "$as_me: failed program was:" >&5
11321 cat conftest.$ac_ext >&5
11322 ac_R_space=no
11323 fi
11324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11325         if test $ac_R_space = yes; then
11326           echo "$as_me:11326: result: yes" >&5
11327 echo "${ECHO_T}yes" >&6
11328           X_LIBS="$X_LIBS -R $x_libraries"
11329         else
11330           echo "$as_me:11330: result: neither works" >&5
11331 echo "${ECHO_T}neither works" >&6
11332         fi
11333       fi
11334       LIBS=$ac_xsave_LIBS
11335     esac
11336   fi
11337
11338   # Check for system-dependent libraries X programs must link with.
11339   # Do this before checking for the system-independent R6 libraries
11340   # (-lICE), since we may need -lsocket or whatever for X linking.
11341
11342   if test "$ISC" = yes; then
11343     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11344   else
11345     # Martyn Johnson says this is needed for Ultrix, if the X
11346     # libraries were built with DECnet support.  And Karl Berry says
11347     # the Alpha needs dnet_stub (dnet does not exist).
11348     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11349     cat >conftest.$ac_ext <<_ACEOF
11350 #line 11350 "configure"
11351 #include "confdefs.h"
11352
11353 /* Override any gcc2 internal prototype to avoid an error.  */
11354 #ifdef __cplusplus
11355 extern "C"
11356 #endif
11357 /* We use char because int might match the return type of a gcc2
11358    builtin and then its argument prototype would still apply.  */
11359 char XOpenDisplay ();
11360 int
11361 main (void)
11362 {
11363 XOpenDisplay ();
11364   ;
11365   return 0;
11366 }
11367 _ACEOF
11368 rm -f conftest.$ac_objext conftest$ac_exeext
11369 if { (eval echo "$as_me:11369: \"$ac_link\"") >&5
11370   (eval $ac_link) 2>&5
11371   ac_status=$?
11372   echo "$as_me:11372: \$? = $ac_status" >&5
11373   (exit $ac_status); } &&
11374          { ac_try='test -s conftest$ac_exeext'
11375   { (eval echo "$as_me:11375: \"$ac_try\"") >&5
11376   (eval $ac_try) 2>&5
11377   ac_status=$?
11378   echo "$as_me:11378: \$? = $ac_status" >&5
11379   (exit $ac_status); }; }; then
11380   :
11381 else
11382   echo "$as_me: failed program was:" >&5
11383 cat conftest.$ac_ext >&5
11384 echo "$as_me:11384: checking for dnet_ntoa in -ldnet" >&5
11385 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11386 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11387   echo $ECHO_N "(cached) $ECHO_C" >&6
11388 else
11389   ac_check_lib_save_LIBS=$LIBS
11390 LIBS="-ldnet  $LIBS"
11391 cat >conftest.$ac_ext <<_ACEOF
11392 #line 11392 "configure"
11393 #include "confdefs.h"
11394
11395 /* Override any gcc2 internal prototype to avoid an error.  */
11396 #ifdef __cplusplus
11397 extern "C"
11398 #endif
11399 /* We use char because int might match the return type of a gcc2
11400    builtin and then its argument prototype would still apply.  */
11401 char dnet_ntoa ();
11402 int
11403 main (void)
11404 {
11405 dnet_ntoa ();
11406   ;
11407   return 0;
11408 }
11409 _ACEOF
11410 rm -f conftest.$ac_objext conftest$ac_exeext
11411 if { (eval echo "$as_me:11411: \"$ac_link\"") >&5
11412   (eval $ac_link) 2>&5
11413   ac_status=$?
11414   echo "$as_me:11414: \$? = $ac_status" >&5
11415   (exit $ac_status); } &&
11416          { ac_try='test -s conftest$ac_exeext'
11417   { (eval echo "$as_me:11417: \"$ac_try\"") >&5
11418   (eval $ac_try) 2>&5
11419   ac_status=$?
11420   echo "$as_me:11420: \$? = $ac_status" >&5
11421   (exit $ac_status); }; }; then
11422   ac_cv_lib_dnet_dnet_ntoa=yes
11423 else
11424   echo "$as_me: failed program was:" >&5
11425 cat conftest.$ac_ext >&5
11426 ac_cv_lib_dnet_dnet_ntoa=no
11427 fi
11428 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11429 LIBS=$ac_check_lib_save_LIBS
11430 fi
11431 echo "$as_me:11431: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11432 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11433 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11434   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11435 fi
11436
11437     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11438       echo "$as_me:11438: checking for dnet_ntoa in -ldnet_stub" >&5
11439 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11440 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11441   echo $ECHO_N "(cached) $ECHO_C" >&6
11442 else
11443   ac_check_lib_save_LIBS=$LIBS
11444 LIBS="-ldnet_stub  $LIBS"
11445 cat >conftest.$ac_ext <<_ACEOF
11446 #line 11446 "configure"
11447 #include "confdefs.h"
11448
11449 /* Override any gcc2 internal prototype to avoid an error.  */
11450 #ifdef __cplusplus
11451 extern "C"
11452 #endif
11453 /* We use char because int might match the return type of a gcc2
11454    builtin and then its argument prototype would still apply.  */
11455 char dnet_ntoa ();
11456 int
11457 main (void)
11458 {
11459 dnet_ntoa ();
11460   ;
11461   return 0;
11462 }
11463 _ACEOF
11464 rm -f conftest.$ac_objext conftest$ac_exeext
11465 if { (eval echo "$as_me:11465: \"$ac_link\"") >&5
11466   (eval $ac_link) 2>&5
11467   ac_status=$?
11468   echo "$as_me:11468: \$? = $ac_status" >&5
11469   (exit $ac_status); } &&
11470          { ac_try='test -s conftest$ac_exeext'
11471   { (eval echo "$as_me:11471: \"$ac_try\"") >&5
11472   (eval $ac_try) 2>&5
11473   ac_status=$?
11474   echo "$as_me:11474: \$? = $ac_status" >&5
11475   (exit $ac_status); }; }; then
11476   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11477 else
11478   echo "$as_me: failed program was:" >&5
11479 cat conftest.$ac_ext >&5
11480 ac_cv_lib_dnet_stub_dnet_ntoa=no
11481 fi
11482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11483 LIBS=$ac_check_lib_save_LIBS
11484 fi
11485 echo "$as_me:11485: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11486 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11487 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11488   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11489 fi
11490
11491     fi
11492 fi
11493 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11494     LIBS="$ac_xsave_LIBS"
11495
11496     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11497     # to get the SysV transport functions.
11498     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11499     # needs -lnsl.
11500     # The nsl library prevents programs from opening the X display
11501     # on Irix 5.2, according to T.E. Dickey.
11502     # The functions gethostbyname, getservbyname, and inet_addr are
11503     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11504     echo "$as_me:11504: checking for gethostbyname" >&5
11505 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11506 if test "${ac_cv_func_gethostbyname+set}" = set; then
11507   echo $ECHO_N "(cached) $ECHO_C" >&6
11508 else
11509   cat >conftest.$ac_ext <<_ACEOF
11510 #line 11510 "configure"
11511 #include "confdefs.h"
11512 /* System header to define __stub macros and hopefully few prototypes,
11513     which can conflict with char gethostbyname (); below.  */
11514 #include <assert.h>
11515 /* Override any gcc2 internal prototype to avoid an error.  */
11516 #ifdef __cplusplus
11517 extern "C"
11518 #endif
11519 /* We use char because int might match the return type of a gcc2
11520    builtin and then its argument prototype would still apply.  */
11521 char gethostbyname ();
11522 char (*f) ();
11523
11524 int
11525 main (void)
11526 {
11527 /* The GNU C library defines this for functions which it implements
11528     to always fail with ENOSYS.  Some functions are actually named
11529     something starting with __ and the normal name is an alias.  */
11530 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11531 choke me
11532 #else
11533 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11534 #endif
11535
11536   ;
11537   return 0;
11538 }
11539 _ACEOF
11540 rm -f conftest.$ac_objext conftest$ac_exeext
11541 if { (eval echo "$as_me:11541: \"$ac_link\"") >&5
11542   (eval $ac_link) 2>&5
11543   ac_status=$?
11544   echo "$as_me:11544: \$? = $ac_status" >&5
11545   (exit $ac_status); } &&
11546          { ac_try='test -s conftest$ac_exeext'
11547   { (eval echo "$as_me:11547: \"$ac_try\"") >&5
11548   (eval $ac_try) 2>&5
11549   ac_status=$?
11550   echo "$as_me:11550: \$? = $ac_status" >&5
11551   (exit $ac_status); }; }; then
11552   ac_cv_func_gethostbyname=yes
11553 else
11554   echo "$as_me: failed program was:" >&5
11555 cat conftest.$ac_ext >&5
11556 ac_cv_func_gethostbyname=no
11557 fi
11558 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11559 fi
11560 echo "$as_me:11560: result: $ac_cv_func_gethostbyname" >&5
11561 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11562
11563     if test $ac_cv_func_gethostbyname = no; then
11564       echo "$as_me:11564: checking for gethostbyname in -lnsl" >&5
11565 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11566 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11567   echo $ECHO_N "(cached) $ECHO_C" >&6
11568 else
11569   ac_check_lib_save_LIBS=$LIBS
11570 LIBS="-lnsl  $LIBS"
11571 cat >conftest.$ac_ext <<_ACEOF
11572 #line 11572 "configure"
11573 #include "confdefs.h"
11574
11575 /* Override any gcc2 internal prototype to avoid an error.  */
11576 #ifdef __cplusplus
11577 extern "C"
11578 #endif
11579 /* We use char because int might match the return type of a gcc2
11580    builtin and then its argument prototype would still apply.  */
11581 char gethostbyname ();
11582 int
11583 main (void)
11584 {
11585 gethostbyname ();
11586   ;
11587   return 0;
11588 }
11589 _ACEOF
11590 rm -f conftest.$ac_objext conftest$ac_exeext
11591 if { (eval echo "$as_me:11591: \"$ac_link\"") >&5
11592   (eval $ac_link) 2>&5
11593   ac_status=$?
11594   echo "$as_me:11594: \$? = $ac_status" >&5
11595   (exit $ac_status); } &&
11596          { ac_try='test -s conftest$ac_exeext'
11597   { (eval echo "$as_me:11597: \"$ac_try\"") >&5
11598   (eval $ac_try) 2>&5
11599   ac_status=$?
11600   echo "$as_me:11600: \$? = $ac_status" >&5
11601   (exit $ac_status); }; }; then
11602   ac_cv_lib_nsl_gethostbyname=yes
11603 else
11604   echo "$as_me: failed program was:" >&5
11605 cat conftest.$ac_ext >&5
11606 ac_cv_lib_nsl_gethostbyname=no
11607 fi
11608 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11609 LIBS=$ac_check_lib_save_LIBS
11610 fi
11611 echo "$as_me:11611: result: $ac_cv_lib_nsl_gethostbyname" >&5
11612 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11613 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11614   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11615 fi
11616
11617       if test $ac_cv_lib_nsl_gethostbyname = no; then
11618         echo "$as_me:11618: checking for gethostbyname in -lbsd" >&5
11619 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11620 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11621   echo $ECHO_N "(cached) $ECHO_C" >&6
11622 else
11623   ac_check_lib_save_LIBS=$LIBS
11624 LIBS="-lbsd  $LIBS"
11625 cat >conftest.$ac_ext <<_ACEOF
11626 #line 11626 "configure"
11627 #include "confdefs.h"
11628
11629 /* Override any gcc2 internal prototype to avoid an error.  */
11630 #ifdef __cplusplus
11631 extern "C"
11632 #endif
11633 /* We use char because int might match the return type of a gcc2
11634    builtin and then its argument prototype would still apply.  */
11635 char gethostbyname ();
11636 int
11637 main (void)
11638 {
11639 gethostbyname ();
11640   ;
11641   return 0;
11642 }
11643 _ACEOF
11644 rm -f conftest.$ac_objext conftest$ac_exeext
11645 if { (eval echo "$as_me:11645: \"$ac_link\"") >&5
11646   (eval $ac_link) 2>&5
11647   ac_status=$?
11648   echo "$as_me:11648: \$? = $ac_status" >&5
11649   (exit $ac_status); } &&
11650          { ac_try='test -s conftest$ac_exeext'
11651   { (eval echo "$as_me:11651: \"$ac_try\"") >&5
11652   (eval $ac_try) 2>&5
11653   ac_status=$?
11654   echo "$as_me:11654: \$? = $ac_status" >&5
11655   (exit $ac_status); }; }; then
11656   ac_cv_lib_bsd_gethostbyname=yes
11657 else
11658   echo "$as_me: failed program was:" >&5
11659 cat conftest.$ac_ext >&5
11660 ac_cv_lib_bsd_gethostbyname=no
11661 fi
11662 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11663 LIBS=$ac_check_lib_save_LIBS
11664 fi
11665 echo "$as_me:11665: result: $ac_cv_lib_bsd_gethostbyname" >&5
11666 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11667 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11668   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11669 fi
11670
11671       fi
11672     fi
11673
11674     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11675     # socket/setsockopt and other routines are undefined under SCO ODT
11676     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11677     # on later versions), says Simon Leinen: it contains gethostby*
11678     # variants that don't use the nameserver (or something).  -lsocket
11679     # must be given before -lnsl if both are needed.  We assume that
11680     # if connect needs -lnsl, so does gethostbyname.
11681     echo "$as_me:11681: checking for connect" >&5
11682 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11683 if test "${ac_cv_func_connect+set}" = set; then
11684   echo $ECHO_N "(cached) $ECHO_C" >&6
11685 else
11686   cat >conftest.$ac_ext <<_ACEOF
11687 #line 11687 "configure"
11688 #include "confdefs.h"
11689 /* System header to define __stub macros and hopefully few prototypes,
11690     which can conflict with char connect (); below.  */
11691 #include <assert.h>
11692 /* Override any gcc2 internal prototype to avoid an error.  */
11693 #ifdef __cplusplus
11694 extern "C"
11695 #endif
11696 /* We use char because int might match the return type of a gcc2
11697    builtin and then its argument prototype would still apply.  */
11698 char connect ();
11699 char (*f) ();
11700
11701 int
11702 main (void)
11703 {
11704 /* The GNU C library defines this for functions which it implements
11705     to always fail with ENOSYS.  Some functions are actually named
11706     something starting with __ and the normal name is an alias.  */
11707 #if defined (__stub_connect) || defined (__stub___connect)
11708 choke me
11709 #else
11710 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11711 #endif
11712
11713   ;
11714   return 0;
11715 }
11716 _ACEOF
11717 rm -f conftest.$ac_objext conftest$ac_exeext
11718 if { (eval echo "$as_me:11718: \"$ac_link\"") >&5
11719   (eval $ac_link) 2>&5
11720   ac_status=$?
11721   echo "$as_me:11721: \$? = $ac_status" >&5
11722   (exit $ac_status); } &&
11723          { ac_try='test -s conftest$ac_exeext'
11724   { (eval echo "$as_me:11724: \"$ac_try\"") >&5
11725   (eval $ac_try) 2>&5
11726   ac_status=$?
11727   echo "$as_me:11727: \$? = $ac_status" >&5
11728   (exit $ac_status); }; }; then
11729   ac_cv_func_connect=yes
11730 else
11731   echo "$as_me: failed program was:" >&5
11732 cat conftest.$ac_ext >&5
11733 ac_cv_func_connect=no
11734 fi
11735 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11736 fi
11737 echo "$as_me:11737: result: $ac_cv_func_connect" >&5
11738 echo "${ECHO_T}$ac_cv_func_connect" >&6
11739
11740     if test $ac_cv_func_connect = no; then
11741       echo "$as_me:11741: checking for connect in -lsocket" >&5
11742 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11743 if test "${ac_cv_lib_socket_connect+set}" = set; then
11744   echo $ECHO_N "(cached) $ECHO_C" >&6
11745 else
11746   ac_check_lib_save_LIBS=$LIBS
11747 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11748 cat >conftest.$ac_ext <<_ACEOF
11749 #line 11749 "configure"
11750 #include "confdefs.h"
11751
11752 /* Override any gcc2 internal prototype to avoid an error.  */
11753 #ifdef __cplusplus
11754 extern "C"
11755 #endif
11756 /* We use char because int might match the return type of a gcc2
11757    builtin and then its argument prototype would still apply.  */
11758 char connect ();
11759 int
11760 main (void)
11761 {
11762 connect ();
11763   ;
11764   return 0;
11765 }
11766 _ACEOF
11767 rm -f conftest.$ac_objext conftest$ac_exeext
11768 if { (eval echo "$as_me:11768: \"$ac_link\"") >&5
11769   (eval $ac_link) 2>&5
11770   ac_status=$?
11771   echo "$as_me:11771: \$? = $ac_status" >&5
11772   (exit $ac_status); } &&
11773          { ac_try='test -s conftest$ac_exeext'
11774   { (eval echo "$as_me:11774: \"$ac_try\"") >&5
11775   (eval $ac_try) 2>&5
11776   ac_status=$?
11777   echo "$as_me:11777: \$? = $ac_status" >&5
11778   (exit $ac_status); }; }; then
11779   ac_cv_lib_socket_connect=yes
11780 else
11781   echo "$as_me: failed program was:" >&5
11782 cat conftest.$ac_ext >&5
11783 ac_cv_lib_socket_connect=no
11784 fi
11785 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11786 LIBS=$ac_check_lib_save_LIBS
11787 fi
11788 echo "$as_me:11788: result: $ac_cv_lib_socket_connect" >&5
11789 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11790 if test $ac_cv_lib_socket_connect = yes; then
11791   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11792 fi
11793
11794     fi
11795
11796     # Guillermo Gomez says -lposix is necessary on A/UX.
11797     echo "$as_me:11797: checking for remove" >&5
11798 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11799 if test "${ac_cv_func_remove+set}" = set; then
11800   echo $ECHO_N "(cached) $ECHO_C" >&6
11801 else
11802   cat >conftest.$ac_ext <<_ACEOF
11803 #line 11803 "configure"
11804 #include "confdefs.h"
11805 /* System header to define __stub macros and hopefully few prototypes,
11806     which can conflict with char remove (); below.  */
11807 #include <assert.h>
11808 /* Override any gcc2 internal prototype to avoid an error.  */
11809 #ifdef __cplusplus
11810 extern "C"
11811 #endif
11812 /* We use char because int might match the return type of a gcc2
11813    builtin and then its argument prototype would still apply.  */
11814 char remove ();
11815 char (*f) ();
11816
11817 int
11818 main (void)
11819 {
11820 /* The GNU C library defines this for functions which it implements
11821     to always fail with ENOSYS.  Some functions are actually named
11822     something starting with __ and the normal name is an alias.  */
11823 #if defined (__stub_remove) || defined (__stub___remove)
11824 choke me
11825 #else
11826 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11827 #endif
11828
11829   ;
11830   return 0;
11831 }
11832 _ACEOF
11833 rm -f conftest.$ac_objext conftest$ac_exeext
11834 if { (eval echo "$as_me:11834: \"$ac_link\"") >&5
11835   (eval $ac_link) 2>&5
11836   ac_status=$?
11837   echo "$as_me:11837: \$? = $ac_status" >&5
11838   (exit $ac_status); } &&
11839          { ac_try='test -s conftest$ac_exeext'
11840   { (eval echo "$as_me:11840: \"$ac_try\"") >&5
11841   (eval $ac_try) 2>&5
11842   ac_status=$?
11843   echo "$as_me:11843: \$? = $ac_status" >&5
11844   (exit $ac_status); }; }; then
11845   ac_cv_func_remove=yes
11846 else
11847   echo "$as_me: failed program was:" >&5
11848 cat conftest.$ac_ext >&5
11849 ac_cv_func_remove=no
11850 fi
11851 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11852 fi
11853 echo "$as_me:11853: result: $ac_cv_func_remove" >&5
11854 echo "${ECHO_T}$ac_cv_func_remove" >&6
11855
11856     if test $ac_cv_func_remove = no; then
11857       echo "$as_me:11857: checking for remove in -lposix" >&5
11858 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11859 if test "${ac_cv_lib_posix_remove+set}" = set; then
11860   echo $ECHO_N "(cached) $ECHO_C" >&6
11861 else
11862   ac_check_lib_save_LIBS=$LIBS
11863 LIBS="-lposix  $LIBS"
11864 cat >conftest.$ac_ext <<_ACEOF
11865 #line 11865 "configure"
11866 #include "confdefs.h"
11867
11868 /* Override any gcc2 internal prototype to avoid an error.  */
11869 #ifdef __cplusplus
11870 extern "C"
11871 #endif
11872 /* We use char because int might match the return type of a gcc2
11873    builtin and then its argument prototype would still apply.  */
11874 char remove ();
11875 int
11876 main (void)
11877 {
11878 remove ();
11879   ;
11880   return 0;
11881 }
11882 _ACEOF
11883 rm -f conftest.$ac_objext conftest$ac_exeext
11884 if { (eval echo "$as_me:11884: \"$ac_link\"") >&5
11885   (eval $ac_link) 2>&5
11886   ac_status=$?
11887   echo "$as_me:11887: \$? = $ac_status" >&5
11888   (exit $ac_status); } &&
11889          { ac_try='test -s conftest$ac_exeext'
11890   { (eval echo "$as_me:11890: \"$ac_try\"") >&5
11891   (eval $ac_try) 2>&5
11892   ac_status=$?
11893   echo "$as_me:11893: \$? = $ac_status" >&5
11894   (exit $ac_status); }; }; then
11895   ac_cv_lib_posix_remove=yes
11896 else
11897   echo "$as_me: failed program was:" >&5
11898 cat conftest.$ac_ext >&5
11899 ac_cv_lib_posix_remove=no
11900 fi
11901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11902 LIBS=$ac_check_lib_save_LIBS
11903 fi
11904 echo "$as_me:11904: result: $ac_cv_lib_posix_remove" >&5
11905 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11906 if test $ac_cv_lib_posix_remove = yes; then
11907   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11908 fi
11909
11910     fi
11911
11912     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11913     echo "$as_me:11913: checking for shmat" >&5
11914 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11915 if test "${ac_cv_func_shmat+set}" = set; then
11916   echo $ECHO_N "(cached) $ECHO_C" >&6
11917 else
11918   cat >conftest.$ac_ext <<_ACEOF
11919 #line 11919 "configure"
11920 #include "confdefs.h"
11921 /* System header to define __stub macros and hopefully few prototypes,
11922     which can conflict with char shmat (); below.  */
11923 #include <assert.h>
11924 /* Override any gcc2 internal prototype to avoid an error.  */
11925 #ifdef __cplusplus
11926 extern "C"
11927 #endif
11928 /* We use char because int might match the return type of a gcc2
11929    builtin and then its argument prototype would still apply.  */
11930 char shmat ();
11931 char (*f) ();
11932
11933 int
11934 main (void)
11935 {
11936 /* The GNU C library defines this for functions which it implements
11937     to always fail with ENOSYS.  Some functions are actually named
11938     something starting with __ and the normal name is an alias.  */
11939 #if defined (__stub_shmat) || defined (__stub___shmat)
11940 choke me
11941 #else
11942 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11943 #endif
11944
11945   ;
11946   return 0;
11947 }
11948 _ACEOF
11949 rm -f conftest.$ac_objext conftest$ac_exeext
11950 if { (eval echo "$as_me:11950: \"$ac_link\"") >&5
11951   (eval $ac_link) 2>&5
11952   ac_status=$?
11953   echo "$as_me:11953: \$? = $ac_status" >&5
11954   (exit $ac_status); } &&
11955          { ac_try='test -s conftest$ac_exeext'
11956   { (eval echo "$as_me:11956: \"$ac_try\"") >&5
11957   (eval $ac_try) 2>&5
11958   ac_status=$?
11959   echo "$as_me:11959: \$? = $ac_status" >&5
11960   (exit $ac_status); }; }; then
11961   ac_cv_func_shmat=yes
11962 else
11963   echo "$as_me: failed program was:" >&5
11964 cat conftest.$ac_ext >&5
11965 ac_cv_func_shmat=no
11966 fi
11967 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11968 fi
11969 echo "$as_me:11969: result: $ac_cv_func_shmat" >&5
11970 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11971
11972     if test $ac_cv_func_shmat = no; then
11973       echo "$as_me:11973: checking for shmat in -lipc" >&5
11974 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11975 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11976   echo $ECHO_N "(cached) $ECHO_C" >&6
11977 else
11978   ac_check_lib_save_LIBS=$LIBS
11979 LIBS="-lipc  $LIBS"
11980 cat >conftest.$ac_ext <<_ACEOF
11981 #line 11981 "configure"
11982 #include "confdefs.h"
11983
11984 /* Override any gcc2 internal prototype to avoid an error.  */
11985 #ifdef __cplusplus
11986 extern "C"
11987 #endif
11988 /* We use char because int might match the return type of a gcc2
11989    builtin and then its argument prototype would still apply.  */
11990 char shmat ();
11991 int
11992 main (void)
11993 {
11994 shmat ();
11995   ;
11996   return 0;
11997 }
11998 _ACEOF
11999 rm -f conftest.$ac_objext conftest$ac_exeext
12000 if { (eval echo "$as_me:12000: \"$ac_link\"") >&5
12001   (eval $ac_link) 2>&5
12002   ac_status=$?
12003   echo "$as_me:12003: \$? = $ac_status" >&5
12004   (exit $ac_status); } &&
12005          { ac_try='test -s conftest$ac_exeext'
12006   { (eval echo "$as_me:12006: \"$ac_try\"") >&5
12007   (eval $ac_try) 2>&5
12008   ac_status=$?
12009   echo "$as_me:12009: \$? = $ac_status" >&5
12010   (exit $ac_status); }; }; then
12011   ac_cv_lib_ipc_shmat=yes
12012 else
12013   echo "$as_me: failed program was:" >&5
12014 cat conftest.$ac_ext >&5
12015 ac_cv_lib_ipc_shmat=no
12016 fi
12017 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12018 LIBS=$ac_check_lib_save_LIBS
12019 fi
12020 echo "$as_me:12020: result: $ac_cv_lib_ipc_shmat" >&5
12021 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
12022 if test $ac_cv_lib_ipc_shmat = yes; then
12023   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
12024 fi
12025
12026     fi
12027   fi
12028
12029   # Check for libraries that X11R6 Xt/Xaw programs need.
12030   ac_save_LDFLAGS=$LDFLAGS
12031   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
12032   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
12033   # check for ICE first), but we must link in the order -lSM -lICE or
12034   # we get undefined symbols.  So assume we have SM if we have ICE.
12035   # These have to be linked with before -lX11, unlike the other
12036   # libraries we check for below, so use a different variable.
12037   # John Interrante, Karl Berry
12038   echo "$as_me:12038: checking for IceConnectionNumber in -lICE" >&5
12039 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
12040 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
12041   echo $ECHO_N "(cached) $ECHO_C" >&6
12042 else
12043   ac_check_lib_save_LIBS=$LIBS
12044 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
12045 cat >conftest.$ac_ext <<_ACEOF
12046 #line 12046 "configure"
12047 #include "confdefs.h"
12048
12049 /* Override any gcc2 internal prototype to avoid an error.  */
12050 #ifdef __cplusplus
12051 extern "C"
12052 #endif
12053 /* We use char because int might match the return type of a gcc2
12054    builtin and then its argument prototype would still apply.  */
12055 char IceConnectionNumber ();
12056 int
12057 main (void)
12058 {
12059 IceConnectionNumber ();
12060   ;
12061   return 0;
12062 }
12063 _ACEOF
12064 rm -f conftest.$ac_objext conftest$ac_exeext
12065 if { (eval echo "$as_me:12065: \"$ac_link\"") >&5
12066   (eval $ac_link) 2>&5
12067   ac_status=$?
12068   echo "$as_me:12068: \$? = $ac_status" >&5
12069   (exit $ac_status); } &&
12070          { ac_try='test -s conftest$ac_exeext'
12071   { (eval echo "$as_me:12071: \"$ac_try\"") >&5
12072   (eval $ac_try) 2>&5
12073   ac_status=$?
12074   echo "$as_me:12074: \$? = $ac_status" >&5
12075   (exit $ac_status); }; }; then
12076   ac_cv_lib_ICE_IceConnectionNumber=yes
12077 else
12078   echo "$as_me: failed program was:" >&5
12079 cat conftest.$ac_ext >&5
12080 ac_cv_lib_ICE_IceConnectionNumber=no
12081 fi
12082 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12083 LIBS=$ac_check_lib_save_LIBS
12084 fi
12085 echo "$as_me:12085: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
12086 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
12087 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
12088   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
12089 fi
12090
12091   LDFLAGS=$ac_save_LDFLAGS
12092
12093 fi
12094
12095 cf_x_athena=${cf_x_athena:-Xaw}
12096
12097 echo "$as_me:12097: checking if you want to link with Xaw 3d library" >&5
12098 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
12099 withval=
12100
12101 # Check whether --with-Xaw3d or --without-Xaw3d was given.
12102 if test "${with_Xaw3d+set}" = set; then
12103   withval="$with_Xaw3d"
12104
12105 fi;
12106 if test "$withval" = yes ; then
12107         cf_x_athena=Xaw3d
12108         echo "$as_me:12108: result: yes" >&5
12109 echo "${ECHO_T}yes" >&6
12110 else
12111         echo "$as_me:12111: result: no" >&5
12112 echo "${ECHO_T}no" >&6
12113 fi
12114
12115 echo "$as_me:12115: checking if you want to link with Xaw 3d xft library" >&5
12116 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
12117 withval=
12118
12119 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
12120 if test "${with_Xaw3dxft+set}" = set; then
12121   withval="$with_Xaw3dxft"
12122
12123 fi;
12124 if test "$withval" = yes ; then
12125         cf_x_athena=Xaw3dxft
12126         echo "$as_me:12126: result: yes" >&5
12127 echo "${ECHO_T}yes" >&6
12128 else
12129         echo "$as_me:12129: result: no" >&5
12130 echo "${ECHO_T}no" >&6
12131 fi
12132
12133 echo "$as_me:12133: checking if you want to link with neXT Athena library" >&5
12134 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
12135 withval=
12136
12137 # Check whether --with-neXtaw or --without-neXtaw was given.
12138 if test "${with_neXtaw+set}" = set; then
12139   withval="$with_neXtaw"
12140
12141 fi;
12142 if test "$withval" = yes ; then
12143         cf_x_athena=neXtaw
12144         echo "$as_me:12144: result: yes" >&5
12145 echo "${ECHO_T}yes" >&6
12146 else
12147         echo "$as_me:12147: result: no" >&5
12148 echo "${ECHO_T}no" >&6
12149 fi
12150
12151 echo "$as_me:12151: checking if you want to link with Athena-Plus library" >&5
12152 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
12153 withval=
12154
12155 # Check whether --with-XawPlus or --without-XawPlus was given.
12156 if test "${with_XawPlus+set}" = set; then
12157   withval="$with_XawPlus"
12158
12159 fi;
12160 if test "$withval" = yes ; then
12161         cf_x_athena=XawPlus
12162         echo "$as_me:12162: result: yes" >&5
12163 echo "${ECHO_T}yes" >&6
12164 else
12165         echo "$as_me:12165: result: no" >&5
12166 echo "${ECHO_T}no" >&6
12167 fi
12168
12169 cf_x_athena_lib=""
12170
12171 if test "$PKG_CONFIG" != none ; then
12172         cf_athena_list=
12173         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12174         for cf_athena_pkg in \
12175                 $cf_athena_list \
12176                 ${cf_x_athena} \
12177                 ${cf_x_athena}-devel \
12178                 lib${cf_x_athena} \
12179                 lib${cf_x_athena}-devel
12180         do
12181
12182 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12183         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12184
12185 echo "${as_me:-configure}:12185: testing found package $cf_athena_pkg ..." 1>&5
12186
12187         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12188         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12189         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12190
12191 echo "${as_me:-configure}:12191: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12192
12193         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12194
12195 echo "${as_me:-configure}:12195: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12196
12197 cf_fix_cppflags=no
12198 cf_new_cflags=
12199 cf_new_cppflags=
12200 cf_new_extra_cppflags=
12201
12202 for cf_add_cflags in $cf_pkgconfig_incs
12203 do
12204 case $cf_fix_cppflags in
12205 (no)
12206         case $cf_add_cflags in
12207         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12208                 case $cf_add_cflags in
12209                 (-D*)
12210                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12211
12212                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12213                                 && test -z "${cf_tst_cflags}" \
12214                                 && cf_fix_cppflags=yes
12215
12216                         if test $cf_fix_cppflags = yes ; then
12217
12218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12220
12221                                 continue
12222                         elif test "${cf_tst_cflags}" = "\"'" ; then
12223
12224         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12225         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12226
12227                                 continue
12228                         fi
12229                         ;;
12230                 esac
12231                 case "$CPPFLAGS" in
12232                 (*$cf_add_cflags)
12233                         ;;
12234                 (*)
12235                         case $cf_add_cflags in
12236                         (-D*)
12237                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12238
12239 CPPFLAGS=`echo "$CPPFLAGS" | \
12240         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12241                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12242
12243                                 ;;
12244                         esac
12245
12246         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12247         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12248
12249                         ;;
12250                 esac
12251                 ;;
12252         (*)
12253
12254         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12255         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12256
12257                 ;;
12258         esac
12259         ;;
12260 (yes)
12261
12262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12264
12265         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12266
12267         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12268                 && test -z "${cf_tst_cflags}" \
12269                 && cf_fix_cppflags=no
12270         ;;
12271 esac
12272 done
12273
12274 if test -n "$cf_new_cflags" ; then
12275
12276         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12277         CFLAGS="${CFLAGS}$cf_new_cflags"
12278
12279 fi
12280
12281 if test -n "$cf_new_cppflags" ; then
12282
12283         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12284         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12285
12286 fi
12287
12288 if test -n "$cf_new_extra_cppflags" ; then
12289
12290         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12291         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12292
12293 fi
12294
12295 cf_add_libs="$cf_pkgconfig_libs"
12296 # Filter out duplicates - this happens with badly-designed ".pc" files...
12297 for cf_add_1lib in $LIBS
12298 do
12299         for cf_add_2lib in $cf_add_libs
12300         do
12301                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12302                 then
12303                         cf_add_1lib=
12304                         break
12305                 fi
12306         done
12307         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12308 done
12309 LIBS="$cf_add_libs"
12310
12311                         cf_x_athena_lib="$cf_pkgconfig_libs"
12312
12313 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12314
12315                         cat >>confdefs.h <<EOF
12316 #define $cf_x_athena_LIBS 1
12317 EOF
12318
12319         for cf_trim_lib in Xmu Xt X11
12320         do
12321                 case "$LIBS" in
12322                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12323                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12324                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12325
12326 echo "${as_me:-configure}:12326: testing ..trimmed $LIBS ..." 1>&5
12327
12328                         ;;
12329                 esac
12330         done
12331
12332 echo "$as_me:12332: checking for usable $cf_x_athena/Xmu package" >&5
12333 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12334 if test "${cf_cv_xaw_compat+set}" = set; then
12335   echo $ECHO_N "(cached) $ECHO_C" >&6
12336 else
12337
12338 cat >conftest.$ac_ext <<_ACEOF
12339 #line 12339 "configure"
12340 #include "confdefs.h"
12341
12342 #include <X11/Xmu/CharSet.h>
12343
12344 int
12345 main (void)
12346 {
12347
12348 int check = XmuCompareISOLatin1("big", "small")
12349
12350   ;
12351   return 0;
12352 }
12353 _ACEOF
12354 rm -f conftest.$ac_objext conftest$ac_exeext
12355 if { (eval echo "$as_me:12355: \"$ac_link\"") >&5
12356   (eval $ac_link) 2>&5
12357   ac_status=$?
12358   echo "$as_me:12358: \$? = $ac_status" >&5
12359   (exit $ac_status); } &&
12360          { ac_try='test -s conftest$ac_exeext'
12361   { (eval echo "$as_me:12361: \"$ac_try\"") >&5
12362   (eval $ac_try) 2>&5
12363   ac_status=$?
12364   echo "$as_me:12364: \$? = $ac_status" >&5
12365   (exit $ac_status); }; }; then
12366   cf_cv_xaw_compat=yes
12367 else
12368   echo "$as_me: failed program was:" >&5
12369 cat conftest.$ac_ext >&5
12370 cf_cv_xaw_compat=no
12371 fi
12372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12373 fi
12374 echo "$as_me:12374: result: $cf_cv_xaw_compat" >&5
12375 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12376
12377                         if test "$cf_cv_xaw_compat" = no
12378                         then
12379                                 # workaround for broken ".pc" files...
12380                                 case "$cf_x_athena_lib" in
12381                                 (*-lXmu*)
12382                                         ;;
12383                                 (*)
12384                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12385
12386 echo "${as_me:-configure}:12386: testing work around broken package ..." 1>&5
12387
12388                                         cf_save_xmu="$LIBS"
12389                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12390
12391 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12392         test -n "$verbose" && echo "    found package xmu" 1>&6
12393
12394 echo "${as_me:-configure}:12394: testing found package xmu ..." 1>&5
12395
12396         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12397         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12398         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12399
12400 echo "${as_me:-configure}:12400: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12401
12402         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12403
12404 echo "${as_me:-configure}:12404: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12405
12406 cf_fix_cppflags=no
12407 cf_new_cflags=
12408 cf_new_cppflags=
12409 cf_new_extra_cppflags=
12410
12411 for cf_add_cflags in $cf_pkgconfig_incs
12412 do
12413 case $cf_fix_cppflags in
12414 (no)
12415         case $cf_add_cflags in
12416         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12417                 case $cf_add_cflags in
12418                 (-D*)
12419                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12420
12421                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12422                                 && test -z "${cf_tst_cflags}" \
12423                                 && cf_fix_cppflags=yes
12424
12425                         if test $cf_fix_cppflags = yes ; then
12426
12427         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12428         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12429
12430                                 continue
12431                         elif test "${cf_tst_cflags}" = "\"'" ; then
12432
12433         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12434         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12435
12436                                 continue
12437                         fi
12438                         ;;
12439                 esac
12440                 case "$CPPFLAGS" in
12441                 (*$cf_add_cflags)
12442                         ;;
12443                 (*)
12444                         case $cf_add_cflags in
12445                         (-D*)
12446                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12447
12448 CPPFLAGS=`echo "$CPPFLAGS" | \
12449         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12450                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12451
12452                                 ;;
12453                         esac
12454
12455         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12456         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12457
12458                         ;;
12459                 esac
12460                 ;;
12461         (*)
12462
12463         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12464         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12465
12466                 ;;
12467         esac
12468         ;;
12469 (yes)
12470
12471         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12472         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12473
12474         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12475
12476         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12477                 && test -z "${cf_tst_cflags}" \
12478                 && cf_fix_cppflags=no
12479         ;;
12480 esac
12481 done
12482
12483 if test -n "$cf_new_cflags" ; then
12484
12485         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12486         CFLAGS="${CFLAGS}$cf_new_cflags"
12487
12488 fi
12489
12490 if test -n "$cf_new_cppflags" ; then
12491
12492         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12493         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12494
12495 fi
12496
12497 if test -n "$cf_new_extra_cppflags" ; then
12498
12499         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12500         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12501
12502 fi
12503
12504 cf_add_libs="$cf_pkgconfig_libs"
12505 # Filter out duplicates - this happens with badly-designed ".pc" files...
12506 for cf_add_1lib in $LIBS
12507 do
12508         for cf_add_2lib in $cf_add_libs
12509         do
12510                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12511                 then
12512                         cf_add_1lib=
12513                         break
12514                 fi
12515         done
12516         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12517 done
12518 LIBS="$cf_add_libs"
12519
12520                                                         LIBS="$cf_save_xmu"
12521
12522 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12523
12524 echo "${as_me:-configure}:12524: testing ...before $LIBS ..." 1>&5
12525
12526 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12527 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12528
12529 echo "${as_me:-configure}:12529: testing ...after  $LIBS ..." 1>&5
12530
12531 else
12532         cf_pkgconfig_incs=
12533         cf_pkgconfig_libs=
12534
12535 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12536
12537 echo "${as_me:-configure}:12537: testing ...before $LIBS ..." 1>&5
12538
12539 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12540 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12541
12542 echo "${as_me:-configure}:12542: testing ...after  $LIBS ..." 1>&5
12543
12544 fi
12545
12546         for cf_trim_lib in Xmu Xt X11
12547         do
12548                 case "$LIBS" in
12549                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12550                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12551                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12552
12553 echo "${as_me:-configure}:12553: testing ..trimmed $LIBS ..." 1>&5
12554
12555                         ;;
12556                 esac
12557         done
12558
12559                                         ;;
12560                                 esac
12561                         fi
12562
12563                         break
12564 else
12565         cf_pkgconfig_incs=
12566         cf_pkgconfig_libs=
12567         :
12568 fi
12569
12570         done
12571 fi
12572
12573 if test -z "$cf_x_athena_lib" ; then
12574
12575 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12576         test -n "$verbose" && echo "    found package Xext" 1>&6
12577
12578 echo "${as_me:-configure}:12578: testing found package Xext ..." 1>&5
12579
12580         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12581         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12582         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12583
12584 echo "${as_me:-configure}:12584: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12585
12586         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12587
12588 echo "${as_me:-configure}:12588: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12589
12590 cf_fix_cppflags=no
12591 cf_new_cflags=
12592 cf_new_cppflags=
12593 cf_new_extra_cppflags=
12594
12595 for cf_add_cflags in $cf_pkgconfig_incs
12596 do
12597 case $cf_fix_cppflags in
12598 (no)
12599         case $cf_add_cflags in
12600         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12601                 case $cf_add_cflags in
12602                 (-D*)
12603                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12604
12605                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12606                                 && test -z "${cf_tst_cflags}" \
12607                                 && cf_fix_cppflags=yes
12608
12609                         if test $cf_fix_cppflags = yes ; then
12610
12611         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12612         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12613
12614                                 continue
12615                         elif test "${cf_tst_cflags}" = "\"'" ; then
12616
12617         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12618         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12619
12620                                 continue
12621                         fi
12622                         ;;
12623                 esac
12624                 case "$CPPFLAGS" in
12625                 (*$cf_add_cflags)
12626                         ;;
12627                 (*)
12628                         case $cf_add_cflags in
12629                         (-D*)
12630                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12631
12632 CPPFLAGS=`echo "$CPPFLAGS" | \
12633         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12634                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12635
12636                                 ;;
12637                         esac
12638
12639         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12640         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12641
12642                         ;;
12643                 esac
12644                 ;;
12645         (*)
12646
12647         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12648         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12649
12650                 ;;
12651         esac
12652         ;;
12653 (yes)
12654
12655         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12656         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12657
12658         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12659
12660         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12661                 && test -z "${cf_tst_cflags}" \
12662                 && cf_fix_cppflags=no
12663         ;;
12664 esac
12665 done
12666
12667 if test -n "$cf_new_cflags" ; then
12668
12669         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12670         CFLAGS="${CFLAGS}$cf_new_cflags"
12671
12672 fi
12673
12674 if test -n "$cf_new_cppflags" ; then
12675
12676         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12677         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12678
12679 fi
12680
12681 if test -n "$cf_new_extra_cppflags" ; then
12682
12683         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12684         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12685
12686 fi
12687
12688 cf_add_libs="$cf_pkgconfig_libs"
12689 # Filter out duplicates - this happens with badly-designed ".pc" files...
12690 for cf_add_1lib in $LIBS
12691 do
12692         for cf_add_2lib in $cf_add_libs
12693         do
12694                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12695                 then
12696                         cf_add_1lib=
12697                         break
12698                 fi
12699         done
12700         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12701 done
12702 LIBS="$cf_add_libs"
12703
12704         :
12705 else
12706         cf_pkgconfig_incs=
12707         cf_pkgconfig_libs=
12708
12709         echo "$as_me:12709: checking for XextCreateExtension in -lXext" >&5
12710 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12711 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12712   echo $ECHO_N "(cached) $ECHO_C" >&6
12713 else
12714   ac_check_lib_save_LIBS=$LIBS
12715 LIBS="-lXext  $LIBS"
12716 cat >conftest.$ac_ext <<_ACEOF
12717 #line 12717 "configure"
12718 #include "confdefs.h"
12719
12720 /* Override any gcc2 internal prototype to avoid an error.  */
12721 #ifdef __cplusplus
12722 extern "C"
12723 #endif
12724 /* We use char because int might match the return type of a gcc2
12725    builtin and then its argument prototype would still apply.  */
12726 char XextCreateExtension ();
12727 int
12728 main (void)
12729 {
12730 XextCreateExtension ();
12731   ;
12732   return 0;
12733 }
12734 _ACEOF
12735 rm -f conftest.$ac_objext conftest$ac_exeext
12736 if { (eval echo "$as_me:12736: \"$ac_link\"") >&5
12737   (eval $ac_link) 2>&5
12738   ac_status=$?
12739   echo "$as_me:12739: \$? = $ac_status" >&5
12740   (exit $ac_status); } &&
12741          { ac_try='test -s conftest$ac_exeext'
12742   { (eval echo "$as_me:12742: \"$ac_try\"") >&5
12743   (eval $ac_try) 2>&5
12744   ac_status=$?
12745   echo "$as_me:12745: \$? = $ac_status" >&5
12746   (exit $ac_status); }; }; then
12747   ac_cv_lib_Xext_XextCreateExtension=yes
12748 else
12749   echo "$as_me: failed program was:" >&5
12750 cat conftest.$ac_ext >&5
12751 ac_cv_lib_Xext_XextCreateExtension=no
12752 fi
12753 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12754 LIBS=$ac_check_lib_save_LIBS
12755 fi
12756 echo "$as_me:12756: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12757 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12758 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12759
12760 cf_add_libs="-lXext"
12761 # Filter out duplicates - this happens with badly-designed ".pc" files...
12762 for cf_add_1lib in $LIBS
12763 do
12764         for cf_add_2lib in $cf_add_libs
12765         do
12766                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12767                 then
12768                         cf_add_1lib=
12769                         break
12770                 fi
12771         done
12772         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12773 done
12774 LIBS="$cf_add_libs"
12775
12776 fi
12777
12778 fi
12779
12780 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12781 # in some cases has installed dummy files in the former, other cases replaced
12782 # it with a link to the new location).  This complicates the configure script.
12783 # Check for that pitfall, and recover using pkg-config
12784 #
12785 # If none of these are set, the configuration is almost certainly broken.
12786 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12787 then
12788
12789 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12790         test -n "$verbose" && echo "    found package x11" 1>&6
12791
12792 echo "${as_me:-configure}:12792: testing found package x11 ..." 1>&5
12793
12794         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12795         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12796         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12797
12798 echo "${as_me:-configure}:12798: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12799
12800         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12801
12802 echo "${as_me:-configure}:12802: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12803
12804 cf_fix_cppflags=no
12805 cf_new_cflags=
12806 cf_new_cppflags=
12807 cf_new_extra_cppflags=
12808
12809 for cf_add_cflags in $cf_pkgconfig_incs
12810 do
12811 case $cf_fix_cppflags in
12812 (no)
12813         case $cf_add_cflags in
12814         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12815                 case $cf_add_cflags in
12816                 (-D*)
12817                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12818
12819                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12820                                 && test -z "${cf_tst_cflags}" \
12821                                 && cf_fix_cppflags=yes
12822
12823                         if test $cf_fix_cppflags = yes ; then
12824
12825         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12826         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12827
12828                                 continue
12829                         elif test "${cf_tst_cflags}" = "\"'" ; then
12830
12831         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12832         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12833
12834                                 continue
12835                         fi
12836                         ;;
12837                 esac
12838                 case "$CPPFLAGS" in
12839                 (*$cf_add_cflags)
12840                         ;;
12841                 (*)
12842                         case $cf_add_cflags in
12843                         (-D*)
12844                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12845
12846 CPPFLAGS=`echo "$CPPFLAGS" | \
12847         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12848                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12849
12850                                 ;;
12851                         esac
12852
12853         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12854         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12855
12856                         ;;
12857                 esac
12858                 ;;
12859         (*)
12860
12861         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12862         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12863
12864                 ;;
12865         esac
12866         ;;
12867 (yes)
12868
12869         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12870         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12871
12872         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12873
12874         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12875                 && test -z "${cf_tst_cflags}" \
12876                 && cf_fix_cppflags=no
12877         ;;
12878 esac
12879 done
12880
12881 if test -n "$cf_new_cflags" ; then
12882
12883         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12884         CFLAGS="${CFLAGS}$cf_new_cflags"
12885
12886 fi
12887
12888 if test -n "$cf_new_cppflags" ; then
12889
12890         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12891         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12892
12893 fi
12894
12895 if test -n "$cf_new_extra_cppflags" ; then
12896
12897         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12898         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12899
12900 fi
12901
12902 cf_add_libs="$cf_pkgconfig_libs"
12903 # Filter out duplicates - this happens with badly-designed ".pc" files...
12904 for cf_add_1lib in $LIBS
12905 do
12906         for cf_add_2lib in $cf_add_libs
12907         do
12908                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12909                 then
12910                         cf_add_1lib=
12911                         break
12912                 fi
12913         done
12914         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12915 done
12916 LIBS="$cf_add_libs"
12917
12918         :
12919 else
12920         cf_pkgconfig_incs=
12921         cf_pkgconfig_libs=
12922         { echo "$as_me:12922: WARNING: unable to find X11 library" >&5
12923 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12924 fi
12925
12926 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12927         test -n "$verbose" && echo "    found package ice" 1>&6
12928
12929 echo "${as_me:-configure}:12929: testing found package ice ..." 1>&5
12930
12931         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12932         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12933         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12934
12935 echo "${as_me:-configure}:12935: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12936
12937         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12938
12939 echo "${as_me:-configure}:12939: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12940
12941 cf_fix_cppflags=no
12942 cf_new_cflags=
12943 cf_new_cppflags=
12944 cf_new_extra_cppflags=
12945
12946 for cf_add_cflags in $cf_pkgconfig_incs
12947 do
12948 case $cf_fix_cppflags in
12949 (no)
12950         case $cf_add_cflags in
12951         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12952                 case $cf_add_cflags in
12953                 (-D*)
12954                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12955
12956                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12957                                 && test -z "${cf_tst_cflags}" \
12958                                 && cf_fix_cppflags=yes
12959
12960                         if test $cf_fix_cppflags = yes ; then
12961
12962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12964
12965                                 continue
12966                         elif test "${cf_tst_cflags}" = "\"'" ; then
12967
12968         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12969         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12970
12971                                 continue
12972                         fi
12973                         ;;
12974                 esac
12975                 case "$CPPFLAGS" in
12976                 (*$cf_add_cflags)
12977                         ;;
12978                 (*)
12979                         case $cf_add_cflags in
12980                         (-D*)
12981                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12982
12983 CPPFLAGS=`echo "$CPPFLAGS" | \
12984         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12985                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12986
12987                                 ;;
12988                         esac
12989
12990         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12991         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12992
12993                         ;;
12994                 esac
12995                 ;;
12996         (*)
12997
12998         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12999         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13000
13001                 ;;
13002         esac
13003         ;;
13004 (yes)
13005
13006         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13007         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13008
13009         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13010
13011         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13012                 && test -z "${cf_tst_cflags}" \
13013                 && cf_fix_cppflags=no
13014         ;;
13015 esac
13016 done
13017
13018 if test -n "$cf_new_cflags" ; then
13019
13020         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13021         CFLAGS="${CFLAGS}$cf_new_cflags"
13022
13023 fi
13024
13025 if test -n "$cf_new_cppflags" ; then
13026
13027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13028         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13029
13030 fi
13031
13032 if test -n "$cf_new_extra_cppflags" ; then
13033
13034         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13035         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13036
13037 fi
13038
13039 cf_add_libs="$cf_pkgconfig_libs"
13040 # Filter out duplicates - this happens with badly-designed ".pc" files...
13041 for cf_add_1lib in $LIBS
13042 do
13043         for cf_add_2lib in $cf_add_libs
13044         do
13045                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13046                 then
13047                         cf_add_1lib=
13048                         break
13049                 fi
13050         done
13051         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13052 done
13053 LIBS="$cf_add_libs"
13054
13055         :
13056 else
13057         cf_pkgconfig_incs=
13058         cf_pkgconfig_libs=
13059         { echo "$as_me:13059: WARNING: unable to find ICE library" >&5
13060 echo "$as_me: WARNING: unable to find ICE library" >&2;}
13061 fi
13062
13063 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13064         test -n "$verbose" && echo "    found package sm" 1>&6
13065
13066 echo "${as_me:-configure}:13066: testing found package sm ..." 1>&5
13067
13068         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13069         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13070         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13071
13072 echo "${as_me:-configure}:13072: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13073
13074         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13075
13076 echo "${as_me:-configure}:13076: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13077
13078 cf_fix_cppflags=no
13079 cf_new_cflags=
13080 cf_new_cppflags=
13081 cf_new_extra_cppflags=
13082
13083 for cf_add_cflags in $cf_pkgconfig_incs
13084 do
13085 case $cf_fix_cppflags in
13086 (no)
13087         case $cf_add_cflags in
13088         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13089                 case $cf_add_cflags in
13090                 (-D*)
13091                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13092
13093                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13094                                 && test -z "${cf_tst_cflags}" \
13095                                 && cf_fix_cppflags=yes
13096
13097                         if test $cf_fix_cppflags = yes ; then
13098
13099         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13100         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13101
13102                                 continue
13103                         elif test "${cf_tst_cflags}" = "\"'" ; then
13104
13105         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13106         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13107
13108                                 continue
13109                         fi
13110                         ;;
13111                 esac
13112                 case "$CPPFLAGS" in
13113                 (*$cf_add_cflags)
13114                         ;;
13115                 (*)
13116                         case $cf_add_cflags in
13117                         (-D*)
13118                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13119
13120 CPPFLAGS=`echo "$CPPFLAGS" | \
13121         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13122                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13123
13124                                 ;;
13125                         esac
13126
13127         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13128         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13129
13130                         ;;
13131                 esac
13132                 ;;
13133         (*)
13134
13135         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13136         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13137
13138                 ;;
13139         esac
13140         ;;
13141 (yes)
13142
13143         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13144         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13145
13146         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13147
13148         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13149                 && test -z "${cf_tst_cflags}" \
13150                 && cf_fix_cppflags=no
13151         ;;
13152 esac
13153 done
13154
13155 if test -n "$cf_new_cflags" ; then
13156
13157         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13158         CFLAGS="${CFLAGS}$cf_new_cflags"
13159
13160 fi
13161
13162 if test -n "$cf_new_cppflags" ; then
13163
13164         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13165         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13166
13167 fi
13168
13169 if test -n "$cf_new_extra_cppflags" ; then
13170
13171         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13172         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13173
13174 fi
13175
13176 cf_add_libs="$cf_pkgconfig_libs"
13177 # Filter out duplicates - this happens with badly-designed ".pc" files...
13178 for cf_add_1lib in $LIBS
13179 do
13180         for cf_add_2lib in $cf_add_libs
13181         do
13182                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13183                 then
13184                         cf_add_1lib=
13185                         break
13186                 fi
13187         done
13188         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13189 done
13190 LIBS="$cf_add_libs"
13191
13192         :
13193 else
13194         cf_pkgconfig_incs=
13195         cf_pkgconfig_libs=
13196         { echo "$as_me:13196: WARNING: unable to find SM library" >&5
13197 echo "$as_me: WARNING: unable to find SM library" >&2;}
13198 fi
13199
13200 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13201         test -n "$verbose" && echo "    found package xt" 1>&6
13202
13203 echo "${as_me:-configure}:13203: testing found package xt ..." 1>&5
13204
13205         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13206         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13207         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13208
13209 echo "${as_me:-configure}:13209: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13210
13211         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13212
13213 echo "${as_me:-configure}:13213: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13214
13215 cf_fix_cppflags=no
13216 cf_new_cflags=
13217 cf_new_cppflags=
13218 cf_new_extra_cppflags=
13219
13220 for cf_add_cflags in $cf_pkgconfig_incs
13221 do
13222 case $cf_fix_cppflags in
13223 (no)
13224         case $cf_add_cflags in
13225         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13226                 case $cf_add_cflags in
13227                 (-D*)
13228                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13229
13230                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13231                                 && test -z "${cf_tst_cflags}" \
13232                                 && cf_fix_cppflags=yes
13233
13234                         if test $cf_fix_cppflags = yes ; then
13235
13236         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13237         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13238
13239                                 continue
13240                         elif test "${cf_tst_cflags}" = "\"'" ; then
13241
13242         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13243         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13244
13245                                 continue
13246                         fi
13247                         ;;
13248                 esac
13249                 case "$CPPFLAGS" in
13250                 (*$cf_add_cflags)
13251                         ;;
13252                 (*)
13253                         case $cf_add_cflags in
13254                         (-D*)
13255                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13256
13257 CPPFLAGS=`echo "$CPPFLAGS" | \
13258         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13259                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13260
13261                                 ;;
13262                         esac
13263
13264         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13265         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13266
13267                         ;;
13268                 esac
13269                 ;;
13270         (*)
13271
13272         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13273         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13274
13275                 ;;
13276         esac
13277         ;;
13278 (yes)
13279
13280         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13281         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13282
13283         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13284
13285         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13286                 && test -z "${cf_tst_cflags}" \
13287                 && cf_fix_cppflags=no
13288         ;;
13289 esac
13290 done
13291
13292 if test -n "$cf_new_cflags" ; then
13293
13294         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13295         CFLAGS="${CFLAGS}$cf_new_cflags"
13296
13297 fi
13298
13299 if test -n "$cf_new_cppflags" ; then
13300
13301         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13302         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13303
13304 fi
13305
13306 if test -n "$cf_new_extra_cppflags" ; then
13307
13308         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13309         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13310
13311 fi
13312
13313 cf_add_libs="$cf_pkgconfig_libs"
13314 # Filter out duplicates - this happens with badly-designed ".pc" files...
13315 for cf_add_1lib in $LIBS
13316 do
13317         for cf_add_2lib in $cf_add_libs
13318         do
13319                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13320                 then
13321                         cf_add_1lib=
13322                         break
13323                 fi
13324         done
13325         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13326 done
13327 LIBS="$cf_add_libs"
13328
13329         :
13330 else
13331         cf_pkgconfig_incs=
13332         cf_pkgconfig_libs=
13333         { echo "$as_me:13333: WARNING: unable to find Xt library" >&5
13334 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13335 fi
13336
13337 fi
13338
13339 cf_have_X_LIBS=no
13340
13341 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13342         test -n "$verbose" && echo "    found package xt" 1>&6
13343
13344 echo "${as_me:-configure}:13344: testing found package xt ..." 1>&5
13345
13346         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13347         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13348         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13349
13350 echo "${as_me:-configure}:13350: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13351
13352         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13353
13354 echo "${as_me:-configure}:13354: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13355
13356 cf_fix_cppflags=no
13357 cf_new_cflags=
13358 cf_new_cppflags=
13359 cf_new_extra_cppflags=
13360
13361 for cf_add_cflags in $cf_pkgconfig_incs
13362 do
13363 case $cf_fix_cppflags in
13364 (no)
13365         case $cf_add_cflags in
13366         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13367                 case $cf_add_cflags in
13368                 (-D*)
13369                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13370
13371                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13372                                 && test -z "${cf_tst_cflags}" \
13373                                 && cf_fix_cppflags=yes
13374
13375                         if test $cf_fix_cppflags = yes ; then
13376
13377         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13378         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13379
13380                                 continue
13381                         elif test "${cf_tst_cflags}" = "\"'" ; then
13382
13383         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13384         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13385
13386                                 continue
13387                         fi
13388                         ;;
13389                 esac
13390                 case "$CPPFLAGS" in
13391                 (*$cf_add_cflags)
13392                         ;;
13393                 (*)
13394                         case $cf_add_cflags in
13395                         (-D*)
13396                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13397
13398 CPPFLAGS=`echo "$CPPFLAGS" | \
13399         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13400                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13401
13402                                 ;;
13403                         esac
13404
13405         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13406         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13407
13408                         ;;
13409                 esac
13410                 ;;
13411         (*)
13412
13413         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13414         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13415
13416                 ;;
13417         esac
13418         ;;
13419 (yes)
13420
13421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13423
13424         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13425
13426         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13427                 && test -z "${cf_tst_cflags}" \
13428                 && cf_fix_cppflags=no
13429         ;;
13430 esac
13431 done
13432
13433 if test -n "$cf_new_cflags" ; then
13434
13435         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13436         CFLAGS="${CFLAGS}$cf_new_cflags"
13437
13438 fi
13439
13440 if test -n "$cf_new_cppflags" ; then
13441
13442         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13443         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13444
13445 fi
13446
13447 if test -n "$cf_new_extra_cppflags" ; then
13448
13449         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13450         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13451
13452 fi
13453
13454 cf_add_libs="$cf_pkgconfig_libs"
13455 # Filter out duplicates - this happens with badly-designed ".pc" files...
13456 for cf_add_1lib in $LIBS
13457 do
13458         for cf_add_2lib in $cf_add_libs
13459         do
13460                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13461                 then
13462                         cf_add_1lib=
13463                         break
13464                 fi
13465         done
13466         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13467 done
13468 LIBS="$cf_add_libs"
13469
13470         case "x$LIBS" in
13471         (*-lX11*)
13472                 ;;
13473         (*)
13474 # we have an "xt" package, but it may omit Xt's dependency on X11
13475 echo "$as_me:13475: checking for usable X dependency" >&5
13476 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13477 if test "${cf_cv_xt_x11_compat+set}" = set; then
13478   echo $ECHO_N "(cached) $ECHO_C" >&6
13479 else
13480
13481 cat >conftest.$ac_ext <<_ACEOF
13482 #line 13482 "configure"
13483 #include "confdefs.h"
13484
13485 #include <X11/Xlib.h>
13486
13487 int
13488 main (void)
13489 {
13490
13491         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13492         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13493         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13494         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13495
13496   ;
13497   return 0;
13498 }
13499 _ACEOF
13500 rm -f conftest.$ac_objext conftest$ac_exeext
13501 if { (eval echo "$as_me:13501: \"$ac_link\"") >&5
13502   (eval $ac_link) 2>&5
13503   ac_status=$?
13504   echo "$as_me:13504: \$? = $ac_status" >&5
13505   (exit $ac_status); } &&
13506          { ac_try='test -s conftest$ac_exeext'
13507   { (eval echo "$as_me:13507: \"$ac_try\"") >&5
13508   (eval $ac_try) 2>&5
13509   ac_status=$?
13510   echo "$as_me:13510: \$? = $ac_status" >&5
13511   (exit $ac_status); }; }; then
13512   cf_cv_xt_x11_compat=yes
13513 else
13514   echo "$as_me: failed program was:" >&5
13515 cat conftest.$ac_ext >&5
13516 cf_cv_xt_x11_compat=no
13517 fi
13518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13519 fi
13520 echo "$as_me:13520: result: $cf_cv_xt_x11_compat" >&5
13521 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13522                 if test "$cf_cv_xt_x11_compat" = no
13523                 then
13524                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13525
13526 echo "${as_me:-configure}:13526: testing work around broken X11 dependency ..." 1>&5
13527
13528                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13529
13530 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13531         test -n "$verbose" && echo "    found package x11" 1>&6
13532
13533 echo "${as_me:-configure}:13533: testing found package x11 ..." 1>&5
13534
13535         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13536         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13537         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13538
13539 echo "${as_me:-configure}:13539: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13540
13541         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13542
13543 echo "${as_me:-configure}:13543: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13544
13545 cf_fix_cppflags=no
13546 cf_new_cflags=
13547 cf_new_cppflags=
13548 cf_new_extra_cppflags=
13549
13550 for cf_add_cflags in $cf_pkgconfig_incs
13551 do
13552 case $cf_fix_cppflags in
13553 (no)
13554         case $cf_add_cflags in
13555         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13556                 case $cf_add_cflags in
13557                 (-D*)
13558                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13559
13560                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13561                                 && test -z "${cf_tst_cflags}" \
13562                                 && cf_fix_cppflags=yes
13563
13564                         if test $cf_fix_cppflags = yes ; then
13565
13566         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13567         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13568
13569                                 continue
13570                         elif test "${cf_tst_cflags}" = "\"'" ; then
13571
13572         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13573         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13574
13575                                 continue
13576                         fi
13577                         ;;
13578                 esac
13579                 case "$CPPFLAGS" in
13580                 (*$cf_add_cflags)
13581                         ;;
13582                 (*)
13583                         case $cf_add_cflags in
13584                         (-D*)
13585                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13586
13587 CPPFLAGS=`echo "$CPPFLAGS" | \
13588         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13589                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13590
13591                                 ;;
13592                         esac
13593
13594         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13595         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13596
13597                         ;;
13598                 esac
13599                 ;;
13600         (*)
13601
13602         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13603         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13604
13605                 ;;
13606         esac
13607         ;;
13608 (yes)
13609
13610         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13611         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13612
13613         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13614
13615         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13616                 && test -z "${cf_tst_cflags}" \
13617                 && cf_fix_cppflags=no
13618         ;;
13619 esac
13620 done
13621
13622 if test -n "$cf_new_cflags" ; then
13623
13624         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13625         CFLAGS="${CFLAGS}$cf_new_cflags"
13626
13627 fi
13628
13629 if test -n "$cf_new_cppflags" ; then
13630
13631         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13632         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13633
13634 fi
13635
13636 if test -n "$cf_new_extra_cppflags" ; then
13637
13638         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13639         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13640
13641 fi
13642
13643 cf_add_libs="$cf_pkgconfig_libs"
13644 # Filter out duplicates - this happens with badly-designed ".pc" files...
13645 for cf_add_1lib in $LIBS
13646 do
13647         for cf_add_2lib in $cf_add_libs
13648         do
13649                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13650                 then
13651                         cf_add_1lib=
13652                         break
13653                 fi
13654         done
13655         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13656 done
13657 LIBS="$cf_add_libs"
13658
13659         :
13660 else
13661         cf_pkgconfig_incs=
13662         cf_pkgconfig_libs=
13663
13664 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13665
13666 echo "${as_me:-configure}:13666: testing ...before $LIBS ..." 1>&5
13667
13668 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13669 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13670
13671 echo "${as_me:-configure}:13671: testing ...after  $LIBS ..." 1>&5
13672
13673 fi
13674
13675                 fi
13676                 ;;
13677         esac
13678
13679 echo "$as_me:13679: checking for usable X Toolkit package" >&5
13680 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13681 if test "${cf_cv_xt_ice_compat+set}" = set; then
13682   echo $ECHO_N "(cached) $ECHO_C" >&6
13683 else
13684
13685 cat >conftest.$ac_ext <<_ACEOF
13686 #line 13686 "configure"
13687 #include "confdefs.h"
13688
13689 #include <X11/Shell.h>
13690
13691 int
13692 main (void)
13693 {
13694 int num = IceConnectionNumber(0)
13695
13696   ;
13697   return 0;
13698 }
13699 _ACEOF
13700 rm -f conftest.$ac_objext conftest$ac_exeext
13701 if { (eval echo "$as_me:13701: \"$ac_link\"") >&5
13702   (eval $ac_link) 2>&5
13703   ac_status=$?
13704   echo "$as_me:13704: \$? = $ac_status" >&5
13705   (exit $ac_status); } &&
13706          { ac_try='test -s conftest$ac_exeext'
13707   { (eval echo "$as_me:13707: \"$ac_try\"") >&5
13708   (eval $ac_try) 2>&5
13709   ac_status=$?
13710   echo "$as_me:13710: \$? = $ac_status" >&5
13711   (exit $ac_status); }; }; then
13712   cf_cv_xt_ice_compat=yes
13713 else
13714   echo "$as_me: failed program was:" >&5
13715 cat conftest.$ac_ext >&5
13716 cf_cv_xt_ice_compat=no
13717 fi
13718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13719 fi
13720 echo "$as_me:13720: result: $cf_cv_xt_ice_compat" >&5
13721 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13722
13723         if test "$cf_cv_xt_ice_compat" = no
13724         then
13725                 # workaround for broken ".pc" files used for X Toolkit.
13726                 case "x$X_PRE_LIBS" in
13727                 (*-lICE*)
13728                         case "x$LIBS" in
13729                         (*-lICE*)
13730                                 ;;
13731                         (*)
13732                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13733
13734 echo "${as_me:-configure}:13734: testing work around broken ICE dependency ..." 1>&5
13735
13736 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13737         test -n "$verbose" && echo "    found package ice" 1>&6
13738
13739 echo "${as_me:-configure}:13739: testing found package ice ..." 1>&5
13740
13741         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13742         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13743         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13744
13745 echo "${as_me:-configure}:13745: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13746
13747         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13748
13749 echo "${as_me:-configure}:13749: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13750
13751 cf_fix_cppflags=no
13752 cf_new_cflags=
13753 cf_new_cppflags=
13754 cf_new_extra_cppflags=
13755
13756 for cf_add_cflags in $cf_pkgconfig_incs
13757 do
13758 case $cf_fix_cppflags in
13759 (no)
13760         case $cf_add_cflags in
13761         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13762                 case $cf_add_cflags in
13763                 (-D*)
13764                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13765
13766                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13767                                 && test -z "${cf_tst_cflags}" \
13768                                 && cf_fix_cppflags=yes
13769
13770                         if test $cf_fix_cppflags = yes ; then
13771
13772         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13773         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13774
13775                                 continue
13776                         elif test "${cf_tst_cflags}" = "\"'" ; then
13777
13778         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13779         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13780
13781                                 continue
13782                         fi
13783                         ;;
13784                 esac
13785                 case "$CPPFLAGS" in
13786                 (*$cf_add_cflags)
13787                         ;;
13788                 (*)
13789                         case $cf_add_cflags in
13790                         (-D*)
13791                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13792
13793 CPPFLAGS=`echo "$CPPFLAGS" | \
13794         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13795                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13796
13797                                 ;;
13798                         esac
13799
13800         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13801         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13802
13803                         ;;
13804                 esac
13805                 ;;
13806         (*)
13807
13808         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13809         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13810
13811                 ;;
13812         esac
13813         ;;
13814 (yes)
13815
13816         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13817         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13818
13819         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13820
13821         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13822                 && test -z "${cf_tst_cflags}" \
13823                 && cf_fix_cppflags=no
13824         ;;
13825 esac
13826 done
13827
13828 if test -n "$cf_new_cflags" ; then
13829
13830         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13831         CFLAGS="${CFLAGS}$cf_new_cflags"
13832
13833 fi
13834
13835 if test -n "$cf_new_cppflags" ; then
13836
13837         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13838         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13839
13840 fi
13841
13842 if test -n "$cf_new_extra_cppflags" ; then
13843
13844         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13845         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13846
13847 fi
13848
13849 cf_add_libs="$cf_pkgconfig_libs"
13850 # Filter out duplicates - this happens with badly-designed ".pc" files...
13851 for cf_add_1lib in $LIBS
13852 do
13853         for cf_add_2lib in $cf_add_libs
13854         do
13855                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13856                 then
13857                         cf_add_1lib=
13858                         break
13859                 fi
13860         done
13861         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13862 done
13863 LIBS="$cf_add_libs"
13864
13865 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13866         test -n "$verbose" && echo "    found package sm" 1>&6
13867
13868 echo "${as_me:-configure}:13868: testing found package sm ..." 1>&5
13869
13870         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13871         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13872         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13873
13874 echo "${as_me:-configure}:13874: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13875
13876         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13877
13878 echo "${as_me:-configure}:13878: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13879
13880 cf_fix_cppflags=no
13881 cf_new_cflags=
13882 cf_new_cppflags=
13883 cf_new_extra_cppflags=
13884
13885 for cf_add_cflags in $cf_pkgconfig_incs
13886 do
13887 case $cf_fix_cppflags in
13888 (no)
13889         case $cf_add_cflags in
13890         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13891                 case $cf_add_cflags in
13892                 (-D*)
13893                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13894
13895                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13896                                 && test -z "${cf_tst_cflags}" \
13897                                 && cf_fix_cppflags=yes
13898
13899                         if test $cf_fix_cppflags = yes ; then
13900
13901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13903
13904                                 continue
13905                         elif test "${cf_tst_cflags}" = "\"'" ; then
13906
13907         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13908         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13909
13910                                 continue
13911                         fi
13912                         ;;
13913                 esac
13914                 case "$CPPFLAGS" in
13915                 (*$cf_add_cflags)
13916                         ;;
13917                 (*)
13918                         case $cf_add_cflags in
13919                         (-D*)
13920                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13921
13922 CPPFLAGS=`echo "$CPPFLAGS" | \
13923         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13924                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13925
13926                                 ;;
13927                         esac
13928
13929         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13930         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13931
13932                         ;;
13933                 esac
13934                 ;;
13935         (*)
13936
13937         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13938         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13939
13940                 ;;
13941         esac
13942         ;;
13943 (yes)
13944
13945         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13946         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13947
13948         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13949
13950         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13951                 && test -z "${cf_tst_cflags}" \
13952                 && cf_fix_cppflags=no
13953         ;;
13954 esac
13955 done
13956
13957 if test -n "$cf_new_cflags" ; then
13958
13959         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13960         CFLAGS="${CFLAGS}$cf_new_cflags"
13961
13962 fi
13963
13964 if test -n "$cf_new_cppflags" ; then
13965
13966         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13967         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13968
13969 fi
13970
13971 if test -n "$cf_new_extra_cppflags" ; then
13972
13973         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13974         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13975
13976 fi
13977
13978 cf_add_libs="$cf_pkgconfig_libs"
13979 # Filter out duplicates - this happens with badly-designed ".pc" files...
13980 for cf_add_1lib in $LIBS
13981 do
13982         for cf_add_2lib in $cf_add_libs
13983         do
13984                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13985                 then
13986                         cf_add_1lib=
13987                         break
13988                 fi
13989         done
13990         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13991 done
13992 LIBS="$cf_add_libs"
13993
13994         :
13995 else
13996         cf_pkgconfig_incs=
13997         cf_pkgconfig_libs=
13998         :
13999 fi
14000
14001 else
14002         cf_pkgconfig_incs=
14003         cf_pkgconfig_libs=
14004
14005 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
14006
14007 echo "${as_me:-configure}:14007: testing ...before $LIBS ..." 1>&5
14008
14009 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
14010 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
14011
14012 echo "${as_me:-configure}:14012: testing ...after  $LIBS ..." 1>&5
14013
14014 fi
14015
14016                                 ;;
14017                         esac
14018                         ;;
14019                 esac
14020         fi
14021
14022         cf_have_X_LIBS=yes
14023
14024 else
14025         cf_pkgconfig_incs=
14026         cf_pkgconfig_libs=
14027
14028         LDFLAGS="$X_LIBS $LDFLAGS"
14029
14030 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14031
14032 echo "${as_me:-configure}:14032: testing checking additions to CFLAGS ..." 1>&5
14033
14034 cf_check_cflags="$CFLAGS"
14035 cf_check_cppflags="$CPPFLAGS"
14036
14037 cf_fix_cppflags=no
14038 cf_new_cflags=
14039 cf_new_cppflags=
14040 cf_new_extra_cppflags=
14041
14042 for cf_add_cflags in $X_CFLAGS
14043 do
14044 case $cf_fix_cppflags in
14045 (no)
14046         case $cf_add_cflags in
14047         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14048                 case $cf_add_cflags in
14049                 (-D*)
14050                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14051
14052                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14053                                 && test -z "${cf_tst_cflags}" \
14054                                 && cf_fix_cppflags=yes
14055
14056                         if test $cf_fix_cppflags = yes ; then
14057
14058         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14059         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14060
14061                                 continue
14062                         elif test "${cf_tst_cflags}" = "\"'" ; then
14063
14064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14066
14067                                 continue
14068                         fi
14069                         ;;
14070                 esac
14071                 case "$CPPFLAGS" in
14072                 (*$cf_add_cflags)
14073                         ;;
14074                 (*)
14075                         case $cf_add_cflags in
14076                         (-D*)
14077                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14078
14079 CPPFLAGS=`echo "$CPPFLAGS" | \
14080         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14081                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14082
14083                                 ;;
14084                         esac
14085
14086         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14087         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14088
14089                         ;;
14090                 esac
14091                 ;;
14092         (*)
14093
14094         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14095         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14096
14097                 ;;
14098         esac
14099         ;;
14100 (yes)
14101
14102         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14103         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14104
14105         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14106
14107         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14108                 && test -z "${cf_tst_cflags}" \
14109                 && cf_fix_cppflags=no
14110         ;;
14111 esac
14112 done
14113
14114 if test -n "$cf_new_cflags" ; then
14115         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14116
14117 echo "${as_me:-configure}:14117: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14118
14119         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14120         CFLAGS="${CFLAGS}$cf_new_cflags"
14121
14122 fi
14123
14124 if test -n "$cf_new_cppflags" ; then
14125         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14126
14127 echo "${as_me:-configure}:14127: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14128
14129         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14130         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14131
14132 fi
14133
14134 if test -n "$cf_new_extra_cppflags" ; then
14135         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14136
14137 echo "${as_me:-configure}:14137: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14138
14139         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14140         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14141
14142 fi
14143
14144 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14145 cat >conftest.$ac_ext <<_ACEOF
14146 #line 14146 "configure"
14147 #include "confdefs.h"
14148 #include <stdio.h>
14149 int
14150 main (void)
14151 {
14152 printf("Hello world");
14153   ;
14154   return 0;
14155 }
14156 _ACEOF
14157 rm -f conftest.$ac_objext conftest$ac_exeext
14158 if { (eval echo "$as_me:14158: \"$ac_link\"") >&5
14159   (eval $ac_link) 2>&5
14160   ac_status=$?
14161   echo "$as_me:14161: \$? = $ac_status" >&5
14162   (exit $ac_status); } &&
14163          { ac_try='test -s conftest$ac_exeext'
14164   { (eval echo "$as_me:14164: \"$ac_try\"") >&5
14165   (eval $ac_try) 2>&5
14166   ac_status=$?
14167   echo "$as_me:14167: \$? = $ac_status" >&5
14168   (exit $ac_status); }; }; then
14169   :
14170 else
14171   echo "$as_me: failed program was:" >&5
14172 cat conftest.$ac_ext >&5
14173 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14174
14175 echo "${as_me:-configure}:14175: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14176
14177          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14178                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14179
14180 echo "${as_me:-configure}:14180: testing but keeping change to \$CPPFLAGS ..." 1>&5
14181
14182          fi
14183          CFLAGS="$cf_check_flags"
14184 fi
14185 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14186 fi
14187
14188         echo "$as_me:14188: checking for XOpenDisplay" >&5
14189 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14190 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14191   echo $ECHO_N "(cached) $ECHO_C" >&6
14192 else
14193   cat >conftest.$ac_ext <<_ACEOF
14194 #line 14194 "configure"
14195 #include "confdefs.h"
14196 /* System header to define __stub macros and hopefully few prototypes,
14197     which can conflict with char XOpenDisplay (); below.  */
14198 #include <assert.h>
14199 /* Override any gcc2 internal prototype to avoid an error.  */
14200 #ifdef __cplusplus
14201 extern "C"
14202 #endif
14203 /* We use char because int might match the return type of a gcc2
14204    builtin and then its argument prototype would still apply.  */
14205 char XOpenDisplay ();
14206 char (*f) ();
14207
14208 int
14209 main (void)
14210 {
14211 /* The GNU C library defines this for functions which it implements
14212     to always fail with ENOSYS.  Some functions are actually named
14213     something starting with __ and the normal name is an alias.  */
14214 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14215 choke me
14216 #else
14217 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14218 #endif
14219
14220   ;
14221   return 0;
14222 }
14223 _ACEOF
14224 rm -f conftest.$ac_objext conftest$ac_exeext
14225 if { (eval echo "$as_me:14225: \"$ac_link\"") >&5
14226   (eval $ac_link) 2>&5
14227   ac_status=$?
14228   echo "$as_me:14228: \$? = $ac_status" >&5
14229   (exit $ac_status); } &&
14230          { ac_try='test -s conftest$ac_exeext'
14231   { (eval echo "$as_me:14231: \"$ac_try\"") >&5
14232   (eval $ac_try) 2>&5
14233   ac_status=$?
14234   echo "$as_me:14234: \$? = $ac_status" >&5
14235   (exit $ac_status); }; }; then
14236   ac_cv_func_XOpenDisplay=yes
14237 else
14238   echo "$as_me: failed program was:" >&5
14239 cat conftest.$ac_ext >&5
14240 ac_cv_func_XOpenDisplay=no
14241 fi
14242 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14243 fi
14244 echo "$as_me:14244: result: $ac_cv_func_XOpenDisplay" >&5
14245 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14246 if test $ac_cv_func_XOpenDisplay = yes; then
14247   :
14248 else
14249
14250         echo "$as_me:14250: checking for XOpenDisplay in -lX11" >&5
14251 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14252 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14253   echo $ECHO_N "(cached) $ECHO_C" >&6
14254 else
14255   ac_check_lib_save_LIBS=$LIBS
14256 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14257 cat >conftest.$ac_ext <<_ACEOF
14258 #line 14258 "configure"
14259 #include "confdefs.h"
14260
14261 /* Override any gcc2 internal prototype to avoid an error.  */
14262 #ifdef __cplusplus
14263 extern "C"
14264 #endif
14265 /* We use char because int might match the return type of a gcc2
14266    builtin and then its argument prototype would still apply.  */
14267 char XOpenDisplay ();
14268 int
14269 main (void)
14270 {
14271 XOpenDisplay ();
14272   ;
14273   return 0;
14274 }
14275 _ACEOF
14276 rm -f conftest.$ac_objext conftest$ac_exeext
14277 if { (eval echo "$as_me:14277: \"$ac_link\"") >&5
14278   (eval $ac_link) 2>&5
14279   ac_status=$?
14280   echo "$as_me:14280: \$? = $ac_status" >&5
14281   (exit $ac_status); } &&
14282          { ac_try='test -s conftest$ac_exeext'
14283   { (eval echo "$as_me:14283: \"$ac_try\"") >&5
14284   (eval $ac_try) 2>&5
14285   ac_status=$?
14286   echo "$as_me:14286: \$? = $ac_status" >&5
14287   (exit $ac_status); }; }; then
14288   ac_cv_lib_X11_XOpenDisplay=yes
14289 else
14290   echo "$as_me: failed program was:" >&5
14291 cat conftest.$ac_ext >&5
14292 ac_cv_lib_X11_XOpenDisplay=no
14293 fi
14294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14295 LIBS=$ac_check_lib_save_LIBS
14296 fi
14297 echo "$as_me:14297: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14298 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14299 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14300
14301 cf_add_libs="-lX11"
14302 # Filter out duplicates - this happens with badly-designed ".pc" files...
14303 for cf_add_1lib in $LIBS
14304 do
14305         for cf_add_2lib in $cf_add_libs
14306         do
14307                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14308                 then
14309                         cf_add_1lib=
14310                         break
14311                 fi
14312         done
14313         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14314 done
14315 LIBS="$cf_add_libs"
14316
14317 fi
14318
14319 fi
14320
14321         echo "$as_me:14321: checking for XtAppInitialize" >&5
14322 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14323 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14324   echo $ECHO_N "(cached) $ECHO_C" >&6
14325 else
14326   cat >conftest.$ac_ext <<_ACEOF
14327 #line 14327 "configure"
14328 #include "confdefs.h"
14329 /* System header to define __stub macros and hopefully few prototypes,
14330     which can conflict with char XtAppInitialize (); below.  */
14331 #include <assert.h>
14332 /* Override any gcc2 internal prototype to avoid an error.  */
14333 #ifdef __cplusplus
14334 extern "C"
14335 #endif
14336 /* We use char because int might match the return type of a gcc2
14337    builtin and then its argument prototype would still apply.  */
14338 char XtAppInitialize ();
14339 char (*f) ();
14340
14341 int
14342 main (void)
14343 {
14344 /* The GNU C library defines this for functions which it implements
14345     to always fail with ENOSYS.  Some functions are actually named
14346     something starting with __ and the normal name is an alias.  */
14347 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14348 choke me
14349 #else
14350 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14351 #endif
14352
14353   ;
14354   return 0;
14355 }
14356 _ACEOF
14357 rm -f conftest.$ac_objext conftest$ac_exeext
14358 if { (eval echo "$as_me:14358: \"$ac_link\"") >&5
14359   (eval $ac_link) 2>&5
14360   ac_status=$?
14361   echo "$as_me:14361: \$? = $ac_status" >&5
14362   (exit $ac_status); } &&
14363          { ac_try='test -s conftest$ac_exeext'
14364   { (eval echo "$as_me:14364: \"$ac_try\"") >&5
14365   (eval $ac_try) 2>&5
14366   ac_status=$?
14367   echo "$as_me:14367: \$? = $ac_status" >&5
14368   (exit $ac_status); }; }; then
14369   ac_cv_func_XtAppInitialize=yes
14370 else
14371   echo "$as_me: failed program was:" >&5
14372 cat conftest.$ac_ext >&5
14373 ac_cv_func_XtAppInitialize=no
14374 fi
14375 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14376 fi
14377 echo "$as_me:14377: result: $ac_cv_func_XtAppInitialize" >&5
14378 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14379 if test $ac_cv_func_XtAppInitialize = yes; then
14380   :
14381 else
14382
14383         echo "$as_me:14383: checking for XtAppInitialize in -lXt" >&5
14384 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14385 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14386   echo $ECHO_N "(cached) $ECHO_C" >&6
14387 else
14388   ac_check_lib_save_LIBS=$LIBS
14389 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14390 cat >conftest.$ac_ext <<_ACEOF
14391 #line 14391 "configure"
14392 #include "confdefs.h"
14393
14394 /* Override any gcc2 internal prototype to avoid an error.  */
14395 #ifdef __cplusplus
14396 extern "C"
14397 #endif
14398 /* We use char because int might match the return type of a gcc2
14399    builtin and then its argument prototype would still apply.  */
14400 char XtAppInitialize ();
14401 int
14402 main (void)
14403 {
14404 XtAppInitialize ();
14405   ;
14406   return 0;
14407 }
14408 _ACEOF
14409 rm -f conftest.$ac_objext conftest$ac_exeext
14410 if { (eval echo "$as_me:14410: \"$ac_link\"") >&5
14411   (eval $ac_link) 2>&5
14412   ac_status=$?
14413   echo "$as_me:14413: \$? = $ac_status" >&5
14414   (exit $ac_status); } &&
14415          { ac_try='test -s conftest$ac_exeext'
14416   { (eval echo "$as_me:14416: \"$ac_try\"") >&5
14417   (eval $ac_try) 2>&5
14418   ac_status=$?
14419   echo "$as_me:14419: \$? = $ac_status" >&5
14420   (exit $ac_status); }; }; then
14421   ac_cv_lib_Xt_XtAppInitialize=yes
14422 else
14423   echo "$as_me: failed program was:" >&5
14424 cat conftest.$ac_ext >&5
14425 ac_cv_lib_Xt_XtAppInitialize=no
14426 fi
14427 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14428 LIBS=$ac_check_lib_save_LIBS
14429 fi
14430 echo "$as_me:14430: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14431 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14432 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14433
14434 cat >>confdefs.h <<\EOF
14435 #define HAVE_LIBXT 1
14436 EOF
14437
14438                  cf_have_X_LIBS=Xt
14439                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14440 fi
14441
14442 fi
14443
14444 fi
14445
14446 if test $cf_have_X_LIBS = no ; then
14447         { echo "$as_me:14447: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14448 test program.  You will have to check and add the proper libraries by hand
14449 to makefile." >&5
14450 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14451 test program.  You will have to check and add the proper libraries by hand
14452 to makefile." >&2;}
14453 fi
14454
14455 cf_x_athena_root=$cf_x_athena
14456 cf_x_athena_inc=""
14457
14458 for cf_path in default \
14459         /usr/contrib/X11R6 \
14460         /usr/contrib/X11R5 \
14461         /usr/lib/X11R5 \
14462         /usr/local
14463 do
14464         if test -z "$cf_x_athena_inc" ; then
14465                 cf_save="$CPPFLAGS"
14466                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14467                 if test $cf_path != default ; then
14468                         CPPFLAGS="$cf_save"
14469
14470         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14471         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14472
14473                         echo "$as_me:14473: checking for $cf_test in $cf_path" >&5
14474 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14475                 else
14476                         echo "$as_me:14476: checking for $cf_test" >&5
14477 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14478                 fi
14479                 cat >conftest.$ac_ext <<_ACEOF
14480 #line 14480 "configure"
14481 #include "confdefs.h"
14482
14483 #include <X11/Intrinsic.h>
14484 #include <$cf_test>
14485 int
14486 main (void)
14487 {
14488
14489   ;
14490   return 0;
14491 }
14492 _ACEOF
14493 rm -f conftest.$ac_objext
14494 if { (eval echo "$as_me:14494: \"$ac_compile\"") >&5
14495   (eval $ac_compile) 2>&5
14496   ac_status=$?
14497   echo "$as_me:14497: \$? = $ac_status" >&5
14498   (exit $ac_status); } &&
14499          { ac_try='test -s conftest.$ac_objext'
14500   { (eval echo "$as_me:14500: \"$ac_try\"") >&5
14501   (eval $ac_try) 2>&5
14502   ac_status=$?
14503   echo "$as_me:14503: \$? = $ac_status" >&5
14504   (exit $ac_status); }; }; then
14505   cf_result=yes
14506 else
14507   echo "$as_me: failed program was:" >&5
14508 cat conftest.$ac_ext >&5
14509 cf_result=no
14510 fi
14511 rm -f conftest.$ac_objext conftest.$ac_ext
14512                 echo "$as_me:14512: result: $cf_result" >&5
14513 echo "${ECHO_T}$cf_result" >&6
14514                 if test "$cf_result" = yes ; then
14515                         cf_x_athena_inc=$cf_path
14516                         break
14517                 else
14518                         CPPFLAGS="$cf_save"
14519                 fi
14520         fi
14521 done
14522
14523 if test -z "$cf_x_athena_inc" ; then
14524         { echo "$as_me:14524: WARNING: Unable to successfully find Athena header files with test program" >&5
14525 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14526 elif test "$cf_x_athena_inc" != default ; then
14527
14528         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14529         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14530
14531 fi
14532
14533 cf_x_athena_root=$cf_x_athena
14534 cf_x_athena_lib=""
14535
14536 for cf_path in default \
14537         /usr/contrib/X11R6 \
14538         /usr/contrib/X11R5 \
14539         /usr/lib/X11R5 \
14540         /usr/local
14541 do
14542         for cf_lib in \
14543                 ${cf_x_athena_root} \
14544                 ${cf_x_athena_root}7 \
14545                 ${cf_x_athena_root}6
14546         do
14547         for cf_libs in \
14548                 "-l$cf_lib -lXmu" \
14549                 "-l$cf_lib -lXpm -lXmu" \
14550                 "-l${cf_lib}_s -lXmu_s"
14551         do
14552                 if test -z "$cf_x_athena_lib" ; then
14553                         cf_save="$LIBS"
14554                         cf_test=XawSimpleMenuAddGlobalActions
14555                         if test $cf_path != default ; then
14556
14557 cf_add_libs="-L$cf_path/lib $cf_libs"
14558 # Filter out duplicates - this happens with badly-designed ".pc" files...
14559 for cf_add_1lib in $LIBS
14560 do
14561         for cf_add_2lib in $cf_add_libs
14562         do
14563                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14564                 then
14565                         cf_add_1lib=
14566                         break
14567                 fi
14568         done
14569         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14570 done
14571 LIBS="$cf_add_libs"
14572
14573                                 echo "$as_me:14573: checking for $cf_libs in $cf_path" >&5
14574 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14575                         else
14576
14577 cf_add_libs="$cf_libs"
14578 # Filter out duplicates - this happens with badly-designed ".pc" files...
14579 for cf_add_1lib in $LIBS
14580 do
14581         for cf_add_2lib in $cf_add_libs
14582         do
14583                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14584                 then
14585                         cf_add_1lib=
14586                         break
14587                 fi
14588         done
14589         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14590 done
14591 LIBS="$cf_add_libs"
14592
14593                                 echo "$as_me:14593: checking for $cf_test in $cf_libs" >&5
14594 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14595                         fi
14596                         cat >conftest.$ac_ext <<_ACEOF
14597 #line 14597 "configure"
14598 #include "confdefs.h"
14599
14600 #include <X11/Intrinsic.h>
14601 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14602
14603 int
14604 main (void)
14605 {
14606
14607 $cf_test((XtAppContext) 0)
14608   ;
14609   return 0;
14610 }
14611 _ACEOF
14612 rm -f conftest.$ac_objext conftest$ac_exeext
14613 if { (eval echo "$as_me:14613: \"$ac_link\"") >&5
14614   (eval $ac_link) 2>&5
14615   ac_status=$?
14616   echo "$as_me:14616: \$? = $ac_status" >&5
14617   (exit $ac_status); } &&
14618          { ac_try='test -s conftest$ac_exeext'
14619   { (eval echo "$as_me:14619: \"$ac_try\"") >&5
14620   (eval $ac_try) 2>&5
14621   ac_status=$?
14622   echo "$as_me:14622: \$? = $ac_status" >&5
14623   (exit $ac_status); }; }; then
14624   cf_result=yes
14625 else
14626   echo "$as_me: failed program was:" >&5
14627 cat conftest.$ac_ext >&5
14628 cf_result=no
14629 fi
14630 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14631                         echo "$as_me:14631: result: $cf_result" >&5
14632 echo "${ECHO_T}$cf_result" >&6
14633                         if test "$cf_result" = yes ; then
14634                                 cf_x_athena_lib="$cf_libs"
14635                                 break
14636                         fi
14637                         LIBS="$cf_save"
14638                 fi
14639         done # cf_libs
14640                 test -n "$cf_x_athena_lib" && break
14641         done # cf_lib
14642 done
14643
14644 if test -z "$cf_x_athena_lib" ; then
14645         { { echo "$as_me:14645: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14646 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14647    { (exit 1); exit 1; }; }
14648 fi
14649
14650 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14651
14652 cat >>confdefs.h <<EOF
14653 #define $cf_x_athena_LIBS 1
14654 EOF
14655
14656 fi
14657
14658 if test -n "$ac_tool_prefix"; then
14659   for ac_prog in xcurses-config
14660   do
14661     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14662 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14663 echo "$as_me:14663: checking for $ac_word" >&5
14664 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14665 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14666   echo $ECHO_N "(cached) $ECHO_C" >&6
14667 else
14668   if test -n "$XCURSES_CONFIG"; then
14669   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14670 else
14671   ac_save_IFS=$IFS; IFS=$ac_path_separator
14672 ac_dummy="$PATH"
14673 for ac_dir in $ac_dummy; do
14674   IFS=$ac_save_IFS
14675   test -z "$ac_dir" && ac_dir=.
14676   $as_executable_p "$ac_dir/$ac_word" || continue
14677 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14678 echo "$as_me:14678: found $ac_dir/$ac_word" >&5
14679 break
14680 done
14681
14682 fi
14683 fi
14684 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14685 if test -n "$XCURSES_CONFIG"; then
14686   echo "$as_me:14686: result: $XCURSES_CONFIG" >&5
14687 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14688 else
14689   echo "$as_me:14689: result: no" >&5
14690 echo "${ECHO_T}no" >&6
14691 fi
14692
14693     test -n "$XCURSES_CONFIG" && break
14694   done
14695 fi
14696 if test -z "$XCURSES_CONFIG"; then
14697   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14698   for ac_prog in xcurses-config
14699 do
14700   # Extract the first word of "$ac_prog", so it can be a program name with args.
14701 set dummy $ac_prog; ac_word=$2
14702 echo "$as_me:14702: checking for $ac_word" >&5
14703 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14704 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14705   echo $ECHO_N "(cached) $ECHO_C" >&6
14706 else
14707   if test -n "$ac_ct_XCURSES_CONFIG"; then
14708   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14709 else
14710   ac_save_IFS=$IFS; IFS=$ac_path_separator
14711 ac_dummy="$PATH"
14712 for ac_dir in $ac_dummy; do
14713   IFS=$ac_save_IFS
14714   test -z "$ac_dir" && ac_dir=.
14715   $as_executable_p "$ac_dir/$ac_word" || continue
14716 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14717 echo "$as_me:14717: found $ac_dir/$ac_word" >&5
14718 break
14719 done
14720
14721 fi
14722 fi
14723 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14724 if test -n "$ac_ct_XCURSES_CONFIG"; then
14725   echo "$as_me:14725: result: $ac_ct_XCURSES_CONFIG" >&5
14726 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14727 else
14728   echo "$as_me:14728: result: no" >&5
14729 echo "${ECHO_T}no" >&6
14730 fi
14731
14732   test -n "$ac_ct_XCURSES_CONFIG" && break
14733 done
14734 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14735
14736   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14737 fi
14738
14739 if test "$XCURSES_CONFIG" != none ; then
14740
14741 cf_fix_cppflags=no
14742 cf_new_cflags=
14743 cf_new_cppflags=
14744 cf_new_extra_cppflags=
14745
14746 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14747 do
14748 case $cf_fix_cppflags in
14749 (no)
14750         case $cf_add_cflags in
14751         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14752                 case $cf_add_cflags in
14753                 (-D*)
14754                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14755
14756                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14757                                 && test -z "${cf_tst_cflags}" \
14758                                 && cf_fix_cppflags=yes
14759
14760                         if test $cf_fix_cppflags = yes ; then
14761
14762         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14763         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14764
14765                                 continue
14766                         elif test "${cf_tst_cflags}" = "\"'" ; then
14767
14768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14770
14771                                 continue
14772                         fi
14773                         ;;
14774                 esac
14775                 case "$CPPFLAGS" in
14776                 (*$cf_add_cflags)
14777                         ;;
14778                 (*)
14779                         case $cf_add_cflags in
14780                         (-D*)
14781                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14782
14783 CPPFLAGS=`echo "$CPPFLAGS" | \
14784         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14785                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14786
14787                                 ;;
14788                         esac
14789
14790         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14791         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14792
14793                         ;;
14794                 esac
14795                 ;;
14796         (*)
14797
14798         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14799         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14800
14801                 ;;
14802         esac
14803         ;;
14804 (yes)
14805
14806         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14807         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14808
14809         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14810
14811         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14812                 && test -z "${cf_tst_cflags}" \
14813                 && cf_fix_cppflags=no
14814         ;;
14815 esac
14816 done
14817
14818 if test -n "$cf_new_cflags" ; then
14819
14820         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14821         CFLAGS="${CFLAGS}$cf_new_cflags"
14822
14823 fi
14824
14825 if test -n "$cf_new_cppflags" ; then
14826
14827         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14828         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14829
14830 fi
14831
14832 if test -n "$cf_new_extra_cppflags" ; then
14833
14834         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14835         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14836
14837 fi
14838
14839 cf_add_libs="`$XCURSES_CONFIG --libs`"
14840 # Filter out duplicates - this happens with badly-designed ".pc" files...
14841 for cf_add_1lib in $LIBS
14842 do
14843         for cf_add_2lib in $cf_add_libs
14844         do
14845                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14846                 then
14847                         cf_add_1lib=
14848                         break
14849                 fi
14850         done
14851         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14852 done
14853 LIBS="$cf_add_libs"
14854
14855 cf_cv_lib_XCurses=yes
14856
14857 else
14858
14859 LDFLAGS="$LDFLAGS $X_LIBS"
14860
14861 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14862
14863 echo "${as_me:-configure}:14863: testing checking additions to CFLAGS ..." 1>&5
14864
14865 cf_check_cflags="$CFLAGS"
14866 cf_check_cppflags="$CPPFLAGS"
14867
14868 cf_fix_cppflags=no
14869 cf_new_cflags=
14870 cf_new_cppflags=
14871 cf_new_extra_cppflags=
14872
14873 for cf_add_cflags in $X_CFLAGS
14874 do
14875 case $cf_fix_cppflags in
14876 (no)
14877         case $cf_add_cflags in
14878         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14879                 case $cf_add_cflags in
14880                 (-D*)
14881                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14882
14883                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14884                                 && test -z "${cf_tst_cflags}" \
14885                                 && cf_fix_cppflags=yes
14886
14887                         if test $cf_fix_cppflags = yes ; then
14888
14889         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14890         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14891
14892                                 continue
14893                         elif test "${cf_tst_cflags}" = "\"'" ; then
14894
14895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14897
14898                                 continue
14899                         fi
14900                         ;;
14901                 esac
14902                 case "$CPPFLAGS" in
14903                 (*$cf_add_cflags)
14904                         ;;
14905                 (*)
14906                         case $cf_add_cflags in
14907                         (-D*)
14908                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14909
14910 CPPFLAGS=`echo "$CPPFLAGS" | \
14911         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14912                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14913
14914                                 ;;
14915                         esac
14916
14917         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14918         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14919
14920                         ;;
14921                 esac
14922                 ;;
14923         (*)
14924
14925         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14926         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14927
14928                 ;;
14929         esac
14930         ;;
14931 (yes)
14932
14933         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14934         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14935
14936         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14937
14938         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14939                 && test -z "${cf_tst_cflags}" \
14940                 && cf_fix_cppflags=no
14941         ;;
14942 esac
14943 done
14944
14945 if test -n "$cf_new_cflags" ; then
14946         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14947
14948 echo "${as_me:-configure}:14948: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14949
14950         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14951         CFLAGS="${CFLAGS}$cf_new_cflags"
14952
14953 fi
14954
14955 if test -n "$cf_new_cppflags" ; then
14956         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14957
14958 echo "${as_me:-configure}:14958: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14959
14960         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14961         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14962
14963 fi
14964
14965 if test -n "$cf_new_extra_cppflags" ; then
14966         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14967
14968 echo "${as_me:-configure}:14968: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14969
14970         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14971         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14972
14973 fi
14974
14975 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14976 cat >conftest.$ac_ext <<_ACEOF
14977 #line 14977 "configure"
14978 #include "confdefs.h"
14979 #include <stdio.h>
14980 int
14981 main (void)
14982 {
14983 printf("Hello world");
14984   ;
14985   return 0;
14986 }
14987 _ACEOF
14988 rm -f conftest.$ac_objext conftest$ac_exeext
14989 if { (eval echo "$as_me:14989: \"$ac_link\"") >&5
14990   (eval $ac_link) 2>&5
14991   ac_status=$?
14992   echo "$as_me:14992: \$? = $ac_status" >&5
14993   (exit $ac_status); } &&
14994          { ac_try='test -s conftest$ac_exeext'
14995   { (eval echo "$as_me:14995: \"$ac_try\"") >&5
14996   (eval $ac_try) 2>&5
14997   ac_status=$?
14998   echo "$as_me:14998: \$? = $ac_status" >&5
14999   (exit $ac_status); }; }; then
15000   :
15001 else
15002   echo "$as_me: failed program was:" >&5
15003 cat conftest.$ac_ext >&5
15004 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
15005
15006 echo "${as_me:-configure}:15006: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
15007
15008          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
15009                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
15010
15011 echo "${as_me:-configure}:15011: testing but keeping change to \$CPPFLAGS ..." 1>&5
15012
15013          fi
15014          CFLAGS="$cf_check_flags"
15015 fi
15016 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15017 fi
15018
15019 echo "$as_me:15019: checking for XOpenDisplay in -lX11" >&5
15020 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
15021 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
15022   echo $ECHO_N "(cached) $ECHO_C" >&6
15023 else
15024   ac_check_lib_save_LIBS=$LIBS
15025 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
15026 cat >conftest.$ac_ext <<_ACEOF
15027 #line 15027 "configure"
15028 #include "confdefs.h"
15029
15030 /* Override any gcc2 internal prototype to avoid an error.  */
15031 #ifdef __cplusplus
15032 extern "C"
15033 #endif
15034 /* We use char because int might match the return type of a gcc2
15035    builtin and then its argument prototype would still apply.  */
15036 char XOpenDisplay ();
15037 int
15038 main (void)
15039 {
15040 XOpenDisplay ();
15041   ;
15042   return 0;
15043 }
15044 _ACEOF
15045 rm -f conftest.$ac_objext conftest$ac_exeext
15046 if { (eval echo "$as_me:15046: \"$ac_link\"") >&5
15047   (eval $ac_link) 2>&5
15048   ac_status=$?
15049   echo "$as_me:15049: \$? = $ac_status" >&5
15050   (exit $ac_status); } &&
15051          { ac_try='test -s conftest$ac_exeext'
15052   { (eval echo "$as_me:15052: \"$ac_try\"") >&5
15053   (eval $ac_try) 2>&5
15054   ac_status=$?
15055   echo "$as_me:15055: \$? = $ac_status" >&5
15056   (exit $ac_status); }; }; then
15057   ac_cv_lib_X11_XOpenDisplay=yes
15058 else
15059   echo "$as_me: failed program was:" >&5
15060 cat conftest.$ac_ext >&5
15061 ac_cv_lib_X11_XOpenDisplay=no
15062 fi
15063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15064 LIBS=$ac_check_lib_save_LIBS
15065 fi
15066 echo "$as_me:15066: result: $ac_cv_lib_X11_XOpenDisplay" >&5
15067 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
15068 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
15069
15070 cf_add_libs="-lX11"
15071 # Filter out duplicates - this happens with badly-designed ".pc" files...
15072 for cf_add_1lib in $LIBS
15073 do
15074         for cf_add_2lib in $cf_add_libs
15075         do
15076                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15077                 then
15078                         cf_add_1lib=
15079                         break
15080                 fi
15081         done
15082         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15083 done
15084 LIBS="$cf_add_libs"
15085
15086 fi
15087
15088 echo "$as_me:15088: checking for XCurses library" >&5
15089 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
15090 if test "${cf_cv_lib_XCurses+set}" = set; then
15091   echo $ECHO_N "(cached) $ECHO_C" >&6
15092 else
15093
15094 cf_add_libs="-lXCurses"
15095 # Filter out duplicates - this happens with badly-designed ".pc" files...
15096 for cf_add_1lib in $LIBS
15097 do
15098         for cf_add_2lib in $cf_add_libs
15099         do
15100                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15101                 then
15102                         cf_add_1lib=
15103                         break
15104                 fi
15105         done
15106         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15107 done
15108 LIBS="$cf_add_libs"
15109
15110 cat >conftest.$ac_ext <<_ACEOF
15111 #line 15111 "configure"
15112 #include "confdefs.h"
15113
15114 #include <xcurses.h>
15115 char *XCursesProgramName = "test";
15116
15117 int
15118 main (void)
15119 {
15120 XCursesExit();
15121   ;
15122   return 0;
15123 }
15124 _ACEOF
15125 rm -f conftest.$ac_objext conftest$ac_exeext
15126 if { (eval echo "$as_me:15126: \"$ac_link\"") >&5
15127   (eval $ac_link) 2>&5
15128   ac_status=$?
15129   echo "$as_me:15129: \$? = $ac_status" >&5
15130   (exit $ac_status); } &&
15131          { ac_try='test -s conftest$ac_exeext'
15132   { (eval echo "$as_me:15132: \"$ac_try\"") >&5
15133   (eval $ac_try) 2>&5
15134   ac_status=$?
15135   echo "$as_me:15135: \$? = $ac_status" >&5
15136   (exit $ac_status); }; }; then
15137   cf_cv_lib_XCurses=yes
15138 else
15139   echo "$as_me: failed program was:" >&5
15140 cat conftest.$ac_ext >&5
15141 cf_cv_lib_XCurses=no
15142 fi
15143 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15144
15145 fi
15146 echo "$as_me:15146: result: $cf_cv_lib_XCurses" >&5
15147 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
15148
15149 fi
15150
15151 if test $cf_cv_lib_XCurses = yes ; then
15152
15153 cat >>confdefs.h <<\EOF
15154 #define UNIX 1
15155 EOF
15156
15157 cat >>confdefs.h <<\EOF
15158 #define XCURSES 1
15159 EOF
15160
15161         echo "$as_me:15161: checking for xcurses.h" >&5
15162 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
15163 if test "${ac_cv_header_xcurses_h+set}" = set; then
15164   echo $ECHO_N "(cached) $ECHO_C" >&6
15165 else
15166   cat >conftest.$ac_ext <<_ACEOF
15167 #line 15167 "configure"
15168 #include "confdefs.h"
15169 #include <xcurses.h>
15170 _ACEOF
15171 if { (eval echo "$as_me:15171: \"$ac_cpp conftest.$ac_ext\"") >&5
15172   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15173   ac_status=$?
15174   egrep -v '^ *\+' conftest.er1 >conftest.err
15175   rm -f conftest.er1
15176   cat conftest.err >&5
15177   echo "$as_me:15177: \$? = $ac_status" >&5
15178   (exit $ac_status); } >/dev/null; then
15179   if test -s conftest.err; then
15180     ac_cpp_err=$ac_c_preproc_warn_flag
15181   else
15182     ac_cpp_err=
15183   fi
15184 else
15185   ac_cpp_err=yes
15186 fi
15187 if test -z "$ac_cpp_err"; then
15188   ac_cv_header_xcurses_h=yes
15189 else
15190   echo "$as_me: failed program was:" >&5
15191   cat conftest.$ac_ext >&5
15192   ac_cv_header_xcurses_h=no
15193 fi
15194 rm -f conftest.err conftest.$ac_ext
15195 fi
15196 echo "$as_me:15196: result: $ac_cv_header_xcurses_h" >&5
15197 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15198 if test $ac_cv_header_xcurses_h = yes; then
15199
15200 cat >>confdefs.h <<\EOF
15201 #define HAVE_XCURSES 1
15202 EOF
15203
15204 fi
15205
15206 else
15207         { { echo "$as_me:15207: error: Cannot link with XCurses" >&5
15208 echo "$as_me: error: Cannot link with XCurses" >&2;}
15209    { (exit 1); exit 1; }; }
15210 fi
15211
15212         ;;
15213 (*)
15214         { { echo "$as_me:15214: error: unexpected screen-value: $cf_cv_screen" >&5
15215 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15216    { (exit 1); exit 1; }; }
15217         ;;
15218 esac
15219
15220 : ${cf_nculib_root:=$cf_cv_screen}
15221 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15222 echo "$as_me:15222: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15223 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15224 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15225   echo $ECHO_N "(cached) $ECHO_C" >&6
15226 else
15227   ac_check_lib_save_LIBS=$LIBS
15228 LIBS="-l$cf_nculib_root  $LIBS"
15229 cat >conftest.$ac_ext <<_ACEOF
15230 #line 15230 "configure"
15231 #include "confdefs.h"
15232
15233 /* Override any gcc2 internal prototype to avoid an error.  */
15234 #ifdef __cplusplus
15235 extern "C"
15236 #endif
15237 /* We use char because int might match the return type of a gcc2
15238    builtin and then its argument prototype would still apply.  */
15239 char _nc_init_pthreads ();
15240 int
15241 main (void)
15242 {
15243 _nc_init_pthreads ();
15244   ;
15245   return 0;
15246 }
15247 _ACEOF
15248 rm -f conftest.$ac_objext conftest$ac_exeext
15249 if { (eval echo "$as_me:15249: \"$ac_link\"") >&5
15250   (eval $ac_link) 2>&5
15251   ac_status=$?
15252   echo "$as_me:15252: \$? = $ac_status" >&5
15253   (exit $ac_status); } &&
15254          { ac_try='test -s conftest$ac_exeext'
15255   { (eval echo "$as_me:15255: \"$ac_try\"") >&5
15256   (eval $ac_try) 2>&5
15257   ac_status=$?
15258   echo "$as_me:15258: \$? = $ac_status" >&5
15259   (exit $ac_status); }; }; then
15260   eval "$as_ac_Lib=yes"
15261 else
15262   echo "$as_me: failed program was:" >&5
15263 cat conftest.$ac_ext >&5
15264 eval "$as_ac_Lib=no"
15265 fi
15266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15267 LIBS=$ac_check_lib_save_LIBS
15268 fi
15269 echo "$as_me:15269: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15270 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15271 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15272   cf_cv_ncurses_pthreads=yes
15273 else
15274   cf_cv_ncurses_pthreads=no
15275 fi
15276
15277 if test "$cf_cv_ncurses_pthreads" = yes
15278 then
15279
15280 cf_add_libs="-lpthread"
15281 # Filter out duplicates - this happens with badly-designed ".pc" files...
15282 for cf_add_1lib in $LIBS
15283 do
15284         for cf_add_2lib in $cf_add_libs
15285         do
15286                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15287                 then
15288                         cf_add_1lib=
15289                         break
15290                 fi
15291         done
15292         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15293 done
15294 LIBS="$cf_add_libs"
15295
15296 fi
15297
15298 case $cf_cv_screen in
15299 (ncurses*)
15300         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15301         ;;
15302 esac
15303
15304 echo "$as_me:15304: checking for X11 rgb file" >&5
15305 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15306
15307 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15308 if test "${with_x11_rgb+set}" = set; then
15309   withval="$with_x11_rgb"
15310   RGB_PATH=$withval
15311 else
15312   RGB_PATH=auto
15313 fi;
15314
15315 if test "x$RGB_PATH" = xauto
15316 then
15317         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15318         for cf_path in \
15319                 /opt/local/share/X11/rgb.txt \
15320                 /opt/X11/share/X11/rgb.txt \
15321                 /usr/share/X11/rgb.txt \
15322                 /usr/X11/share/X11/rgb.txt \
15323                 /usr/X11/lib/X11/rgb.txt \
15324                 /usr/lib/X11/rgb.txt \
15325                 /etc/X11/rgb.txt \
15326                 /usr/pkg/lib/X11/rgb.txt \
15327                 /usr/X11R7/lib/X11/rgb.txt \
15328                 /usr/X11R6/lib/X11/rgb.txt \
15329                 /usr/X11R5/lib/X11/rgb.txt \
15330                 /usr/X11R4/lib/X11/rgb.txt \
15331                 /usr/local/lib/X11/rgb.txt \
15332                 /usr/local/share/X11/rgb.txt \
15333                 /usr/lib64/X11/rgb.txt
15334         do
15335                 if test -f "$cf_path" ; then
15336                         RGB_PATH="$cf_path"
15337                         break
15338                 fi
15339         done
15340 else
15341         cf_path=$RGB_PATH
15342
15343 if test "x$prefix" != xNONE; then
15344         cf_path_syntax="$prefix"
15345 else
15346         cf_path_syntax="$ac_default_prefix"
15347 fi
15348
15349 case ".$cf_path" in
15350 (.\$\(*\)*|.\'*\'*)
15351         ;;
15352 (..|./*|.\\*)
15353         ;;
15354 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15355         ;;
15356 (.\${*prefix}*|.\${*dir}*)
15357         eval cf_path="$cf_path"
15358         case ".$cf_path" in
15359         (.NONE/*)
15360                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15361                 ;;
15362         esac
15363         ;;
15364 (.no|.NONE/*)
15365         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15366         ;;
15367 (*)
15368         { { echo "$as_me:15368: error: expected a pathname, not \"$cf_path\"" >&5
15369 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15370    { (exit 1); exit 1; }; }
15371         ;;
15372 esac
15373
15374 fi
15375
15376 echo "$as_me:15376: result: $RGB_PATH" >&5
15377 echo "${ECHO_T}$RGB_PATH" >&6
15378
15379 cat >>confdefs.h <<EOF
15380 #define RGB_PATH "$cf_path"
15381 EOF
15382
15383 no_x11_rgb=
15384 if test "$RGB_PATH" = no
15385 then
15386         no_x11_rgb="#"
15387 fi
15388
15389 cf_curses_headers=
15390
15391 case $cf_cv_screen in
15392 (pdcurses)
15393         cf_default_panel=no
15394         cf_default_form=no
15395         cf_default_menu=no
15396         cf_default_tinfo=no
15397         ;;
15398 (xcurses|bsdcurses)
15399         cf_default_panel=no
15400         cf_default_form=no
15401         cf_default_menu=no
15402         cf_default_tinfo=yes
15403         ;;
15404 (*)
15405         cf_default_panel=yes
15406         cf_default_form=yes
15407         cf_default_menu=yes
15408         cf_default_tinfo=yes
15409         case $cf_cv_screen in
15410         (ncurses*)
15411                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15412                 ;;
15413         esac
15414         ;;
15415 esac
15416
15417 echo "$as_me:15417: checking if you want to check for panel functions" >&5
15418 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15419
15420 # Check whether --enable-panel or --disable-panel was given.
15421 if test "${enable_panel+set}" = set; then
15422   enableval="$enable_panel"
15423   test "$enableval" != no && enableval=yes
15424         if test "$enableval" != "yes" ; then
15425     cf_enable_panel=no
15426         else
15427                 cf_enable_panel=$cf_default_panel
15428         fi
15429 else
15430   enableval=yes
15431         cf_enable_panel=$cf_default_panel
15432
15433 fi;
15434 echo "$as_me:15434: result: $cf_enable_panel" >&5
15435 echo "${ECHO_T}$cf_enable_panel" >&6
15436 if test $cf_enable_panel = yes
15437 then
15438
15439 cf_have_curses_lib=no
15440
15441 : ${NCURSES_CONFIG_PKG:=none}
15442 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15443         :
15444 elif test "x${PKG_CONFIG:=none}" != xnone; then
15445         echo "$as_me:15445: checking pkg-config for panel$cf_cv_libtype" >&5
15446 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15447         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15448                 echo "$as_me:15448: result: yes" >&5
15449 echo "${ECHO_T}yes" >&6
15450
15451                 echo "$as_me:15451: checking if the panel$cf_cv_libtype package files work" >&5
15452 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15453
15454                 cf_save_CPPFLAGS="$CPPFLAGS"
15455                 cf_save_LIBS="$LIBS"
15456
15457 cf_fix_cppflags=no
15458 cf_new_cflags=
15459 cf_new_cppflags=
15460 cf_new_extra_cppflags=
15461
15462 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15463 do
15464 case $cf_fix_cppflags in
15465 (no)
15466         case $cf_add_cflags in
15467         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15468                 case $cf_add_cflags in
15469                 (-D*)
15470                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15471
15472                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15473                                 && test -z "${cf_tst_cflags}" \
15474                                 && cf_fix_cppflags=yes
15475
15476                         if test $cf_fix_cppflags = yes ; then
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                                 continue
15482                         elif test "${cf_tst_cflags}" = "\"'" ; then
15483
15484         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15485         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15486
15487                                 continue
15488                         fi
15489                         ;;
15490                 esac
15491                 case "$CPPFLAGS" in
15492                 (*$cf_add_cflags)
15493                         ;;
15494                 (*)
15495                         case $cf_add_cflags in
15496                         (-D*)
15497                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15498
15499 CPPFLAGS=`echo "$CPPFLAGS" | \
15500         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15501                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15502
15503                                 ;;
15504                         esac
15505
15506         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15507         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15508
15509                         ;;
15510                 esac
15511                 ;;
15512         (*)
15513
15514         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15515         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15516
15517                 ;;
15518         esac
15519         ;;
15520 (yes)
15521
15522         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15523         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15524
15525         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15526
15527         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15528                 && test -z "${cf_tst_cflags}" \
15529                 && cf_fix_cppflags=no
15530         ;;
15531 esac
15532 done
15533
15534 if test -n "$cf_new_cflags" ; then
15535
15536         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15537         CFLAGS="${CFLAGS}$cf_new_cflags"
15538
15539 fi
15540
15541 if test -n "$cf_new_cppflags" ; then
15542
15543         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15544         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15545
15546 fi
15547
15548 if test -n "$cf_new_extra_cppflags" ; then
15549
15550         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15551         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15552
15553 fi
15554
15555 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15556 # Filter out duplicates - this happens with badly-designed ".pc" files...
15557 for cf_add_1lib in $LIBS
15558 do
15559         for cf_add_2lib in $cf_add_libs
15560         do
15561                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15562                 then
15563                         cf_add_1lib=
15564                         break
15565                 fi
15566         done
15567         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15568 done
15569 LIBS="$cf_add_libs"
15570
15571                 cat >conftest.$ac_ext <<_ACEOF
15572 #line 15572 "configure"
15573 #include "confdefs.h"
15574 #include <panel.h>
15575 int
15576 main (void)
15577 {
15578 (void) new_panel ( 0 );
15579   ;
15580   return 0;
15581 }
15582 _ACEOF
15583 rm -f conftest.$ac_objext conftest$ac_exeext
15584 if { (eval echo "$as_me:15584: \"$ac_link\"") >&5
15585   (eval $ac_link) 2>&5
15586   ac_status=$?
15587   echo "$as_me:15587: \$? = $ac_status" >&5
15588   (exit $ac_status); } &&
15589          { ac_try='test -s conftest$ac_exeext'
15590   { (eval echo "$as_me:15590: \"$ac_try\"") >&5
15591   (eval $ac_try) 2>&5
15592   ac_status=$?
15593   echo "$as_me:15593: \$? = $ac_status" >&5
15594   (exit $ac_status); }; }; then
15595   if test "$cross_compiling" = yes; then
15596   cf_have_curses_lib=maybe
15597 else
15598   cat >conftest.$ac_ext <<_ACEOF
15599 #line 15599 "configure"
15600 #include "confdefs.h"
15601 #include <panel.h>
15602                                 int main(void)
15603                                 { (void) new_panel ( 0 ); return 0; }
15604 _ACEOF
15605 rm -f conftest$ac_exeext
15606 if { (eval echo "$as_me:15606: \"$ac_link\"") >&5
15607   (eval $ac_link) 2>&5
15608   ac_status=$?
15609   echo "$as_me:15609: \$? = $ac_status" >&5
15610   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15611   { (eval echo "$as_me:15611: \"$ac_try\"") >&5
15612   (eval $ac_try) 2>&5
15613   ac_status=$?
15614   echo "$as_me:15614: \$? = $ac_status" >&5
15615   (exit $ac_status); }; }; then
15616   cf_have_curses_lib=yes
15617 else
15618   echo "$as_me: program exited with status $ac_status" >&5
15619 echo "$as_me: failed program was:" >&5
15620 cat conftest.$ac_ext >&5
15621 cf_have_curses_lib=no
15622 fi
15623 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15624 fi
15625 else
15626   echo "$as_me: failed program was:" >&5
15627 cat conftest.$ac_ext >&5
15628 cf_have_curses_lib=no
15629 fi
15630 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15631                 echo "$as_me:15631: result: $cf_have_curses_lib" >&5
15632 echo "${ECHO_T}$cf_have_curses_lib" >&6
15633                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15634                 if test "$cf_have_curses_lib" != "yes"
15635                 then
15636                         CPPFLAGS="$cf_save_CPPFLAGS"
15637                         LIBS="$cf_save_LIBS"
15638                 else
15639
15640 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15641
15642                         cat >>confdefs.h <<EOF
15643 #define $cf_upper 1
15644 EOF
15645
15646                 fi
15647         fi
15648 fi
15649 if test "$cf_have_curses_lib" = no; then
15650         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15651 echo "$as_me:15651: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15652 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15653 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15654   echo $ECHO_N "(cached) $ECHO_C" >&6
15655 else
15656   ac_check_lib_save_LIBS=$LIBS
15657 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15658 cat >conftest.$ac_ext <<_ACEOF
15659 #line 15659 "configure"
15660 #include "confdefs.h"
15661
15662 /* Override any gcc2 internal prototype to avoid an error.  */
15663 #ifdef __cplusplus
15664 extern "C"
15665 #endif
15666 /* We use char because int might match the return type of a gcc2
15667    builtin and then its argument prototype would still apply.  */
15668 char new_panel ();
15669 int
15670 main (void)
15671 {
15672 new_panel ();
15673   ;
15674   return 0;
15675 }
15676 _ACEOF
15677 rm -f conftest.$ac_objext conftest$ac_exeext
15678 if { (eval echo "$as_me:15678: \"$ac_link\"") >&5
15679   (eval $ac_link) 2>&5
15680   ac_status=$?
15681   echo "$as_me:15681: \$? = $ac_status" >&5
15682   (exit $ac_status); } &&
15683          { ac_try='test -s conftest$ac_exeext'
15684   { (eval echo "$as_me:15684: \"$ac_try\"") >&5
15685   (eval $ac_try) 2>&5
15686   ac_status=$?
15687   echo "$as_me:15687: \$? = $ac_status" >&5
15688   (exit $ac_status); }; }; then
15689   eval "$as_ac_Lib=yes"
15690 else
15691   echo "$as_me: failed program was:" >&5
15692 cat conftest.$ac_ext >&5
15693 eval "$as_ac_Lib=no"
15694 fi
15695 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15696 LIBS=$ac_check_lib_save_LIBS
15697 fi
15698 echo "$as_me:15698: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15699 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15700 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15701
15702 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15703
15704 cf_add_libs="-lpanel$cf_cv_libtype"
15705 # Filter out duplicates - this happens with badly-designed ".pc" files...
15706 for cf_add_1lib in $LIBS
15707 do
15708         for cf_add_2lib in $cf_add_libs
15709         do
15710                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15711                 then
15712                         cf_add_1lib=
15713                         break
15714                 fi
15715         done
15716         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15717 done
15718 LIBS="$cf_add_libs"
15719
15720                 cat >>confdefs.h <<EOF
15721 #define $cf_upper 1
15722 EOF
15723
15724 fi
15725
15726 fi
15727
15728         cf_curses_headers="$cf_curses_headers panel.h"
15729 fi
15730
15731 echo "$as_me:15731: checking if you want to check for menu functions" >&5
15732 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15733
15734 # Check whether --enable-menu or --disable-menu was given.
15735 if test "${enable_menu+set}" = set; then
15736   enableval="$enable_menu"
15737   test "$enableval" != no && enableval=yes
15738         if test "$enableval" != "yes" ; then
15739     cf_enable_menu=no
15740         else
15741                 cf_enable_menu=$cf_default_menu
15742         fi
15743 else
15744   enableval=yes
15745         cf_enable_menu=$cf_default_menu
15746
15747 fi;
15748 echo "$as_me:15748: result: $cf_enable_menu" >&5
15749 echo "${ECHO_T}$cf_enable_menu" >&6
15750 if test $cf_enable_menu = yes
15751 then
15752         case $cf_cv_screen in
15753         (ncurses*)
15754                 ;;
15755         (curses*)
15756
15757 echo "$as_me:15757: checking for NetBSD menu.h" >&5
15758 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15759 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15760   echo $ECHO_N "(cached) $ECHO_C" >&6
15761 else
15762
15763 cat >conftest.$ac_ext <<_ACEOF
15764 #line 15764 "configure"
15765 #include "confdefs.h"
15766
15767 #include <${cf_cv_ncurses_header:-curses.h}>
15768 #include <menu.h>
15769
15770 int
15771 main (void)
15772 {
15773
15774         MENU *menu;
15775         int y = menu->max_item_width;
15776
15777   ;
15778   return 0;
15779 }
15780 _ACEOF
15781 rm -f conftest.$ac_objext
15782 if { (eval echo "$as_me:15782: \"$ac_compile\"") >&5
15783   (eval $ac_compile) 2>&5
15784   ac_status=$?
15785   echo "$as_me:15785: \$? = $ac_status" >&5
15786   (exit $ac_status); } &&
15787          { ac_try='test -s conftest.$ac_objext'
15788   { (eval echo "$as_me:15788: \"$ac_try\"") >&5
15789   (eval $ac_try) 2>&5
15790   ac_status=$?
15791   echo "$as_me:15791: \$? = $ac_status" >&5
15792   (exit $ac_status); }; }; then
15793   cf_cv_netbsd_menu_h=yes
15794
15795 else
15796   echo "$as_me: failed program was:" >&5
15797 cat conftest.$ac_ext >&5
15798 cf_cv_netbsd_menu_h=no
15799 fi
15800 rm -f conftest.$ac_objext conftest.$ac_ext
15801
15802 fi
15803 echo "$as_me:15803: result: $cf_cv_netbsd_menu_h" >&5
15804 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15805
15806 test "$cf_cv_netbsd_menu_h" = yes &&
15807 cat >>confdefs.h <<\EOF
15808 #define HAVE_NETBSD_MENU_H 1
15809 EOF
15810
15811                 ;;
15812         esac
15813
15814 cf_have_curses_lib=no
15815
15816 : ${NCURSES_CONFIG_PKG:=none}
15817 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15818         :
15819 elif test "x${PKG_CONFIG:=none}" != xnone; then
15820         echo "$as_me:15820: checking pkg-config for menu$cf_cv_libtype" >&5
15821 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15822         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15823                 echo "$as_me:15823: result: yes" >&5
15824 echo "${ECHO_T}yes" >&6
15825
15826                 echo "$as_me:15826: checking if the menu$cf_cv_libtype package files work" >&5
15827 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15828
15829                 cf_save_CPPFLAGS="$CPPFLAGS"
15830                 cf_save_LIBS="$LIBS"
15831
15832 cf_fix_cppflags=no
15833 cf_new_cflags=
15834 cf_new_cppflags=
15835 cf_new_extra_cppflags=
15836
15837 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15838 do
15839 case $cf_fix_cppflags in
15840 (no)
15841         case $cf_add_cflags in
15842         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15843                 case $cf_add_cflags in
15844                 (-D*)
15845                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15846
15847                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15848                                 && test -z "${cf_tst_cflags}" \
15849                                 && cf_fix_cppflags=yes
15850
15851                         if test $cf_fix_cppflags = yes ; then
15852
15853         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15854         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15855
15856                                 continue
15857                         elif test "${cf_tst_cflags}" = "\"'" ; then
15858
15859         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15860         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15861
15862                                 continue
15863                         fi
15864                         ;;
15865                 esac
15866                 case "$CPPFLAGS" in
15867                 (*$cf_add_cflags)
15868                         ;;
15869                 (*)
15870                         case $cf_add_cflags in
15871                         (-D*)
15872                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15873
15874 CPPFLAGS=`echo "$CPPFLAGS" | \
15875         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15876                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15877
15878                                 ;;
15879                         esac
15880
15881         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15882         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15883
15884                         ;;
15885                 esac
15886                 ;;
15887         (*)
15888
15889         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15890         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15891
15892                 ;;
15893         esac
15894         ;;
15895 (yes)
15896
15897         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15898         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15899
15900         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15901
15902         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15903                 && test -z "${cf_tst_cflags}" \
15904                 && cf_fix_cppflags=no
15905         ;;
15906 esac
15907 done
15908
15909 if test -n "$cf_new_cflags" ; then
15910
15911         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15912         CFLAGS="${CFLAGS}$cf_new_cflags"
15913
15914 fi
15915
15916 if test -n "$cf_new_cppflags" ; then
15917
15918         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15919         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15920
15921 fi
15922
15923 if test -n "$cf_new_extra_cppflags" ; then
15924
15925         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15926         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15927
15928 fi
15929
15930 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15931 # Filter out duplicates - this happens with badly-designed ".pc" files...
15932 for cf_add_1lib in $LIBS
15933 do
15934         for cf_add_2lib in $cf_add_libs
15935         do
15936                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15937                 then
15938                         cf_add_1lib=
15939                         break
15940                 fi
15941         done
15942         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15943 done
15944 LIBS="$cf_add_libs"
15945
15946                 cat >conftest.$ac_ext <<_ACEOF
15947 #line 15947 "configure"
15948 #include "confdefs.h"
15949 #include <menu.h>
15950 int
15951 main (void)
15952 {
15953 (void) menu_driver ( 0,0 );
15954   ;
15955   return 0;
15956 }
15957 _ACEOF
15958 rm -f conftest.$ac_objext conftest$ac_exeext
15959 if { (eval echo "$as_me:15959: \"$ac_link\"") >&5
15960   (eval $ac_link) 2>&5
15961   ac_status=$?
15962   echo "$as_me:15962: \$? = $ac_status" >&5
15963   (exit $ac_status); } &&
15964          { ac_try='test -s conftest$ac_exeext'
15965   { (eval echo "$as_me:15965: \"$ac_try\"") >&5
15966   (eval $ac_try) 2>&5
15967   ac_status=$?
15968   echo "$as_me:15968: \$? = $ac_status" >&5
15969   (exit $ac_status); }; }; then
15970   if test "$cross_compiling" = yes; then
15971   cf_have_curses_lib=maybe
15972 else
15973   cat >conftest.$ac_ext <<_ACEOF
15974 #line 15974 "configure"
15975 #include "confdefs.h"
15976 #include <menu.h>
15977                                 int main(void)
15978                                 { (void) menu_driver ( 0,0 ); return 0; }
15979 _ACEOF
15980 rm -f conftest$ac_exeext
15981 if { (eval echo "$as_me:15981: \"$ac_link\"") >&5
15982   (eval $ac_link) 2>&5
15983   ac_status=$?
15984   echo "$as_me:15984: \$? = $ac_status" >&5
15985   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15986   { (eval echo "$as_me:15986: \"$ac_try\"") >&5
15987   (eval $ac_try) 2>&5
15988   ac_status=$?
15989   echo "$as_me:15989: \$? = $ac_status" >&5
15990   (exit $ac_status); }; }; then
15991   cf_have_curses_lib=yes
15992 else
15993   echo "$as_me: program exited with status $ac_status" >&5
15994 echo "$as_me: failed program was:" >&5
15995 cat conftest.$ac_ext >&5
15996 cf_have_curses_lib=no
15997 fi
15998 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15999 fi
16000 else
16001   echo "$as_me: failed program was:" >&5
16002 cat conftest.$ac_ext >&5
16003 cf_have_curses_lib=no
16004 fi
16005 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16006                 echo "$as_me:16006: result: $cf_have_curses_lib" >&5
16007 echo "${ECHO_T}$cf_have_curses_lib" >&6
16008                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16009                 if test "$cf_have_curses_lib" != "yes"
16010                 then
16011                         CPPFLAGS="$cf_save_CPPFLAGS"
16012                         LIBS="$cf_save_LIBS"
16013                 else
16014
16015 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16016
16017                         cat >>confdefs.h <<EOF
16018 #define $cf_upper 1
16019 EOF
16020
16021                 fi
16022         fi
16023 fi
16024 if test "$cf_have_curses_lib" = no; then
16025         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
16026 echo "$as_me:16026: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
16027 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
16028 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16029   echo $ECHO_N "(cached) $ECHO_C" >&6
16030 else
16031   ac_check_lib_save_LIBS=$LIBS
16032 LIBS="-lmenu$cf_cv_libtype  $LIBS"
16033 cat >conftest.$ac_ext <<_ACEOF
16034 #line 16034 "configure"
16035 #include "confdefs.h"
16036
16037 /* Override any gcc2 internal prototype to avoid an error.  */
16038 #ifdef __cplusplus
16039 extern "C"
16040 #endif
16041 /* We use char because int might match the return type of a gcc2
16042    builtin and then its argument prototype would still apply.  */
16043 char menu_driver ();
16044 int
16045 main (void)
16046 {
16047 menu_driver ();
16048   ;
16049   return 0;
16050 }
16051 _ACEOF
16052 rm -f conftest.$ac_objext conftest$ac_exeext
16053 if { (eval echo "$as_me:16053: \"$ac_link\"") >&5
16054   (eval $ac_link) 2>&5
16055   ac_status=$?
16056   echo "$as_me:16056: \$? = $ac_status" >&5
16057   (exit $ac_status); } &&
16058          { ac_try='test -s conftest$ac_exeext'
16059   { (eval echo "$as_me:16059: \"$ac_try\"") >&5
16060   (eval $ac_try) 2>&5
16061   ac_status=$?
16062   echo "$as_me:16062: \$? = $ac_status" >&5
16063   (exit $ac_status); }; }; then
16064   eval "$as_ac_Lib=yes"
16065 else
16066   echo "$as_me: failed program was:" >&5
16067 cat conftest.$ac_ext >&5
16068 eval "$as_ac_Lib=no"
16069 fi
16070 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16071 LIBS=$ac_check_lib_save_LIBS
16072 fi
16073 echo "$as_me:16073: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16074 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16075 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16076
16077 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16078
16079 cf_add_libs="-lmenu$cf_cv_libtype"
16080 # Filter out duplicates - this happens with badly-designed ".pc" files...
16081 for cf_add_1lib in $LIBS
16082 do
16083         for cf_add_2lib in $cf_add_libs
16084         do
16085                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16086                 then
16087                         cf_add_1lib=
16088                         break
16089                 fi
16090         done
16091         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16092 done
16093 LIBS="$cf_add_libs"
16094
16095                 cat >>confdefs.h <<EOF
16096 #define $cf_upper 1
16097 EOF
16098
16099 fi
16100
16101 fi
16102
16103         cf_curses_headers="$cf_curses_headers menu.h"
16104 fi
16105
16106 echo "$as_me:16106: checking if you want to check for form functions" >&5
16107 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
16108
16109 # Check whether --enable-form or --disable-form was given.
16110 if test "${enable_form+set}" = set; then
16111   enableval="$enable_form"
16112   test "$enableval" != no && enableval=yes
16113         if test "$enableval" != "yes" ; then
16114     cf_enable_form=no
16115         else
16116                 cf_enable_form=$cf_default_form
16117         fi
16118 else
16119   enableval=yes
16120         cf_enable_form=$cf_default_form
16121
16122 fi;
16123 echo "$as_me:16123: result: $cf_enable_form" >&5
16124 echo "${ECHO_T}$cf_enable_form" >&6
16125 if test $cf_enable_form = yes
16126 then
16127         case $cf_cv_screen in
16128         (ncurses*)
16129                 ;;
16130         (curses*)
16131
16132 echo "$as_me:16132: checking for NetBSD form.h" >&5
16133 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
16134 if test "${cf_cv_netbsd_form_h+set}" = set; then
16135   echo $ECHO_N "(cached) $ECHO_C" >&6
16136 else
16137
16138 cat >conftest.$ac_ext <<_ACEOF
16139 #line 16139 "configure"
16140 #include "confdefs.h"
16141
16142 #include <${cf_cv_ncurses_header:-curses.h}>
16143 #include <form.h>
16144
16145 int
16146 main (void)
16147 {
16148
16149         FORM *form;
16150         int y = current_field(form)->cursor_ypos;
16151         int x = current_field(form)->cursor_xpos;
16152
16153   ;
16154   return 0;
16155 }
16156 _ACEOF
16157 rm -f conftest.$ac_objext
16158 if { (eval echo "$as_me:16158: \"$ac_compile\"") >&5
16159   (eval $ac_compile) 2>&5
16160   ac_status=$?
16161   echo "$as_me:16161: \$? = $ac_status" >&5
16162   (exit $ac_status); } &&
16163          { ac_try='test -s conftest.$ac_objext'
16164   { (eval echo "$as_me:16164: \"$ac_try\"") >&5
16165   (eval $ac_try) 2>&5
16166   ac_status=$?
16167   echo "$as_me:16167: \$? = $ac_status" >&5
16168   (exit $ac_status); }; }; then
16169   cf_cv_netbsd_form_h=yes
16170
16171 else
16172   echo "$as_me: failed program was:" >&5
16173 cat conftest.$ac_ext >&5
16174 cf_cv_netbsd_form_h=no
16175 fi
16176 rm -f conftest.$ac_objext conftest.$ac_ext
16177
16178 fi
16179 echo "$as_me:16179: result: $cf_cv_netbsd_form_h" >&5
16180 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16181
16182 test "$cf_cv_netbsd_form_h" = yes &&
16183 cat >>confdefs.h <<\EOF
16184 #define HAVE_NETBSD_FORM_H 1
16185 EOF
16186
16187                 ;;
16188         esac
16189
16190 cf_have_curses_lib=no
16191
16192 : ${NCURSES_CONFIG_PKG:=none}
16193 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16194         :
16195 elif test "x${PKG_CONFIG:=none}" != xnone; then
16196         echo "$as_me:16196: checking pkg-config for form$cf_cv_libtype" >&5
16197 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16198         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16199                 echo "$as_me:16199: result: yes" >&5
16200 echo "${ECHO_T}yes" >&6
16201
16202                 echo "$as_me:16202: checking if the form$cf_cv_libtype package files work" >&5
16203 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16204
16205                 cf_save_CPPFLAGS="$CPPFLAGS"
16206                 cf_save_LIBS="$LIBS"
16207
16208 cf_fix_cppflags=no
16209 cf_new_cflags=
16210 cf_new_cppflags=
16211 cf_new_extra_cppflags=
16212
16213 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16214 do
16215 case $cf_fix_cppflags in
16216 (no)
16217         case $cf_add_cflags in
16218         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16219                 case $cf_add_cflags in
16220                 (-D*)
16221                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16222
16223                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16224                                 && test -z "${cf_tst_cflags}" \
16225                                 && cf_fix_cppflags=yes
16226
16227                         if test $cf_fix_cppflags = yes ; then
16228
16229         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16230         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16231
16232                                 continue
16233                         elif test "${cf_tst_cflags}" = "\"'" ; then
16234
16235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16237
16238                                 continue
16239                         fi
16240                         ;;
16241                 esac
16242                 case "$CPPFLAGS" in
16243                 (*$cf_add_cflags)
16244                         ;;
16245                 (*)
16246                         case $cf_add_cflags in
16247                         (-D*)
16248                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16249
16250 CPPFLAGS=`echo "$CPPFLAGS" | \
16251         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16252                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16253
16254                                 ;;
16255                         esac
16256
16257         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16258         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16259
16260                         ;;
16261                 esac
16262                 ;;
16263         (*)
16264
16265         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16266         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16267
16268                 ;;
16269         esac
16270         ;;
16271 (yes)
16272
16273         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16274         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16275
16276         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16277
16278         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16279                 && test -z "${cf_tst_cflags}" \
16280                 && cf_fix_cppflags=no
16281         ;;
16282 esac
16283 done
16284
16285 if test -n "$cf_new_cflags" ; then
16286
16287         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16288         CFLAGS="${CFLAGS}$cf_new_cflags"
16289
16290 fi
16291
16292 if test -n "$cf_new_cppflags" ; then
16293
16294         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16295         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16296
16297 fi
16298
16299 if test -n "$cf_new_extra_cppflags" ; then
16300
16301         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16302         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16303
16304 fi
16305
16306 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16307 # Filter out duplicates - this happens with badly-designed ".pc" files...
16308 for cf_add_1lib in $LIBS
16309 do
16310         for cf_add_2lib in $cf_add_libs
16311         do
16312                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16313                 then
16314                         cf_add_1lib=
16315                         break
16316                 fi
16317         done
16318         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16319 done
16320 LIBS="$cf_add_libs"
16321
16322                 cat >conftest.$ac_ext <<_ACEOF
16323 #line 16323 "configure"
16324 #include "confdefs.h"
16325 #include <form.h>
16326 int
16327 main (void)
16328 {
16329 (void) form_driver ( 0,0 );
16330   ;
16331   return 0;
16332 }
16333 _ACEOF
16334 rm -f conftest.$ac_objext conftest$ac_exeext
16335 if { (eval echo "$as_me:16335: \"$ac_link\"") >&5
16336   (eval $ac_link) 2>&5
16337   ac_status=$?
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit $ac_status); } &&
16340          { ac_try='test -s conftest$ac_exeext'
16341   { (eval echo "$as_me:16341: \"$ac_try\"") >&5
16342   (eval $ac_try) 2>&5
16343   ac_status=$?
16344   echo "$as_me:16344: \$? = $ac_status" >&5
16345   (exit $ac_status); }; }; then
16346   if test "$cross_compiling" = yes; then
16347   cf_have_curses_lib=maybe
16348 else
16349   cat >conftest.$ac_ext <<_ACEOF
16350 #line 16350 "configure"
16351 #include "confdefs.h"
16352 #include <form.h>
16353                                 int main(void)
16354                                 { (void) form_driver ( 0,0 ); return 0; }
16355 _ACEOF
16356 rm -f conftest$ac_exeext
16357 if { (eval echo "$as_me:16357: \"$ac_link\"") >&5
16358   (eval $ac_link) 2>&5
16359   ac_status=$?
16360   echo "$as_me:16360: \$? = $ac_status" >&5
16361   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16362   { (eval echo "$as_me:16362: \"$ac_try\"") >&5
16363   (eval $ac_try) 2>&5
16364   ac_status=$?
16365   echo "$as_me:16365: \$? = $ac_status" >&5
16366   (exit $ac_status); }; }; then
16367   cf_have_curses_lib=yes
16368 else
16369   echo "$as_me: program exited with status $ac_status" >&5
16370 echo "$as_me: failed program was:" >&5
16371 cat conftest.$ac_ext >&5
16372 cf_have_curses_lib=no
16373 fi
16374 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16375 fi
16376 else
16377   echo "$as_me: failed program was:" >&5
16378 cat conftest.$ac_ext >&5
16379 cf_have_curses_lib=no
16380 fi
16381 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16382                 echo "$as_me:16382: result: $cf_have_curses_lib" >&5
16383 echo "${ECHO_T}$cf_have_curses_lib" >&6
16384                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16385                 if test "$cf_have_curses_lib" != "yes"
16386                 then
16387                         CPPFLAGS="$cf_save_CPPFLAGS"
16388                         LIBS="$cf_save_LIBS"
16389                 else
16390
16391 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16392
16393                         cat >>confdefs.h <<EOF
16394 #define $cf_upper 1
16395 EOF
16396
16397                 fi
16398         fi
16399 fi
16400 if test "$cf_have_curses_lib" = no; then
16401         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16402 echo "$as_me:16402: checking for form_driver in -lform$cf_cv_libtype" >&5
16403 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16404 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16405   echo $ECHO_N "(cached) $ECHO_C" >&6
16406 else
16407   ac_check_lib_save_LIBS=$LIBS
16408 LIBS="-lform$cf_cv_libtype  $LIBS"
16409 cat >conftest.$ac_ext <<_ACEOF
16410 #line 16410 "configure"
16411 #include "confdefs.h"
16412
16413 /* Override any gcc2 internal prototype to avoid an error.  */
16414 #ifdef __cplusplus
16415 extern "C"
16416 #endif
16417 /* We use char because int might match the return type of a gcc2
16418    builtin and then its argument prototype would still apply.  */
16419 char form_driver ();
16420 int
16421 main (void)
16422 {
16423 form_driver ();
16424   ;
16425   return 0;
16426 }
16427 _ACEOF
16428 rm -f conftest.$ac_objext conftest$ac_exeext
16429 if { (eval echo "$as_me:16429: \"$ac_link\"") >&5
16430   (eval $ac_link) 2>&5
16431   ac_status=$?
16432   echo "$as_me:16432: \$? = $ac_status" >&5
16433   (exit $ac_status); } &&
16434          { ac_try='test -s conftest$ac_exeext'
16435   { (eval echo "$as_me:16435: \"$ac_try\"") >&5
16436   (eval $ac_try) 2>&5
16437   ac_status=$?
16438   echo "$as_me:16438: \$? = $ac_status" >&5
16439   (exit $ac_status); }; }; then
16440   eval "$as_ac_Lib=yes"
16441 else
16442   echo "$as_me: failed program was:" >&5
16443 cat conftest.$ac_ext >&5
16444 eval "$as_ac_Lib=no"
16445 fi
16446 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16447 LIBS=$ac_check_lib_save_LIBS
16448 fi
16449 echo "$as_me:16449: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16450 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16451 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16452
16453 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16454
16455 cf_add_libs="-lform$cf_cv_libtype"
16456 # Filter out duplicates - this happens with badly-designed ".pc" files...
16457 for cf_add_1lib in $LIBS
16458 do
16459         for cf_add_2lib in $cf_add_libs
16460         do
16461                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16462                 then
16463                         cf_add_1lib=
16464                         break
16465                 fi
16466         done
16467         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16468 done
16469 LIBS="$cf_add_libs"
16470
16471                 cat >>confdefs.h <<EOF
16472 #define $cf_upper 1
16473 EOF
16474
16475 fi
16476
16477 fi
16478
16479         cf_curses_headers="$cf_curses_headers form.h"
16480 fi
16481
16482 # look for curses-related headers
16483
16484 for ac_header in $cf_curses_headers
16485 do
16486 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16487 echo "$as_me:16487: checking for $ac_header" >&5
16488 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16489 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16490   echo $ECHO_N "(cached) $ECHO_C" >&6
16491 else
16492   cat >conftest.$ac_ext <<_ACEOF
16493 #line 16493 "configure"
16494 #include "confdefs.h"
16495 #include <$ac_header>
16496 _ACEOF
16497 if { (eval echo "$as_me:16497: \"$ac_cpp conftest.$ac_ext\"") >&5
16498   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16499   ac_status=$?
16500   egrep -v '^ *\+' conftest.er1 >conftest.err
16501   rm -f conftest.er1
16502   cat conftest.err >&5
16503   echo "$as_me:16503: \$? = $ac_status" >&5
16504   (exit $ac_status); } >/dev/null; then
16505   if test -s conftest.err; then
16506     ac_cpp_err=$ac_c_preproc_warn_flag
16507   else
16508     ac_cpp_err=
16509   fi
16510 else
16511   ac_cpp_err=yes
16512 fi
16513 if test -z "$ac_cpp_err"; then
16514   eval "$as_ac_Header=yes"
16515 else
16516   echo "$as_me: failed program was:" >&5
16517   cat conftest.$ac_ext >&5
16518   eval "$as_ac_Header=no"
16519 fi
16520 rm -f conftest.err conftest.$ac_ext
16521 fi
16522 echo "$as_me:16522: result: `eval echo '${'$as_ac_Header'}'`" >&5
16523 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16524 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16525   cat >>confdefs.h <<EOF
16526 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16527 EOF
16528
16529 fi
16530 done
16531
16532 echo "$as_me:16532: checking for ANSI C header files" >&5
16533 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16534 if test "${ac_cv_header_stdc+set}" = set; then
16535   echo $ECHO_N "(cached) $ECHO_C" >&6
16536 else
16537   cat >conftest.$ac_ext <<_ACEOF
16538 #line 16538 "configure"
16539 #include "confdefs.h"
16540 #include <stdlib.h>
16541 #include <stdarg.h>
16542 #include <string.h>
16543 #include <float.h>
16544
16545 _ACEOF
16546 if { (eval echo "$as_me:16546: \"$ac_cpp conftest.$ac_ext\"") >&5
16547   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16548   ac_status=$?
16549   egrep -v '^ *\+' conftest.er1 >conftest.err
16550   rm -f conftest.er1
16551   cat conftest.err >&5
16552   echo "$as_me:16552: \$? = $ac_status" >&5
16553   (exit $ac_status); } >/dev/null; then
16554   if test -s conftest.err; then
16555     ac_cpp_err=$ac_c_preproc_warn_flag
16556   else
16557     ac_cpp_err=
16558   fi
16559 else
16560   ac_cpp_err=yes
16561 fi
16562 if test -z "$ac_cpp_err"; then
16563   ac_cv_header_stdc=yes
16564 else
16565   echo "$as_me: failed program was:" >&5
16566   cat conftest.$ac_ext >&5
16567   ac_cv_header_stdc=no
16568 fi
16569 rm -f conftest.err conftest.$ac_ext
16570
16571 if test $ac_cv_header_stdc = yes; then
16572   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16573   cat >conftest.$ac_ext <<_ACEOF
16574 #line 16574 "configure"
16575 #include "confdefs.h"
16576 #include <string.h>
16577
16578 _ACEOF
16579 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16580   egrep "memchr" >/dev/null 2>&1; then
16581   :
16582 else
16583   ac_cv_header_stdc=no
16584 fi
16585 rm -rf conftest*
16586
16587 fi
16588
16589 if test $ac_cv_header_stdc = yes; then
16590   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16591   cat >conftest.$ac_ext <<_ACEOF
16592 #line 16592 "configure"
16593 #include "confdefs.h"
16594 #include <stdlib.h>
16595
16596 _ACEOF
16597 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16598   egrep "free" >/dev/null 2>&1; then
16599   :
16600 else
16601   ac_cv_header_stdc=no
16602 fi
16603 rm -rf conftest*
16604
16605 fi
16606
16607 if test $ac_cv_header_stdc = yes; then
16608   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16609   if test "$cross_compiling" = yes; then
16610   :
16611 else
16612   cat >conftest.$ac_ext <<_ACEOF
16613 #line 16613 "configure"
16614 #include "confdefs.h"
16615 #include <ctype.h>
16616 #if ((' ' & 0x0FF) == 0x020)
16617 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16618 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16619 #else
16620 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16621                      || ('j' <= (c) && (c) <= 'r') \
16622                      || ('s' <= (c) && (c) <= 'z'))
16623 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16624 #endif
16625
16626 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16627 int
16628 main (void)
16629 {
16630   int i;
16631   for (i = 0; i < 256; i++)
16632     if (XOR (islower (i), ISLOWER (i))
16633         || toupper (i) != TOUPPER (i))
16634       $ac_main_return(2);
16635   $ac_main_return (0);
16636 }
16637 _ACEOF
16638 rm -f conftest$ac_exeext
16639 if { (eval echo "$as_me:16639: \"$ac_link\"") >&5
16640   (eval $ac_link) 2>&5
16641   ac_status=$?
16642   echo "$as_me:16642: \$? = $ac_status" >&5
16643   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16644   { (eval echo "$as_me:16644: \"$ac_try\"") >&5
16645   (eval $ac_try) 2>&5
16646   ac_status=$?
16647   echo "$as_me:16647: \$? = $ac_status" >&5
16648   (exit $ac_status); }; }; then
16649   :
16650 else
16651   echo "$as_me: program exited with status $ac_status" >&5
16652 echo "$as_me: failed program was:" >&5
16653 cat conftest.$ac_ext >&5
16654 ac_cv_header_stdc=no
16655 fi
16656 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16657 fi
16658 fi
16659 fi
16660 echo "$as_me:16660: result: $ac_cv_header_stdc" >&5
16661 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16662 if test $ac_cv_header_stdc = yes; then
16663
16664 cat >>confdefs.h <<\EOF
16665 #define STDC_HEADERS 1
16666 EOF
16667
16668 fi
16669
16670 echo "$as_me:16670: checking whether time.h and sys/time.h may both be included" >&5
16671 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16672 if test "${ac_cv_header_time+set}" = set; then
16673   echo $ECHO_N "(cached) $ECHO_C" >&6
16674 else
16675   cat >conftest.$ac_ext <<_ACEOF
16676 #line 16676 "configure"
16677 #include "confdefs.h"
16678 #include <sys/types.h>
16679 #include <sys/time.h>
16680 #include <time.h>
16681
16682 int
16683 main (void)
16684 {
16685 if ((struct tm *) 0)
16686 return 0;
16687   ;
16688   return 0;
16689 }
16690 _ACEOF
16691 rm -f conftest.$ac_objext
16692 if { (eval echo "$as_me:16692: \"$ac_compile\"") >&5
16693   (eval $ac_compile) 2>&5
16694   ac_status=$?
16695   echo "$as_me:16695: \$? = $ac_status" >&5
16696   (exit $ac_status); } &&
16697          { ac_try='test -s conftest.$ac_objext'
16698   { (eval echo "$as_me:16698: \"$ac_try\"") >&5
16699   (eval $ac_try) 2>&5
16700   ac_status=$?
16701   echo "$as_me:16701: \$? = $ac_status" >&5
16702   (exit $ac_status); }; }; then
16703   ac_cv_header_time=yes
16704 else
16705   echo "$as_me: failed program was:" >&5
16706 cat conftest.$ac_ext >&5
16707 ac_cv_header_time=no
16708 fi
16709 rm -f conftest.$ac_objext conftest.$ac_ext
16710 fi
16711 echo "$as_me:16711: result: $ac_cv_header_time" >&5
16712 echo "${ECHO_T}$ac_cv_header_time" >&6
16713 if test $ac_cv_header_time = yes; then
16714
16715 cat >>confdefs.h <<\EOF
16716 #define TIME_WITH_SYS_TIME 1
16717 EOF
16718
16719 fi
16720
16721 for ac_header in \
16722 getopt.h \
16723 locale.h \
16724 math.h \
16725 stdarg.h \
16726 stdint.h \
16727 sys/ioctl.h \
16728 sys/select.h \
16729 sys/time.h \
16730 termios.h \
16731 unistd.h \
16732
16733 do
16734 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16735 echo "$as_me:16735: checking for $ac_header" >&5
16736 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16737 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16738   echo $ECHO_N "(cached) $ECHO_C" >&6
16739 else
16740   cat >conftest.$ac_ext <<_ACEOF
16741 #line 16741 "configure"
16742 #include "confdefs.h"
16743 #include <$ac_header>
16744 _ACEOF
16745 if { (eval echo "$as_me:16745: \"$ac_cpp conftest.$ac_ext\"") >&5
16746   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16747   ac_status=$?
16748   egrep -v '^ *\+' conftest.er1 >conftest.err
16749   rm -f conftest.er1
16750   cat conftest.err >&5
16751   echo "$as_me:16751: \$? = $ac_status" >&5
16752   (exit $ac_status); } >/dev/null; then
16753   if test -s conftest.err; then
16754     ac_cpp_err=$ac_c_preproc_warn_flag
16755   else
16756     ac_cpp_err=
16757   fi
16758 else
16759   ac_cpp_err=yes
16760 fi
16761 if test -z "$ac_cpp_err"; then
16762   eval "$as_ac_Header=yes"
16763 else
16764   echo "$as_me: failed program was:" >&5
16765   cat conftest.$ac_ext >&5
16766   eval "$as_ac_Header=no"
16767 fi
16768 rm -f conftest.err conftest.$ac_ext
16769 fi
16770 echo "$as_me:16770: result: `eval echo '${'$as_ac_Header'}'`" >&5
16771 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16772 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16773   cat >>confdefs.h <<EOF
16774 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16775 EOF
16776
16777 fi
16778 done
16779
16780 for ac_header in unistd.h getopt.h
16781 do
16782 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16783 echo "$as_me:16783: checking for $ac_header" >&5
16784 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16785 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16786   echo $ECHO_N "(cached) $ECHO_C" >&6
16787 else
16788   cat >conftest.$ac_ext <<_ACEOF
16789 #line 16789 "configure"
16790 #include "confdefs.h"
16791 #include <$ac_header>
16792 _ACEOF
16793 if { (eval echo "$as_me:16793: \"$ac_cpp conftest.$ac_ext\"") >&5
16794   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16795   ac_status=$?
16796   egrep -v '^ *\+' conftest.er1 >conftest.err
16797   rm -f conftest.er1
16798   cat conftest.err >&5
16799   echo "$as_me:16799: \$? = $ac_status" >&5
16800   (exit $ac_status); } >/dev/null; then
16801   if test -s conftest.err; then
16802     ac_cpp_err=$ac_c_preproc_warn_flag
16803   else
16804     ac_cpp_err=
16805   fi
16806 else
16807   ac_cpp_err=yes
16808 fi
16809 if test -z "$ac_cpp_err"; then
16810   eval "$as_ac_Header=yes"
16811 else
16812   echo "$as_me: failed program was:" >&5
16813   cat conftest.$ac_ext >&5
16814   eval "$as_ac_Header=no"
16815 fi
16816 rm -f conftest.err conftest.$ac_ext
16817 fi
16818 echo "$as_me:16818: result: `eval echo '${'$as_ac_Header'}'`" >&5
16819 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16820 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16821   cat >>confdefs.h <<EOF
16822 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16823 EOF
16824
16825 fi
16826 done
16827
16828 echo "$as_me:16828: checking for header declaring getopt variables" >&5
16829 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16830 if test "${cf_cv_getopt_header+set}" = set; then
16831   echo $ECHO_N "(cached) $ECHO_C" >&6
16832 else
16833
16834 cf_cv_getopt_header=none
16835 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16836 do
16837 cat >conftest.$ac_ext <<_ACEOF
16838 #line 16838 "configure"
16839 #include "confdefs.h"
16840
16841 #include <$cf_header>
16842 int
16843 main (void)
16844 {
16845 int x = optind; char *y = optarg
16846   ;
16847   return 0;
16848 }
16849 _ACEOF
16850 rm -f conftest.$ac_objext
16851 if { (eval echo "$as_me:16851: \"$ac_compile\"") >&5
16852   (eval $ac_compile) 2>&5
16853   ac_status=$?
16854   echo "$as_me:16854: \$? = $ac_status" >&5
16855   (exit $ac_status); } &&
16856          { ac_try='test -s conftest.$ac_objext'
16857   { (eval echo "$as_me:16857: \"$ac_try\"") >&5
16858   (eval $ac_try) 2>&5
16859   ac_status=$?
16860   echo "$as_me:16860: \$? = $ac_status" >&5
16861   (exit $ac_status); }; }; then
16862   cf_cv_getopt_header=$cf_header
16863  break
16864 else
16865   echo "$as_me: failed program was:" >&5
16866 cat conftest.$ac_ext >&5
16867 fi
16868 rm -f conftest.$ac_objext conftest.$ac_ext
16869 done
16870
16871 fi
16872 echo "$as_me:16872: result: $cf_cv_getopt_header" >&5
16873 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16874 if test $cf_cv_getopt_header != none ; then
16875
16876 cat >>confdefs.h <<\EOF
16877 #define HAVE_GETOPT_HEADER 1
16878 EOF
16879
16880 fi
16881 if test $cf_cv_getopt_header = getopt.h ; then
16882
16883 cat >>confdefs.h <<\EOF
16884 #define NEED_GETOPT_H 1
16885 EOF
16886
16887 fi
16888
16889 for ac_func in \
16890 getopt \
16891 gettimeofday \
16892 tdestroy \
16893 tsearch \
16894
16895 do
16896 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16897 echo "$as_me:16897: checking for $ac_func" >&5
16898 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16899 if eval "test \"\${$as_ac_var+set}\" = set"; then
16900   echo $ECHO_N "(cached) $ECHO_C" >&6
16901 else
16902   cat >conftest.$ac_ext <<_ACEOF
16903 #line 16903 "configure"
16904 #include "confdefs.h"
16905 /* System header to define __stub macros and hopefully few prototypes,
16906     which can conflict with char $ac_func (); below.  */
16907 #include <assert.h>
16908 /* Override any gcc2 internal prototype to avoid an error.  */
16909 #ifdef __cplusplus
16910 extern "C"
16911 #endif
16912 /* We use char because int might match the return type of a gcc2
16913    builtin and then its argument prototype would still apply.  */
16914 char $ac_func ();
16915 char (*f) ();
16916
16917 int
16918 main (void)
16919 {
16920 /* The GNU C library defines this for functions which it implements
16921     to always fail with ENOSYS.  Some functions are actually named
16922     something starting with __ and the normal name is an alias.  */
16923 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16924 choke me
16925 #else
16926 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16927 #endif
16928
16929   ;
16930   return 0;
16931 }
16932 _ACEOF
16933 rm -f conftest.$ac_objext conftest$ac_exeext
16934 if { (eval echo "$as_me:16934: \"$ac_link\"") >&5
16935   (eval $ac_link) 2>&5
16936   ac_status=$?
16937   echo "$as_me:16937: \$? = $ac_status" >&5
16938   (exit $ac_status); } &&
16939          { ac_try='test -s conftest$ac_exeext'
16940   { (eval echo "$as_me:16940: \"$ac_try\"") >&5
16941   (eval $ac_try) 2>&5
16942   ac_status=$?
16943   echo "$as_me:16943: \$? = $ac_status" >&5
16944   (exit $ac_status); }; }; then
16945   eval "$as_ac_var=yes"
16946 else
16947   echo "$as_me: failed program was:" >&5
16948 cat conftest.$ac_ext >&5
16949 eval "$as_ac_var=no"
16950 fi
16951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16952 fi
16953 echo "$as_me:16953: result: `eval echo '${'$as_ac_var'}'`" >&5
16954 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16955 if test `eval echo '${'$as_ac_var'}'` = yes; then
16956   cat >>confdefs.h <<EOF
16957 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16958 EOF
16959
16960 fi
16961 done
16962
16963 # use a compile-check to work with ncurses*-config and subdirectory includes
16964 echo "$as_me:16964: checking if we can use termcap.h" >&5
16965 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
16966 if test "${cf_cv_have_termcap_h+set}" = set; then
16967   echo $ECHO_N "(cached) $ECHO_C" >&6
16968 else
16969
16970         cat >conftest.$ac_ext <<_ACEOF
16971 #line 16971 "configure"
16972 #include "confdefs.h"
16973
16974 #include <curses.h>
16975 #include <termcap.h>
16976
16977 int
16978 main (void)
16979 {
16980 return 0;
16981   ;
16982   return 0;
16983 }
16984 _ACEOF
16985 rm -f conftest.$ac_objext
16986 if { (eval echo "$as_me:16986: \"$ac_compile\"") >&5
16987   (eval $ac_compile) 2>&5
16988   ac_status=$?
16989   echo "$as_me:16989: \$? = $ac_status" >&5
16990   (exit $ac_status); } &&
16991          { ac_try='test -s conftest.$ac_objext'
16992   { (eval echo "$as_me:16992: \"$ac_try\"") >&5
16993   (eval $ac_try) 2>&5
16994   ac_status=$?
16995   echo "$as_me:16995: \$? = $ac_status" >&5
16996   (exit $ac_status); }; }; then
16997   cf_cv_have_termcap_h=yes
16998 else
16999   echo "$as_me: failed program was:" >&5
17000 cat conftest.$ac_ext >&5
17001 cf_cv_have_termcap_h=no
17002 fi
17003 rm -f conftest.$ac_objext conftest.$ac_ext
17004 fi
17005 echo "$as_me:17005: result: $cf_cv_have_termcap_h" >&5
17006 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
17007 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
17008 #define HAVE_TERMCAP_H 1
17009 EOF
17010
17011 if test "x$ac_cv_func_getopt" = xno; then
17012         { { echo "$as_me:17012: error: getopt is required for building programs" >&5
17013 echo "$as_me: error: getopt is required for building programs" >&2;}
17014    { (exit 1); exit 1; }; }
17015 fi
17016
17017 if test "$cf_enable_widec" = yes; then
17018
17019 for ac_func in \
17020 mblen \
17021 mbrlen \
17022 mbrtowc \
17023 mbsrtowcs \
17024 mbstowcs \
17025 mbtowc \
17026 wcsrtombs \
17027 wcstombs \
17028
17029 do
17030 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
17031 echo "$as_me:17031: checking for $ac_func" >&5
17032 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
17033 if eval "test \"\${$as_ac_var+set}\" = set"; then
17034   echo $ECHO_N "(cached) $ECHO_C" >&6
17035 else
17036   cat >conftest.$ac_ext <<_ACEOF
17037 #line 17037 "configure"
17038 #include "confdefs.h"
17039 /* System header to define __stub macros and hopefully few prototypes,
17040     which can conflict with char $ac_func (); below.  */
17041 #include <assert.h>
17042 /* Override any gcc2 internal prototype to avoid an error.  */
17043 #ifdef __cplusplus
17044 extern "C"
17045 #endif
17046 /* We use char because int might match the return type of a gcc2
17047    builtin and then its argument prototype would still apply.  */
17048 char $ac_func ();
17049 char (*f) ();
17050
17051 int
17052 main (void)
17053 {
17054 /* The GNU C library defines this for functions which it implements
17055     to always fail with ENOSYS.  Some functions are actually named
17056     something starting with __ and the normal name is an alias.  */
17057 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
17058 choke me
17059 #else
17060 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
17061 #endif
17062
17063   ;
17064   return 0;
17065 }
17066 _ACEOF
17067 rm -f conftest.$ac_objext conftest$ac_exeext
17068 if { (eval echo "$as_me:17068: \"$ac_link\"") >&5
17069   (eval $ac_link) 2>&5
17070   ac_status=$?
17071   echo "$as_me:17071: \$? = $ac_status" >&5
17072   (exit $ac_status); } &&
17073          { ac_try='test -s conftest$ac_exeext'
17074   { (eval echo "$as_me:17074: \"$ac_try\"") >&5
17075   (eval $ac_try) 2>&5
17076   ac_status=$?
17077   echo "$as_me:17077: \$? = $ac_status" >&5
17078   (exit $ac_status); }; }; then
17079   eval "$as_ac_var=yes"
17080 else
17081   echo "$as_me: failed program was:" >&5
17082 cat conftest.$ac_ext >&5
17083 eval "$as_ac_var=no"
17084 fi
17085 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17086 fi
17087 echo "$as_me:17087: result: `eval echo '${'$as_ac_var'}'`" >&5
17088 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
17089 if test `eval echo '${'$as_ac_var'}'` = yes; then
17090   cat >>confdefs.h <<EOF
17091 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
17092 EOF
17093
17094 fi
17095 done
17096
17097 fi
17098
17099 echo "$as_me:17099: checking definition to turn on extended curses functions" >&5
17100 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
17101 if test "${cf_cv_need_xopen_extension+set}" = set; then
17102   echo $ECHO_N "(cached) $ECHO_C" >&6
17103 else
17104
17105 cf_cv_need_xopen_extension=unknown
17106 cat >conftest.$ac_ext <<_ACEOF
17107 #line 17107 "configure"
17108 #include "confdefs.h"
17109
17110 #include <stdlib.h>
17111 #include <${cf_cv_ncurses_header:-curses.h}>
17112 int
17113 main (void)
17114 {
17115
17116 #if defined(NCURSES_VERSION_PATCH)
17117 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
17118         make an error
17119 #endif
17120 #endif
17121 #ifdef NCURSES_VERSION
17122         cchar_t check;
17123         int check2 = curs_set((int)sizeof(check));
17124 #endif
17125         long x = winnstr(stdscr, "", 0);
17126         int x1, y1;
17127         getbegyx(stdscr, y1, x1)
17128   ;
17129   return 0;
17130 }
17131 _ACEOF
17132 rm -f conftest.$ac_objext conftest$ac_exeext
17133 if { (eval echo "$as_me:17133: \"$ac_link\"") >&5
17134   (eval $ac_link) 2>&5
17135   ac_status=$?
17136   echo "$as_me:17136: \$? = $ac_status" >&5
17137   (exit $ac_status); } &&
17138          { ac_try='test -s conftest$ac_exeext'
17139   { (eval echo "$as_me:17139: \"$ac_try\"") >&5
17140   (eval $ac_try) 2>&5
17141   ac_status=$?
17142   echo "$as_me:17142: \$? = $ac_status" >&5
17143   (exit $ac_status); }; }; then
17144   cf_cv_need_xopen_extension=none
17145 else
17146   echo "$as_me: failed program was:" >&5
17147 cat conftest.$ac_ext >&5
17148
17149         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
17150         do
17151                 cat >conftest.$ac_ext <<_ACEOF
17152 #line 17152 "configure"
17153 #include "confdefs.h"
17154
17155 #define $cf_try_xopen_extension 1
17156 #include <stdlib.h>
17157 #include <${cf_cv_ncurses_header:-curses.h}>
17158 int
17159 main (void)
17160 {
17161
17162 #ifdef NCURSES_VERSION
17163                 cchar_t check;
17164                 int check2 = curs_set((int)sizeof(check));
17165 #endif
17166                 long x = winnstr(stdscr, "", 0);
17167                 int x1, y1;
17168                 getbegyx(stdscr, y1, x1)
17169   ;
17170   return 0;
17171 }
17172 _ACEOF
17173 rm -f conftest.$ac_objext conftest$ac_exeext
17174 if { (eval echo "$as_me:17174: \"$ac_link\"") >&5
17175   (eval $ac_link) 2>&5
17176   ac_status=$?
17177   echo "$as_me:17177: \$? = $ac_status" >&5
17178   (exit $ac_status); } &&
17179          { ac_try='test -s conftest$ac_exeext'
17180   { (eval echo "$as_me:17180: \"$ac_try\"") >&5
17181   (eval $ac_try) 2>&5
17182   ac_status=$?
17183   echo "$as_me:17183: \$? = $ac_status" >&5
17184   (exit $ac_status); }; }; then
17185   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17186 else
17187   echo "$as_me: failed program was:" >&5
17188 cat conftest.$ac_ext >&5
17189 fi
17190 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17191         done
17192
17193 fi
17194 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17195
17196 fi
17197 echo "$as_me:17197: result: $cf_cv_need_xopen_extension" >&5
17198 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17199
17200 case $cf_cv_need_xopen_extension in
17201 (*_*)
17202
17203         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17204         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17205
17206         ;;
17207 esac
17208
17209 echo "$as_me:17209: checking for term.h" >&5
17210 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17211 if test "${cf_cv_term_header+set}" = set; then
17212   echo $ECHO_N "(cached) $ECHO_C" >&6
17213 else
17214
17215 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17216 # for <term.h> if we do not find the variant.
17217
17218 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17219
17220 case ${cf_cv_ncurses_header:-curses.h} in
17221 (*/*)
17222         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17223         cf_header_list="$cf_header_item $cf_header_list"
17224         ;;
17225 esac
17226
17227 for cf_header in $cf_header_list
17228 do
17229         cat >conftest.$ac_ext <<_ACEOF
17230 #line 17230 "configure"
17231 #include "confdefs.h"
17232
17233 #include <${cf_cv_ncurses_header:-curses.h}>
17234 #include <${cf_header}>
17235 int
17236 main (void)
17237 {
17238 WINDOW *x
17239   ;
17240   return 0;
17241 }
17242 _ACEOF
17243 rm -f conftest.$ac_objext
17244 if { (eval echo "$as_me:17244: \"$ac_compile\"") >&5
17245   (eval $ac_compile) 2>&5
17246   ac_status=$?
17247   echo "$as_me:17247: \$? = $ac_status" >&5
17248   (exit $ac_status); } &&
17249          { ac_try='test -s conftest.$ac_objext'
17250   { (eval echo "$as_me:17250: \"$ac_try\"") >&5
17251   (eval $ac_try) 2>&5
17252   ac_status=$?
17253   echo "$as_me:17253: \$? = $ac_status" >&5
17254   (exit $ac_status); }; }; then
17255   cf_cv_term_header=$cf_header
17256          break
17257 else
17258   echo "$as_me: failed program was:" >&5
17259 cat conftest.$ac_ext >&5
17260 cf_cv_term_header=no
17261 fi
17262 rm -f conftest.$ac_objext conftest.$ac_ext
17263 done
17264
17265 case $cf_cv_term_header in
17266 (no)
17267         # If curses is ncurses, some packagers still mess it up by trying to make
17268         # us use GNU termcap.  This handles the most common case.
17269         for cf_header in ncurses/term.h ncursesw/term.h
17270         do
17271                 cat >conftest.$ac_ext <<_ACEOF
17272 #line 17272 "configure"
17273 #include "confdefs.h"
17274
17275 #include <${cf_cv_ncurses_header:-curses.h}>
17276 #ifdef NCURSES_VERSION
17277 #include <${cf_header}>
17278 #else
17279 make an error
17280 #endif
17281 int
17282 main (void)
17283 {
17284 WINDOW *x
17285   ;
17286   return 0;
17287 }
17288 _ACEOF
17289 rm -f conftest.$ac_objext
17290 if { (eval echo "$as_me:17290: \"$ac_compile\"") >&5
17291   (eval $ac_compile) 2>&5
17292   ac_status=$?
17293   echo "$as_me:17293: \$? = $ac_status" >&5
17294   (exit $ac_status); } &&
17295          { ac_try='test -s conftest.$ac_objext'
17296   { (eval echo "$as_me:17296: \"$ac_try\"") >&5
17297   (eval $ac_try) 2>&5
17298   ac_status=$?
17299   echo "$as_me:17299: \$? = $ac_status" >&5
17300   (exit $ac_status); }; }; then
17301   cf_cv_term_header=$cf_header
17302                          break
17303 else
17304   echo "$as_me: failed program was:" >&5
17305 cat conftest.$ac_ext >&5
17306 cf_cv_term_header=no
17307 fi
17308 rm -f conftest.$ac_objext conftest.$ac_ext
17309         done
17310         ;;
17311 esac
17312
17313 fi
17314 echo "$as_me:17314: result: $cf_cv_term_header" >&5
17315 echo "${ECHO_T}$cf_cv_term_header" >&6
17316
17317 case $cf_cv_term_header in
17318 (term.h)
17319
17320 cat >>confdefs.h <<\EOF
17321 #define HAVE_TERM_H 1
17322 EOF
17323
17324         ;;
17325 (ncurses/term.h)
17326
17327 cat >>confdefs.h <<\EOF
17328 #define HAVE_NCURSES_TERM_H 1
17329 EOF
17330
17331         ;;
17332 (ncursesw/term.h)
17333
17334 cat >>confdefs.h <<\EOF
17335 #define HAVE_NCURSESW_TERM_H 1
17336 EOF
17337
17338         ;;
17339 esac
17340
17341 echo "$as_me:17341: checking for unctrl.h" >&5
17342 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17343 if test "${cf_cv_unctrl_header+set}" = set; then
17344   echo $ECHO_N "(cached) $ECHO_C" >&6
17345 else
17346
17347 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17348 # for <unctrl.h> if we do not find the variant.
17349
17350 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17351
17352 case ${cf_cv_ncurses_header:-curses.h} in
17353 (*/*)
17354         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17355         cf_header_list="$cf_header_item $cf_header_list"
17356         ;;
17357 esac
17358
17359 for cf_header in $cf_header_list
17360 do
17361         cat >conftest.$ac_ext <<_ACEOF
17362 #line 17362 "configure"
17363 #include "confdefs.h"
17364
17365 #include <${cf_cv_ncurses_header:-curses.h}>
17366 #include <${cf_header}>
17367 int
17368 main (void)
17369 {
17370 WINDOW *x
17371   ;
17372   return 0;
17373 }
17374 _ACEOF
17375 rm -f conftest.$ac_objext
17376 if { (eval echo "$as_me:17376: \"$ac_compile\"") >&5
17377   (eval $ac_compile) 2>&5
17378   ac_status=$?
17379   echo "$as_me:17379: \$? = $ac_status" >&5
17380   (exit $ac_status); } &&
17381          { ac_try='test -s conftest.$ac_objext'
17382   { (eval echo "$as_me:17382: \"$ac_try\"") >&5
17383   (eval $ac_try) 2>&5
17384   ac_status=$?
17385   echo "$as_me:17385: \$? = $ac_status" >&5
17386   (exit $ac_status); }; }; then
17387   cf_cv_unctrl_header=$cf_header
17388          break
17389 else
17390   echo "$as_me: failed program was:" >&5
17391 cat conftest.$ac_ext >&5
17392 cf_cv_unctrl_header=no
17393 fi
17394 rm -f conftest.$ac_objext conftest.$ac_ext
17395 done
17396
17397 fi
17398 echo "$as_me:17398: result: $cf_cv_unctrl_header" >&5
17399 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17400
17401 case $cf_cv_unctrl_header in
17402 (no)
17403         { echo "$as_me:17403: WARNING: unctrl.h header not found" >&5
17404 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17405         ;;
17406 esac
17407
17408 case $cf_cv_unctrl_header in
17409 (unctrl.h)
17410
17411 cat >>confdefs.h <<\EOF
17412 #define HAVE_UNCTRL_H 1
17413 EOF
17414
17415         ;;
17416 (ncurses/unctrl.h)
17417
17418 cat >>confdefs.h <<\EOF
17419 #define HAVE_NCURSES_UNCTRL_H 1
17420 EOF
17421
17422         ;;
17423 (ncursesw/unctrl.h)
17424
17425 cat >>confdefs.h <<\EOF
17426 #define HAVE_NCURSESW_UNCTRL_H 1
17427 EOF
17428
17429         ;;
17430 esac
17431
17432 for cf_func in \
17433 alloc_pair \
17434 assume_default_colors \
17435 chgat \
17436 color_content \
17437 color_set \
17438 copywin \
17439 delscreen \
17440 dupwin \
17441 filter \
17442 getbegx \
17443 getcurx \
17444 getmaxx \
17445 getnstr \
17446 getparx \
17447 getwin \
17448 halfdelay \
17449 init_extended_color \
17450 mvderwin \
17451 mvvline \
17452 mvwin \
17453 mvwvline \
17454 napms \
17455 newpad \
17456 putwin \
17457 reset_color_pairs \
17458 resize_term \
17459 resizeterm \
17460 restartterm \
17461 ripoffline \
17462 scr_dump \
17463 setupterm \
17464 slk_color \
17465 slk_init \
17466 termattrs \
17467 tgetent \
17468 tigetnum \
17469 tigetstr \
17470 tputs_sp \
17471 typeahead \
17472 use_default_colors \
17473 use_env \
17474 use_extended_names \
17475 use_screen \
17476 use_window \
17477 vid_puts \
17478 vidputs \
17479 vsscanf \
17480 vw_printw \
17481 wchgat \
17482 winsdelln \
17483 winsstr \
17484 wresize \
17485 wsyncdown \
17486 _tracef \
17487
17488 do
17489
17490 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17491
17492         echo "$as_me:17492: checking for ${cf_func}" >&5
17493 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17494
17495 echo "${as_me:-configure}:17495: testing ${cf_func} ..." 1>&5
17496
17497         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17498   echo $ECHO_N "(cached) $ECHO_C" >&6
17499 else
17500
17501                 eval cf_result='$ac_cv_func_'$cf_func
17502                 if test ".$cf_result" != ".no"; then
17503                         cat >conftest.$ac_ext <<_ACEOF
17504 #line 17504 "configure"
17505 #include "confdefs.h"
17506
17507 #ifdef HAVE_XCURSES
17508 #include <xcurses.h>
17509 char * XCursesProgramName = "test";
17510 #else
17511 #include <${cf_cv_ncurses_header:-curses.h}>
17512 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17513 #include <ncursesw/term.h>
17514 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17515 #include <ncurses/term.h>
17516 #elif defined(HAVE_TERM_H)
17517 #include <term.h>
17518 #endif
17519 #endif
17520
17521 int
17522 main (void)
17523 {
17524
17525 #ifndef ${cf_func}
17526 long foo = (long)(&${cf_func});
17527 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17528 if (foo + 1234L > 5678L)
17529         ${cf_cv_main_return:-return}(foo != 0);
17530 #endif
17531
17532   ;
17533   return 0;
17534 }
17535 _ACEOF
17536 rm -f conftest.$ac_objext conftest$ac_exeext
17537 if { (eval echo "$as_me:17537: \"$ac_link\"") >&5
17538   (eval $ac_link) 2>&5
17539   ac_status=$?
17540   echo "$as_me:17540: \$? = $ac_status" >&5
17541   (exit $ac_status); } &&
17542          { ac_try='test -s conftest$ac_exeext'
17543   { (eval echo "$as_me:17543: \"$ac_try\"") >&5
17544   (eval $ac_try) 2>&5
17545   ac_status=$?
17546   echo "$as_me:17546: \$? = $ac_status" >&5
17547   (exit $ac_status); }; }; then
17548   cf_result=yes
17549 else
17550   echo "$as_me: failed program was:" >&5
17551 cat conftest.$ac_ext >&5
17552 cf_result=no
17553 fi
17554 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17555                 fi
17556                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17557
17558 fi
17559
17560         # use the computed/retrieved cache-value:
17561         eval 'cf_result=$cf_cv_func_'$cf_func
17562         echo "$as_me:17562: result: $cf_result" >&5
17563 echo "${ECHO_T}$cf_result" >&6
17564         if test $cf_result != no; then
17565                 cat >>confdefs.h <<EOF
17566 #define HAVE_${cf_tr_func} 1
17567 EOF
17568
17569         fi
17570 done
17571
17572 for cf_func in tputs
17573 do
17574
17575 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17576
17577         echo "$as_me:17577: checking for ${cf_func}" >&5
17578 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17579
17580 echo "${as_me:-configure}:17580: testing ${cf_func} ..." 1>&5
17581
17582         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17583   echo $ECHO_N "(cached) $ECHO_C" >&6
17584 else
17585
17586                 eval cf_result='$ac_cv_func_'$cf_func
17587                 if test ".$cf_result" != ".no"; then
17588                         cat >conftest.$ac_ext <<_ACEOF
17589 #line 17589 "configure"
17590 #include "confdefs.h"
17591
17592 #ifdef HAVE_XCURSES
17593 #include <xcurses.h>
17594 char * XCursesProgramName = "test";
17595 #else
17596 #include <${cf_cv_ncurses_header:-curses.h}>
17597 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17598 #include <ncursesw/term.h>
17599 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17600 #include <ncurses/term.h>
17601 #elif defined(HAVE_TERM_H)
17602 #include <term.h>
17603 #endif
17604 #endif
17605
17606 int
17607 main (void)
17608 {
17609
17610 #ifndef ${cf_func}
17611 long foo = (long)(&${cf_func});
17612 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17613 if (foo + 1234L > 5678L)
17614         ${cf_cv_main_return:-return}(foo != 0);
17615 #endif
17616
17617   ;
17618   return 0;
17619 }
17620 _ACEOF
17621 rm -f conftest.$ac_objext conftest$ac_exeext
17622 if { (eval echo "$as_me:17622: \"$ac_link\"") >&5
17623   (eval $ac_link) 2>&5
17624   ac_status=$?
17625   echo "$as_me:17625: \$? = $ac_status" >&5
17626   (exit $ac_status); } &&
17627          { ac_try='test -s conftest$ac_exeext'
17628   { (eval echo "$as_me:17628: \"$ac_try\"") >&5
17629   (eval $ac_try) 2>&5
17630   ac_status=$?
17631   echo "$as_me:17631: \$? = $ac_status" >&5
17632   (exit $ac_status); }; }; then
17633   cf_result=yes
17634 else
17635   echo "$as_me: failed program was:" >&5
17636 cat conftest.$ac_ext >&5
17637 cf_result=no
17638 fi
17639 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17640                 fi
17641                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17642
17643 fi
17644
17645         # use the computed/retrieved cache-value:
17646         eval 'cf_result=$cf_cv_func_'$cf_func
17647         echo "$as_me:17647: result: $cf_result" >&5
17648 echo "${ECHO_T}$cf_result" >&6
17649         if test $cf_result != no; then
17650                 cat >>confdefs.h <<EOF
17651 #define HAVE_${cf_tr_func} 1
17652 EOF
17653
17654         fi
17655 done
17656
17657 if test x$cf_cv_func_tputs = xyes
17658 then
17659         cf_done=no
17660         for cf_arg in int char
17661         do
17662                 for cf_ret in int void
17663                 do
17664                         if test $cf_ret = void
17665                         then
17666                                 cf_return="/* nothing */"
17667                         else
17668                                 cf_return="return value"
17669                         fi
17670                         cat >conftest.$ac_ext <<_ACEOF
17671 #line 17671 "configure"
17672 #include "confdefs.h"
17673
17674 #include <${cf_cv_ncurses_header:-curses.h}>
17675 #include <$cf_cv_term_header>
17676
17677 static $cf_ret outc($cf_arg value) { $cf_return; }
17678
17679 int
17680 main (void)
17681 {
17682
17683         tputs("hello", 0, outc);
17684         ${cf_cv_main_return:-return}(0);
17685
17686   ;
17687   return 0;
17688 }
17689 _ACEOF
17690 rm -f conftest.$ac_objext
17691 if { (eval echo "$as_me:17691: \"$ac_compile\"") >&5
17692   (eval $ac_compile) 2>&5
17693   ac_status=$?
17694   echo "$as_me:17694: \$? = $ac_status" >&5
17695   (exit $ac_status); } &&
17696          { ac_try='test -s conftest.$ac_objext'
17697   { (eval echo "$as_me:17697: \"$ac_try\"") >&5
17698   (eval $ac_try) 2>&5
17699   ac_status=$?
17700   echo "$as_me:17700: \$? = $ac_status" >&5
17701   (exit $ac_status); }; }; then
17702
17703                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17704
17705 echo "${as_me:-configure}:17705: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17706
17707                 cat >>confdefs.h <<EOF
17708 #define TPUTS_ARG               $cf_arg
17709 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17710 #define TPUTS_RETURN(value)     $cf_return
17711 EOF
17712                 cf_done=yes
17713                 break
17714
17715 else
17716   echo "$as_me: failed program was:" >&5
17717 cat conftest.$ac_ext >&5
17718 fi
17719 rm -f conftest.$ac_objext conftest.$ac_ext
17720                 done
17721                 test $cf_done = yes && break
17722         done
17723 fi
17724
17725 echo "$as_me:17725: checking for ncurses extended functions" >&5
17726 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17727 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17728   echo $ECHO_N "(cached) $ECHO_C" >&6
17729 else
17730
17731 cat >conftest.$ac_ext <<_ACEOF
17732 #line 17732 "configure"
17733 #include "confdefs.h"
17734
17735 #include <${cf_cv_ncurses_header:-curses.h}>
17736 int
17737 main (void)
17738 {
17739
17740 int x = NCURSES_EXT_FUNCS
17741
17742   ;
17743   return 0;
17744 }
17745 _ACEOF
17746 rm -f conftest.$ac_objext
17747 if { (eval echo "$as_me:17747: \"$ac_compile\"") >&5
17748   (eval $ac_compile) 2>&5
17749   ac_status=$?
17750   echo "$as_me:17750: \$? = $ac_status" >&5
17751   (exit $ac_status); } &&
17752          { ac_try='test -s conftest.$ac_objext'
17753   { (eval echo "$as_me:17753: \"$ac_try\"") >&5
17754   (eval $ac_try) 2>&5
17755   ac_status=$?
17756   echo "$as_me:17756: \$? = $ac_status" >&5
17757   (exit $ac_status); }; }; then
17758   cf_cv_ncurses_ext_funcs=defined
17759 else
17760   echo "$as_me: failed program was:" >&5
17761 cat conftest.$ac_ext >&5
17762
17763 cat >conftest.$ac_ext <<_ACEOF
17764 #line 17764 "configure"
17765 #include "confdefs.h"
17766
17767 #include <${cf_cv_ncurses_header:-curses.h}>
17768 int
17769 main (void)
17770 {
17771
17772         (void) assume_default_colors (0, 0);
17773         (void) curses_version ();
17774         (void) define_key (0, 0);
17775         (void) is_term_resized (0, 0);
17776         (void) key_defined (0);
17777         (void) keybound (0, 0);
17778         (void) keyok (0, 0);
17779         (void) resize_term (0, 0);
17780         (void) resizeterm (0, 0);
17781         (void) use_default_colors ();
17782         (void) use_extended_names (0);
17783         (void) wresize (0, 0, 0);
17784   ;
17785   return 0;
17786 }
17787 _ACEOF
17788 rm -f conftest.$ac_objext conftest$ac_exeext
17789 if { (eval echo "$as_me:17789: \"$ac_link\"") >&5
17790   (eval $ac_link) 2>&5
17791   ac_status=$?
17792   echo "$as_me:17792: \$? = $ac_status" >&5
17793   (exit $ac_status); } &&
17794          { ac_try='test -s conftest$ac_exeext'
17795   { (eval echo "$as_me:17795: \"$ac_try\"") >&5
17796   (eval $ac_try) 2>&5
17797   ac_status=$?
17798   echo "$as_me:17798: \$? = $ac_status" >&5
17799   (exit $ac_status); }; }; then
17800   cf_cv_ncurses_ext_funcs=yes
17801 else
17802   echo "$as_me: failed program was:" >&5
17803 cat conftest.$ac_ext >&5
17804 cf_cv_ncurses_ext_funcs=no
17805 fi
17806 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17807
17808 fi
17809 rm -f conftest.$ac_objext conftest.$ac_ext
17810
17811 fi
17812 echo "$as_me:17812: result: $cf_cv_ncurses_ext_funcs" >&5
17813 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17814 test "$cf_cv_ncurses_ext_funcs" = yes &&
17815 cat >>confdefs.h <<\EOF
17816 #define NCURSES_EXT_FUNCS 1
17817 EOF
17818
17819 if test "$cf_enable_widec" = yes
17820 then
17821         # workaround for systems with ncurses before 20111029, due to change of
17822         # feature test macro from _XPG5 to _XOPEN_SOURCE
17823         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17824         then
17825                 cf_define_xpg5=no
17826                 echo "$as_me:17826: checking if _XPG5 should be defined to enable wide-characters" >&5
17827 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17828
17829                 cat >conftest.$ac_ext <<_ACEOF
17830 #line 17830 "configure"
17831 #include "confdefs.h"
17832
17833 #include <${cf_cv_ncurses_header:-curses.h}>
17834 int
17835 main (void)
17836 {
17837 int x = _XPG5
17838   ;
17839   return 0;
17840 }
17841 _ACEOF
17842 rm -f conftest.$ac_objext
17843 if { (eval echo "$as_me:17843: \"$ac_compile\"") >&5
17844   (eval $ac_compile) 2>&5
17845   ac_status=$?
17846   echo "$as_me:17846: \$? = $ac_status" >&5
17847   (exit $ac_status); } &&
17848          { ac_try='test -s conftest.$ac_objext'
17849   { (eval echo "$as_me:17849: \"$ac_try\"") >&5
17850   (eval $ac_try) 2>&5
17851   ac_status=$?
17852   echo "$as_me:17852: \$? = $ac_status" >&5
17853   (exit $ac_status); }; }; then
17854   :
17855 else
17856   echo "$as_me: failed program was:" >&5
17857 cat conftest.$ac_ext >&5
17858 cf_save_cppflags="$CPPFLAGS"
17859                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17860                          cat >conftest.$ac_ext <<_ACEOF
17861 #line 17861 "configure"
17862 #include "confdefs.h"
17863
17864 #include <${cf_cv_ncurses_header:-curses.h}>
17865 int
17866 main (void)
17867 {
17868 int x = _XPG5
17869   ;
17870   return 0;
17871 }
17872 _ACEOF
17873 rm -f conftest.$ac_objext
17874 if { (eval echo "$as_me:17874: \"$ac_compile\"") >&5
17875   (eval $ac_compile) 2>&5
17876   ac_status=$?
17877   echo "$as_me:17877: \$? = $ac_status" >&5
17878   (exit $ac_status); } &&
17879          { ac_try='test -s conftest.$ac_objext'
17880   { (eval echo "$as_me:17880: \"$ac_try\"") >&5
17881   (eval $ac_try) 2>&5
17882   ac_status=$?
17883   echo "$as_me:17883: \$? = $ac_status" >&5
17884   (exit $ac_status); }; }; then
17885   cf_define_xpg5=yes
17886 else
17887   echo "$as_me: failed program was:" >&5
17888 cat conftest.$ac_ext >&5
17889 fi
17890 rm -f conftest.$ac_objext conftest.$ac_ext
17891                          CPPFLAGS="$cf_save_cppflags"
17892 fi
17893 rm -f conftest.$ac_objext conftest.$ac_ext
17894                 echo "$as_me:17894: result: $cf_define_xpg5" >&5
17895 echo "${ECHO_T}$cf_define_xpg5" >&6
17896
17897                 if test "$cf_define_xpg5" = yes
17898                 then
17899                         CPPFLAGS="$CPPFLAGS -D_XPG5"
17900                 fi
17901         fi
17902
17903         echo "$as_me:17903: checking for wide-character functions" >&5
17904 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
17905 if test "${cf_cv_widechar_funcs+set}" = set; then
17906   echo $ECHO_N "(cached) $ECHO_C" >&6
17907 else
17908
17909         cat >conftest.$ac_ext <<_ACEOF
17910 #line 17910 "configure"
17911 #include "confdefs.h"
17912
17913 #include <${cf_cv_ncurses_header:-curses.h}>
17914 int
17915 main (void)
17916 {
17917
17918                 static wchar_t src_wchar[2];
17919                 static cchar_t dst_cchar;
17920                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
17921
17922   ;
17923   return 0;
17924 }
17925 _ACEOF
17926 rm -f conftest.$ac_objext conftest$ac_exeext
17927 if { (eval echo "$as_me:17927: \"$ac_link\"") >&5
17928   (eval $ac_link) 2>&5
17929   ac_status=$?
17930   echo "$as_me:17930: \$? = $ac_status" >&5
17931   (exit $ac_status); } &&
17932          { ac_try='test -s conftest$ac_exeext'
17933   { (eval echo "$as_me:17933: \"$ac_try\"") >&5
17934   (eval $ac_try) 2>&5
17935   ac_status=$?
17936   echo "$as_me:17936: \$? = $ac_status" >&5
17937   (exit $ac_status); }; }; then
17938   cf_cv_widechar_funcs=yes
17939 else
17940   echo "$as_me: failed program was:" >&5
17941 cat conftest.$ac_ext >&5
17942 cf_cv_widechar_funcs=no
17943 fi
17944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17945
17946 fi
17947 echo "$as_me:17947: result: $cf_cv_widechar_funcs" >&5
17948 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
17949         if test "$cf_cv_widechar_funcs" != no ; then
17950
17951 cat >>confdefs.h <<\EOF
17952 #define USE_WIDEC_SUPPORT 1
17953 EOF
17954
17955         else
17956                 cat >>confdefs.h <<\EOF
17957 #define USE_WIDEC_SUPPORT 0
17958 EOF
17959
17960         fi
17961 else
17962         cat >>confdefs.h <<\EOF
17963 #define USE_WIDEC_SUPPORT 0
17964 EOF
17965
17966 fi
17967
17968 echo "$as_me:17968: checking if $cf_cv_screen library uses pthreads" >&5
17969 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
17970 if test "${cf_cv_use_pthreads+set}" = set; then
17971   echo $ECHO_N "(cached) $ECHO_C" >&6
17972 else
17973
17974 cat >conftest.$ac_ext <<_ACEOF
17975 #line 17975 "configure"
17976 #include "confdefs.h"
17977
17978 #include <${cf_cv_ncurses_header:-curses.h}>
17979 extern void _nc_init_pthreads(void);
17980
17981 int
17982 main (void)
17983 {
17984
17985         initscr();
17986         _nc_init_pthreads();
17987
17988   ;
17989   return 0;
17990 }
17991 _ACEOF
17992 rm -f conftest.$ac_objext conftest$ac_exeext
17993 if { (eval echo "$as_me:17993: \"$ac_link\"") >&5
17994   (eval $ac_link) 2>&5
17995   ac_status=$?
17996   echo "$as_me:17996: \$? = $ac_status" >&5
17997   (exit $ac_status); } &&
17998          { ac_try='test -s conftest$ac_exeext'
17999   { (eval echo "$as_me:17999: \"$ac_try\"") >&5
18000   (eval $ac_try) 2>&5
18001   ac_status=$?
18002   echo "$as_me:18002: \$? = $ac_status" >&5
18003   (exit $ac_status); }; }; then
18004   cf_cv_use_pthreads=yes
18005 else
18006   echo "$as_me: failed program was:" >&5
18007 cat conftest.$ac_ext >&5
18008 cf_cv_use_pthreads=no
18009 fi
18010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18011
18012 fi
18013 echo "$as_me:18013: result: $cf_cv_use_pthreads" >&5
18014 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
18015 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
18016 #define USE_PTHREADS 1
18017 EOF
18018
18019 echo "$as_me:18019: checking if sys/time.h works with sys/select.h" >&5
18020 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
18021 if test "${cf_cv_sys_time_select+set}" = set; then
18022   echo $ECHO_N "(cached) $ECHO_C" >&6
18023 else
18024
18025 cat >conftest.$ac_ext <<_ACEOF
18026 #line 18026 "configure"
18027 #include "confdefs.h"
18028
18029 #include <sys/types.h>
18030 #ifdef HAVE_SYS_TIME_H
18031 #include <sys/time.h>
18032 #endif
18033 #ifdef HAVE_SYS_SELECT_H
18034 #include <sys/select.h>
18035 #endif
18036
18037 int
18038 main (void)
18039 {
18040
18041   ;
18042   return 0;
18043 }
18044 _ACEOF
18045 rm -f conftest.$ac_objext
18046 if { (eval echo "$as_me:18046: \"$ac_compile\"") >&5
18047   (eval $ac_compile) 2>&5
18048   ac_status=$?
18049   echo "$as_me:18049: \$? = $ac_status" >&5
18050   (exit $ac_status); } &&
18051          { ac_try='test -s conftest.$ac_objext'
18052   { (eval echo "$as_me:18052: \"$ac_try\"") >&5
18053   (eval $ac_try) 2>&5
18054   ac_status=$?
18055   echo "$as_me:18055: \$? = $ac_status" >&5
18056   (exit $ac_status); }; }; then
18057   cf_cv_sys_time_select=yes
18058 else
18059   echo "$as_me: failed program was:" >&5
18060 cat conftest.$ac_ext >&5
18061 cf_cv_sys_time_select=no
18062 fi
18063 rm -f conftest.$ac_objext conftest.$ac_ext
18064
18065 fi
18066
18067 echo "$as_me:18067: result: $cf_cv_sys_time_select" >&5
18068 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
18069 test "$cf_cv_sys_time_select" = yes &&
18070 cat >>confdefs.h <<\EOF
18071 #define HAVE_SYS_TIME_SELECT 1
18072 EOF
18073
18074 # special check for test/ditto.c
18075
18076 echo "$as_me:18076: checking for openpty in -lutil" >&5
18077 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
18078 if test "${ac_cv_lib_util_openpty+set}" = set; then
18079   echo $ECHO_N "(cached) $ECHO_C" >&6
18080 else
18081   ac_check_lib_save_LIBS=$LIBS
18082 LIBS="-lutil  $LIBS"
18083 cat >conftest.$ac_ext <<_ACEOF
18084 #line 18084 "configure"
18085 #include "confdefs.h"
18086
18087 /* Override any gcc2 internal prototype to avoid an error.  */
18088 #ifdef __cplusplus
18089 extern "C"
18090 #endif
18091 /* We use char because int might match the return type of a gcc2
18092    builtin and then its argument prototype would still apply.  */
18093 char openpty ();
18094 int
18095 main (void)
18096 {
18097 openpty ();
18098   ;
18099   return 0;
18100 }
18101 _ACEOF
18102 rm -f conftest.$ac_objext conftest$ac_exeext
18103 if { (eval echo "$as_me:18103: \"$ac_link\"") >&5
18104   (eval $ac_link) 2>&5
18105   ac_status=$?
18106   echo "$as_me:18106: \$? = $ac_status" >&5
18107   (exit $ac_status); } &&
18108          { ac_try='test -s conftest$ac_exeext'
18109   { (eval echo "$as_me:18109: \"$ac_try\"") >&5
18110   (eval $ac_try) 2>&5
18111   ac_status=$?
18112   echo "$as_me:18112: \$? = $ac_status" >&5
18113   (exit $ac_status); }; }; then
18114   ac_cv_lib_util_openpty=yes
18115 else
18116   echo "$as_me: failed program was:" >&5
18117 cat conftest.$ac_ext >&5
18118 ac_cv_lib_util_openpty=no
18119 fi
18120 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18121 LIBS=$ac_check_lib_save_LIBS
18122 fi
18123 echo "$as_me:18123: result: $ac_cv_lib_util_openpty" >&5
18124 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
18125 if test $ac_cv_lib_util_openpty = yes; then
18126   cf_cv_lib_util=yes
18127 else
18128   cf_cv_lib_util=no
18129 fi
18130
18131 echo "$as_me:18131: checking for openpty header" >&5
18132 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
18133 if test "${cf_cv_func_openpty+set}" = set; then
18134   echo $ECHO_N "(cached) $ECHO_C" >&6
18135 else
18136
18137         cf_save_LIBS="$LIBS"
18138         test $cf_cv_lib_util = yes && {
18139 cf_add_libs="-lutil"
18140 # Filter out duplicates - this happens with badly-designed ".pc" files...
18141 for cf_add_1lib in $LIBS
18142 do
18143         for cf_add_2lib in $cf_add_libs
18144         do
18145                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18146                 then
18147                         cf_add_1lib=
18148                         break
18149                 fi
18150         done
18151         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18152 done
18153 LIBS="$cf_add_libs"
18154  }
18155         for cf_header in pty.h libutil.h util.h
18156         do
18157         cat >conftest.$ac_ext <<_ACEOF
18158 #line 18158 "configure"
18159 #include "confdefs.h"
18160
18161 #include <$cf_header>
18162
18163 int
18164 main (void)
18165 {
18166
18167         int x = openpty((int *)0, (int *)0, (char *)0,
18168                                    (struct termios *)0, (struct winsize *)0);
18169
18170   ;
18171   return 0;
18172 }
18173 _ACEOF
18174 rm -f conftest.$ac_objext conftest$ac_exeext
18175 if { (eval echo "$as_me:18175: \"$ac_link\"") >&5
18176   (eval $ac_link) 2>&5
18177   ac_status=$?
18178   echo "$as_me:18178: \$? = $ac_status" >&5
18179   (exit $ac_status); } &&
18180          { ac_try='test -s conftest$ac_exeext'
18181   { (eval echo "$as_me:18181: \"$ac_try\"") >&5
18182   (eval $ac_try) 2>&5
18183   ac_status=$?
18184   echo "$as_me:18184: \$? = $ac_status" >&5
18185   (exit $ac_status); }; }; then
18186
18187                 cf_cv_func_openpty=$cf_header
18188                 break
18189
18190 else
18191   echo "$as_me: failed program was:" >&5
18192 cat conftest.$ac_ext >&5
18193
18194                 cf_cv_func_openpty=no
18195
18196 fi
18197 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18198         done
18199         LIBS="$cf_save_LIBS"
18200
18201 fi
18202 echo "$as_me:18202: result: $cf_cv_func_openpty" >&5
18203 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18204
18205 if test "$cf_cv_func_openpty" != no ; then
18206
18207 cat >>confdefs.h <<EOF
18208 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18209 EOF
18210
18211 cat >>confdefs.h <<\EOF
18212 #define USE_XTERM_PTY 1
18213 EOF
18214
18215         if test "x$cf_cv_lib_util" = xyes ; then
18216
18217 cf_add_libs="-lutil"
18218 # Filter out duplicates - this happens with badly-designed ".pc" files...
18219 for cf_add_1lib in $TEST_LIBS
18220 do
18221         for cf_add_2lib in $cf_add_libs
18222         do
18223                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18224                 then
18225                         cf_add_1lib=
18226                         break
18227                 fi
18228         done
18229         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18230 done
18231 TEST_LIBS="$cf_add_libs"
18232
18233         fi
18234 fi
18235
18236 echo "$as_me:18236: checking for function curses_version" >&5
18237 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18238 if test "${cf_cv_func_curses_version+set}" = set; then
18239   echo $ECHO_N "(cached) $ECHO_C" >&6
18240 else
18241
18242 if test "$cross_compiling" = yes; then
18243   cf_cv_func_curses_version=unknown
18244 else
18245   cat >conftest.$ac_ext <<_ACEOF
18246 #line 18246 "configure"
18247 #include "confdefs.h"
18248
18249 #include <${cf_cv_ncurses_header:-curses.h}>
18250 int main(void)
18251 {
18252         char temp[1024];
18253         sprintf(temp, "%s\n", curses_version());
18254         ${cf_cv_main_return:-return}(0);
18255 }
18256
18257 _ACEOF
18258 rm -f conftest$ac_exeext
18259 if { (eval echo "$as_me:18259: \"$ac_link\"") >&5
18260   (eval $ac_link) 2>&5
18261   ac_status=$?
18262   echo "$as_me:18262: \$? = $ac_status" >&5
18263   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18264   { (eval echo "$as_me:18264: \"$ac_try\"") >&5
18265   (eval $ac_try) 2>&5
18266   ac_status=$?
18267   echo "$as_me:18267: \$? = $ac_status" >&5
18268   (exit $ac_status); }; }; then
18269   cf_cv_func_curses_version=yes
18270
18271 else
18272   echo "$as_me: program exited with status $ac_status" >&5
18273 echo "$as_me: failed program was:" >&5
18274 cat conftest.$ac_ext >&5
18275 cf_cv_func_curses_version=no
18276
18277 fi
18278 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18279 fi
18280 rm -f core
18281 fi
18282 echo "$as_me:18282: result: $cf_cv_func_curses_version" >&5
18283 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18284 test "$cf_cv_func_curses_version" = yes &&
18285 cat >>confdefs.h <<\EOF
18286 #define HAVE_CURSES_VERSION 1
18287 EOF
18288
18289 echo "$as_me:18289: checking for alternate character set array" >&5
18290 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18291 if test "${cf_cv_curses_acs_map+set}" = set; then
18292   echo $ECHO_N "(cached) $ECHO_C" >&6
18293 else
18294
18295 cf_cv_curses_acs_map=unknown
18296 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18297 do
18298 cat >conftest.$ac_ext <<_ACEOF
18299 #line 18299 "configure"
18300 #include "confdefs.h"
18301
18302 #include <${cf_cv_ncurses_header:-curses.h}>
18303
18304 int
18305 main (void)
18306 {
18307
18308 $name['k'] = ACS_PLUS
18309
18310   ;
18311   return 0;
18312 }
18313 _ACEOF
18314 rm -f conftest.$ac_objext conftest$ac_exeext
18315 if { (eval echo "$as_me:18315: \"$ac_link\"") >&5
18316   (eval $ac_link) 2>&5
18317   ac_status=$?
18318   echo "$as_me:18318: \$? = $ac_status" >&5
18319   (exit $ac_status); } &&
18320          { ac_try='test -s conftest$ac_exeext'
18321   { (eval echo "$as_me:18321: \"$ac_try\"") >&5
18322   (eval $ac_try) 2>&5
18323   ac_status=$?
18324   echo "$as_me:18324: \$? = $ac_status" >&5
18325   (exit $ac_status); }; }; then
18326   cf_cv_curses_acs_map=$name; break
18327 else
18328   echo "$as_me: failed program was:" >&5
18329 cat conftest.$ac_ext >&5
18330 fi
18331 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18332 done
18333
18334 fi
18335 echo "$as_me:18335: result: $cf_cv_curses_acs_map" >&5
18336 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18337
18338 test "$cf_cv_curses_acs_map" != unknown &&
18339 cat >>confdefs.h <<EOF
18340 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18341 EOF
18342
18343 if test "$cf_enable_widec" = yes; then
18344
18345 echo "$as_me:18345: checking for wide alternate character set array" >&5
18346 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18347 if test "${cf_cv_curses_wacs_map+set}" = set; then
18348   echo $ECHO_N "(cached) $ECHO_C" >&6
18349 else
18350
18351         cf_cv_curses_wacs_map=unknown
18352         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18353         do
18354         cat >conftest.$ac_ext <<_ACEOF
18355 #line 18355 "configure"
18356 #include "confdefs.h"
18357
18358 #ifndef _XOPEN_SOURCE_EXTENDED
18359 #define _XOPEN_SOURCE_EXTENDED
18360 #endif
18361 #include <${cf_cv_ncurses_header:-curses.h}>
18362 int
18363 main (void)
18364 {
18365 void *foo = &($name['k'])
18366   ;
18367   return 0;
18368 }
18369 _ACEOF
18370 rm -f conftest.$ac_objext conftest$ac_exeext
18371 if { (eval echo "$as_me:18371: \"$ac_link\"") >&5
18372   (eval $ac_link) 2>&5
18373   ac_status=$?
18374   echo "$as_me:18374: \$? = $ac_status" >&5
18375   (exit $ac_status); } &&
18376          { ac_try='test -s conftest$ac_exeext'
18377   { (eval echo "$as_me:18377: \"$ac_try\"") >&5
18378   (eval $ac_try) 2>&5
18379   ac_status=$?
18380   echo "$as_me:18380: \$? = $ac_status" >&5
18381   (exit $ac_status); }; }; then
18382   cf_cv_curses_wacs_map=$name
18383          break
18384 else
18385   echo "$as_me: failed program was:" >&5
18386 cat conftest.$ac_ext >&5
18387 fi
18388 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18389         done
18390 fi
18391 echo "$as_me:18391: result: $cf_cv_curses_wacs_map" >&5
18392 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18393
18394 test "$cf_cv_curses_wacs_map" != unknown &&
18395 cat >>confdefs.h <<EOF
18396 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18397 EOF
18398
18399 echo "$as_me:18399: checking for wide alternate character constants" >&5
18400 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18401 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18402   echo $ECHO_N "(cached) $ECHO_C" >&6
18403 else
18404
18405 cf_cv_curses_wacs_symbols=no
18406 if test "$cf_cv_curses_wacs_map" != unknown
18407 then
18408         cat >conftest.$ac_ext <<_ACEOF
18409 #line 18409 "configure"
18410 #include "confdefs.h"
18411
18412 #ifndef _XOPEN_SOURCE_EXTENDED
18413 #define _XOPEN_SOURCE_EXTENDED
18414 #endif
18415 #include <${cf_cv_ncurses_header:-curses.h}>
18416 int
18417 main (void)
18418 {
18419 cchar_t *foo = WACS_PLUS;
18420          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18421   ;
18422   return 0;
18423 }
18424 _ACEOF
18425 rm -f conftest.$ac_objext conftest$ac_exeext
18426 if { (eval echo "$as_me:18426: \"$ac_link\"") >&5
18427   (eval $ac_link) 2>&5
18428   ac_status=$?
18429   echo "$as_me:18429: \$? = $ac_status" >&5
18430   (exit $ac_status); } &&
18431          { ac_try='test -s conftest$ac_exeext'
18432   { (eval echo "$as_me:18432: \"$ac_try\"") >&5
18433   (eval $ac_try) 2>&5
18434   ac_status=$?
18435   echo "$as_me:18435: \$? = $ac_status" >&5
18436   (exit $ac_status); }; }; then
18437   cf_cv_curses_wacs_symbols=yes
18438 else
18439   echo "$as_me: failed program was:" >&5
18440 cat conftest.$ac_ext >&5
18441 fi
18442 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18443 else
18444         cat >conftest.$ac_ext <<_ACEOF
18445 #line 18445 "configure"
18446 #include "confdefs.h"
18447
18448 #ifndef _XOPEN_SOURCE_EXTENDED
18449 #define _XOPEN_SOURCE_EXTENDED
18450 #endif
18451 #include <${cf_cv_ncurses_header:-curses.h}>
18452 int
18453 main (void)
18454 {
18455 cchar_t *foo = WACS_PLUS
18456   ;
18457   return 0;
18458 }
18459 _ACEOF
18460 rm -f conftest.$ac_objext conftest$ac_exeext
18461 if { (eval echo "$as_me:18461: \"$ac_link\"") >&5
18462   (eval $ac_link) 2>&5
18463   ac_status=$?
18464   echo "$as_me:18464: \$? = $ac_status" >&5
18465   (exit $ac_status); } &&
18466          { ac_try='test -s conftest$ac_exeext'
18467   { (eval echo "$as_me:18467: \"$ac_try\"") >&5
18468   (eval $ac_try) 2>&5
18469   ac_status=$?
18470   echo "$as_me:18470: \$? = $ac_status" >&5
18471   (exit $ac_status); }; }; then
18472   cf_cv_curses_wacs_symbols=yes
18473 else
18474   echo "$as_me: failed program was:" >&5
18475 cat conftest.$ac_ext >&5
18476 fi
18477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18478 fi
18479
18480 fi
18481 echo "$as_me:18481: result: $cf_cv_curses_wacs_symbols" >&5
18482 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18483
18484 test "$cf_cv_curses_wacs_symbols" != no &&
18485 cat >>confdefs.h <<\EOF
18486 #define CURSES_WACS_SYMBOLS 1
18487 EOF
18488
18489 fi
18490
18491 echo "$as_me:18491: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18492 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18493 cat >conftest.$ac_ext <<_ACEOF
18494 #line 18494 "configure"
18495 #include "confdefs.h"
18496
18497 #ifndef _XOPEN_SOURCE_EXTENDED
18498 #define _XOPEN_SOURCE_EXTENDED
18499 #endif
18500 #include <${cf_cv_ncurses_header:-curses.h}>
18501 int
18502 main (void)
18503 {
18504
18505 attr_t foo
18506
18507   ;
18508   return 0;
18509 }
18510 _ACEOF
18511 rm -f conftest.$ac_objext
18512 if { (eval echo "$as_me:18512: \"$ac_compile\"") >&5
18513   (eval $ac_compile) 2>&5
18514   ac_status=$?
18515   echo "$as_me:18515: \$? = $ac_status" >&5
18516   (exit $ac_status); } &&
18517          { ac_try='test -s conftest.$ac_objext'
18518   { (eval echo "$as_me:18518: \"$ac_try\"") >&5
18519   (eval $ac_try) 2>&5
18520   ac_status=$?
18521   echo "$as_me:18521: \$? = $ac_status" >&5
18522   (exit $ac_status); }; }; then
18523   cf_result=yes
18524 else
18525   echo "$as_me: failed program was:" >&5
18526 cat conftest.$ac_ext >&5
18527 cf_result=no
18528 fi
18529 rm -f conftest.$ac_objext conftest.$ac_ext
18530 echo "$as_me:18530: result: $cf_result" >&5
18531 echo "${ECHO_T}$cf_result" >&6
18532 if test $cf_result = yes ; then
18533
18534 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18535
18536 cat >>confdefs.h <<EOF
18537 #define $cf_result 1
18538 EOF
18539
18540 else
18541
18542 cat >>confdefs.h <<EOF
18543 #define attr_t long
18544 EOF
18545
18546 fi
18547
18548 if test "$cf_enable_widec" = yes; then
18549
18550 # This is needed on Tru64 5.0 to declare mbstate_t
18551 echo "$as_me:18551: checking if we must include wchar.h to declare mbstate_t" >&5
18552 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18553 if test "${cf_cv_mbstate_t+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 <stdlib.h>
18562 #include <stdarg.h>
18563 #include <stdio.h>
18564 #ifdef HAVE_LIBUTF8_H
18565 #include <libutf8.h>
18566 #endif
18567 int
18568 main (void)
18569 {
18570 mbstate_t state
18571   ;
18572   return 0;
18573 }
18574 _ACEOF
18575 rm -f conftest.$ac_objext
18576 if { (eval echo "$as_me:18576: \"$ac_compile\"") >&5
18577   (eval $ac_compile) 2>&5
18578   ac_status=$?
18579   echo "$as_me:18579: \$? = $ac_status" >&5
18580   (exit $ac_status); } &&
18581          { ac_try='test -s conftest.$ac_objext'
18582   { (eval echo "$as_me:18582: \"$ac_try\"") >&5
18583   (eval $ac_try) 2>&5
18584   ac_status=$?
18585   echo "$as_me:18585: \$? = $ac_status" >&5
18586   (exit $ac_status); }; }; then
18587   cf_cv_mbstate_t=no
18588 else
18589   echo "$as_me: failed program was:" >&5
18590 cat conftest.$ac_ext >&5
18591 cat >conftest.$ac_ext <<_ACEOF
18592 #line 18592 "configure"
18593 #include "confdefs.h"
18594
18595 #include <stdlib.h>
18596 #include <stdarg.h>
18597 #include <stdio.h>
18598 #include <wchar.h>
18599 #ifdef HAVE_LIBUTF8_H
18600 #include <libutf8.h>
18601 #endif
18602 int
18603 main (void)
18604 {
18605 mbstate_t value
18606   ;
18607   return 0;
18608 }
18609 _ACEOF
18610 rm -f conftest.$ac_objext
18611 if { (eval echo "$as_me:18611: \"$ac_compile\"") >&5
18612   (eval $ac_compile) 2>&5
18613   ac_status=$?
18614   echo "$as_me:18614: \$? = $ac_status" >&5
18615   (exit $ac_status); } &&
18616          { ac_try='test -s conftest.$ac_objext'
18617   { (eval echo "$as_me:18617: \"$ac_try\"") >&5
18618   (eval $ac_try) 2>&5
18619   ac_status=$?
18620   echo "$as_me:18620: \$? = $ac_status" >&5
18621   (exit $ac_status); }; }; then
18622   cf_cv_mbstate_t=yes
18623 else
18624   echo "$as_me: failed program was:" >&5
18625 cat conftest.$ac_ext >&5
18626 cf_cv_mbstate_t=unknown
18627 fi
18628 rm -f conftest.$ac_objext conftest.$ac_ext
18629 fi
18630 rm -f conftest.$ac_objext conftest.$ac_ext
18631 fi
18632 echo "$as_me:18632: result: $cf_cv_mbstate_t" >&5
18633 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18634
18635 if test "$cf_cv_mbstate_t" = yes ; then
18636
18637 cat >>confdefs.h <<\EOF
18638 #define NEED_WCHAR_H 1
18639 EOF
18640
18641         NEED_WCHAR_H=1
18642 fi
18643
18644 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18645 if test "$cf_cv_mbstate_t" = unknown ; then
18646         NCURSES_MBSTATE_T=1
18647 fi
18648
18649 # if we find mbstate_t in either place, use substitution to provide a fallback.
18650 if test "$cf_cv_mbstate_t" != unknown ; then
18651         NCURSES_OK_MBSTATE_T=1
18652 fi
18653
18654 # This is needed on Tru64 5.0 to declare wchar_t
18655 echo "$as_me:18655: checking if we must include wchar.h to declare wchar_t" >&5
18656 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18657 if test "${cf_cv_wchar_t+set}" = set; then
18658   echo $ECHO_N "(cached) $ECHO_C" >&6
18659 else
18660
18661 cat >conftest.$ac_ext <<_ACEOF
18662 #line 18662 "configure"
18663 #include "confdefs.h"
18664
18665 #include <stdlib.h>
18666 #include <stdarg.h>
18667 #include <stdio.h>
18668 #ifdef HAVE_LIBUTF8_H
18669 #include <libutf8.h>
18670 #endif
18671 int
18672 main (void)
18673 {
18674 wchar_t state
18675   ;
18676   return 0;
18677 }
18678 _ACEOF
18679 rm -f conftest.$ac_objext
18680 if { (eval echo "$as_me:18680: \"$ac_compile\"") >&5
18681   (eval $ac_compile) 2>&5
18682   ac_status=$?
18683   echo "$as_me:18683: \$? = $ac_status" >&5
18684   (exit $ac_status); } &&
18685          { ac_try='test -s conftest.$ac_objext'
18686   { (eval echo "$as_me:18686: \"$ac_try\"") >&5
18687   (eval $ac_try) 2>&5
18688   ac_status=$?
18689   echo "$as_me:18689: \$? = $ac_status" >&5
18690   (exit $ac_status); }; }; then
18691   cf_cv_wchar_t=no
18692 else
18693   echo "$as_me: failed program was:" >&5
18694 cat conftest.$ac_ext >&5
18695 cat >conftest.$ac_ext <<_ACEOF
18696 #line 18696 "configure"
18697 #include "confdefs.h"
18698
18699 #include <stdlib.h>
18700 #include <stdarg.h>
18701 #include <stdio.h>
18702 #include <wchar.h>
18703 #ifdef HAVE_LIBUTF8_H
18704 #include <libutf8.h>
18705 #endif
18706 int
18707 main (void)
18708 {
18709 wchar_t value
18710   ;
18711   return 0;
18712 }
18713 _ACEOF
18714 rm -f conftest.$ac_objext
18715 if { (eval echo "$as_me:18715: \"$ac_compile\"") >&5
18716   (eval $ac_compile) 2>&5
18717   ac_status=$?
18718   echo "$as_me:18718: \$? = $ac_status" >&5
18719   (exit $ac_status); } &&
18720          { ac_try='test -s conftest.$ac_objext'
18721   { (eval echo "$as_me:18721: \"$ac_try\"") >&5
18722   (eval $ac_try) 2>&5
18723   ac_status=$?
18724   echo "$as_me:18724: \$? = $ac_status" >&5
18725   (exit $ac_status); }; }; then
18726   cf_cv_wchar_t=yes
18727 else
18728   echo "$as_me: failed program was:" >&5
18729 cat conftest.$ac_ext >&5
18730 cf_cv_wchar_t=unknown
18731 fi
18732 rm -f conftest.$ac_objext conftest.$ac_ext
18733 fi
18734 rm -f conftest.$ac_objext conftest.$ac_ext
18735 fi
18736 echo "$as_me:18736: result: $cf_cv_wchar_t" >&5
18737 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18738
18739 if test "$cf_cv_wchar_t" = yes ; then
18740
18741 cat >>confdefs.h <<\EOF
18742 #define NEED_WCHAR_H 1
18743 EOF
18744
18745         NEED_WCHAR_H=1
18746 fi
18747
18748 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18749 if test "$cf_cv_wchar_t" = unknown ; then
18750         NCURSES_WCHAR_T=1
18751 fi
18752
18753 # if we find wchar_t in either place, use substitution to provide a fallback.
18754 if test "$cf_cv_wchar_t" != unknown ; then
18755         NCURSES_OK_WCHAR_T=1
18756 fi
18757
18758 # This is needed on Tru64 5.0 to declare wint_t
18759 echo "$as_me:18759: checking if we must include wchar.h to declare wint_t" >&5
18760 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18761 if test "${cf_cv_wint_t+set}" = set; then
18762   echo $ECHO_N "(cached) $ECHO_C" >&6
18763 else
18764
18765 cat >conftest.$ac_ext <<_ACEOF
18766 #line 18766 "configure"
18767 #include "confdefs.h"
18768
18769 #include <stdlib.h>
18770 #include <stdarg.h>
18771 #include <stdio.h>
18772 #ifdef HAVE_LIBUTF8_H
18773 #include <libutf8.h>
18774 #endif
18775 int
18776 main (void)
18777 {
18778 wint_t state
18779   ;
18780   return 0;
18781 }
18782 _ACEOF
18783 rm -f conftest.$ac_objext
18784 if { (eval echo "$as_me:18784: \"$ac_compile\"") >&5
18785   (eval $ac_compile) 2>&5
18786   ac_status=$?
18787   echo "$as_me:18787: \$? = $ac_status" >&5
18788   (exit $ac_status); } &&
18789          { ac_try='test -s conftest.$ac_objext'
18790   { (eval echo "$as_me:18790: \"$ac_try\"") >&5
18791   (eval $ac_try) 2>&5
18792   ac_status=$?
18793   echo "$as_me:18793: \$? = $ac_status" >&5
18794   (exit $ac_status); }; }; then
18795   cf_cv_wint_t=no
18796 else
18797   echo "$as_me: failed program was:" >&5
18798 cat conftest.$ac_ext >&5
18799 cat >conftest.$ac_ext <<_ACEOF
18800 #line 18800 "configure"
18801 #include "confdefs.h"
18802
18803 #include <stdlib.h>
18804 #include <stdarg.h>
18805 #include <stdio.h>
18806 #include <wchar.h>
18807 #ifdef HAVE_LIBUTF8_H
18808 #include <libutf8.h>
18809 #endif
18810 int
18811 main (void)
18812 {
18813 wint_t value
18814   ;
18815   return 0;
18816 }
18817 _ACEOF
18818 rm -f conftest.$ac_objext
18819 if { (eval echo "$as_me:18819: \"$ac_compile\"") >&5
18820   (eval $ac_compile) 2>&5
18821   ac_status=$?
18822   echo "$as_me:18822: \$? = $ac_status" >&5
18823   (exit $ac_status); } &&
18824          { ac_try='test -s conftest.$ac_objext'
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_wint_t=yes
18831 else
18832   echo "$as_me: failed program was:" >&5
18833 cat conftest.$ac_ext >&5
18834 cf_cv_wint_t=unknown
18835 fi
18836 rm -f conftest.$ac_objext conftest.$ac_ext
18837 fi
18838 rm -f conftest.$ac_objext conftest.$ac_ext
18839 fi
18840 echo "$as_me:18840: result: $cf_cv_wint_t" >&5
18841 echo "${ECHO_T}$cf_cv_wint_t" >&6
18842
18843 if test "$cf_cv_wint_t" = yes ; then
18844
18845 cat >>confdefs.h <<\EOF
18846 #define NEED_WCHAR_H 1
18847 EOF
18848
18849         NEED_WCHAR_H=1
18850 fi
18851
18852 # if we do not find wint_t in either place, use substitution to provide a fallback.
18853 if test "$cf_cv_wint_t" = unknown ; then
18854         NCURSES_WINT_T=1
18855 fi
18856
18857 # if we find wint_t in either place, use substitution to provide a fallback.
18858 if test "$cf_cv_wint_t" != unknown ; then
18859         NCURSES_OK_WINT_T=1
18860 fi
18861
18862         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18863
18864 echo "$as_me:18864: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18865 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18866 cat >conftest.$ac_ext <<_ACEOF
18867 #line 18867 "configure"
18868 #include "confdefs.h"
18869
18870 #ifndef _XOPEN_SOURCE_EXTENDED
18871 #define _XOPEN_SOURCE_EXTENDED
18872 #endif
18873 #include <${cf_cv_ncurses_header:-curses.h}>
18874 int
18875 main (void)
18876 {
18877
18878 mbstate_t foo
18879
18880   ;
18881   return 0;
18882 }
18883 _ACEOF
18884 rm -f conftest.$ac_objext
18885 if { (eval echo "$as_me:18885: \"$ac_compile\"") >&5
18886   (eval $ac_compile) 2>&5
18887   ac_status=$?
18888   echo "$as_me:18888: \$? = $ac_status" >&5
18889   (exit $ac_status); } &&
18890          { ac_try='test -s conftest.$ac_objext'
18891   { (eval echo "$as_me:18891: \"$ac_try\"") >&5
18892   (eval $ac_try) 2>&5
18893   ac_status=$?
18894   echo "$as_me:18894: \$? = $ac_status" >&5
18895   (exit $ac_status); }; }; then
18896   cf_result=yes
18897 else
18898   echo "$as_me: failed program was:" >&5
18899 cat conftest.$ac_ext >&5
18900 cf_result=no
18901 fi
18902 rm -f conftest.$ac_objext conftest.$ac_ext
18903 echo "$as_me:18903: result: $cf_result" >&5
18904 echo "${ECHO_T}$cf_result" >&6
18905 if test $cf_result = yes ; then
18906
18907 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18908
18909 cat >>confdefs.h <<EOF
18910 #define $cf_result 1
18911 EOF
18912
18913 else
18914
18915 cat >>confdefs.h <<EOF
18916 #define mbstate_t long
18917 EOF
18918
18919 fi
18920
18921         fi
18922
18923         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
18924
18925 echo "$as_me:18925: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18926 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18927 cat >conftest.$ac_ext <<_ACEOF
18928 #line 18928 "configure"
18929 #include "confdefs.h"
18930
18931 #ifndef _XOPEN_SOURCE_EXTENDED
18932 #define _XOPEN_SOURCE_EXTENDED
18933 #endif
18934 #include <${cf_cv_ncurses_header:-curses.h}>
18935 int
18936 main (void)
18937 {
18938
18939 wchar_t foo
18940
18941   ;
18942   return 0;
18943 }
18944 _ACEOF
18945 rm -f conftest.$ac_objext
18946 if { (eval echo "$as_me:18946: \"$ac_compile\"") >&5
18947   (eval $ac_compile) 2>&5
18948   ac_status=$?
18949   echo "$as_me:18949: \$? = $ac_status" >&5
18950   (exit $ac_status); } &&
18951          { ac_try='test -s conftest.$ac_objext'
18952   { (eval echo "$as_me:18952: \"$ac_try\"") >&5
18953   (eval $ac_try) 2>&5
18954   ac_status=$?
18955   echo "$as_me:18955: \$? = $ac_status" >&5
18956   (exit $ac_status); }; }; then
18957   cf_result=yes
18958 else
18959   echo "$as_me: failed program was:" >&5
18960 cat conftest.$ac_ext >&5
18961 cf_result=no
18962 fi
18963 rm -f conftest.$ac_objext conftest.$ac_ext
18964 echo "$as_me:18964: result: $cf_result" >&5
18965 echo "${ECHO_T}$cf_result" >&6
18966 if test $cf_result = yes ; then
18967
18968 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18969
18970 cat >>confdefs.h <<EOF
18971 #define $cf_result 1
18972 EOF
18973
18974 else
18975
18976 cat >>confdefs.h <<EOF
18977 #define wchar_t long
18978 EOF
18979
18980 fi
18981
18982         fi
18983
18984         if test "$NCURSES_OK_WINT_T" = 0 ; then
18985
18986 echo "$as_me:18986: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18987 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18988 cat >conftest.$ac_ext <<_ACEOF
18989 #line 18989 "configure"
18990 #include "confdefs.h"
18991
18992 #ifndef _XOPEN_SOURCE_EXTENDED
18993 #define _XOPEN_SOURCE_EXTENDED
18994 #endif
18995 #include <${cf_cv_ncurses_header:-curses.h}>
18996 int
18997 main (void)
18998 {
18999
19000 wint_t foo
19001
19002   ;
19003   return 0;
19004 }
19005 _ACEOF
19006 rm -f conftest.$ac_objext
19007 if { (eval echo "$as_me:19007: \"$ac_compile\"") >&5
19008   (eval $ac_compile) 2>&5
19009   ac_status=$?
19010   echo "$as_me:19010: \$? = $ac_status" >&5
19011   (exit $ac_status); } &&
19012          { ac_try='test -s conftest.$ac_objext'
19013   { (eval echo "$as_me:19013: \"$ac_try\"") >&5
19014   (eval $ac_try) 2>&5
19015   ac_status=$?
19016   echo "$as_me:19016: \$? = $ac_status" >&5
19017   (exit $ac_status); }; }; then
19018   cf_result=yes
19019 else
19020   echo "$as_me: failed program was:" >&5
19021 cat conftest.$ac_ext >&5
19022 cf_result=no
19023 fi
19024 rm -f conftest.$ac_objext conftest.$ac_ext
19025 echo "$as_me:19025: result: $cf_result" >&5
19026 echo "${ECHO_T}$cf_result" >&6
19027 if test $cf_result = yes ; then
19028
19029 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19030
19031 cat >>confdefs.h <<EOF
19032 #define $cf_result 1
19033 EOF
19034
19035 else
19036
19037 cat >>confdefs.h <<EOF
19038 #define wint_t long
19039 EOF
19040
19041 fi
19042
19043         fi
19044 fi
19045
19046 for cf_data in \
19047 curscr \
19048 ospeed \
19049 boolnames \
19050 boolfnames \
19051 ttytype
19052 do
19053 echo "$as_me:19053: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
19054 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
19055
19056 cat >conftest.$ac_ext <<_ACEOF
19057 #line 19057 "configure"
19058 #include "confdefs.h"
19059
19060 #ifdef HAVE_XCURSES
19061 #include <xcurses.h>
19062 char * XCursesProgramName = "test";
19063 #else
19064 #include <${cf_cv_ncurses_header:-curses.h}>
19065 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19066 #include <ncursesw/term.h>
19067 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19068 #include <ncurses/term.h>
19069 #elif defined(HAVE_TERM_H)
19070 #include <term.h>
19071 #endif
19072 #endif
19073
19074 int
19075 main (void)
19076 {
19077
19078 void *foo = &($cf_data)
19079
19080   ;
19081   return 0;
19082 }
19083 _ACEOF
19084 rm -f conftest.$ac_objext
19085 if { (eval echo "$as_me:19085: \"$ac_compile\"") >&5
19086   (eval $ac_compile) 2>&5
19087   ac_status=$?
19088   echo "$as_me:19088: \$? = $ac_status" >&5
19089   (exit $ac_status); } &&
19090          { ac_try='test -s conftest.$ac_objext'
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_result=yes
19097
19098 else
19099   echo "$as_me: failed program was:" >&5
19100 cat conftest.$ac_ext >&5
19101 cf_result=no
19102 fi
19103 rm -f conftest.$ac_objext conftest.$ac_ext
19104 echo "$as_me:19104: result: $cf_result" >&5
19105 echo "${ECHO_T}$cf_result" >&6
19106
19107 if test $cf_result = yes ; then
19108
19109 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19110
19111         cat >>confdefs.h <<EOF
19112 #define $cf_result 1
19113 EOF
19114
19115 else
19116         echo "$as_me:19116: checking for data $cf_data in library" >&5
19117 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
19118         # BSD linkers insist on making weak linkage, but resolve at runtime.
19119         if test "$cross_compiling" = yes; then
19120
19121         # cross-compiling
19122         cat >conftest.$ac_ext <<_ACEOF
19123 #line 19123 "configure"
19124 #include "confdefs.h"
19125
19126 #ifdef HAVE_XCURSES
19127 #include <xcurses.h>
19128 char * XCursesProgramName = "test";
19129 #else
19130 #include <${cf_cv_ncurses_header:-curses.h}>
19131 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19132 #include <ncursesw/term.h>
19133 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19134 #include <ncurses/term.h>
19135 #elif defined(HAVE_TERM_H)
19136 #include <term.h>
19137 #endif
19138 #endif
19139
19140 extern char $cf_data;
19141 int
19142 main (void)
19143 {
19144
19145         do {
19146                 void *foo = &($cf_data);
19147                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19148                 ${cf_cv_main_return:-return}(foo == 0);
19149         } while (0)
19150
19151   ;
19152   return 0;
19153 }
19154 _ACEOF
19155 rm -f conftest.$ac_objext conftest$ac_exeext
19156 if { (eval echo "$as_me:19156: \"$ac_link\"") >&5
19157   (eval $ac_link) 2>&5
19158   ac_status=$?
19159   echo "$as_me:19159: \$? = $ac_status" >&5
19160   (exit $ac_status); } &&
19161          { ac_try='test -s conftest$ac_exeext'
19162   { (eval echo "$as_me:19162: \"$ac_try\"") >&5
19163   (eval $ac_try) 2>&5
19164   ac_status=$?
19165   echo "$as_me:19165: \$? = $ac_status" >&5
19166   (exit $ac_status); }; }; then
19167   cf_result=yes
19168 else
19169   echo "$as_me: failed program was:" >&5
19170 cat conftest.$ac_ext >&5
19171 cf_result=no
19172 fi
19173 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19174
19175 else
19176   cat >conftest.$ac_ext <<_ACEOF
19177 #line 19177 "configure"
19178 #include "confdefs.h"
19179
19180 #ifdef HAVE_XCURSES
19181 #include <xcurses.h>
19182 char * XCursesProgramName = "test";
19183 #else
19184 #include <${cf_cv_ncurses_header:-curses.h}>
19185 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19186 #include <ncursesw/term.h>
19187 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19188 #include <ncurses/term.h>
19189 #elif defined(HAVE_TERM_H)
19190 #include <term.h>
19191 #endif
19192 #endif
19193
19194 extern char $cf_data;
19195 int main(void)
19196 {
19197         void *foo = &($cf_data);
19198         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19199         ${cf_cv_main_return:-return}(foo == 0);
19200 }
19201 _ACEOF
19202 rm -f conftest$ac_exeext
19203 if { (eval echo "$as_me:19203: \"$ac_link\"") >&5
19204   (eval $ac_link) 2>&5
19205   ac_status=$?
19206   echo "$as_me:19206: \$? = $ac_status" >&5
19207   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19208   { (eval echo "$as_me:19208: \"$ac_try\"") >&5
19209   (eval $ac_try) 2>&5
19210   ac_status=$?
19211   echo "$as_me:19211: \$? = $ac_status" >&5
19212   (exit $ac_status); }; }; then
19213   cf_result=yes
19214
19215 else
19216   echo "$as_me: program exited with status $ac_status" >&5
19217 echo "$as_me: failed program was:" >&5
19218 cat conftest.$ac_ext >&5
19219 cf_result=no
19220 fi
19221 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19222 fi
19223         echo "$as_me:19223: result: $cf_result" >&5
19224 echo "${ECHO_T}$cf_result" >&6
19225         if test $cf_result = yes ; then
19226
19227 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19228
19229                 cat >>confdefs.h <<EOF
19230 #define $cf_result 1
19231 EOF
19232
19233                 # do not exit loop here, since we prefer system's declarations
19234         fi
19235 fi
19236 done
19237
19238 if ( test "$GCC" = yes || test "$GXX" = yes )
19239 then
19240 echo "$as_me:19240: checking if you want to turn on gcc warnings" >&5
19241 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19242
19243 # Check whether --enable-warnings or --disable-warnings was given.
19244 if test "${enable_warnings+set}" = set; then
19245   enableval="$enable_warnings"
19246   test "$enableval" != yes && enableval=no
19247         if test "$enableval" != "no" ; then
19248     with_warnings=yes
19249         else
19250                 with_warnings=no
19251         fi
19252 else
19253   enableval=no
19254         with_warnings=no
19255
19256 fi;
19257 echo "$as_me:19257: result: $with_warnings" >&5
19258 echo "${ECHO_T}$with_warnings" >&6
19259 if test "$with_warnings" = "yes"
19260 then
19261
19262 if test "$GCC" = yes
19263 then
19264 cat > conftest.i <<EOF
19265 #ifndef GCC_PRINTF
19266 #define GCC_PRINTF 0
19267 #endif
19268 #ifndef GCC_SCANF
19269 #define GCC_SCANF 0
19270 #endif
19271 #ifndef GCC_NORETURN
19272 #define GCC_NORETURN /* nothing */
19273 #endif
19274 #ifndef GCC_UNUSED
19275 #define GCC_UNUSED /* nothing */
19276 #endif
19277 EOF
19278 if test "$GCC" = yes
19279 then
19280         { echo "$as_me:19280: checking for $CC __attribute__ directives..." >&5
19281 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19282 cat > conftest.$ac_ext <<EOF
19283 #line 19283 "${as_me:-configure}"
19284 #include "confdefs.h"
19285 #include "conftest.h"
19286 #include "conftest.i"
19287 #if     GCC_PRINTF
19288 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19289 #else
19290 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19291 #endif
19292 #if     GCC_SCANF
19293 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19294 #else
19295 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19296 #endif
19297 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19298 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19299 extern void foo(void) GCC_NORETURN;
19300 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19301 EOF
19302         cf_printf_attribute=no
19303         cf_scanf_attribute=no
19304         for cf_attribute in scanf printf unused noreturn
19305         do
19306
19307 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19308
19309                 cf_directive="__attribute__(($cf_attribute))"
19310                 echo "checking for $CC $cf_directive" 1>&5
19311
19312                 case $cf_attribute in
19313                 (printf)
19314                         cf_printf_attribute=yes
19315                         cat >conftest.h <<EOF
19316 #define GCC_$cf_ATTRIBUTE 1
19317 EOF
19318                         ;;
19319                 (scanf)
19320                         cf_scanf_attribute=yes
19321                         cat >conftest.h <<EOF
19322 #define GCC_$cf_ATTRIBUTE 1
19323 EOF
19324                         ;;
19325                 (*)
19326                         cat >conftest.h <<EOF
19327 #define GCC_$cf_ATTRIBUTE $cf_directive
19328 EOF
19329                         ;;
19330                 esac
19331
19332                 if { (eval echo "$as_me:19332: \"$ac_compile\"") >&5
19333   (eval $ac_compile) 2>&5
19334   ac_status=$?
19335   echo "$as_me:19335: \$? = $ac_status" >&5
19336   (exit $ac_status); }; then
19337                         test -n "$verbose" && echo "$as_me:19337: result: ... $cf_attribute" >&5
19338 echo "${ECHO_T}... $cf_attribute" >&6
19339                         cat conftest.h >>confdefs.h
19340                         case $cf_attribute in
19341                         (noreturn)
19342
19343 cat >>confdefs.h <<EOF
19344 #define GCC_NORETURN $cf_directive
19345 EOF
19346
19347                                 ;;
19348                         (printf)
19349                                 cf_value='/* nothing */'
19350                                 if test "$cf_printf_attribute" != no ; then
19351                                         cf_value='__attribute__((format(printf,fmt,var)))'
19352
19353 cat >>confdefs.h <<\EOF
19354 #define GCC_PRINTF 1
19355 EOF
19356
19357                                 fi
19358
19359 cat >>confdefs.h <<EOF
19360 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19361 EOF
19362
19363                                 ;;
19364                         (scanf)
19365                                 cf_value='/* nothing */'
19366                                 if test "$cf_scanf_attribute" != no ; then
19367                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19368
19369 cat >>confdefs.h <<\EOF
19370 #define GCC_SCANF 1
19371 EOF
19372
19373                                 fi
19374
19375 cat >>confdefs.h <<EOF
19376 #define GCC_SCANFLIKE(fmt,var) $cf_value
19377 EOF
19378
19379                                 ;;
19380                         (unused)
19381
19382 cat >>confdefs.h <<EOF
19383 #define GCC_UNUSED $cf_directive
19384 EOF
19385
19386                                 ;;
19387                         esac
19388                 fi
19389         done
19390 else
19391         fgrep define conftest.i >>confdefs.h
19392 fi
19393 rm -rf conftest*
19394 fi
19395
19396 INTEL_COMPILER=no
19397
19398 if test "$GCC" = yes ; then
19399         case $host_os in
19400         (linux*|gnu*)
19401                 echo "$as_me:19401: checking if this is really Intel C compiler" >&5
19402 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19403                 cf_save_CFLAGS="$CFLAGS"
19404                 CFLAGS="$CFLAGS -no-gcc"
19405                 cat >conftest.$ac_ext <<_ACEOF
19406 #line 19406 "configure"
19407 #include "confdefs.h"
19408
19409 int
19410 main (void)
19411 {
19412
19413 #ifdef __INTEL_COMPILER
19414 #else
19415 make an error
19416 #endif
19417
19418   ;
19419   return 0;
19420 }
19421 _ACEOF
19422 rm -f conftest.$ac_objext
19423 if { (eval echo "$as_me:19423: \"$ac_compile\"") >&5
19424   (eval $ac_compile) 2>&5
19425   ac_status=$?
19426   echo "$as_me:19426: \$? = $ac_status" >&5
19427   (exit $ac_status); } &&
19428          { ac_try='test -s conftest.$ac_objext'
19429   { (eval echo "$as_me:19429: \"$ac_try\"") >&5
19430   (eval $ac_try) 2>&5
19431   ac_status=$?
19432   echo "$as_me:19432: \$? = $ac_status" >&5
19433   (exit $ac_status); }; }; then
19434   INTEL_COMPILER=yes
19435 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19436
19437 else
19438   echo "$as_me: failed program was:" >&5
19439 cat conftest.$ac_ext >&5
19440 fi
19441 rm -f conftest.$ac_objext conftest.$ac_ext
19442                 CFLAGS="$cf_save_CFLAGS"
19443                 echo "$as_me:19443: result: $INTEL_COMPILER" >&5
19444 echo "${ECHO_T}$INTEL_COMPILER" >&6
19445                 ;;
19446         esac
19447 fi
19448
19449 CLANG_COMPILER=no
19450
19451 if test "$GCC" = yes ; then
19452         echo "$as_me:19452: checking if this is really Clang C compiler" >&5
19453 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19454         cf_save_CFLAGS="$CFLAGS"
19455         CFLAGS="$CFLAGS -Qunused-arguments"
19456         cat >conftest.$ac_ext <<_ACEOF
19457 #line 19457 "configure"
19458 #include "confdefs.h"
19459
19460 int
19461 main (void)
19462 {
19463
19464 #ifdef __clang__
19465 #else
19466 make an error
19467 #endif
19468
19469   ;
19470   return 0;
19471 }
19472 _ACEOF
19473 rm -f conftest.$ac_objext
19474 if { (eval echo "$as_me:19474: \"$ac_compile\"") >&5
19475   (eval $ac_compile) 2>&5
19476   ac_status=$?
19477   echo "$as_me:19477: \$? = $ac_status" >&5
19478   (exit $ac_status); } &&
19479          { ac_try='test -s conftest.$ac_objext'
19480   { (eval echo "$as_me:19480: \"$ac_try\"") >&5
19481   (eval $ac_try) 2>&5
19482   ac_status=$?
19483   echo "$as_me:19483: \$? = $ac_status" >&5
19484   (exit $ac_status); }; }; then
19485   CLANG_COMPILER=yes
19486 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19487
19488 else
19489   echo "$as_me: failed program was:" >&5
19490 cat conftest.$ac_ext >&5
19491 fi
19492 rm -f conftest.$ac_objext conftest.$ac_ext
19493         CFLAGS="$cf_save_CFLAGS"
19494         echo "$as_me:19494: result: $CLANG_COMPILER" >&5
19495 echo "${ECHO_T}$CLANG_COMPILER" >&6
19496 fi
19497
19498 cat > conftest.$ac_ext <<EOF
19499 #line 19499 "${as_me:-configure}"
19500 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19501 EOF
19502
19503 if test "$INTEL_COMPILER" = yes
19504 then
19505 # The "-wdXXX" options suppress warnings:
19506 # remark #1419: external declaration in primary source file
19507 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19508 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19509 # remark #193: zero used for undefined preprocessing identifier
19510 # remark #593: variable "curs_sb_left_arrow" was set but never used
19511 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19512 # remark #869: parameter "tw" was never referenced
19513 # remark #981: operands are evaluated in unspecified order
19514 # warning #279: controlling expression is constant
19515
19516         { echo "$as_me:19516: checking for $CC warning options..." >&5
19517 echo "$as_me: checking for $CC warning options..." >&6;}
19518         cf_save_CFLAGS="$CFLAGS"
19519         EXTRA_CFLAGS="-Wall"
19520         for cf_opt in \
19521                 wd1419 \
19522                 wd1683 \
19523                 wd1684 \
19524                 wd193 \
19525                 wd593 \
19526                 wd279 \
19527                 wd810 \
19528                 wd869 \
19529                 wd981
19530         do
19531                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19532                 if { (eval echo "$as_me:19532: \"$ac_compile\"") >&5
19533   (eval $ac_compile) 2>&5
19534   ac_status=$?
19535   echo "$as_me:19535: \$? = $ac_status" >&5
19536   (exit $ac_status); }; then
19537                         test -n "$verbose" && echo "$as_me:19537: result: ... -$cf_opt" >&5
19538 echo "${ECHO_T}... -$cf_opt" >&6
19539                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19540                 fi
19541         done
19542         CFLAGS="$cf_save_CFLAGS"
19543
19544 elif test "$GCC" = yes
19545 then
19546         { echo "$as_me:19546: checking for $CC warning options..." >&5
19547 echo "$as_me: checking for $CC warning options..." >&6;}
19548         cf_save_CFLAGS="$CFLAGS"
19549         EXTRA_CFLAGS=
19550         cf_warn_CONST=""
19551         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19552         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19553         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19554         for cf_opt in W Wall \
19555                 Wbad-function-cast \
19556                 Wcast-align \
19557                 Wcast-qual \
19558                 Wdeclaration-after-statement \
19559                 Wextra \
19560                 Winline \
19561                 Wmissing-declarations \
19562                 Wmissing-prototypes \
19563                 Wnested-externs \
19564                 Wpointer-arith \
19565                 Wshadow \
19566                 Wstrict-prototypes \
19567                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19568         do
19569                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19570                 if { (eval echo "$as_me:19570: \"$ac_compile\"") >&5
19571   (eval $ac_compile) 2>&5
19572   ac_status=$?
19573   echo "$as_me:19573: \$? = $ac_status" >&5
19574   (exit $ac_status); }; then
19575                         test -n "$verbose" && echo "$as_me:19575: result: ... -$cf_opt" >&5
19576 echo "${ECHO_T}... -$cf_opt" >&6
19577                         case $cf_opt in
19578                         (Wcast-qual)
19579
19580         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19581         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19582
19583                                 ;;
19584                         (Winline)
19585                                 case $GCC_VERSION in
19586                                 ([34].*)
19587                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19588
19589 echo "${as_me:-configure}:19589: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19590
19591                                         continue;;
19592                                 esac
19593                                 ;;
19594                         (Wpointer-arith)
19595                                 case $GCC_VERSION in
19596                                 ([12].*)
19597                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19598
19599 echo "${as_me:-configure}:19599: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19600
19601                                         continue;;
19602                                 esac
19603                                 ;;
19604                         esac
19605                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19606                 fi
19607         done
19608         CFLAGS="$cf_save_CFLAGS"
19609 fi
19610 rm -rf conftest*
19611
19612 fi
19613 fi
19614
19615 echo "$as_me:19615: checking if you want to use dmalloc for testing" >&5
19616 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19617
19618 # Check whether --with-dmalloc or --without-dmalloc was given.
19619 if test "${with_dmalloc+set}" = set; then
19620   withval="$with_dmalloc"
19621
19622 cat >>confdefs.h <<EOF
19623 #define USE_DMALLOC 1
19624 EOF
19625
19626         : ${with_cflags:=-g}
19627         : ${with_no_leaks:=yes}
19628          with_dmalloc=yes
19629 else
19630   with_dmalloc=
19631 fi;
19632 echo "$as_me:19632: result: ${with_dmalloc:-no}" >&5
19633 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19634
19635 case .$with_cflags in
19636 (.*-g*)
19637         case .$CFLAGS in
19638         (.*-g*)
19639                 ;;
19640         (*)
19641
19642 cf_fix_cppflags=no
19643 cf_new_cflags=
19644 cf_new_cppflags=
19645 cf_new_extra_cppflags=
19646
19647 for cf_add_cflags in -g
19648 do
19649 case $cf_fix_cppflags in
19650 (no)
19651         case $cf_add_cflags in
19652         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19653                 case $cf_add_cflags in
19654                 (-D*)
19655                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19656
19657                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19658                                 && test -z "${cf_tst_cflags}" \
19659                                 && cf_fix_cppflags=yes
19660
19661                         if test $cf_fix_cppflags = yes ; then
19662
19663         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19664         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19665
19666                                 continue
19667                         elif test "${cf_tst_cflags}" = "\"'" ; then
19668
19669         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19670         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19671
19672                                 continue
19673                         fi
19674                         ;;
19675                 esac
19676                 case "$CPPFLAGS" in
19677                 (*$cf_add_cflags)
19678                         ;;
19679                 (*)
19680                         case $cf_add_cflags in
19681                         (-D*)
19682                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19683
19684 CPPFLAGS=`echo "$CPPFLAGS" | \
19685         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19686                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19687
19688                                 ;;
19689                         esac
19690
19691         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19692         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19693
19694                         ;;
19695                 esac
19696                 ;;
19697         (*)
19698
19699         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19700         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19701
19702                 ;;
19703         esac
19704         ;;
19705 (yes)
19706
19707         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19708         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19709
19710         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19711
19712         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19713                 && test -z "${cf_tst_cflags}" \
19714                 && cf_fix_cppflags=no
19715         ;;
19716 esac
19717 done
19718
19719 if test -n "$cf_new_cflags" ; then
19720
19721         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19722         CFLAGS="${CFLAGS}$cf_new_cflags"
19723
19724 fi
19725
19726 if test -n "$cf_new_cppflags" ; then
19727
19728         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19729         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19730
19731 fi
19732
19733 if test -n "$cf_new_extra_cppflags" ; then
19734
19735         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19736         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19737
19738 fi
19739
19740                 ;;
19741         esac
19742         ;;
19743 esac
19744
19745 if test "$with_dmalloc" = yes ; then
19746         echo "$as_me:19746: checking for dmalloc.h" >&5
19747 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19748 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19749   echo $ECHO_N "(cached) $ECHO_C" >&6
19750 else
19751   cat >conftest.$ac_ext <<_ACEOF
19752 #line 19752 "configure"
19753 #include "confdefs.h"
19754 #include <dmalloc.h>
19755 _ACEOF
19756 if { (eval echo "$as_me:19756: \"$ac_cpp conftest.$ac_ext\"") >&5
19757   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19758   ac_status=$?
19759   egrep -v '^ *\+' conftest.er1 >conftest.err
19760   rm -f conftest.er1
19761   cat conftest.err >&5
19762   echo "$as_me:19762: \$? = $ac_status" >&5
19763   (exit $ac_status); } >/dev/null; then
19764   if test -s conftest.err; then
19765     ac_cpp_err=$ac_c_preproc_warn_flag
19766   else
19767     ac_cpp_err=
19768   fi
19769 else
19770   ac_cpp_err=yes
19771 fi
19772 if test -z "$ac_cpp_err"; then
19773   ac_cv_header_dmalloc_h=yes
19774 else
19775   echo "$as_me: failed program was:" >&5
19776   cat conftest.$ac_ext >&5
19777   ac_cv_header_dmalloc_h=no
19778 fi
19779 rm -f conftest.err conftest.$ac_ext
19780 fi
19781 echo "$as_me:19781: result: $ac_cv_header_dmalloc_h" >&5
19782 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19783 if test $ac_cv_header_dmalloc_h = yes; then
19784
19785 echo "$as_me:19785: checking for dmalloc_debug in -ldmalloc" >&5
19786 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19787 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19788   echo $ECHO_N "(cached) $ECHO_C" >&6
19789 else
19790   ac_check_lib_save_LIBS=$LIBS
19791 LIBS="-ldmalloc  $LIBS"
19792 cat >conftest.$ac_ext <<_ACEOF
19793 #line 19793 "configure"
19794 #include "confdefs.h"
19795
19796 /* Override any gcc2 internal prototype to avoid an error.  */
19797 #ifdef __cplusplus
19798 extern "C"
19799 #endif
19800 /* We use char because int might match the return type of a gcc2
19801    builtin and then its argument prototype would still apply.  */
19802 char dmalloc_debug ();
19803 int
19804 main (void)
19805 {
19806 dmalloc_debug ();
19807   ;
19808   return 0;
19809 }
19810 _ACEOF
19811 rm -f conftest.$ac_objext conftest$ac_exeext
19812 if { (eval echo "$as_me:19812: \"$ac_link\"") >&5
19813   (eval $ac_link) 2>&5
19814   ac_status=$?
19815   echo "$as_me:19815: \$? = $ac_status" >&5
19816   (exit $ac_status); } &&
19817          { ac_try='test -s conftest$ac_exeext'
19818   { (eval echo "$as_me:19818: \"$ac_try\"") >&5
19819   (eval $ac_try) 2>&5
19820   ac_status=$?
19821   echo "$as_me:19821: \$? = $ac_status" >&5
19822   (exit $ac_status); }; }; then
19823   ac_cv_lib_dmalloc_dmalloc_debug=yes
19824 else
19825   echo "$as_me: failed program was:" >&5
19826 cat conftest.$ac_ext >&5
19827 ac_cv_lib_dmalloc_dmalloc_debug=no
19828 fi
19829 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19830 LIBS=$ac_check_lib_save_LIBS
19831 fi
19832 echo "$as_me:19832: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19833 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19834 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19835   cat >>confdefs.h <<EOF
19836 #define HAVE_LIBDMALLOC 1
19837 EOF
19838
19839   LIBS="-ldmalloc $LIBS"
19840
19841 fi
19842
19843 fi
19844
19845 fi
19846
19847 echo "$as_me:19847: checking if you want to use dbmalloc for testing" >&5
19848 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19849
19850 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19851 if test "${with_dbmalloc+set}" = set; then
19852   withval="$with_dbmalloc"
19853
19854 cat >>confdefs.h <<EOF
19855 #define USE_DBMALLOC 1
19856 EOF
19857
19858         : ${with_cflags:=-g}
19859         : ${with_no_leaks:=yes}
19860          with_dbmalloc=yes
19861 else
19862   with_dbmalloc=
19863 fi;
19864 echo "$as_me:19864: result: ${with_dbmalloc:-no}" >&5
19865 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
19866
19867 case .$with_cflags in
19868 (.*-g*)
19869         case .$CFLAGS in
19870         (.*-g*)
19871                 ;;
19872         (*)
19873
19874 cf_fix_cppflags=no
19875 cf_new_cflags=
19876 cf_new_cppflags=
19877 cf_new_extra_cppflags=
19878
19879 for cf_add_cflags in -g
19880 do
19881 case $cf_fix_cppflags in
19882 (no)
19883         case $cf_add_cflags in
19884         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19885                 case $cf_add_cflags in
19886                 (-D*)
19887                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19888
19889                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19890                                 && test -z "${cf_tst_cflags}" \
19891                                 && cf_fix_cppflags=yes
19892
19893                         if test $cf_fix_cppflags = yes ; then
19894
19895         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19896         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19897
19898                                 continue
19899                         elif test "${cf_tst_cflags}" = "\"'" ; then
19900
19901         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19902         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19903
19904                                 continue
19905                         fi
19906                         ;;
19907                 esac
19908                 case "$CPPFLAGS" in
19909                 (*$cf_add_cflags)
19910                         ;;
19911                 (*)
19912                         case $cf_add_cflags in
19913                         (-D*)
19914                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19915
19916 CPPFLAGS=`echo "$CPPFLAGS" | \
19917         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19918                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19919
19920                                 ;;
19921                         esac
19922
19923         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19924         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19925
19926                         ;;
19927                 esac
19928                 ;;
19929         (*)
19930
19931         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19932         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19933
19934                 ;;
19935         esac
19936         ;;
19937 (yes)
19938
19939         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19940         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19941
19942         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19943
19944         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19945                 && test -z "${cf_tst_cflags}" \
19946                 && cf_fix_cppflags=no
19947         ;;
19948 esac
19949 done
19950
19951 if test -n "$cf_new_cflags" ; then
19952
19953         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19954         CFLAGS="${CFLAGS}$cf_new_cflags"
19955
19956 fi
19957
19958 if test -n "$cf_new_cppflags" ; then
19959
19960         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19961         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19962
19963 fi
19964
19965 if test -n "$cf_new_extra_cppflags" ; then
19966
19967         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19968         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19969
19970 fi
19971
19972                 ;;
19973         esac
19974         ;;
19975 esac
19976
19977 if test "$with_dbmalloc" = yes ; then
19978         echo "$as_me:19978: checking for dbmalloc.h" >&5
19979 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
19980 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
19981   echo $ECHO_N "(cached) $ECHO_C" >&6
19982 else
19983   cat >conftest.$ac_ext <<_ACEOF
19984 #line 19984 "configure"
19985 #include "confdefs.h"
19986 #include <dbmalloc.h>
19987 _ACEOF
19988 if { (eval echo "$as_me:19988: \"$ac_cpp conftest.$ac_ext\"") >&5
19989   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19990   ac_status=$?
19991   egrep -v '^ *\+' conftest.er1 >conftest.err
19992   rm -f conftest.er1
19993   cat conftest.err >&5
19994   echo "$as_me:19994: \$? = $ac_status" >&5
19995   (exit $ac_status); } >/dev/null; then
19996   if test -s conftest.err; then
19997     ac_cpp_err=$ac_c_preproc_warn_flag
19998   else
19999     ac_cpp_err=
20000   fi
20001 else
20002   ac_cpp_err=yes
20003 fi
20004 if test -z "$ac_cpp_err"; then
20005   ac_cv_header_dbmalloc_h=yes
20006 else
20007   echo "$as_me: failed program was:" >&5
20008   cat conftest.$ac_ext >&5
20009   ac_cv_header_dbmalloc_h=no
20010 fi
20011 rm -f conftest.err conftest.$ac_ext
20012 fi
20013 echo "$as_me:20013: result: $ac_cv_header_dbmalloc_h" >&5
20014 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
20015 if test $ac_cv_header_dbmalloc_h = yes; then
20016
20017 echo "$as_me:20017: checking for debug_malloc in -ldbmalloc" >&5
20018 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
20019 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
20020   echo $ECHO_N "(cached) $ECHO_C" >&6
20021 else
20022   ac_check_lib_save_LIBS=$LIBS
20023 LIBS="-ldbmalloc  $LIBS"
20024 cat >conftest.$ac_ext <<_ACEOF
20025 #line 20025 "configure"
20026 #include "confdefs.h"
20027
20028 /* Override any gcc2 internal prototype to avoid an error.  */
20029 #ifdef __cplusplus
20030 extern "C"
20031 #endif
20032 /* We use char because int might match the return type of a gcc2
20033    builtin and then its argument prototype would still apply.  */
20034 char debug_malloc ();
20035 int
20036 main (void)
20037 {
20038 debug_malloc ();
20039   ;
20040   return 0;
20041 }
20042 _ACEOF
20043 rm -f conftest.$ac_objext conftest$ac_exeext
20044 if { (eval echo "$as_me:20044: \"$ac_link\"") >&5
20045   (eval $ac_link) 2>&5
20046   ac_status=$?
20047   echo "$as_me:20047: \$? = $ac_status" >&5
20048   (exit $ac_status); } &&
20049          { ac_try='test -s conftest$ac_exeext'
20050   { (eval echo "$as_me:20050: \"$ac_try\"") >&5
20051   (eval $ac_try) 2>&5
20052   ac_status=$?
20053   echo "$as_me:20053: \$? = $ac_status" >&5
20054   (exit $ac_status); }; }; then
20055   ac_cv_lib_dbmalloc_debug_malloc=yes
20056 else
20057   echo "$as_me: failed program was:" >&5
20058 cat conftest.$ac_ext >&5
20059 ac_cv_lib_dbmalloc_debug_malloc=no
20060 fi
20061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20062 LIBS=$ac_check_lib_save_LIBS
20063 fi
20064 echo "$as_me:20064: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
20065 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
20066 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
20067   cat >>confdefs.h <<EOF
20068 #define HAVE_LIBDBMALLOC 1
20069 EOF
20070
20071   LIBS="-ldbmalloc $LIBS"
20072
20073 fi
20074
20075 fi
20076
20077 fi
20078
20079 echo "$as_me:20079: checking if you want to use valgrind for testing" >&5
20080 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
20081
20082 # Check whether --with-valgrind or --without-valgrind was given.
20083 if test "${with_valgrind+set}" = set; then
20084   withval="$with_valgrind"
20085
20086 cat >>confdefs.h <<EOF
20087 #define USE_VALGRIND 1
20088 EOF
20089
20090         : ${with_cflags:=-g}
20091         : ${with_no_leaks:=yes}
20092          with_valgrind=yes
20093 else
20094   with_valgrind=
20095 fi;
20096 echo "$as_me:20096: result: ${with_valgrind:-no}" >&5
20097 echo "${ECHO_T}${with_valgrind:-no}" >&6
20098
20099 case .$with_cflags in
20100 (.*-g*)
20101         case .$CFLAGS in
20102         (.*-g*)
20103                 ;;
20104         (*)
20105
20106 cf_fix_cppflags=no
20107 cf_new_cflags=
20108 cf_new_cppflags=
20109 cf_new_extra_cppflags=
20110
20111 for cf_add_cflags in -g
20112 do
20113 case $cf_fix_cppflags in
20114 (no)
20115         case $cf_add_cflags in
20116         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
20117                 case $cf_add_cflags in
20118                 (-D*)
20119                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
20120
20121                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20122                                 && test -z "${cf_tst_cflags}" \
20123                                 && cf_fix_cppflags=yes
20124
20125                         if test $cf_fix_cppflags = yes ; then
20126
20127         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20128         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20129
20130                                 continue
20131                         elif test "${cf_tst_cflags}" = "\"'" ; then
20132
20133         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20134         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20135
20136                                 continue
20137                         fi
20138                         ;;
20139                 esac
20140                 case "$CPPFLAGS" in
20141                 (*$cf_add_cflags)
20142                         ;;
20143                 (*)
20144                         case $cf_add_cflags in
20145                         (-D*)
20146                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
20147
20148 CPPFLAGS=`echo "$CPPFLAGS" | \
20149         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
20150                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
20151
20152                                 ;;
20153                         esac
20154
20155         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
20156         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
20157
20158                         ;;
20159                 esac
20160                 ;;
20161         (*)
20162
20163         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
20164         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20165
20166                 ;;
20167         esac
20168         ;;
20169 (yes)
20170
20171         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20172         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20173
20174         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20175
20176         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20177                 && test -z "${cf_tst_cflags}" \
20178                 && cf_fix_cppflags=no
20179         ;;
20180 esac
20181 done
20182
20183 if test -n "$cf_new_cflags" ; then
20184
20185         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20186         CFLAGS="${CFLAGS}$cf_new_cflags"
20187
20188 fi
20189
20190 if test -n "$cf_new_cppflags" ; then
20191
20192         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20193         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20194
20195 fi
20196
20197 if test -n "$cf_new_extra_cppflags" ; then
20198
20199         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20200         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20201
20202 fi
20203
20204                 ;;
20205         esac
20206         ;;
20207 esac
20208
20209 echo "$as_me:20209: checking if you want to perform memory-leak testing" >&5
20210 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20211
20212 # Check whether --enable-leaks or --disable-leaks was given.
20213 if test "${enable_leaks+set}" = set; then
20214   enableval="$enable_leaks"
20215   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20216 else
20217   : ${with_no_leaks:=no}
20218 fi;
20219 echo "$as_me:20219: result: $with_no_leaks" >&5
20220 echo "${ECHO_T}$with_no_leaks" >&6
20221
20222 if test "$with_no_leaks" = yes ; then
20223
20224 cat >>confdefs.h <<\EOF
20225 #define NO_LEAKS 1
20226 EOF
20227
20228 cat >>confdefs.h <<\EOF
20229 #define YY_NO_LEAKS 1
20230 EOF
20231
20232 fi
20233
20234 LD_RPATH_OPT=
20235 if test "x$cf_cv_enable_rpath" != xno
20236 then
20237         echo "$as_me:20237: checking for an rpath option" >&5
20238 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20239         case $cf_cv_system_name in
20240         (irix*)
20241                 if test "$GCC" = yes; then
20242                         LD_RPATH_OPT="-Wl,-rpath,"
20243                 else
20244                         LD_RPATH_OPT="-rpath "
20245                 fi
20246                 ;;
20247         (linux*|gnu*|k*bsd*-gnu|freebsd*)
20248                 LD_RPATH_OPT="-Wl,-rpath,"
20249                 ;;
20250         (openbsd[2-9].*|mirbsd*)
20251                 LD_RPATH_OPT="-Wl,-rpath,"
20252                 ;;
20253         (dragonfly*)
20254                 LD_RPATH_OPT="-rpath "
20255                 ;;
20256         (netbsd*)
20257                 LD_RPATH_OPT="-Wl,-rpath,"
20258                 ;;
20259         (osf*|mls+*)
20260                 LD_RPATH_OPT="-rpath "
20261                 ;;
20262         (solaris2*)
20263                 LD_RPATH_OPT="-R"
20264                 ;;
20265         (*)
20266                 ;;
20267         esac
20268         echo "$as_me:20268: result: $LD_RPATH_OPT" >&5
20269 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20270
20271         case "x$LD_RPATH_OPT" in
20272         (x-R*)
20273                 echo "$as_me:20273: checking if we need a space after rpath option" >&5
20274 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20275                 cf_save_LIBS="$LIBS"
20276
20277 cf_add_libs="${LD_RPATH_OPT}$libdir"
20278 # Filter out duplicates - this happens with badly-designed ".pc" files...
20279 for cf_add_1lib in $LIBS
20280 do
20281         for cf_add_2lib in $cf_add_libs
20282         do
20283                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20284                 then
20285                         cf_add_1lib=
20286                         break
20287                 fi
20288         done
20289         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20290 done
20291 LIBS="$cf_add_libs"
20292
20293                 cat >conftest.$ac_ext <<_ACEOF
20294 #line 20294 "configure"
20295 #include "confdefs.h"
20296
20297 int
20298 main (void)
20299 {
20300
20301   ;
20302   return 0;
20303 }
20304 _ACEOF
20305 rm -f conftest.$ac_objext conftest$ac_exeext
20306 if { (eval echo "$as_me:20306: \"$ac_link\"") >&5
20307   (eval $ac_link) 2>&5
20308   ac_status=$?
20309   echo "$as_me:20309: \$? = $ac_status" >&5
20310   (exit $ac_status); } &&
20311          { ac_try='test -s conftest$ac_exeext'
20312   { (eval echo "$as_me:20312: \"$ac_try\"") >&5
20313   (eval $ac_try) 2>&5
20314   ac_status=$?
20315   echo "$as_me:20315: \$? = $ac_status" >&5
20316   (exit $ac_status); }; }; then
20317   cf_rpath_space=no
20318 else
20319   echo "$as_me: failed program was:" >&5
20320 cat conftest.$ac_ext >&5
20321 cf_rpath_space=yes
20322 fi
20323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20324                 LIBS="$cf_save_LIBS"
20325                 echo "$as_me:20325: result: $cf_rpath_space" >&5
20326 echo "${ECHO_T}$cf_rpath_space" >&6
20327                 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20328                 ;;
20329         esac
20330 fi
20331
20332 echo "$as_me:20332: checking if rpath-hack should be disabled" >&5
20333 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20334
20335 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20336 if test "${enable_rpath_hack+set}" = set; then
20337   enableval="$enable_rpath_hack"
20338   test "$enableval" != no && enableval=yes
20339         if test "$enableval" != "yes" ; then
20340     cf_disable_rpath_hack=yes
20341         else
20342                 cf_disable_rpath_hack=no
20343         fi
20344 else
20345   enableval=yes
20346         cf_disable_rpath_hack=no
20347
20348 fi;
20349 echo "$as_me:20349: result: $cf_disable_rpath_hack" >&5
20350 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20351 if test "$cf_disable_rpath_hack" = no ; then
20352
20353 echo "$as_me:20353: checking for updated LDFLAGS" >&5
20354 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20355 if test -n "$LD_RPATH_OPT" ; then
20356         echo "$as_me:20356: result: maybe" >&5
20357 echo "${ECHO_T}maybe" >&6
20358
20359         for ac_prog in ldd
20360 do
20361   # Extract the first word of "$ac_prog", so it can be a program name with args.
20362 set dummy $ac_prog; ac_word=$2
20363 echo "$as_me:20363: checking for $ac_word" >&5
20364 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20365 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20366   echo $ECHO_N "(cached) $ECHO_C" >&6
20367 else
20368   if test -n "$cf_ldd_prog"; then
20369   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20370 else
20371   ac_save_IFS=$IFS; IFS=$ac_path_separator
20372 ac_dummy="$PATH"
20373 for ac_dir in $ac_dummy; do
20374   IFS=$ac_save_IFS
20375   test -z "$ac_dir" && ac_dir=.
20376   $as_executable_p "$ac_dir/$ac_word" || continue
20377 ac_cv_prog_cf_ldd_prog="$ac_prog"
20378 echo "$as_me:20378: found $ac_dir/$ac_word" >&5
20379 break
20380 done
20381
20382 fi
20383 fi
20384 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20385 if test -n "$cf_ldd_prog"; then
20386   echo "$as_me:20386: result: $cf_ldd_prog" >&5
20387 echo "${ECHO_T}$cf_ldd_prog" >&6
20388 else
20389   echo "$as_me:20389: result: no" >&5
20390 echo "${ECHO_T}no" >&6
20391 fi
20392
20393   test -n "$cf_ldd_prog" && break
20394 done
20395 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20396
20397         cf_rpath_list="/usr/lib /lib"
20398         if test "$cf_ldd_prog" != no
20399         then
20400                 cf_rpath_oops=
20401
20402 cat >conftest.$ac_ext <<_ACEOF
20403 #line 20403 "configure"
20404 #include "confdefs.h"
20405 #include <stdio.h>
20406 int
20407 main (void)
20408 {
20409 printf("Hello");
20410   ;
20411   return 0;
20412 }
20413 _ACEOF
20414 rm -f conftest.$ac_objext conftest$ac_exeext
20415 if { (eval echo "$as_me:20415: \"$ac_link\"") >&5
20416   (eval $ac_link) 2>&5
20417   ac_status=$?
20418   echo "$as_me:20418: \$? = $ac_status" >&5
20419   (exit $ac_status); } &&
20420          { ac_try='test -s conftest$ac_exeext'
20421   { (eval echo "$as_me:20421: \"$ac_try\"") >&5
20422   (eval $ac_try) 2>&5
20423   ac_status=$?
20424   echo "$as_me:20424: \$? = $ac_status" >&5
20425   (exit $ac_status); }; }; then
20426   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20427                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20428 else
20429   echo "$as_me: failed program was:" >&5
20430 cat conftest.$ac_ext >&5
20431 fi
20432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20433
20434                 # If we passed the link-test, but get a "not found" on a given library,
20435                 # this could be due to inept reconfiguration of gcc to make it only
20436                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20437                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20438                 # /usr/local libraries.
20439                 if test -n "$cf_rpath_oops"
20440                 then
20441                         for cf_rpath_src in $cf_rpath_oops
20442                         do
20443                                 for cf_rpath_dir in \
20444                                         /usr/local \
20445                                         /usr/pkg \
20446                                         /opt/sfw
20447                                 do
20448                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20449                                         then
20450                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20451
20452 echo "${as_me:-configure}:20452: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20453
20454                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20455                                                 break
20456                                         fi
20457                                 done
20458                         done
20459                 fi
20460         fi
20461
20462         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20463
20464 echo "${as_me:-configure}:20464: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20465
20466 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20467
20468 echo "${as_me:-configure}:20468: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20469
20470 cf_rpath_dst=
20471 for cf_rpath_src in $LDFLAGS
20472 do
20473         case $cf_rpath_src in
20474         (-L*)
20475
20476                 # check if this refers to a directory which we will ignore
20477                 cf_rpath_skip=no
20478                 if test -n "$cf_rpath_list"
20479                 then
20480                         for cf_rpath_item in $cf_rpath_list
20481                         do
20482                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20483                                 then
20484                                         cf_rpath_skip=yes
20485                                         break
20486                                 fi
20487                         done
20488                 fi
20489
20490                 if test "$cf_rpath_skip" = no
20491                 then
20492                         # transform the option
20493                         if test "$LD_RPATH_OPT" = "-R " ; then
20494                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20495                         else
20496                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20497                         fi
20498
20499                         # if we have not already added this, add it now
20500                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20501                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20502                         then
20503                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20504
20505 echo "${as_me:-configure}:20505: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20506
20507                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20508                         fi
20509                 fi
20510                 ;;
20511         esac
20512         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20513 done
20514 LDFLAGS=$cf_rpath_dst
20515
20516 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20517
20518 echo "${as_me:-configure}:20518: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20519
20520 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20521
20522 echo "${as_me:-configure}:20522: testing ...checking LIBS $LIBS ..." 1>&5
20523
20524 cf_rpath_dst=
20525 for cf_rpath_src in $LIBS
20526 do
20527         case $cf_rpath_src in
20528         (-L*)
20529
20530                 # check if this refers to a directory which we will ignore
20531                 cf_rpath_skip=no
20532                 if test -n "$cf_rpath_list"
20533                 then
20534                         for cf_rpath_item in $cf_rpath_list
20535                         do
20536                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20537                                 then
20538                                         cf_rpath_skip=yes
20539                                         break
20540                                 fi
20541                         done
20542                 fi
20543
20544                 if test "$cf_rpath_skip" = no
20545                 then
20546                         # transform the option
20547                         if test "$LD_RPATH_OPT" = "-R " ; then
20548                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20549                         else
20550                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20551                         fi
20552
20553                         # if we have not already added this, add it now
20554                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20555                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20556                         then
20557                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20558
20559 echo "${as_me:-configure}:20559: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20560
20561                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20562                         fi
20563                 fi
20564                 ;;
20565         esac
20566         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20567 done
20568 LIBS=$cf_rpath_dst
20569
20570 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20571
20572 echo "${as_me:-configure}:20572: testing ...checked LIBS $LIBS ..." 1>&5
20573
20574         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20575
20576 echo "${as_me:-configure}:20576: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20577
20578 else
20579         echo "$as_me:20579: result: no" >&5
20580 echo "${ECHO_T}no" >&6
20581 fi
20582
20583 fi
20584
20585 TEST_ARGS="$LIBS"
20586 LIBS=
20587
20588 ac_config_files="$ac_config_files Makefile"
20589 ac_config_commands="$ac_config_commands default"
20590 cat >confcache <<\_ACEOF
20591 # This file is a shell script that caches the results of configure
20592 # tests run on this system so they can be shared between configure
20593 # scripts and configure runs, see configure's option --config-cache.
20594 # It is not useful on other systems.  If it contains results you don't
20595 # want to keep, you may remove or edit it.
20596 #
20597 # config.status only pays attention to the cache file if you give it
20598 # the --recheck option to rerun configure.
20599 #
20600 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20601 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20602 # following values.
20603
20604 _ACEOF
20605
20606 # The following way of writing the cache mishandles newlines in values,
20607 # but we know of no workaround that is simple, portable, and efficient.
20608 # So, don't put newlines in cache variables' values.
20609 # Ultrix sh set writes to stderr and can't be redirected directly,
20610 # and sets the high bit in the cache file unless we assign to the vars.
20611 {
20612   (set) 2>&1 |
20613     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20614     *ac_space=\ *)
20615       # `set' does not quote correctly, so add quotes (double-quote
20616       # substitution turns \\\\ into \\, and sed turns \\ into \).
20617       sed -n \
20618         "s/'/'\\\\''/g;
20619           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20620       ;;
20621     *)
20622       # `set' quotes correctly as required by POSIX, so do not add quotes.
20623       sed -n \
20624         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20625       ;;
20626     esac;
20627 } |
20628   sed '
20629      t clear
20630      : clear
20631      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20632      t end
20633      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20634      : end' >>confcache
20635 if cmp -s $cache_file confcache; then :; else
20636   if test -w $cache_file; then
20637     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20638     cat confcache >$cache_file
20639   else
20640     echo "not updating unwritable cache $cache_file"
20641   fi
20642 fi
20643 rm -f confcache
20644
20645 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20646 # Let make expand exec_prefix.
20647 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20648
20649 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20650 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20651 # trailing colons and then remove the whole line if VPATH becomes empty
20652 # (actually we leave an empty line to preserve line numbers).
20653 if test "x$srcdir" = x.; then
20654   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20655 s/:*\$(srcdir):*/:/;
20656 s/:*\${srcdir}:*/:/;
20657 s/:*@srcdir@:*/:/;
20658 s/^\([^=]*=[    ]*\):*/\1/;
20659 s/:*$//;
20660 s/^[^=]*=[      ]*$//;
20661 }'
20662 fi
20663
20664 DEFS=-DHAVE_CONFIG_H
20665
20666 : ${CONFIG_STATUS=./config.status}
20667 ac_clean_files_save=$ac_clean_files
20668 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20669 { echo "$as_me:20669: creating $CONFIG_STATUS" >&5
20670 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20671 cat >$CONFIG_STATUS <<_ACEOF
20672 #! $SHELL
20673 # Generated automatically by configure.
20674 # Run this file to recreate the current configuration.
20675 # Compiler output produced by configure, useful for debugging
20676 # configure, is in config.log if it exists.
20677
20678 debug=false
20679 SHELL=\${CONFIG_SHELL-$SHELL}
20680 ac_cs_invocation="\$0 \$@"
20681
20682 _ACEOF
20683
20684 cat >>$CONFIG_STATUS <<\_ACEOF
20685 # Be Bourne compatible
20686 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20687   emulate sh
20688   NULLCMD=:
20689 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20690   set -o posix
20691 fi
20692
20693 # Name of the executable.
20694 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20695
20696 if expr a : '\(a\)' >/dev/null 2>&1; then
20697   as_expr=expr
20698 else
20699   as_expr=false
20700 fi
20701
20702 rm -f conf$$ conf$$.exe conf$$.file
20703 echo >conf$$.file
20704 if ln -s conf$$.file conf$$ 2>/dev/null; then
20705   # We could just check for DJGPP; but this test a) works b) is more generic
20706   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20707   if test -f conf$$.exe; then
20708     # Don't use ln at all; we don't have any links
20709     as_ln_s='cp -p'
20710   else
20711     as_ln_s='ln -s'
20712   fi
20713 elif ln conf$$.file conf$$ 2>/dev/null; then
20714   as_ln_s=ln
20715 else
20716   as_ln_s='cp -p'
20717 fi
20718 rm -f conf$$ conf$$.exe conf$$.file
20719
20720 as_executable_p="test -f"
20721
20722 # Support unset when possible.
20723 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20724   as_unset=unset
20725 else
20726   as_unset=false
20727 fi
20728
20729 # NLS nuisances.
20730 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20731 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20732 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20733 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20734 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20735 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20736 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20737 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20738
20739 # IFS
20740 # We need space, tab and new line, in precisely that order.
20741 as_nl='
20742 '
20743 IFS="   $as_nl"
20744
20745 # CDPATH.
20746 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20747
20748 exec 6>&1
20749
20750 _ACEOF
20751
20752 # Files that config.status was made for.
20753 if test -n "$ac_config_files"; then
20754   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20755 fi
20756
20757 if test -n "$ac_config_headers"; then
20758   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20759 fi
20760
20761 if test -n "$ac_config_links"; then
20762   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20763 fi
20764
20765 if test -n "$ac_config_commands"; then
20766   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20767 fi
20768
20769 cat >>$CONFIG_STATUS <<\EOF
20770
20771 ac_cs_usage="\
20772 \`$as_me' instantiates files from templates according to the
20773 current configuration.
20774
20775 Usage: $0 [OPTIONS] [FILE]...
20776
20777   -h, --help       print this help, then exit
20778   -V, --version    print version number, then exit
20779   -d, --debug      don't remove temporary files
20780       --recheck    update $as_me by reconfiguring in the same conditions
20781   --file=FILE[:TEMPLATE]
20782                    instantiate the configuration file FILE
20783   --header=FILE[:TEMPLATE]
20784                    instantiate the configuration header FILE
20785
20786 Configuration files:
20787 $config_files
20788
20789 Configuration headers:
20790 $config_headers
20791
20792 Configuration commands:
20793 $config_commands
20794
20795 Report bugs to <dickey@invisible-island.net>."
20796 EOF
20797
20798 cat >>$CONFIG_STATUS <<EOF
20799 ac_cs_version="\\
20800 config.status
20801 configured by $0, generated by GNU Autoconf 2.52.20180819,
20802   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20803
20804 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20805 Free Software Foundation, Inc.
20806 This config.status script is free software; the Free Software Foundation
20807 gives unlimited permission to copy, distribute and modify it."
20808 srcdir=$srcdir
20809 INSTALL="$INSTALL"
20810 EOF
20811
20812 cat >>$CONFIG_STATUS <<\EOF
20813 # If no file are specified by the user, then we need to provide default
20814 # value.  By we need to know if files were specified by the user.
20815 ac_need_defaults=:
20816 while test $# != 0
20817 do
20818   case $1 in
20819   --*=*)
20820     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20821     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20822     shift
20823     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20824     shift
20825     ;;
20826   -*);;
20827   *) # This is not an option, so the user has probably given explicit
20828      # arguments.
20829      ac_need_defaults=false;;
20830   esac
20831
20832   case $1 in
20833   # Handling of the options.
20834 EOF
20835 cat >>$CONFIG_STATUS <<EOF
20836   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20837     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20838     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20839 EOF
20840 cat >>$CONFIG_STATUS <<\EOF
20841   --version | --vers* | -V )
20842     echo "$ac_cs_version"; exit 0 ;;
20843   --he | --h)
20844     # Conflict between --help and --header
20845     { { echo "$as_me:20845: error: ambiguous option: $1
20846 Try \`$0 --help' for more information." >&5
20847 echo "$as_me: error: ambiguous option: $1
20848 Try \`$0 --help' for more information." >&2;}
20849    { (exit 1); exit 1; }; };;
20850   --help | --hel | -h )
20851     echo "$ac_cs_usage"; exit 0 ;;
20852   --debug | --d* | -d )
20853     debug=: ;;
20854   --file | --fil | --fi | --f )
20855     shift
20856     CONFIG_FILES="$CONFIG_FILES $1"
20857     ac_need_defaults=false;;
20858   --header | --heade | --head | --hea )
20859     shift
20860     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20861     ac_need_defaults=false;;
20862
20863   # This is an error.
20864   -*) { { echo "$as_me:20864: error: unrecognized option: $1
20865 Try \`$0 --help' for more information." >&5
20866 echo "$as_me: error: unrecognized option: $1
20867 Try \`$0 --help' for more information." >&2;}
20868    { (exit 1); exit 1; }; } ;;
20869
20870   *) ac_config_targets="$ac_config_targets $1" ;;
20871
20872   esac
20873   shift
20874 done
20875
20876 exec 5>>config.log
20877 cat >&5 << _ACEOF
20878
20879 ## ----------------------- ##
20880 ## Running config.status.  ##
20881 ## ----------------------- ##
20882
20883 This file was extended by $as_me 2.52.20180819, executed with
20884   CONFIG_FILES    = $CONFIG_FILES
20885   CONFIG_HEADERS  = $CONFIG_HEADERS
20886   CONFIG_LINKS    = $CONFIG_LINKS
20887   CONFIG_COMMANDS = $CONFIG_COMMANDS
20888   > $ac_cs_invocation
20889 on `(hostname || uname -n) 2>/dev/null | sed 1q`
20890
20891 _ACEOF
20892 EOF
20893
20894 cat >>$CONFIG_STATUS <<EOF
20895 #
20896 # INIT-COMMANDS section.
20897 #
20898
20899 AWK="$AWK"
20900 ECHO_CC="$ECHO_CC"
20901 ECHO_LD="$ECHO_LD"
20902 SHOW_CC="$SHOW_LD"
20903
20904 EOF
20905
20906 cat >>$CONFIG_STATUS <<\EOF
20907 for ac_config_target in $ac_config_targets
20908 do
20909   case "$ac_config_target" in
20910   # Handling of arguments.
20911   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20912   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
20913   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
20914   *) { { echo "$as_me:20914: error: invalid argument: $ac_config_target" >&5
20915 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
20916    { (exit 1); exit 1; }; };;
20917   esac
20918 done
20919
20920 # If the user did not use the arguments to specify the items to instantiate,
20921 # then the envvar interface is used.  Set only those that are not.
20922 # We use the long form for the default assignment because of an extremely
20923 # bizarre bug on SunOS 4.1.3.
20924 if $ac_need_defaults; then
20925   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20926   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20927   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20928 fi
20929
20930 # Create a temporary directory, and hook for its removal unless debugging.
20931 $debug ||
20932 {
20933   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
20934   trap '{ (exit 1); exit 1; }' 1 2 13 15
20935 }
20936
20937 # Create a (secure) tmp directory for tmp files.
20938 : ${TMPDIR=/tmp}
20939 {
20940   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
20941   test -n "$tmp" && test -d "$tmp"
20942 }  ||
20943 {
20944   tmp=$TMPDIR/cs$$-$RANDOM
20945   (umask 077 && mkdir $tmp)
20946 } ||
20947 {
20948    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
20949    { (exit 1); exit 1; }
20950 }
20951
20952 EOF
20953
20954 cat >>$CONFIG_STATUS <<EOF
20955
20956 #
20957 # CONFIG_FILES section.
20958 #
20959
20960 # No need to generate the scripts if there are no CONFIG_FILES.
20961 # This happens for instance when ./config.status config.h
20962 if test -n "\$CONFIG_FILES"; then
20963   # Protect against being on the right side of a sed subst in config.status.
20964   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20965    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20966 s,@SHELL@,$SHELL,;t t
20967 s,@exec_prefix@,$exec_prefix,;t t
20968 s,@prefix@,$prefix,;t t
20969 s,@program_transform_name@,$program_transform_name,;t t
20970 s,@bindir@,$bindir,;t t
20971 s,@sbindir@,$sbindir,;t t
20972 s,@libexecdir@,$libexecdir,;t t
20973 s,@datarootdir@,$datarootdir,;t t
20974 s,@datadir@,$datadir,;t t
20975 s,@sysconfdir@,$sysconfdir,;t t
20976 s,@sharedstatedir@,$sharedstatedir,;t t
20977 s,@localstatedir@,$localstatedir,;t t
20978 s,@runstatedir@,$runstatedir,;t t
20979 s,@libdir@,$libdir,;t t
20980 s,@includedir@,$includedir,;t t
20981 s,@oldincludedir@,$oldincludedir,;t t
20982 s,@infodir@,$infodir,;t t
20983 s,@mandir@,$mandir,;t t
20984 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20985 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20986 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20987 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20988 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20989 s,@build_alias@,$build_alias,;t t
20990 s,@host_alias@,$host_alias,;t t
20991 s,@target_alias@,$target_alias,;t t
20992 s,@ECHO_C@,$ECHO_C,;t t
20993 s,@ECHO_N@,$ECHO_N,;t t
20994 s,@ECHO_T@,$ECHO_T,;t t
20995 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
20996 s,@DEFS@,$DEFS,;t t
20997 s,@LIBS@,$LIBS,;t t
20998 s,@build@,$build,;t t
20999 s,@build_cpu@,$build_cpu,;t t
21000 s,@build_vendor@,$build_vendor,;t t
21001 s,@build_os@,$build_os,;t t
21002 s,@host@,$host,;t t
21003 s,@host_cpu@,$host_cpu,;t t
21004 s,@host_vendor@,$host_vendor,;t t
21005 s,@host_os@,$host_os,;t t
21006 s,@SET_MAKE@,$SET_MAKE,;t t
21007 s,@CC@,$CC,;t t
21008 s,@CFLAGS@,$CFLAGS,;t t
21009 s,@LDFLAGS@,$LDFLAGS,;t t
21010 s,@CPPFLAGS@,$CPPFLAGS,;t t
21011 s,@ac_ct_CC@,$ac_ct_CC,;t t
21012 s,@EXEEXT@,$EXEEXT,;t t
21013 s,@OBJEXT@,$OBJEXT,;t t
21014 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
21015 s,@CPP@,$CPP,;t t
21016 s,@AWK@,$AWK,;t t
21017 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
21018 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
21019 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
21020 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
21021 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
21022 s,@LINT@,$LINT,;t t
21023 s,@LINT_OPTS@,$LINT_OPTS,;t t
21024 s,@CTAGS@,$CTAGS,;t t
21025 s,@ETAGS@,$ETAGS,;t t
21026 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
21027 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
21028 s,@MATH_LIB@,$MATH_LIB,;t t
21029 s,@top_builddir@,$top_builddir,;t t
21030 s,@CC_G_OPT@,$CC_G_OPT,;t t
21031 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
21032 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
21033 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
21034 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
21035 s,@LD@,$LD,;t t
21036 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
21037 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
21038 s,@LD_MODEL@,$LD_MODEL,;t t
21039 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
21040 s,@LIBTOOL@,$LIBTOOL,;t t
21041 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
21042 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
21043 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
21044 s,@LIB_LINK@,$LIB_LINK,;t t
21045 s,@LINK_TESTS@,$LINK_TESTS,;t t
21046 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
21047 s,@PACKAGE@,$PACKAGE,;t t
21048 s,@PTHREAD@,$PTHREAD,;t t
21049 s,@TEST_ARGS@,$TEST_ARGS,;t t
21050 s,@TEST_DEPS@,$TEST_DEPS,;t t
21051 s,@TEST_LIBS@,$TEST_LIBS,;t t
21052 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
21053 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
21054 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
21055 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
21056 s,@includesubdir@,$includesubdir,;t t
21057 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
21058 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
21059 s,@ECHO_LT@,$ECHO_LT,;t t
21060 s,@ECHO_LD@,$ECHO_LD,;t t
21061 s,@RULE_CC@,$RULE_CC,;t t
21062 s,@SHOW_CC@,$SHOW_CC,;t t
21063 s,@ECHO_CC@,$ECHO_CC,;t t
21064 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
21065 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
21066 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
21067 s,@X_CFLAGS@,$X_CFLAGS,;t t
21068 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
21069 s,@X_LIBS@,$X_LIBS,;t t
21070 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
21071 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
21072 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
21073 s,@RGB_PATH@,$RGB_PATH,;t t
21074 s,@no_x11_rgb@,$no_x11_rgb,;t t
21075 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
21076 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
21077 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
21078 CEOF
21079
21080 EOF
21081
21082   cat >>$CONFIG_STATUS <<\EOF
21083   # Split the substitutions into bite-sized pieces for seds with
21084   # small command number limits, like on Digital OSF/1 and HP-UX.
21085   ac_max_sed_lines=48
21086   ac_sed_frag=1 # Number of current file.
21087   ac_beg=1 # First line for current file.
21088   ac_end=$ac_max_sed_lines # Line after last line for current file.
21089   ac_more_lines=:
21090   ac_sed_cmds=
21091   while $ac_more_lines; do
21092     if test $ac_beg -gt 1; then
21093       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21094     else
21095       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
21096     fi
21097     if test ! -s $tmp/subs.frag; then
21098       ac_more_lines=false
21099     else
21100       # The purpose of the label and of the branching condition is to
21101       # speed up the sed processing (if there are no `@' at all, there
21102       # is no need to browse any of the substitutions).
21103       # These are the two extra sed commands mentioned above.
21104       (echo ':t
21105   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
21106       # It is possible to make a multiline substitution using escaped newlines.
21107       # Ensure that we do not split the substitution between script fragments.
21108       ac_BEG=$ac_end
21109       ac_END=`expr $ac_end + $ac_max_sed_lines`
21110       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
21111       if test -s $tmp/subs.next; then
21112         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
21113         if test ! -s $tmp/subs.edit; then
21114           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
21115           if test ! -s $tmp/subs.edit; then
21116             if test $ac_beg -gt 1; then
21117               ac_end=`expr $ac_end - 1`
21118               continue
21119             fi
21120           fi
21121         fi
21122       fi
21123
21124       if test -z "$ac_sed_cmds"; then
21125         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
21126       else
21127         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
21128       fi
21129       ac_sed_frag=`expr $ac_sed_frag + 1`
21130       ac_beg=$ac_end
21131       ac_end=`expr $ac_end + $ac_max_sed_lines`
21132     fi
21133   done
21134   if test -z "$ac_sed_cmds"; then
21135     ac_sed_cmds=cat
21136   fi
21137 fi # test -n "$CONFIG_FILES"
21138
21139 EOF
21140 cat >>$CONFIG_STATUS <<\EOF
21141 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
21142   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21143   case $ac_file in
21144   - | *:- | *:-:* ) # input from stdin
21145         cat >$tmp/stdin
21146         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21147         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21148   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21149         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21150   * )   ac_file_in=$ac_file.in ;;
21151   esac
21152
21153   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
21154   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21155          X"$ac_file" : 'X\(//\)[^/]' \| \
21156          X"$ac_file" : 'X\(//\)$' \| \
21157          X"$ac_file" : 'X\(/\)' \| \
21158          .     : '\(.\)' 2>/dev/null ||
21159 echo X"$ac_file" |
21160     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21161           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21162           /^X\(\/\/\)$/{ s//\1/; q; }
21163           /^X\(\/\).*/{ s//\1/; q; }
21164           s/.*/./; q'`
21165   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21166     { case "$ac_dir" in
21167   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21168   *)                      as_incr_dir=.;;
21169 esac
21170 as_dummy="$ac_dir"
21171 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21172   case $as_mkdir_dir in
21173     # Skip DOS drivespec
21174     ?:) as_incr_dir=$as_mkdir_dir ;;
21175     *)
21176       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21177       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21178     ;;
21179   esac
21180 done; }
21181
21182     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21183     # A "../" for each directory in $ac_dir_suffix.
21184     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21185   else
21186     ac_dir_suffix= ac_dots=
21187   fi
21188
21189   case $srcdir in
21190   .)  ac_srcdir=.
21191       if test -z "$ac_dots"; then
21192          ac_top_srcdir=.
21193       else
21194          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21195       fi ;;
21196   [\\/]* | ?:[\\/]* )
21197       ac_srcdir=$srcdir$ac_dir_suffix;
21198       ac_top_srcdir=$srcdir ;;
21199   *) # Relative path.
21200     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21201     ac_top_srcdir=$ac_dots$srcdir ;;
21202   esac
21203
21204   case $INSTALL in
21205   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21206   *) ac_INSTALL=$ac_dots$INSTALL ;;
21207   esac
21208
21209   if test x"$ac_file" != x-; then
21210     { echo "$as_me:21210: creating $ac_file" >&5
21211 echo "$as_me: creating $ac_file" >&6;}
21212     rm -f "$ac_file"
21213   fi
21214   # Let's still pretend it is `configure' which instantiates (i.e., don't
21215   # use $as_me), people would be surprised to read:
21216   #    /* config.h.  Generated automatically by config.status.  */
21217   configure_input="Generated automatically from `echo $ac_file_in |
21218                                                  sed 's,.*/,,'` by configure."
21219
21220   # First look for the input files in the build tree, otherwise in the
21221   # src tree.
21222   ac_file_inputs=`IFS=:
21223     for f in $ac_file_in; do
21224       case $f in
21225       -) echo $tmp/stdin ;;
21226       [\\/$]*)
21227          # Absolute (can't be DOS-style, as IFS=:)
21228          test -f "$f" || { { echo "$as_me:21228: error: cannot find input file: $f" >&5
21229 echo "$as_me: error: cannot find input file: $f" >&2;}
21230    { (exit 1); exit 1; }; }
21231          echo $f;;
21232       *) # Relative
21233          if test -f "$f"; then
21234            # Build tree
21235            echo $f
21236          elif test -f "$srcdir/$f"; then
21237            # Source tree
21238            echo $srcdir/$f
21239          else
21240            # /dev/null tree
21241            { { echo "$as_me:21241: error: cannot find input file: $f" >&5
21242 echo "$as_me: error: cannot find input file: $f" >&2;}
21243    { (exit 1); exit 1; }; }
21244          fi;;
21245       esac
21246     done` || { (exit 1); exit 1; }
21247 EOF
21248 cat >>$CONFIG_STATUS <<\EOF
21249   ac_warn_datarootdir=no
21250   if test x"$ac_file" != x-; then
21251     for ac_item in $ac_file_inputs
21252     do
21253       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21254       if test -n "$ac_seen"; then
21255         ac_used=`grep '@datarootdir@' $ac_item`
21256         if test -z "$ac_used"; then
21257           { echo "$as_me:21257: WARNING: datarootdir was used implicitly but not set:
21258 $ac_seen" >&5
21259 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21260 $ac_seen" >&2;}
21261           ac_warn_datarootdir=yes
21262         fi
21263       fi
21264       ac_seen=`grep '${datarootdir}' $ac_item`
21265       if test -n "$ac_seen"; then
21266         { echo "$as_me:21266: WARNING: datarootdir was used explicitly but not set:
21267 $ac_seen" >&5
21268 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21269 $ac_seen" >&2;}
21270         ac_warn_datarootdir=yes
21271       fi
21272     done
21273   fi
21274
21275 if test "x$ac_warn_datarootdir" = xyes; then
21276   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21277 fi
21278
21279 EOF
21280 cat >>$CONFIG_STATUS <<EOF
21281   sed "$ac_vpsub
21282 $extrasub
21283 EOF
21284 cat >>$CONFIG_STATUS <<\EOF
21285 :t
21286 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21287 s,@configure_input@,$configure_input,;t t
21288 s,@srcdir@,$ac_srcdir,;t t
21289 s,@top_srcdir@,$ac_top_srcdir,;t t
21290 s,@INSTALL@,$ac_INSTALL,;t t
21291 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21292   rm -f $tmp/stdin
21293   if test x"$ac_file" != x-; then
21294     cp $tmp/out $ac_file
21295
21296     for ac_name in prefix exec_prefix datarootdir
21297     do
21298         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21299         if test -n "$ac_seen"; then
21300             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21301             if test -z "$ac_init"; then
21302               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21303               { echo "$as_me:21303: WARNING: Variable $ac_name is used but was not set:
21304 $ac_seen" >&5
21305 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21306 $ac_seen" >&2;}
21307             fi
21308         fi
21309     done
21310     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21311     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21312     if test -s $tmp/out; then
21313       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21314       { echo "$as_me:21314: WARNING: Some variables may not be substituted:
21315 $ac_seen" >&5
21316 echo "$as_me: WARNING: Some variables may not be substituted:
21317 $ac_seen" >&2;}
21318     fi
21319   else
21320     cat $tmp/out
21321   fi
21322   rm -f $tmp/out
21323
21324 done
21325 EOF
21326 cat >>$CONFIG_STATUS <<\EOF
21327
21328 #
21329 # CONFIG_HEADER section.
21330 #
21331
21332 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21333 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21334 #
21335 # ac_d sets the value in "#define NAME VALUE" lines.
21336 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21337 ac_dB='[        ].*$,\1#\2'
21338 ac_dC=' '
21339 ac_dD=',;t'
21340 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21341 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21342 ac_iB='\([      ]\),\1#\2define\3'
21343 ac_iC=' '
21344 ac_iD='\4,;t'
21345 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21346 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21347 ac_uB='$,\1#\2define\3'
21348 ac_uC=' '
21349 ac_uD=',;t'
21350
21351 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21352   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21353   case $ac_file in
21354   - | *:- | *:-:* ) # input from stdin
21355         cat >$tmp/stdin
21356         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21357         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21358   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21359         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21360   * )   ac_file_in=$ac_file.in ;;
21361   esac
21362
21363   test x"$ac_file" != x- && { echo "$as_me:21363: creating $ac_file" >&5
21364 echo "$as_me: creating $ac_file" >&6;}
21365
21366   # First look for the input files in the build tree, otherwise in the
21367   # src tree.
21368   ac_file_inputs=`IFS=:
21369     for f in $ac_file_in; do
21370       case $f in
21371       -) echo $tmp/stdin ;;
21372       [\\/$]*)
21373          # Absolute (can't be DOS-style, as IFS=:)
21374          test -f "$f" || { { echo "$as_me:21374: error: cannot find input file: $f" >&5
21375 echo "$as_me: error: cannot find input file: $f" >&2;}
21376    { (exit 1); exit 1; }; }
21377          echo $f;;
21378       *) # Relative
21379          if test -f "$f"; then
21380            # Build tree
21381            echo $f
21382          elif test -f "$srcdir/$f"; then
21383            # Source tree
21384            echo $srcdir/$f
21385          else
21386            # /dev/null tree
21387            { { echo "$as_me:21387: error: cannot find input file: $f" >&5
21388 echo "$as_me: error: cannot find input file: $f" >&2;}
21389    { (exit 1); exit 1; }; }
21390          fi;;
21391       esac
21392     done` || { (exit 1); exit 1; }
21393   # Remove the trailing spaces.
21394   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21395
21396 EOF
21397
21398 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21399 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21400 # be either 'cat' or 'sort'.
21401 cat confdefs.h | uniq >conftest.vals
21402
21403 # Break up conftest.vals because some shells have a limit on
21404 # the size of here documents, and old seds have small limits too.
21405
21406 rm -f conftest.tail
21407 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21408 while grep . conftest.vals >/dev/null
21409 do
21410   # Write chunks of a limited-size here document to conftest.frag.
21411   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21412   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21413   echo 'CEOF' >> $CONFIG_STATUS
21414   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21415   rm -f conftest.vals
21416   mv conftest.tail conftest.vals
21417 done
21418 rm -f conftest.vals
21419
21420 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21421 # marker @DEFS@.
21422 echo '  cat >> conftest.edit <<CEOF
21423 /@DEFS@/r conftest.frag
21424 /@DEFS@/d
21425 CEOF
21426 sed -f conftest.edit $tmp/in > $tmp/out
21427 rm -f $tmp/in
21428 mv $tmp/out $tmp/in
21429 rm -f conftest.edit conftest.frag
21430 ' >> $CONFIG_STATUS
21431
21432 cat >>$CONFIG_STATUS <<\EOF
21433   # Let's still pretend it is `configure' which instantiates (i.e., don't
21434   # use $as_me), people would be surprised to read:
21435   #    /* config.h.  Generated automatically by config.status.  */
21436   if test x"$ac_file" = x-; then
21437     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21438   else
21439     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21440   fi
21441   cat $tmp/in >>$tmp/config.h
21442   rm -f $tmp/in
21443   if test x"$ac_file" != x-; then
21444     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21445       { echo "$as_me:21445: $ac_file is unchanged" >&5
21446 echo "$as_me: $ac_file is unchanged" >&6;}
21447     else
21448       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21449          X"$ac_file" : 'X\(//\)[^/]' \| \
21450          X"$ac_file" : 'X\(//\)$' \| \
21451          X"$ac_file" : 'X\(/\)' \| \
21452          .     : '\(.\)' 2>/dev/null ||
21453 echo X"$ac_file" |
21454     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21455           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21456           /^X\(\/\/\)$/{ s//\1/; q; }
21457           /^X\(\/\).*/{ s//\1/; q; }
21458           s/.*/./; q'`
21459       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21460         { case "$ac_dir" in
21461   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21462   *)                      as_incr_dir=.;;
21463 esac
21464 as_dummy="$ac_dir"
21465 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21466   case $as_mkdir_dir in
21467     # Skip DOS drivespec
21468     ?:) as_incr_dir=$as_mkdir_dir ;;
21469     *)
21470       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21471       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21472     ;;
21473   esac
21474 done; }
21475
21476       fi
21477       rm -f $ac_file
21478       mv $tmp/config.h $ac_file
21479     fi
21480   else
21481     cat $tmp/config.h
21482     rm -f $tmp/config.h
21483   fi
21484 done
21485 EOF
21486 cat >>$CONFIG_STATUS <<\EOF
21487 #
21488 # CONFIG_COMMANDS section.
21489 #
21490 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21491   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21492   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21493
21494   case $ac_dest in
21495     default )
21496
21497 for cf_dir in .
21498 do
21499         if test ! -d $srcdir/$cf_dir; then
21500                 continue
21501         elif test -f $srcdir/$cf_dir/programs; then
21502                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21503         fi
21504 done
21505
21506         cat >>Makefile <<TEST_EOF
21507
21508 # These rules are generated so we do not rely on suffix rules, which do not
21509 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21510 # some, and the '\$x' confuses others).
21511 TEST_EOF
21512
21513 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21514 for N in $LIST
21515 do
21516         cat >>Makefile <<TEST_EOF
21517
21518 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21519         \$(srcdir)/test.priv.h \\
21520         ncurses_cfg.h
21521         $SHOW_CC
21522         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21523 TEST_EOF
21524 done
21525
21526 if test -f ../config.guess && test -f ../config.sub
21527 then
21528         cat >>Makefile <<TEST_EOF
21529
21530 # if we used CF_INHERIT for getting these files, we can remove them
21531 distclean::
21532         rm -f config.guess config.sub
21533 TEST_EOF
21534 fi
21535  ;;
21536   esac
21537 done
21538 EOF
21539
21540 cat >>$CONFIG_STATUS <<\EOF
21541
21542 { (exit 0); exit 0; }
21543 EOF
21544 chmod +x $CONFIG_STATUS
21545 ac_clean_files=$ac_clean_files_save
21546
21547 # configure is writing to config.log, and then calls config.status.
21548 # config.status does its own redirection, appending to config.log.
21549 # Unfortunately, on DOS this fails, as config.log is still kept open
21550 # by configure, so config.status won't be able to write to it; its
21551 # output is simply discarded.  So we exec the FD to /dev/null,
21552 # effectively closing config.log, so it can be properly (re)opened and
21553 # appended to by config.status.  When coming back to configure, we
21554 # need to make the FD available again.
21555 if test "$no_create" != yes; then
21556   ac_cs_success=:
21557   exec 5>/dev/null
21558   $SHELL $CONFIG_STATUS || ac_cs_success=false
21559   exec 5>>config.log
21560   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21561   # would make configure fail if this is the last instruction.
21562   $ac_cs_success || { (exit 1); exit 1; }
21563 fi
21564