]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
83f2f39d746d9e25a2bb0b21f2f11b0bb0eb3a47
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20170501.
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 libdir='${exec_prefix}/lib'
143 includedir='${prefix}/include'
144 oldincludedir='/usr/include'
145 infodir='${datarootdir}/info'
146 mandir='${datarootdir}/man'
147
148 # Identity of this package.
149 PACKAGE_NAME=
150 PACKAGE_TARNAME=
151 PACKAGE_VERSION=
152 PACKAGE_STRING=
153 PACKAGE_BUGREPORT=
154
155 ac_prev=
156 for ac_option
157 do
158   # If the previous option needs an argument, assign it.
159   if test -n "$ac_prev"; then
160     eval "$ac_prev=\$ac_option"
161     ac_prev=
162     continue
163   fi
164
165   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
166
167   # Accept the important Cygnus configure options, so we can diagnose typos.
168
169   case $ac_option in
170
171   -bindir | --bindir | --bindi | --bind | --bin | --bi)
172     ac_prev=bindir ;;
173   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
174     bindir=$ac_optarg ;;
175
176   -build | --build | --buil | --bui | --bu)
177     ac_prev=build_alias ;;
178   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
179     build_alias=$ac_optarg ;;
180
181   -cache-file | --cache-file | --cache-fil | --cache-fi \
182   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
183     ac_prev=cache_file ;;
184   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
185   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
186     cache_file=$ac_optarg ;;
187
188   --config-cache | -C)
189     cache_file=config.cache ;;
190
191   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
192     ac_prev=datadir ;;
193   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
194   | --da=*)
195     datadir=$ac_optarg ;;
196
197   -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
198   | --dataroo | --dataro | --datar)
199     ac_prev=datarootdir ;;
200   -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
201   | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
202     datarootdir=$ac_optarg ;;
203
204   -disable-* | --disable-*)
205     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
206     # Reject names that are not valid shell variable names.
207     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
208       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
209    { (exit 1); exit 1; }; }
210     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
211     eval "enable_$ac_feature=no" ;;
212
213   -enable-* | --enable-*)
214     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
215     # Reject names that are not valid shell variable names.
216     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
217       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
218    { (exit 1); exit 1; }; }
219     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
220     case $ac_option in
221       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
222       *) ac_optarg=yes ;;
223     esac
224     eval "enable_$ac_feature='$ac_optarg'" ;;
225
226   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
227   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
228   | --exec | --exe | --ex)
229     ac_prev=exec_prefix ;;
230   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
231   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
232   | --exec=* | --exe=* | --ex=*)
233     exec_prefix=$ac_optarg ;;
234
235   -gas | --gas | --ga | --g)
236     # Obsolete; use --with-gas.
237     with_gas=yes ;;
238
239   -help | --help | --hel | --he | -h)
240     ac_init_help=long ;;
241   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
242     ac_init_help=recursive ;;
243   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
244     ac_init_help=short ;;
245
246   -host | --host | --hos | --ho)
247     ac_prev=host_alias ;;
248   -host=* | --host=* | --hos=* | --ho=*)
249     host_alias=$ac_optarg ;;
250
251   -includedir | --includedir | --includedi | --included | --include \
252   | --includ | --inclu | --incl | --inc)
253     ac_prev=includedir ;;
254   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
255   | --includ=* | --inclu=* | --incl=* | --inc=*)
256     includedir=$ac_optarg ;;
257
258   -infodir | --infodir | --infodi | --infod | --info | --inf)
259     ac_prev=infodir ;;
260   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
261     infodir=$ac_optarg ;;
262
263   -libdir | --libdir | --libdi | --libd)
264     ac_prev=libdir ;;
265   -libdir=* | --libdir=* | --libdi=* | --libd=*)
266     libdir=$ac_optarg ;;
267
268   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
269   | --libexe | --libex | --libe)
270     ac_prev=libexecdir ;;
271   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
272   | --libexe=* | --libex=* | --libe=*)
273     libexecdir=$ac_optarg ;;
274
275   -localstatedir | --localstatedir | --localstatedi | --localstated \
276   | --localstate | --localstat | --localsta | --localst \
277   | --locals | --local | --loca | --loc | --lo)
278     ac_prev=localstatedir ;;
279   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
280   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
281   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
282     localstatedir=$ac_optarg ;;
283
284   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
285     ac_prev=mandir ;;
286   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
287     mandir=$ac_optarg ;;
288
289   -nfp | --nfp | --nf)
290     # Obsolete; use --without-fp.
291     with_fp=no ;;
292
293   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
294   | --no-cr | --no-c)
295     no_create=yes ;;
296
297   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
298   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
299     no_recursion=yes ;;
300
301   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
302   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
303   | --oldin | --oldi | --old | --ol | --o)
304     ac_prev=oldincludedir ;;
305   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
306   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
307   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
308     oldincludedir=$ac_optarg ;;
309
310   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
311     ac_prev=prefix ;;
312   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
313     prefix=$ac_optarg ;;
314
315   -program-prefix | --program-prefix | --program-prefi | --program-pref \
316   | --program-pre | --program-pr | --program-p)
317     ac_prev=program_prefix ;;
318   -program-prefix=* | --program-prefix=* | --program-prefi=* \
319   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
320     program_prefix=$ac_optarg ;;
321
322   -program-suffix | --program-suffix | --program-suffi | --program-suff \
323   | --program-suf | --program-su | --program-s)
324     ac_prev=program_suffix ;;
325   -program-suffix=* | --program-suffix=* | --program-suffi=* \
326   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
327     program_suffix=$ac_optarg ;;
328
329   -program-transform-name | --program-transform-name \
330   | --program-transform-nam | --program-transform-na \
331   | --program-transform-n | --program-transform- \
332   | --program-transform | --program-transfor \
333   | --program-transfo | --program-transf \
334   | --program-trans | --program-tran \
335   | --progr-tra | --program-tr | --program-t)
336     ac_prev=program_transform_name ;;
337   -program-transform-name=* | --program-transform-name=* \
338   | --program-transform-nam=* | --program-transform-na=* \
339   | --program-transform-n=* | --program-transform-=* \
340   | --program-transform=* | --program-transfor=* \
341   | --program-transfo=* | --program-transf=* \
342   | --program-trans=* | --program-tran=* \
343   | --progr-tra=* | --program-tr=* | --program-t=*)
344     program_transform_name=$ac_optarg ;;
345
346   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
347   | -silent | --silent | --silen | --sile | --sil)
348     silent=yes ;;
349
350   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
351     ac_prev=sbindir ;;
352   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
353   | --sbi=* | --sb=*)
354     sbindir=$ac_optarg ;;
355
356   -sharedstatedir | --sharedstatedir | --sharedstatedi \
357   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
358   | --sharedst | --shareds | --shared | --share | --shar \
359   | --sha | --sh)
360     ac_prev=sharedstatedir ;;
361   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
362   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
363   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
364   | --sha=* | --sh=*)
365     sharedstatedir=$ac_optarg ;;
366
367   -site | --site | --sit)
368     ac_prev=site ;;
369   -site=* | --site=* | --sit=*)
370     site=$ac_optarg ;;
371
372   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
373     ac_prev=srcdir ;;
374   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
375     srcdir=$ac_optarg ;;
376
377   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
378   | --syscon | --sysco | --sysc | --sys | --sy)
379     ac_prev=sysconfdir ;;
380   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
381   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
382     sysconfdir=$ac_optarg ;;
383
384   -target | --target | --targe | --targ | --tar | --ta | --t)
385     ac_prev=target_alias ;;
386   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
387     target_alias=$ac_optarg ;;
388
389   -v | -verbose | --verbose | --verbos | --verbo | --verb)
390     verbose=yes ;;
391
392   -version | --version | --versio | --versi | --vers | -V)
393     ac_init_version=: ;;
394
395   -with-* | --with-*)
396     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
397     # Reject names that are not valid shell variable names.
398     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
399       { echo "$as_me: error: invalid package name: $ac_package" >&2
400    { (exit 1); exit 1; }; }
401     ac_package=`echo $ac_package| sed 's/-/_/g'`
402     case $ac_option in
403       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
404       *) ac_optarg=yes ;;
405     esac
406     eval "with_$ac_package='$ac_optarg'" ;;
407
408   -without-* | --without-*)
409     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
410     # Reject names that are not valid shell variable names.
411     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
412       { echo "$as_me: error: invalid package name: $ac_package" >&2
413    { (exit 1); exit 1; }; }
414     ac_package=`echo $ac_package | sed 's/-/_/g'`
415     eval "with_$ac_package=no" ;;
416
417   --x)
418     # Obsolete; use --with-x.
419     with_x=yes ;;
420
421   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
422   | --x-incl | --x-inc | --x-in | --x-i)
423     ac_prev=x_includes ;;
424   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
425   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
426     x_includes=$ac_optarg ;;
427
428   -x-libraries | --x-libraries | --x-librarie | --x-librari \
429   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
430     ac_prev=x_libraries ;;
431   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
432   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
433     x_libraries=$ac_optarg ;;
434
435   -*) { echo "$as_me: error: unrecognized option: $ac_option
436 Try \`$0 --help' for more information." >&2
437    { (exit 1); exit 1; }; }
438     ;;
439
440   *=*)
441     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
442     # Reject names that are not valid shell variable names.
443     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
444       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
445    { (exit 1); exit 1; }; }
446     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
447     eval "$ac_envvar='$ac_optarg'"
448     export $ac_envvar ;;
449
450   *)
451     # FIXME: should be removed in autoconf 3.0.
452     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
453     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
454       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
455     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
456     ;;
457
458   esac
459 done
460
461 if test -n "$ac_prev"; then
462   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
463   { echo "$as_me: error: missing argument to $ac_option" >&2
464    { (exit 1); exit 1; }; }
465 fi
466
467 # Be sure to have absolute paths.
468 for ac_var in exec_prefix prefix
469 do
470   eval ac_val=$`echo $ac_var`
471   case $ac_val in
472     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
473     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
474    { (exit 1); exit 1; }; };;
475   esac
476 done
477
478 # Be sure to have absolute paths.
479 for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \
480               localstatedir libdir includedir oldincludedir infodir mandir
481 do
482   eval ac_val=$`echo $ac_var`
483   case $ac_val in
484     [\\/$]* | ?:[\\/]* ) ;;
485     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
486    { (exit 1); exit 1; }; };;
487   esac
488 done
489
490 # There might be people who depend on the old broken behavior: `$host'
491 # used to hold the argument of --host etc.
492 build=$build_alias
493 host=$host_alias
494 target=$target_alias
495
496 # FIXME: should be removed in autoconf 3.0.
497 if test "x$host_alias" != x; then
498   if test "x$build_alias" = x; then
499     cross_compiling=maybe
500     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
501     If a cross compiler is detected then cross compile mode will be used." >&2
502   elif test "x$build_alias" != "x$host_alias"; then
503     cross_compiling=yes
504   fi
505 fi
506
507 ac_tool_prefix=
508 test -n "$host_alias" && ac_tool_prefix=$host_alias-
509
510 test "$silent" = yes && exec 6>/dev/null
511
512 # Find the source files, if location was not specified.
513 if test -z "$srcdir"; then
514   ac_srcdir_defaulted=yes
515   # Try the directory containing this script, then its parent.
516   ac_prog=$0
517   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
518   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
519   srcdir=$ac_confdir
520   if test ! -r $srcdir/$ac_unique_file; then
521     srcdir=..
522   fi
523 else
524   ac_srcdir_defaulted=no
525 fi
526 if test ! -r $srcdir/$ac_unique_file; then
527   if test "$ac_srcdir_defaulted" = yes; then
528     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
529    { (exit 1); exit 1; }; }
530   else
531     { echo "$as_me: error: cannot find sources in $srcdir" >&2
532    { (exit 1); exit 1; }; }
533   fi
534 fi
535 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
536 ac_env_build_alias_set=${build_alias+set}
537 ac_env_build_alias_value=$build_alias
538 ac_cv_env_build_alias_set=${build_alias+set}
539 ac_cv_env_build_alias_value=$build_alias
540 ac_env_host_alias_set=${host_alias+set}
541 ac_env_host_alias_value=$host_alias
542 ac_cv_env_host_alias_set=${host_alias+set}
543 ac_cv_env_host_alias_value=$host_alias
544 ac_env_target_alias_set=${target_alias+set}
545 ac_env_target_alias_value=$target_alias
546 ac_cv_env_target_alias_set=${target_alias+set}
547 ac_cv_env_target_alias_value=$target_alias
548 ac_env_CC_set=${CC+set}
549 ac_env_CC_value=$CC
550 ac_cv_env_CC_set=${CC+set}
551 ac_cv_env_CC_value=$CC
552 ac_env_CFLAGS_set=${CFLAGS+set}
553 ac_env_CFLAGS_value=$CFLAGS
554 ac_cv_env_CFLAGS_set=${CFLAGS+set}
555 ac_cv_env_CFLAGS_value=$CFLAGS
556 ac_env_LDFLAGS_set=${LDFLAGS+set}
557 ac_env_LDFLAGS_value=$LDFLAGS
558 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
559 ac_cv_env_LDFLAGS_value=$LDFLAGS
560 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
561 ac_env_CPPFLAGS_value=$CPPFLAGS
562 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
563 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
564 ac_env_CPP_set=${CPP+set}
565 ac_env_CPP_value=$CPP
566 ac_cv_env_CPP_set=${CPP+set}
567 ac_cv_env_CPP_value=$CPP
568
569 #
570 # Report the --help message.
571 #
572 if test "$ac_init_help" = "long"; then
573   # Omit some internal or obsolete options to make the list less imposing.
574   # This message is too long to be a string in the A/UX 3.1 sh.
575   cat <<EOF
576 \`configure' configures this package to adapt to many kinds of systems.
577
578 Usage: $0 [OPTION]... [VAR=VALUE]...
579
580 To assign environment variables (e.g., CC, CFLAGS...), specify them as
581 VAR=VALUE.  See below for descriptions of some of the useful variables.
582
583 Defaults for the options are specified in brackets.
584
585 Configuration:
586   -h, --help              display this help and exit
587       --help=short        display options specific to this package
588       --help=recursive    display the short help of all the included packages
589   -V, --version           display version information and exit
590   -q, --quiet, --silent   do not print \`checking...' messages
591       --cache-file=FILE   cache test results in FILE [disabled]
592   -C, --config-cache      alias for \`--cache-file=config.cache'
593   -n, --no-create         do not create output files
594       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
595
596 EOF
597
598   cat <<EOF
599 Installation directories:
600   --prefix=PREFIX         install architecture-independent files in PREFIX
601                           [$ac_default_prefix]
602   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
603                           [PREFIX]
604
605 By default, \`make install' will install all the files in
606 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
607 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
608 for instance \`--prefix=\$HOME'.
609
610 For better control, use the options below.
611
612 Fine tuning of the installation directories:
613   --bindir=DIR            user executables [EPREFIX/bin]
614   --sbindir=DIR           system admin executables [EPREFIX/sbin]
615   --libexecdir=DIR        program executables [EPREFIX/libexec]
616   --datarootdir=DIR       read-only architecture-independent data [PREFIX/share]
617   --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
618   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
619   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
620   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
621   --libdir=DIR            object code libraries [EPREFIX/lib]
622   --includedir=DIR        C header files [PREFIX/include]
623   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
624   --infodir=DIR           info documentation [DATAROOTDIR/info]
625   --mandir=DIR            man documentation [DATAROOTDIR/man]
626 EOF
627
628   cat <<\EOF
629
630 Program names:
631   --program-prefix=PREFIX            prepend PREFIX to installed program names
632   --program-suffix=SUFFIX            append SUFFIX to installed program names
633   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
634
635 X features:
636   --x-includes=DIR    X include files are in DIR
637   --x-libraries=DIR   X library files are in DIR
638
639 System types:
640   --build=BUILD           configure for building on BUILD [guessed]
641   --host=HOST       build programs to run on HOST [BUILD]
642 EOF
643 fi
644
645 if test -n "$ac_init_help"; then
646
647   cat <<\EOF
648
649 Optional Features:
650   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
651   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
652
653 Optional Packages:
654   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
655   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
656
657 General Options:
658   --disable-stripping     do not strip installed executables
659   --enable-string-hacks   work around bogus compiler/loader warnings
660   --with-pkg-config{=path} enable/disable use of pkg-config
661   --disable-echo          do not display "compiling" commands
662 Curses Version-dependent Options:
663   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
664   --disable-widec         disable checks for wide-character functions
665   --with-curses-dir=DIR   directory in which (n)curses is installed
666   --with-screen=XXX       use specified curses-libraries
667   --with-ncursesw         use wide ncurses-libraries
668   --with-ncurses          use ncurses-libraries
669   --with-pdcurses         compile/link with pdcurses X11 library
670   --with-curses-colr      compile/link with HPUX 10.x color-curses
671   --with-curses-5lib      compile/link with SunOS 5lib curses
672   --with-Xaw3d            link with Xaw 3d library
673   --with-Xaw3dxft         link with Xaw 3d xft library
674   --with-neXtaw           link with neXT Athena library
675   --with-XawPlus          link with Athena-Plus library
676   --with-x                use the X Window System
677   --with-x11-rgb=FILE   file containing X11 rgb information (EPREFIX/lib/X11/rgb.txt)
678   --disable-panel         disable checks for panel functions
679   --disable-menu          disable checks for menu functions
680   --disable-form          disable checks for form functions
681 Testing/development Options:
682   --enable-warnings       test: turn on gcc compiler warnings
683   --with-dmalloc          test: use Gray Watson's dmalloc library
684   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
685   --with-valgrind         test: use valgrind
686   --disable-leaks         test: free permanent memory, analyze leaks
687   --disable-rpath-hack    don't add rpath options for additional libraries
688
689 Some influential environment variables:
690   CC          C compiler command
691   CFLAGS      C compiler flags
692   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
693               nonstandard directory <lib dir>
694   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
695               headers in a nonstandard directory <include dir>
696   CPP         C preprocessor
697
698 Use these variables to override the choices made by `configure' or to help
699 it to find libraries and programs with nonstandard names/locations.
700
701 EOF
702 fi
703
704 if test "$ac_init_help" = "recursive"; then
705   # If there are subdirs, report their specific --help.
706   ac_popdir=`pwd`
707   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
708     cd $ac_subdir
709     # A "../" for each directory in /$ac_subdir.
710     ac_dots=`echo $ac_subdir |
711              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
712
713     case $srcdir in
714     .) # No --srcdir option.  We are building in place.
715       ac_sub_srcdir=$srcdir ;;
716     [\\/]* | ?:[\\/]* ) # Absolute path.
717       ac_sub_srcdir=$srcdir/$ac_subdir ;;
718     *) # Relative path.
719       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
720     esac
721
722     # Check for guested configure; otherwise get Cygnus style configure.
723     if test -f $ac_sub_srcdir/configure.gnu; then
724       echo
725       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
726     elif test -f $ac_sub_srcdir/configure; then
727       echo
728       $SHELL $ac_sub_srcdir/configure  --help=recursive
729     elif test -f $ac_sub_srcdir/configure.ac ||
730            test -f $ac_sub_srcdir/configure.in; then
731       echo
732       $ac_configure --help
733     else
734       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
735     fi
736     cd $ac_popdir
737   done
738 fi
739
740 test -n "$ac_init_help" && exit 0
741 if $ac_init_version; then
742   cat <<\EOF
743
744 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
745 Free Software Foundation, Inc.
746 This configure script is free software; the Free Software Foundation
747 gives unlimited permission to copy, distribute and modify it.
748 EOF
749   exit 0
750 fi
751 exec 5>config.log
752 cat >&5 <<EOF
753 This file contains any messages produced by compilers while
754 running configure, to aid debugging if configure makes a mistake.
755
756 It was created by $as_me, which was
757 generated by GNU Autoconf 2.52.20170501.  Invocation command line was
758
759   $ $0 $@
760
761 EOF
762 {
763 cat <<_ASUNAME
764 ## ---------- ##
765 ## Platform.  ##
766 ## ---------- ##
767
768 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
769 uname -m = `(uname -m) 2>/dev/null || echo unknown`
770 uname -r = `(uname -r) 2>/dev/null || echo unknown`
771 uname -s = `(uname -s) 2>/dev/null || echo unknown`
772 uname -v = `(uname -v) 2>/dev/null || echo unknown`
773
774 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
775 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
776
777 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
778 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
779 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
780 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
781 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
782 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
783 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
784
785 PATH = $PATH
786
787 _ASUNAME
788 } >&5
789
790 cat >&5 <<EOF
791 ## ------------ ##
792 ## Core tests.  ##
793 ## ------------ ##
794
795 EOF
796
797 # Keep a trace of the command line.
798 # Strip out --no-create and --no-recursion so they do not pile up.
799 # Also quote any args containing shell meta-characters.
800 ac_configure_args=
801 ac_sep=
802 for ac_arg
803 do
804   case $ac_arg in
805   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
806   | --no-cr | --no-c) ;;
807   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
808   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
809   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
810     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
811     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
812     ac_sep=" " ;;
813   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
814      ac_sep=" " ;;
815   esac
816   # Get rid of the leading space.
817 done
818
819 # When interrupted or exit'd, cleanup temporary files, and complete
820 # config.log.  We remove comments because anyway the quotes in there
821 # would cause problems or look ugly.
822 trap 'exit_status=$?
823   # Save into config.log some information that might help in debugging.
824   echo >&5
825   echo "## ----------------- ##" >&5
826   echo "## Cache variables.  ##" >&5
827   echo "## ----------------- ##" >&5
828   echo >&5
829   # The following way of writing the cache mishandles newlines in values,
830 {
831   (set) 2>&1 |
832     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
833     *ac_space=\ *)
834       sed -n \
835         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
836           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
837       ;;
838     *)
839       sed -n \
840         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
841       ;;
842     esac;
843 } >&5
844   sed "/^$/d" confdefs.h >conftest.log
845   if test -s conftest.log; then
846     echo >&5
847     echo "## ------------ ##" >&5
848     echo "## confdefs.h.  ##" >&5
849     echo "## ------------ ##" >&5
850     echo >&5
851     cat conftest.log >&5
852   fi
853   (echo; echo) >&5
854   test "$ac_signal" != 0 &&
855     echo "$as_me: caught signal $ac_signal" >&5
856   echo "$as_me: exit $exit_status" >&5
857   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
858     exit $exit_status
859      ' 0
860 for ac_signal in 1 2 13 15; do
861   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
862 done
863 ac_signal=0
864
865 # confdefs.h avoids OS command line length limits that DEFS can exceed.
866 rm -rf conftest* confdefs.h
867 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
868 echo >confdefs.h
869
870 # Let the site file select an alternate cache file if it wants to.
871 # Prefer explicitly selected file to automatically selected ones.
872 if test -z "$CONFIG_SITE"; then
873   if test "x$prefix" != xNONE; then
874     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
875   else
876     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
877   fi
878 fi
879 for ac_site_file in $CONFIG_SITE; do
880   if test -r "$ac_site_file"; then
881     { echo "$as_me:881: loading site script $ac_site_file" >&5
882 echo "$as_me: loading site script $ac_site_file" >&6;}
883     cat "$ac_site_file" >&5
884     . "$ac_site_file"
885   fi
886 done
887
888 if test -r "$cache_file"; then
889   # Some versions of bash will fail to source /dev/null (special
890   # files actually), so we avoid doing that.
891   if test -f "$cache_file"; then
892     { echo "$as_me:892: loading cache $cache_file" >&5
893 echo "$as_me: loading cache $cache_file" >&6;}
894     case $cache_file in
895       [\\/]* | ?:[\\/]* ) . $cache_file;;
896       *)                      . ./$cache_file;;
897     esac
898   fi
899 else
900   { echo "$as_me:900: creating cache $cache_file" >&5
901 echo "$as_me: creating cache $cache_file" >&6;}
902   >$cache_file
903 fi
904
905 # Check that the precious variables saved in the cache have kept the same
906 # value.
907 ac_cache_corrupted=false
908 for ac_var in `(set) 2>&1 |
909                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
910   eval ac_old_set=\$ac_cv_env_${ac_var}_set
911   eval ac_new_set=\$ac_env_${ac_var}_set
912   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
913   eval ac_new_val="\$ac_env_${ac_var}_value"
914   case $ac_old_set,$ac_new_set in
915     set,)
916       { echo "$as_me:916: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
917 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
918       ac_cache_corrupted=: ;;
919     ,set)
920       { echo "$as_me:920: error: \`$ac_var' was not set in the previous run" >&5
921 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
922       ac_cache_corrupted=: ;;
923     ,);;
924     *)
925       if test "x$ac_old_val" != "x$ac_new_val"; then
926         { echo "$as_me:926: error: \`$ac_var' has changed since the previous run:" >&5
927 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
928         { echo "$as_me:928:   former value:  $ac_old_val" >&5
929 echo "$as_me:   former value:  $ac_old_val" >&2;}
930         { echo "$as_me:930:   current value: $ac_new_val" >&5
931 echo "$as_me:   current value: $ac_new_val" >&2;}
932         ac_cache_corrupted=:
933       fi;;
934   esac
935   # Pass precious variables to config.status.  It doesn't matter if
936   # we pass some twice (in addition to the command line arguments).
937   if test "$ac_new_set" = set; then
938     case $ac_new_val in
939     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
940       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
941       ac_configure_args="$ac_configure_args '$ac_arg'"
942       ;;
943     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
944        ;;
945     esac
946   fi
947 done
948 if $ac_cache_corrupted; then
949   { echo "$as_me:949: error: changes in the environment can compromise the build" >&5
950 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
951   { { echo "$as_me:951: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
952 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
953    { (exit 1); exit 1; }; }
954 fi
955
956 ac_ext=c
957 ac_cpp='$CPP $CPPFLAGS'
958 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
959 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
960 ac_compiler_gnu=$ac_cv_c_compiler_gnu
961 ac_main_return=return
962
963 case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in
964   *c*,-n*) ECHO_N= ECHO_C=      # newlines do not sed ;-) only broken shells would use this case anyway
965                    ECHO_T='     ' ;;
966   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
967   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
968 esac
969 echo "#! $SHELL" >conftest.sh
970 echo  "exit 0"   >>conftest.sh
971 chmod +x conftest.sh
972 if { (echo "$as_me:972: PATH=\".;.\"; conftest.sh") >&5
973   (PATH=".;."; conftest.sh) 2>&5
974   ac_status=$?
975   echo "$as_me:975: \$? = $ac_status" >&5
976   (exit $ac_status); }; then
977   ac_path_separator=';'
978 else
979   ac_path_separator=:
980 fi
981 PATH_SEPARATOR="$ac_path_separator"
982 rm -f conftest.sh
983
984 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
985
986 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
987
988 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
989
990 ac_aux_dir=
991 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
992   if test -f $ac_dir/install-sh; then
993     ac_aux_dir=$ac_dir
994     ac_install_sh="$ac_aux_dir/install-sh -c"
995     break
996   elif test -f $ac_dir/install.sh; then
997     ac_aux_dir=$ac_dir
998     ac_install_sh="$ac_aux_dir/install.sh -c"
999     break
1000   elif test -f $ac_dir/shtool; then
1001     ac_aux_dir=$ac_dir
1002     ac_install_sh="$ac_aux_dir/shtool install -c"
1003     break
1004   fi
1005 done
1006 if test -z "$ac_aux_dir"; then
1007   { { echo "$as_me:1007: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
1008 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
1009    { (exit 1); exit 1; }; }
1010 fi
1011 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
1012 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
1013 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
1014
1015 # Make sure we can run config.sub.
1016 $ac_config_sub sun4 >/dev/null 2>&1 ||
1017   { { echo "$as_me:1017: error: cannot run $ac_config_sub" >&5
1018 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
1019    { (exit 1); exit 1; }; }
1020
1021 echo "$as_me:1021: checking build system type" >&5
1022 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1023 if test "${ac_cv_build+set}" = set; then
1024   echo $ECHO_N "(cached) $ECHO_C" >&6
1025 else
1026   ac_cv_build_alias=$build_alias
1027 test -z "$ac_cv_build_alias" &&
1028   ac_cv_build_alias=`$ac_config_guess`
1029 test -z "$ac_cv_build_alias" &&
1030   { { echo "$as_me:1030: error: cannot guess build type; you must specify one" >&5
1031 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1032    { (exit 1); exit 1; }; }
1033 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1034   { { echo "$as_me:1034: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1035 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1036    { (exit 1); exit 1; }; }
1037
1038 fi
1039 echo "$as_me:1039: result: $ac_cv_build" >&5
1040 echo "${ECHO_T}$ac_cv_build" >&6
1041 build=$ac_cv_build
1042 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1043 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1044 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1045
1046 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1047         echo "$as_me:1047: checking host system type" >&5
1048 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1049 if test "${ac_cv_host+set}" = set; then
1050   echo $ECHO_N "(cached) $ECHO_C" >&6
1051 else
1052   ac_cv_host_alias=$host_alias
1053 test -z "$ac_cv_host_alias" &&
1054   ac_cv_host_alias=$ac_cv_build_alias
1055 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1056   { { echo "$as_me:1056: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1057 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1058    { (exit 1); exit 1; }; }
1059
1060 fi
1061 echo "$as_me:1061: result: $ac_cv_host" >&5
1062 echo "${ECHO_T}$ac_cv_host" >&6
1063 host=$ac_cv_host
1064 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1065 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1066 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1067
1068         system_name="$host_os"
1069 else
1070         system_name="`(uname -s -r) 2>/dev/null`"
1071         if test -z "$system_name" ; then
1072                 system_name="`(hostname) 2>/dev/null`"
1073         fi
1074 fi
1075 test -n "$system_name" &&
1076 cat >>confdefs.h <<EOF
1077 #define SYSTEM_NAME "$system_name"
1078 EOF
1079
1080 if test "${cf_cv_system_name+set}" = set; then
1081   echo $ECHO_N "(cached) $ECHO_C" >&6
1082 else
1083   cf_cv_system_name="$system_name"
1084 fi
1085
1086 test -z "$system_name" && system_name="$cf_cv_system_name"
1087 test -n "$cf_cv_system_name" && echo "$as_me:1087: result: Configuring for $cf_cv_system_name" >&5
1088 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1089
1090 if test ".$system_name" != ".$cf_cv_system_name" ; then
1091         echo "$as_me:1091: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1092 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1093         { { echo "$as_me:1093: error: \"Please remove config.cache and try again.\"" >&5
1094 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1095    { (exit 1); exit 1; }; }
1096 fi
1097
1098 test "$program_prefix" != NONE &&
1099   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1100 # Use a double $ so make ignores it.
1101 test "$program_suffix" != NONE &&
1102   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1103 # Double any \ or $.  echo might interpret backslashes.
1104 # By default was `s,x,x', remove it if useless.
1105 cat <<\_ACEOF >conftest.sed
1106 s/[\\$]/&&/g;s/;s,x,x,$//
1107 _ACEOF
1108 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1109 rm conftest.sed
1110
1111 echo "$as_me:1111: checking whether ${MAKE-make} sets \${MAKE}" >&5
1112 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1113 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1114 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1115   echo $ECHO_N "(cached) $ECHO_C" >&6
1116 else
1117   cat >conftest.make <<\EOF
1118 all:
1119         @echo 'ac_maketemp="${MAKE}"'
1120 EOF
1121 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1122 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1123 if test -n "$ac_maketemp"; then
1124   eval ac_cv_prog_make_${ac_make}_set=yes
1125 else
1126   eval ac_cv_prog_make_${ac_make}_set=no
1127 fi
1128 rm -f conftest.make
1129 fi
1130 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1131   echo "$as_me:1131: result: yes" >&5
1132 echo "${ECHO_T}yes" >&6
1133   SET_MAKE=
1134 else
1135   echo "$as_me:1135: result: no" >&5
1136 echo "${ECHO_T}no" >&6
1137   SET_MAKE="MAKE=${MAKE-make}"
1138 fi
1139
1140 ac_ext=c
1141 ac_cpp='$CPP $CPPFLAGS'
1142 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1143 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1144 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1145 ac_main_return=return
1146 if test -n "$ac_tool_prefix"; then
1147   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1148 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1149 echo "$as_me:1149: checking for $ac_word" >&5
1150 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1151 if test "${ac_cv_prog_CC+set}" = set; then
1152   echo $ECHO_N "(cached) $ECHO_C" >&6
1153 else
1154   if test -n "$CC"; then
1155   ac_cv_prog_CC="$CC" # Let the user override the test.
1156 else
1157   ac_save_IFS=$IFS; IFS=$ac_path_separator
1158 ac_dummy="$PATH"
1159 for ac_dir in $ac_dummy; do
1160   IFS=$ac_save_IFS
1161   test -z "$ac_dir" && ac_dir=.
1162   $as_executable_p "$ac_dir/$ac_word" || continue
1163 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1164 echo "$as_me:1164: found $ac_dir/$ac_word" >&5
1165 break
1166 done
1167
1168 fi
1169 fi
1170 CC=$ac_cv_prog_CC
1171 if test -n "$CC"; then
1172   echo "$as_me:1172: result: $CC" >&5
1173 echo "${ECHO_T}$CC" >&6
1174 else
1175   echo "$as_me:1175: result: no" >&5
1176 echo "${ECHO_T}no" >&6
1177 fi
1178
1179 fi
1180 if test -z "$ac_cv_prog_CC"; then
1181   ac_ct_CC=$CC
1182   # Extract the first word of "gcc", so it can be a program name with args.
1183 set dummy gcc; ac_word=$2
1184 echo "$as_me:1184: checking for $ac_word" >&5
1185 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1186 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1187   echo $ECHO_N "(cached) $ECHO_C" >&6
1188 else
1189   if test -n "$ac_ct_CC"; then
1190   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1191 else
1192   ac_save_IFS=$IFS; IFS=$ac_path_separator
1193 ac_dummy="$PATH"
1194 for ac_dir in $ac_dummy; do
1195   IFS=$ac_save_IFS
1196   test -z "$ac_dir" && ac_dir=.
1197   $as_executable_p "$ac_dir/$ac_word" || continue
1198 ac_cv_prog_ac_ct_CC="gcc"
1199 echo "$as_me:1199: found $ac_dir/$ac_word" >&5
1200 break
1201 done
1202
1203 fi
1204 fi
1205 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1206 if test -n "$ac_ct_CC"; then
1207   echo "$as_me:1207: result: $ac_ct_CC" >&5
1208 echo "${ECHO_T}$ac_ct_CC" >&6
1209 else
1210   echo "$as_me:1210: result: no" >&5
1211 echo "${ECHO_T}no" >&6
1212 fi
1213
1214   CC=$ac_ct_CC
1215 else
1216   CC="$ac_cv_prog_CC"
1217 fi
1218
1219 if test -z "$CC"; then
1220   if test -n "$ac_tool_prefix"; then
1221   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1222 set dummy ${ac_tool_prefix}cc; ac_word=$2
1223 echo "$as_me:1223: checking for $ac_word" >&5
1224 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1225 if test "${ac_cv_prog_CC+set}" = set; then
1226   echo $ECHO_N "(cached) $ECHO_C" >&6
1227 else
1228   if test -n "$CC"; then
1229   ac_cv_prog_CC="$CC" # Let the user override the test.
1230 else
1231   ac_save_IFS=$IFS; IFS=$ac_path_separator
1232 ac_dummy="$PATH"
1233 for ac_dir in $ac_dummy; do
1234   IFS=$ac_save_IFS
1235   test -z "$ac_dir" && ac_dir=.
1236   $as_executable_p "$ac_dir/$ac_word" || continue
1237 ac_cv_prog_CC="${ac_tool_prefix}cc"
1238 echo "$as_me:1238: found $ac_dir/$ac_word" >&5
1239 break
1240 done
1241
1242 fi
1243 fi
1244 CC=$ac_cv_prog_CC
1245 if test -n "$CC"; then
1246   echo "$as_me:1246: result: $CC" >&5
1247 echo "${ECHO_T}$CC" >&6
1248 else
1249   echo "$as_me:1249: result: no" >&5
1250 echo "${ECHO_T}no" >&6
1251 fi
1252
1253 fi
1254 if test -z "$ac_cv_prog_CC"; then
1255   ac_ct_CC=$CC
1256   # Extract the first word of "cc", so it can be a program name with args.
1257 set dummy cc; ac_word=$2
1258 echo "$as_me:1258: checking for $ac_word" >&5
1259 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1260 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1261   echo $ECHO_N "(cached) $ECHO_C" >&6
1262 else
1263   if test -n "$ac_ct_CC"; then
1264   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1265 else
1266   ac_save_IFS=$IFS; IFS=$ac_path_separator
1267 ac_dummy="$PATH"
1268 for ac_dir in $ac_dummy; do
1269   IFS=$ac_save_IFS
1270   test -z "$ac_dir" && ac_dir=.
1271   $as_executable_p "$ac_dir/$ac_word" || continue
1272 ac_cv_prog_ac_ct_CC="cc"
1273 echo "$as_me:1273: found $ac_dir/$ac_word" >&5
1274 break
1275 done
1276
1277 fi
1278 fi
1279 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1280 if test -n "$ac_ct_CC"; then
1281   echo "$as_me:1281: result: $ac_ct_CC" >&5
1282 echo "${ECHO_T}$ac_ct_CC" >&6
1283 else
1284   echo "$as_me:1284: result: no" >&5
1285 echo "${ECHO_T}no" >&6
1286 fi
1287
1288   CC=$ac_ct_CC
1289 else
1290   CC="$ac_cv_prog_CC"
1291 fi
1292
1293 fi
1294 if test -z "$CC"; then
1295   # Extract the first word of "cc", so it can be a program name with args.
1296 set dummy cc; ac_word=$2
1297 echo "$as_me:1297: checking for $ac_word" >&5
1298 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1299 if test "${ac_cv_prog_CC+set}" = set; then
1300   echo $ECHO_N "(cached) $ECHO_C" >&6
1301 else
1302   if test -n "$CC"; then
1303   ac_cv_prog_CC="$CC" # Let the user override the test.
1304 else
1305   ac_prog_rejected=no
1306   ac_save_IFS=$IFS; IFS=$ac_path_separator
1307 ac_dummy="$PATH"
1308 for ac_dir in $ac_dummy; do
1309   IFS=$ac_save_IFS
1310   test -z "$ac_dir" && ac_dir=.
1311   $as_executable_p "$ac_dir/$ac_word" || continue
1312 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1313   ac_prog_rejected=yes
1314   continue
1315 fi
1316 ac_cv_prog_CC="cc"
1317 echo "$as_me:1317: found $ac_dir/$ac_word" >&5
1318 break
1319 done
1320
1321 if test $ac_prog_rejected = yes; then
1322   # We found a bogon in the path, so make sure we never use it.
1323   set dummy $ac_cv_prog_CC
1324   shift
1325   if test $# != 0; then
1326     # We chose a different compiler from the bogus one.
1327     # However, it has the same basename, so the bogon will be chosen
1328     # first if we set CC to just the basename; use the full file name.
1329     shift
1330     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1331     shift
1332     ac_cv_prog_CC="$@"
1333   fi
1334 fi
1335 fi
1336 fi
1337 CC=$ac_cv_prog_CC
1338 if test -n "$CC"; then
1339   echo "$as_me:1339: result: $CC" >&5
1340 echo "${ECHO_T}$CC" >&6
1341 else
1342   echo "$as_me:1342: result: no" >&5
1343 echo "${ECHO_T}no" >&6
1344 fi
1345
1346 fi
1347 if test -z "$CC"; then
1348   if test -n "$ac_tool_prefix"; then
1349   for ac_prog in cl
1350   do
1351     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1352 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1353 echo "$as_me:1353: checking for $ac_word" >&5
1354 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1355 if test "${ac_cv_prog_CC+set}" = set; then
1356   echo $ECHO_N "(cached) $ECHO_C" >&6
1357 else
1358   if test -n "$CC"; then
1359   ac_cv_prog_CC="$CC" # Let the user override the test.
1360 else
1361   ac_save_IFS=$IFS; IFS=$ac_path_separator
1362 ac_dummy="$PATH"
1363 for ac_dir in $ac_dummy; do
1364   IFS=$ac_save_IFS
1365   test -z "$ac_dir" && ac_dir=.
1366   $as_executable_p "$ac_dir/$ac_word" || continue
1367 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1368 echo "$as_me:1368: found $ac_dir/$ac_word" >&5
1369 break
1370 done
1371
1372 fi
1373 fi
1374 CC=$ac_cv_prog_CC
1375 if test -n "$CC"; then
1376   echo "$as_me:1376: result: $CC" >&5
1377 echo "${ECHO_T}$CC" >&6
1378 else
1379   echo "$as_me:1379: result: no" >&5
1380 echo "${ECHO_T}no" >&6
1381 fi
1382
1383     test -n "$CC" && break
1384   done
1385 fi
1386 if test -z "$CC"; then
1387   ac_ct_CC=$CC
1388   for ac_prog in cl
1389 do
1390   # Extract the first word of "$ac_prog", so it can be a program name with args.
1391 set dummy $ac_prog; ac_word=$2
1392 echo "$as_me:1392: checking for $ac_word" >&5
1393 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1394 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1395   echo $ECHO_N "(cached) $ECHO_C" >&6
1396 else
1397   if test -n "$ac_ct_CC"; then
1398   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1399 else
1400   ac_save_IFS=$IFS; IFS=$ac_path_separator
1401 ac_dummy="$PATH"
1402 for ac_dir in $ac_dummy; do
1403   IFS=$ac_save_IFS
1404   test -z "$ac_dir" && ac_dir=.
1405   $as_executable_p "$ac_dir/$ac_word" || continue
1406 ac_cv_prog_ac_ct_CC="$ac_prog"
1407 echo "$as_me:1407: found $ac_dir/$ac_word" >&5
1408 break
1409 done
1410
1411 fi
1412 fi
1413 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1414 if test -n "$ac_ct_CC"; then
1415   echo "$as_me:1415: result: $ac_ct_CC" >&5
1416 echo "${ECHO_T}$ac_ct_CC" >&6
1417 else
1418   echo "$as_me:1418: result: no" >&5
1419 echo "${ECHO_T}no" >&6
1420 fi
1421
1422   test -n "$ac_ct_CC" && break
1423 done
1424
1425   CC=$ac_ct_CC
1426 fi
1427
1428 fi
1429
1430 test -z "$CC" && { { echo "$as_me:1430: error: no acceptable cc found in \$PATH" >&5
1431 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1432    { (exit 1); exit 1; }; }
1433
1434 # Provide some information about the compiler.
1435 echo "$as_me:1435:" \
1436      "checking for C compiler version" >&5
1437 ac_compiler=`set X $ac_compile; echo $2`
1438 { (eval echo "$as_me:1438: \"$ac_compiler --version </dev/null >&5\"") >&5
1439   (eval $ac_compiler --version </dev/null >&5) 2>&5
1440   ac_status=$?
1441   echo "$as_me:1441: \$? = $ac_status" >&5
1442   (exit $ac_status); }
1443 { (eval echo "$as_me:1443: \"$ac_compiler -v </dev/null >&5\"") >&5
1444   (eval $ac_compiler -v </dev/null >&5) 2>&5
1445   ac_status=$?
1446   echo "$as_me:1446: \$? = $ac_status" >&5
1447   (exit $ac_status); }
1448 { (eval echo "$as_me:1448: \"$ac_compiler -V </dev/null >&5\"") >&5
1449   (eval $ac_compiler -V </dev/null >&5) 2>&5
1450   ac_status=$?
1451   echo "$as_me:1451: \$? = $ac_status" >&5
1452   (exit $ac_status); }
1453
1454 cat >conftest.$ac_ext <<_ACEOF
1455 #line 1455 "configure"
1456 #include "confdefs.h"
1457
1458 int
1459 main (void)
1460 {
1461
1462   ;
1463   return 0;
1464 }
1465 _ACEOF
1466 ac_clean_files_save=$ac_clean_files
1467 ac_clean_files="$ac_clean_files a.out a.exe"
1468 # Try to create an executable without -o first, disregard a.out.
1469 # It will help us diagnose broken compilers, and finding out an intuition
1470 # of exeext.
1471 echo "$as_me:1471: checking for C compiler default output" >&5
1472 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1473 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1474 if { (eval echo "$as_me:1474: \"$ac_link_default\"") >&5
1475   (eval $ac_link_default) 2>&5
1476   ac_status=$?
1477   echo "$as_me:1477: \$? = $ac_status" >&5
1478   (exit $ac_status); }; then
1479   # Find the output, starting from the most likely.  This scheme is
1480 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1481 # resort.
1482 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1483                 ls a.out conftest 2>/dev/null;
1484                 ls a.* conftest.* 2>/dev/null`; do
1485   case $ac_file in
1486     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1487     a.out ) # We found the default executable, but exeext='' is most
1488             # certainly right.
1489             break;;
1490     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1491           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1492           export ac_cv_exeext
1493           break;;
1494     * ) break;;
1495   esac
1496 done
1497 else
1498   echo "$as_me: failed program was:" >&5
1499 cat conftest.$ac_ext >&5
1500 { { echo "$as_me:1500: error: C compiler cannot create executables" >&5
1501 echo "$as_me: error: C compiler cannot create executables" >&2;}
1502    { (exit 77); exit 77; }; }
1503 fi
1504
1505 ac_exeext=$ac_cv_exeext
1506 echo "$as_me:1506: result: $ac_file" >&5
1507 echo "${ECHO_T}$ac_file" >&6
1508
1509 # Check the compiler produces executables we can run.  If not, either
1510 # the compiler is broken, or we cross compile.
1511 echo "$as_me:1511: checking whether the C compiler works" >&5
1512 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1513 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1514 # If not cross compiling, check that we can run a simple program.
1515 if test "$cross_compiling" != yes; then
1516   if { ac_try='./$ac_file'
1517   { (eval echo "$as_me:1517: \"$ac_try\"") >&5
1518   (eval $ac_try) 2>&5
1519   ac_status=$?
1520   echo "$as_me:1520: \$? = $ac_status" >&5
1521   (exit $ac_status); }; }; then
1522     cross_compiling=no
1523   else
1524     if test "$cross_compiling" = maybe; then
1525         cross_compiling=yes
1526     else
1527         { { echo "$as_me:1527: error: cannot run C compiled programs.
1528 If you meant to cross compile, use \`--host'." >&5
1529 echo "$as_me: error: cannot run C compiled programs.
1530 If you meant to cross compile, use \`--host'." >&2;}
1531    { (exit 1); exit 1; }; }
1532     fi
1533   fi
1534 fi
1535 echo "$as_me:1535: result: yes" >&5
1536 echo "${ECHO_T}yes" >&6
1537
1538 rm -f a.out a.exe conftest$ac_cv_exeext
1539 ac_clean_files=$ac_clean_files_save
1540 # Check the compiler produces executables we can run.  If not, either
1541 # the compiler is broken, or we cross compile.
1542 echo "$as_me:1542: checking whether we are cross compiling" >&5
1543 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1544 echo "$as_me:1544: result: $cross_compiling" >&5
1545 echo "${ECHO_T}$cross_compiling" >&6
1546
1547 echo "$as_me:1547: checking for executable suffix" >&5
1548 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1549 if { (eval echo "$as_me:1549: \"$ac_link\"") >&5
1550   (eval $ac_link) 2>&5
1551   ac_status=$?
1552   echo "$as_me:1552: \$? = $ac_status" >&5
1553   (exit $ac_status); }; then
1554   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1555 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1556 # work properly (i.e., refer to `conftest.exe'), while it won't with
1557 # `rm'.
1558 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1559   case $ac_file in
1560     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1561     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1562           export ac_cv_exeext
1563           break;;
1564     * ) break;;
1565   esac
1566 done
1567 else
1568   { { echo "$as_me:1568: error: cannot compute EXEEXT: cannot compile and link" >&5
1569 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1570    { (exit 1); exit 1; }; }
1571 fi
1572
1573 rm -f conftest$ac_cv_exeext
1574 echo "$as_me:1574: result: $ac_cv_exeext" >&5
1575 echo "${ECHO_T}$ac_cv_exeext" >&6
1576
1577 rm -f conftest.$ac_ext
1578 EXEEXT=$ac_cv_exeext
1579 ac_exeext=$EXEEXT
1580 echo "$as_me:1580: checking for object suffix" >&5
1581 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1582 if test "${ac_cv_objext+set}" = set; then
1583   echo $ECHO_N "(cached) $ECHO_C" >&6
1584 else
1585   cat >conftest.$ac_ext <<_ACEOF
1586 #line 1586 "configure"
1587 #include "confdefs.h"
1588
1589 int
1590 main (void)
1591 {
1592
1593   ;
1594   return 0;
1595 }
1596 _ACEOF
1597 rm -f conftest.o conftest.obj
1598 if { (eval echo "$as_me:1598: \"$ac_compile\"") >&5
1599   (eval $ac_compile) 2>&5
1600   ac_status=$?
1601   echo "$as_me:1601: \$? = $ac_status" >&5
1602   (exit $ac_status); }; then
1603   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1604   case $ac_file in
1605     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1606     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1607        break;;
1608   esac
1609 done
1610 else
1611   echo "$as_me: failed program was:" >&5
1612 cat conftest.$ac_ext >&5
1613 { { echo "$as_me:1613: error: cannot compute OBJEXT: cannot compile" >&5
1614 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1615    { (exit 1); exit 1; }; }
1616 fi
1617
1618 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1619 fi
1620 echo "$as_me:1620: result: $ac_cv_objext" >&5
1621 echo "${ECHO_T}$ac_cv_objext" >&6
1622 OBJEXT=$ac_cv_objext
1623 ac_objext=$OBJEXT
1624 echo "$as_me:1624: checking whether we are using the GNU C compiler" >&5
1625 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1626 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1627   echo $ECHO_N "(cached) $ECHO_C" >&6
1628 else
1629   cat >conftest.$ac_ext <<_ACEOF
1630 #line 1630 "configure"
1631 #include "confdefs.h"
1632
1633 int
1634 main (void)
1635 {
1636 #ifndef __GNUC__
1637        choke me
1638 #endif
1639
1640   ;
1641   return 0;
1642 }
1643 _ACEOF
1644 rm -f conftest.$ac_objext
1645 if { (eval echo "$as_me:1645: \"$ac_compile\"") >&5
1646   (eval $ac_compile) 2>&5
1647   ac_status=$?
1648   echo "$as_me:1648: \$? = $ac_status" >&5
1649   (exit $ac_status); } &&
1650          { ac_try='test -s conftest.$ac_objext'
1651   { (eval echo "$as_me:1651: \"$ac_try\"") >&5
1652   (eval $ac_try) 2>&5
1653   ac_status=$?
1654   echo "$as_me:1654: \$? = $ac_status" >&5
1655   (exit $ac_status); }; }; then
1656   ac_compiler_gnu=yes
1657 else
1658   echo "$as_me: failed program was:" >&5
1659 cat conftest.$ac_ext >&5
1660 ac_compiler_gnu=no
1661 fi
1662 rm -f conftest.$ac_objext conftest.$ac_ext
1663 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1664
1665 fi
1666 echo "$as_me:1666: result: $ac_cv_c_compiler_gnu" >&5
1667 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1668 GCC=`test $ac_compiler_gnu = yes && echo yes`
1669 ac_test_CFLAGS=${CFLAGS+set}
1670 ac_save_CFLAGS=$CFLAGS
1671 CFLAGS="-g"
1672 echo "$as_me:1672: checking whether $CC accepts -g" >&5
1673 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1674 if test "${ac_cv_prog_cc_g+set}" = set; then
1675   echo $ECHO_N "(cached) $ECHO_C" >&6
1676 else
1677   cat >conftest.$ac_ext <<_ACEOF
1678 #line 1678 "configure"
1679 #include "confdefs.h"
1680
1681 int
1682 main (void)
1683 {
1684
1685   ;
1686   return 0;
1687 }
1688 _ACEOF
1689 rm -f conftest.$ac_objext
1690 if { (eval echo "$as_me:1690: \"$ac_compile\"") >&5
1691   (eval $ac_compile) 2>&5
1692   ac_status=$?
1693   echo "$as_me:1693: \$? = $ac_status" >&5
1694   (exit $ac_status); } &&
1695          { ac_try='test -s conftest.$ac_objext'
1696   { (eval echo "$as_me:1696: \"$ac_try\"") >&5
1697   (eval $ac_try) 2>&5
1698   ac_status=$?
1699   echo "$as_me:1699: \$? = $ac_status" >&5
1700   (exit $ac_status); }; }; then
1701   ac_cv_prog_cc_g=yes
1702 else
1703   echo "$as_me: failed program was:" >&5
1704 cat conftest.$ac_ext >&5
1705 ac_cv_prog_cc_g=no
1706 fi
1707 rm -f conftest.$ac_objext conftest.$ac_ext
1708 fi
1709 echo "$as_me:1709: result: $ac_cv_prog_cc_g" >&5
1710 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1711 if test "$ac_test_CFLAGS" = set; then
1712   CFLAGS=$ac_save_CFLAGS
1713 elif test $ac_cv_prog_cc_g = yes; then
1714   if test "$GCC" = yes; then
1715     CFLAGS="-g -O2"
1716   else
1717     CFLAGS="-g"
1718   fi
1719 else
1720   if test "$GCC" = yes; then
1721     CFLAGS="-O2"
1722   else
1723     CFLAGS=
1724   fi
1725 fi
1726 # Some people use a C++ compiler to compile C.  Since we use `exit',
1727 # in C++ we need to declare it.  In case someone uses the same compiler
1728 # for both compiling C and C++ we need to have the C++ compiler decide
1729 # the declaration of exit, since it's the most demanding environment.
1730 cat >conftest.$ac_ext <<_ACEOF
1731 #ifndef __cplusplus
1732   choke me
1733 #endif
1734 _ACEOF
1735 rm -f conftest.$ac_objext
1736 if { (eval echo "$as_me:1736: \"$ac_compile\"") >&5
1737   (eval $ac_compile) 2>&5
1738   ac_status=$?
1739   echo "$as_me:1739: \$? = $ac_status" >&5
1740   (exit $ac_status); } &&
1741          { ac_try='test -s conftest.$ac_objext'
1742   { (eval echo "$as_me:1742: \"$ac_try\"") >&5
1743   (eval $ac_try) 2>&5
1744   ac_status=$?
1745   echo "$as_me:1745: \$? = $ac_status" >&5
1746   (exit $ac_status); }; }; then
1747   for ac_declaration in \
1748    ''\
1749    '#include <stdlib.h>' \
1750    'extern "C" void std::exit (int) throw (); using std::exit;' \
1751    'extern "C" void std::exit (int); using std::exit;' \
1752    'extern "C" void exit (int) throw ();' \
1753    'extern "C" void exit (int);' \
1754    'void exit (int);'
1755 do
1756   cat >conftest.$ac_ext <<_ACEOF
1757 #line 1757 "configure"
1758 #include "confdefs.h"
1759 #include <stdlib.h>
1760 $ac_declaration
1761 int
1762 main (void)
1763 {
1764 exit (42);
1765   ;
1766   return 0;
1767 }
1768 _ACEOF
1769 rm -f conftest.$ac_objext
1770 if { (eval echo "$as_me:1770: \"$ac_compile\"") >&5
1771   (eval $ac_compile) 2>&5
1772   ac_status=$?
1773   echo "$as_me:1773: \$? = $ac_status" >&5
1774   (exit $ac_status); } &&
1775          { ac_try='test -s conftest.$ac_objext'
1776   { (eval echo "$as_me:1776: \"$ac_try\"") >&5
1777   (eval $ac_try) 2>&5
1778   ac_status=$?
1779   echo "$as_me:1779: \$? = $ac_status" >&5
1780   (exit $ac_status); }; }; then
1781   :
1782 else
1783   echo "$as_me: failed program was:" >&5
1784 cat conftest.$ac_ext >&5
1785 continue
1786 fi
1787 rm -f conftest.$ac_objext conftest.$ac_ext
1788   cat >conftest.$ac_ext <<_ACEOF
1789 #line 1789 "configure"
1790 #include "confdefs.h"
1791 $ac_declaration
1792 int
1793 main (void)
1794 {
1795 exit (42);
1796   ;
1797   return 0;
1798 }
1799 _ACEOF
1800 rm -f conftest.$ac_objext
1801 if { (eval echo "$as_me:1801: \"$ac_compile\"") >&5
1802   (eval $ac_compile) 2>&5
1803   ac_status=$?
1804   echo "$as_me:1804: \$? = $ac_status" >&5
1805   (exit $ac_status); } &&
1806          { ac_try='test -s conftest.$ac_objext'
1807   { (eval echo "$as_me:1807: \"$ac_try\"") >&5
1808   (eval $ac_try) 2>&5
1809   ac_status=$?
1810   echo "$as_me:1810: \$? = $ac_status" >&5
1811   (exit $ac_status); }; }; then
1812   break
1813 else
1814   echo "$as_me: failed program was:" >&5
1815 cat conftest.$ac_ext >&5
1816 fi
1817 rm -f conftest.$ac_objext conftest.$ac_ext
1818 done
1819 rm -rf conftest*
1820 if test -n "$ac_declaration"; then
1821   echo '#ifdef __cplusplus' >>confdefs.h
1822   echo $ac_declaration      >>confdefs.h
1823   echo '#endif'             >>confdefs.h
1824 fi
1825
1826 else
1827   echo "$as_me: failed program was:" >&5
1828 cat conftest.$ac_ext >&5
1829 fi
1830 rm -f conftest.$ac_objext conftest.$ac_ext
1831 ac_ext=c
1832 ac_cpp='$CPP $CPPFLAGS'
1833 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1834 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1835 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1836 ac_main_return=return
1837
1838 GCC_VERSION=none
1839 if test "$GCC" = yes ; then
1840         echo "$as_me:1840: checking version of $CC" >&5
1841 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
1842         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.].*//'`"
1843         test -z "$GCC_VERSION" && GCC_VERSION=unknown
1844         echo "$as_me:1844: result: $GCC_VERSION" >&5
1845 echo "${ECHO_T}$GCC_VERSION" >&6
1846 fi
1847
1848 echo "$as_me:1848: checking for $CC option to accept ANSI C" >&5
1849 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
1850 if test "${ac_cv_prog_cc_stdc+set}" = set; then
1851   echo $ECHO_N "(cached) $ECHO_C" >&6
1852 else
1853   ac_cv_prog_cc_stdc=no
1854 ac_save_CC=$CC
1855 cat >conftest.$ac_ext <<_ACEOF
1856 #line 1856 "configure"
1857 #include "confdefs.h"
1858 #include <stdarg.h>
1859 #include <stdio.h>
1860 #include <sys/types.h>
1861 #include <sys/stat.h>
1862 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
1863 struct buf { int x; };
1864 FILE * (*rcsopen) (struct buf *, struct stat *, int);
1865 static char *e (p, i)
1866      char **p;
1867      int i;
1868 {
1869   return p[i];
1870 }
1871 static char *f (char * (*g) (char **, int), char **p, ...)
1872 {
1873   char *s;
1874   va_list v;
1875   va_start (v,p);
1876   s = g (p, va_arg (v,int));
1877   va_end (v);
1878   return s;
1879 }
1880 int test (int i, double x);
1881 struct s1 {int (*f) (int a);};
1882 struct s2 {int (*f) (double a);};
1883 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
1884 int argc;
1885 char **argv;
1886 int
1887 main (void)
1888 {
1889 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
1890   ;
1891   return 0;
1892 }
1893 _ACEOF
1894 # Don't try gcc -ansi; that turns off useful extensions and
1895 # breaks some systems' header files.
1896 # AIX                   -qlanglvl=ansi
1897 # Ultrix and OSF/1      -std1
1898 # HP-UX 10.20 and later -Ae
1899 # HP-UX older versions  -Aa -D_HPUX_SOURCE
1900 # SVR4                  -Xc -D__EXTENSIONS__
1901 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
1902 do
1903   CC="$ac_save_CC $ac_arg"
1904   rm -f conftest.$ac_objext
1905 if { (eval echo "$as_me:1905: \"$ac_compile\"") >&5
1906   (eval $ac_compile) 2>&5
1907   ac_status=$?
1908   echo "$as_me:1908: \$? = $ac_status" >&5
1909   (exit $ac_status); } &&
1910          { ac_try='test -s conftest.$ac_objext'
1911   { (eval echo "$as_me:1911: \"$ac_try\"") >&5
1912   (eval $ac_try) 2>&5
1913   ac_status=$?
1914   echo "$as_me:1914: \$? = $ac_status" >&5
1915   (exit $ac_status); }; }; then
1916   ac_cv_prog_cc_stdc=$ac_arg
1917 break
1918 else
1919   echo "$as_me: failed program was:" >&5
1920 cat conftest.$ac_ext >&5
1921 fi
1922 rm -f conftest.$ac_objext
1923 done
1924 rm -f conftest.$ac_ext conftest.$ac_objext
1925 CC=$ac_save_CC
1926
1927 fi
1928
1929 case "x$ac_cv_prog_cc_stdc" in
1930   x|xno)
1931     echo "$as_me:1931: result: none needed" >&5
1932 echo "${ECHO_T}none needed" >&6 ;;
1933   *)
1934     echo "$as_me:1934: result: $ac_cv_prog_cc_stdc" >&5
1935 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
1936     CC="$CC $ac_cv_prog_cc_stdc" ;;
1937 esac
1938
1939 # This should have been defined by AC_PROG_CC
1940 : ${CC:=cc}
1941
1942 echo "$as_me:1942: checking \$CC variable" >&5
1943 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
1944 case "$CC" in
1945 (*[\ \  ]-*)
1946         echo "$as_me:1946: result: broken" >&5
1947 echo "${ECHO_T}broken" >&6
1948         { echo "$as_me:1948: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
1949 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
1950         # humor him...
1951         cf_prog=`echo "$CC" | sed -e 's/        / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'`
1952         cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(prog))); }'`
1953         CC="$cf_prog"
1954         for cf_arg in $cf_flags
1955         do
1956                 case "x$cf_arg" in
1957                 (x-[IUDfgOW]*)
1958
1959 cf_fix_cppflags=no
1960 cf_new_cflags=
1961 cf_new_cppflags=
1962 cf_new_extra_cppflags=
1963
1964 for cf_add_cflags in $cf_arg
1965 do
1966 case $cf_fix_cppflags in
1967 (no)
1968         case $cf_add_cflags in
1969         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
1970                 case $cf_add_cflags in
1971                 (-D*)
1972                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
1973
1974                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
1975                                 && test -z "${cf_tst_cflags}" \
1976                                 && cf_fix_cppflags=yes
1977
1978                         if test $cf_fix_cppflags = yes ; then
1979
1980         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1981         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1982
1983                                 continue
1984                         elif test "${cf_tst_cflags}" = "\"'" ; then
1985
1986         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
1987         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
1988
1989                                 continue
1990                         fi
1991                         ;;
1992                 esac
1993                 case "$CPPFLAGS" in
1994                 (*$cf_add_cflags)
1995                         ;;
1996                 (*)
1997                         case $cf_add_cflags in
1998                         (-D*)
1999                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2000
2001 CPPFLAGS=`echo "$CPPFLAGS" | \
2002         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2003                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2004
2005                                 ;;
2006                         esac
2007
2008         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
2009         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
2010
2011                         ;;
2012                 esac
2013                 ;;
2014         (*)
2015
2016         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
2017         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
2018
2019                 ;;
2020         esac
2021         ;;
2022 (yes)
2023
2024         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
2025         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
2026
2027         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2028
2029         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
2030                 && test -z "${cf_tst_cflags}" \
2031                 && cf_fix_cppflags=no
2032         ;;
2033 esac
2034 done
2035
2036 if test -n "$cf_new_cflags" ; then
2037
2038         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
2039         CFLAGS="${CFLAGS}$cf_new_cflags"
2040
2041 fi
2042
2043 if test -n "$cf_new_cppflags" ; then
2044
2045         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
2046         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
2047
2048 fi
2049
2050 if test -n "$cf_new_extra_cppflags" ; then
2051
2052         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
2053         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
2054
2055 fi
2056
2057                         ;;
2058                 (*)
2059                         CC="$CC $cf_arg"
2060                         ;;
2061                 esac
2062         done
2063         test -n "$verbose" && echo "    resulting CC: '$CC'" 1>&6
2064
2065 echo "${as_me:-configure}:2065: testing resulting CC: '$CC' ..." 1>&5
2066
2067         test -n "$verbose" && echo "    resulting CFLAGS: '$CFLAGS'" 1>&6
2068
2069 echo "${as_me:-configure}:2069: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5
2070
2071         test -n "$verbose" && echo "    resulting CPPFLAGS: '$CPPFLAGS'" 1>&6
2072
2073 echo "${as_me:-configure}:2073: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5
2074
2075         ;;
2076 (*)
2077         echo "$as_me:2077: result: ok" >&5
2078 echo "${ECHO_T}ok" >&6
2079         ;;
2080 esac
2081
2082 echo "$as_me:2082: checking for inline" >&5
2083 echo $ECHO_N "checking for inline... $ECHO_C" >&6
2084 if test "${ac_cv_c_inline+set}" = set; then
2085   echo $ECHO_N "(cached) $ECHO_C" >&6
2086 else
2087   ac_cv_c_inline=no
2088 for ac_kw in inline __inline__ __inline; do
2089   cat >conftest.$ac_ext <<_ACEOF
2090 #line 2090 "configure"
2091 #include "confdefs.h"
2092 #ifndef __cplusplus
2093 static $ac_kw int static_foo () {return 0; }
2094 $ac_kw int foo () {return 0; }
2095 #endif
2096
2097 _ACEOF
2098 rm -f conftest.$ac_objext
2099 if { (eval echo "$as_me:2099: \"$ac_compile\"") >&5
2100   (eval $ac_compile) 2>&5
2101   ac_status=$?
2102   echo "$as_me:2102: \$? = $ac_status" >&5
2103   (exit $ac_status); } &&
2104          { ac_try='test -s conftest.$ac_objext'
2105   { (eval echo "$as_me:2105: \"$ac_try\"") >&5
2106   (eval $ac_try) 2>&5
2107   ac_status=$?
2108   echo "$as_me:2108: \$? = $ac_status" >&5
2109   (exit $ac_status); }; }; then
2110   ac_cv_c_inline=$ac_kw; break
2111 else
2112   echo "$as_me: failed program was:" >&5
2113 cat conftest.$ac_ext >&5
2114 fi
2115 rm -f conftest.$ac_objext conftest.$ac_ext
2116 done
2117
2118 fi
2119 echo "$as_me:2119: result: $ac_cv_c_inline" >&5
2120 echo "${ECHO_T}$ac_cv_c_inline" >&6
2121 case $ac_cv_c_inline in
2122   inline | yes) ;;
2123   no)
2124 cat >>confdefs.h <<\EOF
2125 #define inline
2126 EOF
2127  ;;
2128   *)  cat >>confdefs.h <<EOF
2129 #define inline $ac_cv_c_inline
2130 EOF
2131  ;;
2132 esac
2133
2134 ac_ext=c
2135 ac_cpp='$CPP $CPPFLAGS'
2136 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2137 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2138 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2139 ac_main_return=return
2140 echo "$as_me:2140: checking how to run the C preprocessor" >&5
2141 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
2142 # On Suns, sometimes $CPP names a directory.
2143 if test -n "$CPP" && test -d "$CPP"; then
2144   CPP=
2145 fi
2146 if test -z "$CPP"; then
2147   if test "${ac_cv_prog_CPP+set}" = set; then
2148   echo $ECHO_N "(cached) $ECHO_C" >&6
2149 else
2150       # Double quotes because CPP needs to be expanded
2151     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
2152     do
2153       ac_preproc_ok=false
2154 for ac_c_preproc_warn_flag in '' yes
2155 do
2156   # Use a header file that comes with gcc, so configuring glibc
2157   # with a fresh cross-compiler works.
2158   # On the NeXT, cc -E runs the code through the compiler's parser,
2159   # not just through cpp. "Syntax error" is here to catch this case.
2160   cat >conftest.$ac_ext <<_ACEOF
2161 #line 2161 "configure"
2162 #include "confdefs.h"
2163 #include <assert.h>
2164                      Syntax error
2165 _ACEOF
2166 if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5
2167   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2168   ac_status=$?
2169   egrep -v '^ *\+' conftest.er1 >conftest.err
2170   rm -f conftest.er1
2171   cat conftest.err >&5
2172   echo "$as_me:2172: \$? = $ac_status" >&5
2173   (exit $ac_status); } >/dev/null; then
2174   if test -s conftest.err; then
2175     ac_cpp_err=$ac_c_preproc_warn_flag
2176   else
2177     ac_cpp_err=
2178   fi
2179 else
2180   ac_cpp_err=yes
2181 fi
2182 if test -z "$ac_cpp_err"; then
2183   :
2184 else
2185   echo "$as_me: failed program was:" >&5
2186   cat conftest.$ac_ext >&5
2187   # Broken: fails on valid input.
2188 continue
2189 fi
2190 rm -f conftest.err conftest.$ac_ext
2191
2192   # OK, works on sane cases.  Now check whether non-existent headers
2193   # can be detected and how.
2194   cat >conftest.$ac_ext <<_ACEOF
2195 #line 2195 "configure"
2196 #include "confdefs.h"
2197 #include <ac_nonexistent.h>
2198 _ACEOF
2199 if { (eval echo "$as_me:2199: \"$ac_cpp conftest.$ac_ext\"") >&5
2200   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2201   ac_status=$?
2202   egrep -v '^ *\+' conftest.er1 >conftest.err
2203   rm -f conftest.er1
2204   cat conftest.err >&5
2205   echo "$as_me:2205: \$? = $ac_status" >&5
2206   (exit $ac_status); } >/dev/null; then
2207   if test -s conftest.err; then
2208     ac_cpp_err=$ac_c_preproc_warn_flag
2209   else
2210     ac_cpp_err=
2211   fi
2212 else
2213   ac_cpp_err=yes
2214 fi
2215 if test -z "$ac_cpp_err"; then
2216   # Broken: success on invalid input.
2217 continue
2218 else
2219   echo "$as_me: failed program was:" >&5
2220   cat conftest.$ac_ext >&5
2221   # Passes both tests.
2222 ac_preproc_ok=:
2223 break
2224 fi
2225 rm -f conftest.err conftest.$ac_ext
2226
2227 done
2228 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2229 rm -f conftest.err conftest.$ac_ext
2230 if $ac_preproc_ok; then
2231   break
2232 fi
2233
2234     done
2235     ac_cv_prog_CPP=$CPP
2236
2237 fi
2238   CPP=$ac_cv_prog_CPP
2239 else
2240   ac_cv_prog_CPP=$CPP
2241 fi
2242 echo "$as_me:2242: result: $CPP" >&5
2243 echo "${ECHO_T}$CPP" >&6
2244 ac_preproc_ok=false
2245 for ac_c_preproc_warn_flag in '' yes
2246 do
2247   # Use a header file that comes with gcc, so configuring glibc
2248   # with a fresh cross-compiler works.
2249   # On the NeXT, cc -E runs the code through the compiler's parser,
2250   # not just through cpp. "Syntax error" is here to catch this case.
2251   cat >conftest.$ac_ext <<_ACEOF
2252 #line 2252 "configure"
2253 #include "confdefs.h"
2254 #include <assert.h>
2255                      Syntax error
2256 _ACEOF
2257 if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5
2258   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2259   ac_status=$?
2260   egrep -v '^ *\+' conftest.er1 >conftest.err
2261   rm -f conftest.er1
2262   cat conftest.err >&5
2263   echo "$as_me:2263: \$? = $ac_status" >&5
2264   (exit $ac_status); } >/dev/null; then
2265   if test -s conftest.err; then
2266     ac_cpp_err=$ac_c_preproc_warn_flag
2267   else
2268     ac_cpp_err=
2269   fi
2270 else
2271   ac_cpp_err=yes
2272 fi
2273 if test -z "$ac_cpp_err"; then
2274   :
2275 else
2276   echo "$as_me: failed program was:" >&5
2277   cat conftest.$ac_ext >&5
2278   # Broken: fails on valid input.
2279 continue
2280 fi
2281 rm -f conftest.err conftest.$ac_ext
2282
2283   # OK, works on sane cases.  Now check whether non-existent headers
2284   # can be detected and how.
2285   cat >conftest.$ac_ext <<_ACEOF
2286 #line 2286 "configure"
2287 #include "confdefs.h"
2288 #include <ac_nonexistent.h>
2289 _ACEOF
2290 if { (eval echo "$as_me:2290: \"$ac_cpp conftest.$ac_ext\"") >&5
2291   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
2292   ac_status=$?
2293   egrep -v '^ *\+' conftest.er1 >conftest.err
2294   rm -f conftest.er1
2295   cat conftest.err >&5
2296   echo "$as_me:2296: \$? = $ac_status" >&5
2297   (exit $ac_status); } >/dev/null; then
2298   if test -s conftest.err; then
2299     ac_cpp_err=$ac_c_preproc_warn_flag
2300   else
2301     ac_cpp_err=
2302   fi
2303 else
2304   ac_cpp_err=yes
2305 fi
2306 if test -z "$ac_cpp_err"; then
2307   # Broken: success on invalid input.
2308 continue
2309 else
2310   echo "$as_me: failed program was:" >&5
2311   cat conftest.$ac_ext >&5
2312   # Passes both tests.
2313 ac_preproc_ok=:
2314 break
2315 fi
2316 rm -f conftest.err conftest.$ac_ext
2317
2318 done
2319 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2320 rm -f conftest.err conftest.$ac_ext
2321 if $ac_preproc_ok; then
2322   :
2323 else
2324   { { echo "$as_me:2324: error: C preprocessor \"$CPP\" fails sanity check" >&5
2325 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2326    { (exit 1); exit 1; }; }
2327 fi
2328
2329 ac_ext=c
2330 ac_cpp='$CPP $CPPFLAGS'
2331 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2332 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2333 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2334 ac_main_return=return
2335
2336 for ac_prog in mawk gawk nawk awk
2337 do
2338   # Extract the first word of "$ac_prog", so it can be a program name with args.
2339 set dummy $ac_prog; ac_word=$2
2340 echo "$as_me:2340: checking for $ac_word" >&5
2341 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2342 if test "${ac_cv_prog_AWK+set}" = set; then
2343   echo $ECHO_N "(cached) $ECHO_C" >&6
2344 else
2345   if test -n "$AWK"; then
2346   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2347 else
2348   ac_save_IFS=$IFS; IFS=$ac_path_separator
2349 ac_dummy="$PATH"
2350 for ac_dir in $ac_dummy; do
2351   IFS=$ac_save_IFS
2352   test -z "$ac_dir" && ac_dir=.
2353   $as_executable_p "$ac_dir/$ac_word" || continue
2354 ac_cv_prog_AWK="$ac_prog"
2355 echo "$as_me:2355: found $ac_dir/$ac_word" >&5
2356 break
2357 done
2358
2359 fi
2360 fi
2361 AWK=$ac_cv_prog_AWK
2362 if test -n "$AWK"; then
2363   echo "$as_me:2363: result: $AWK" >&5
2364 echo "${ECHO_T}$AWK" >&6
2365 else
2366   echo "$as_me:2366: result: no" >&5
2367 echo "${ECHO_T}no" >&6
2368 fi
2369
2370   test -n "$AWK" && break
2371 done
2372
2373 # Find a good install program.  We prefer a C program (faster),
2374 # so one script is as good as another.  But avoid the broken or
2375 # incompatible versions:
2376 # SysV /etc/install, /usr/sbin/install
2377 # SunOS /usr/etc/install
2378 # IRIX /sbin/install
2379 # AIX /bin/install
2380 # AmigaOS /C/install, which installs bootblocks on floppy discs
2381 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2382 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2383 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2384 # ./install, which can be erroneously created by make from ./install.sh.
2385 echo "$as_me:2385: checking for a BSD compatible install" >&5
2386 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2387 if test -z "$INSTALL"; then
2388 if test "${ac_cv_path_install+set}" = set; then
2389   echo $ECHO_N "(cached) $ECHO_C" >&6
2390 else
2391     ac_save_IFS=$IFS; IFS=$ac_path_separator
2392   for ac_dir in $PATH; do
2393     IFS=$ac_save_IFS
2394     # Account for people who put trailing slashes in PATH elements.
2395     case $ac_dir/ in
2396     / | ./ | .// | /cC/* \
2397     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2398     | /usr/ucb/* ) ;;
2399     *)
2400       # OSF1 and SCO ODT 3.0 have their own names for install.
2401       # Don't use installbsd from OSF since it installs stuff as root
2402       # by default.
2403       for ac_prog in ginstall scoinst install; do
2404         if $as_executable_p "$ac_dir/$ac_prog"; then
2405           if test $ac_prog = install &&
2406             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2407             # AIX install.  It has an incompatible calling convention.
2408             :
2409           elif test $ac_prog = install &&
2410             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2411             # program-specific install script used by HP pwplus--don't use.
2412             :
2413           else
2414             ac_cv_path_install="$ac_dir/$ac_prog -c"
2415             break 2
2416           fi
2417         fi
2418       done
2419       ;;
2420     esac
2421   done
2422
2423 fi
2424   if test "${ac_cv_path_install+set}" = set; then
2425     INSTALL=$ac_cv_path_install
2426   else
2427     # As a last resort, use the slow shell script.  We don't cache a
2428     # path for INSTALL within a source directory, because that will
2429     # break other packages using the cache if that directory is
2430     # removed, or if the path is relative.
2431     INSTALL=$ac_install_sh
2432   fi
2433 fi
2434 echo "$as_me:2434: result: $INSTALL" >&5
2435 echo "${ECHO_T}$INSTALL" >&6
2436
2437 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2438 # It thinks the first close brace ends the variable substitution.
2439 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2440
2441 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2442
2443 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2444
2445 case $INSTALL in
2446 (/*)
2447         ;;
2448 (*)
2449         cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2450         test -z "$cf_dir" && cf_dir=.
2451         INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2452         ;;
2453 esac
2454
2455 echo "$as_me:2455: checking if you want to install stripped executables" >&5
2456 echo $ECHO_N "checking if you want to install stripped executables... $ECHO_C" >&6
2457
2458 # Check whether --enable-stripping or --disable-stripping was given.
2459 if test "${enable_stripping+set}" = set; then
2460   enableval="$enable_stripping"
2461   test "$enableval" != no && enableval=yes
2462         if test "$enableval" != "yes" ; then
2463     with_stripping=no
2464         else
2465                 with_stripping=yes
2466         fi
2467 else
2468   enableval=yes
2469         with_stripping=yes
2470
2471 fi;
2472 echo "$as_me:2472: result: $with_stripping" >&5
2473 echo "${ECHO_T}$with_stripping" >&6
2474
2475 if test "$with_stripping" = yes
2476 then
2477         INSTALL_OPT_S="-s"
2478 else
2479         INSTALL_OPT_S=
2480 fi
2481
2482 echo "$as_me:2482: checking if install needs to be told about ownership" >&5
2483 echo $ECHO_N "checking if install needs to be told about ownership... $ECHO_C" >&6
2484 case `$ac_config_guess` in
2485 (*minix)
2486         with_install_o=yes
2487         ;;
2488 (*)
2489         with_install_o=no
2490         ;;
2491 esac
2492
2493 echo "$as_me:2493: result: $with_install_o" >&5
2494 echo "${ECHO_T}$with_install_o" >&6
2495 if test "x$with_install_o" = xyes
2496 then
2497         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'`
2498 else
2499         INSTALL_OPT_O=
2500 fi
2501
2502 for ac_prog in lint cppcheck splint
2503 do
2504   # Extract the first word of "$ac_prog", so it can be a program name with args.
2505 set dummy $ac_prog; ac_word=$2
2506 echo "$as_me:2506: checking for $ac_word" >&5
2507 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2508 if test "${ac_cv_prog_LINT+set}" = set; then
2509   echo $ECHO_N "(cached) $ECHO_C" >&6
2510 else
2511   if test -n "$LINT"; then
2512   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2513 else
2514   ac_save_IFS=$IFS; IFS=$ac_path_separator
2515 ac_dummy="$PATH"
2516 for ac_dir in $ac_dummy; do
2517   IFS=$ac_save_IFS
2518   test -z "$ac_dir" && ac_dir=.
2519   $as_executable_p "$ac_dir/$ac_word" || continue
2520 ac_cv_prog_LINT="$ac_prog"
2521 echo "$as_me:2521: found $ac_dir/$ac_word" >&5
2522 break
2523 done
2524
2525 fi
2526 fi
2527 LINT=$ac_cv_prog_LINT
2528 if test -n "$LINT"; then
2529   echo "$as_me:2529: result: $LINT" >&5
2530 echo "${ECHO_T}$LINT" >&6
2531 else
2532   echo "$as_me:2532: result: no" >&5
2533 echo "${ECHO_T}no" >&6
2534 fi
2535
2536   test -n "$LINT" && break
2537 done
2538
2539 echo "$as_me:2539: checking if filesystem supports mixed-case filenames" >&5
2540 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2541 if test "${cf_cv_mixedcase+set}" = set; then
2542   echo $ECHO_N "(cached) $ECHO_C" >&6
2543 else
2544
2545 if test "$cross_compiling" = yes ; then
2546         case $target_alias in
2547         (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
2548                 cf_cv_mixedcase=no
2549                 ;;
2550         (*)
2551                 cf_cv_mixedcase=yes
2552                 ;;
2553         esac
2554 else
2555         rm -f conftest CONFTEST
2556         echo test >conftest
2557         if test -f CONFTEST ; then
2558                 cf_cv_mixedcase=no
2559         else
2560                 cf_cv_mixedcase=yes
2561         fi
2562         rm -f conftest CONFTEST
2563 fi
2564
2565 fi
2566 echo "$as_me:2566: result: $cf_cv_mixedcase" >&5
2567 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2568 test "$cf_cv_mixedcase" = yes &&
2569 cat >>confdefs.h <<\EOF
2570 #define MIXEDCASE_FILENAMES 1
2571 EOF
2572
2573 for ac_prog in exctags ctags
2574 do
2575   # Extract the first word of "$ac_prog", so it can be a program name with args.
2576 set dummy $ac_prog; ac_word=$2
2577 echo "$as_me:2577: checking for $ac_word" >&5
2578 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2579 if test "${ac_cv_prog_CTAGS+set}" = set; then
2580   echo $ECHO_N "(cached) $ECHO_C" >&6
2581 else
2582   if test -n "$CTAGS"; then
2583   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2584 else
2585   ac_save_IFS=$IFS; IFS=$ac_path_separator
2586 ac_dummy="$PATH"
2587 for ac_dir in $ac_dummy; do
2588   IFS=$ac_save_IFS
2589   test -z "$ac_dir" && ac_dir=.
2590   $as_executable_p "$ac_dir/$ac_word" || continue
2591 ac_cv_prog_CTAGS="$ac_prog"
2592 echo "$as_me:2592: found $ac_dir/$ac_word" >&5
2593 break
2594 done
2595
2596 fi
2597 fi
2598 CTAGS=$ac_cv_prog_CTAGS
2599 if test -n "$CTAGS"; then
2600   echo "$as_me:2600: result: $CTAGS" >&5
2601 echo "${ECHO_T}$CTAGS" >&6
2602 else
2603   echo "$as_me:2603: result: no" >&5
2604 echo "${ECHO_T}no" >&6
2605 fi
2606
2607   test -n "$CTAGS" && break
2608 done
2609
2610 for ac_prog in exetags etags
2611 do
2612   # Extract the first word of "$ac_prog", so it can be a program name with args.
2613 set dummy $ac_prog; ac_word=$2
2614 echo "$as_me:2614: checking for $ac_word" >&5
2615 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2616 if test "${ac_cv_prog_ETAGS+set}" = set; then
2617   echo $ECHO_N "(cached) $ECHO_C" >&6
2618 else
2619   if test -n "$ETAGS"; then
2620   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2621 else
2622   ac_save_IFS=$IFS; IFS=$ac_path_separator
2623 ac_dummy="$PATH"
2624 for ac_dir in $ac_dummy; do
2625   IFS=$ac_save_IFS
2626   test -z "$ac_dir" && ac_dir=.
2627   $as_executable_p "$ac_dir/$ac_word" || continue
2628 ac_cv_prog_ETAGS="$ac_prog"
2629 echo "$as_me:2629: found $ac_dir/$ac_word" >&5
2630 break
2631 done
2632
2633 fi
2634 fi
2635 ETAGS=$ac_cv_prog_ETAGS
2636 if test -n "$ETAGS"; then
2637   echo "$as_me:2637: result: $ETAGS" >&5
2638 echo "${ECHO_T}$ETAGS" >&6
2639 else
2640   echo "$as_me:2640: result: no" >&5
2641 echo "${ECHO_T}no" >&6
2642 fi
2643
2644   test -n "$ETAGS" && break
2645 done
2646
2647 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2648 set dummy ${CTAGS:-ctags}; ac_word=$2
2649 echo "$as_me:2649: checking for $ac_word" >&5
2650 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2651 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2652   echo $ECHO_N "(cached) $ECHO_C" >&6
2653 else
2654   if test -n "$MAKE_LOWER_TAGS"; then
2655   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2656 else
2657   ac_save_IFS=$IFS; IFS=$ac_path_separator
2658 ac_dummy="$PATH"
2659 for ac_dir in $ac_dummy; do
2660   IFS=$ac_save_IFS
2661   test -z "$ac_dir" && ac_dir=.
2662   $as_executable_p "$ac_dir/$ac_word" || continue
2663 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2664 echo "$as_me:2664: found $ac_dir/$ac_word" >&5
2665 break
2666 done
2667
2668   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2669 fi
2670 fi
2671 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2672 if test -n "$MAKE_LOWER_TAGS"; then
2673   echo "$as_me:2673: result: $MAKE_LOWER_TAGS" >&5
2674 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2675 else
2676   echo "$as_me:2676: result: no" >&5
2677 echo "${ECHO_T}no" >&6
2678 fi
2679
2680 if test "$cf_cv_mixedcase" = yes ; then
2681         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2682 set dummy ${ETAGS:-etags}; ac_word=$2
2683 echo "$as_me:2683: checking for $ac_word" >&5
2684 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2685 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2686   echo $ECHO_N "(cached) $ECHO_C" >&6
2687 else
2688   if test -n "$MAKE_UPPER_TAGS"; then
2689   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2690 else
2691   ac_save_IFS=$IFS; IFS=$ac_path_separator
2692 ac_dummy="$PATH"
2693 for ac_dir in $ac_dummy; do
2694   IFS=$ac_save_IFS
2695   test -z "$ac_dir" && ac_dir=.
2696   $as_executable_p "$ac_dir/$ac_word" || continue
2697 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2698 echo "$as_me:2698: found $ac_dir/$ac_word" >&5
2699 break
2700 done
2701
2702   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2703 fi
2704 fi
2705 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2706 if test -n "$MAKE_UPPER_TAGS"; then
2707   echo "$as_me:2707: result: $MAKE_UPPER_TAGS" >&5
2708 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2709 else
2710   echo "$as_me:2710: result: no" >&5
2711 echo "${ECHO_T}no" >&6
2712 fi
2713
2714 else
2715         MAKE_UPPER_TAGS=no
2716 fi
2717
2718 if test "$MAKE_UPPER_TAGS" = yes ; then
2719         MAKE_UPPER_TAGS=
2720 else
2721         MAKE_UPPER_TAGS="#"
2722 fi
2723
2724 if test "$MAKE_LOWER_TAGS" = yes ; then
2725         MAKE_LOWER_TAGS=
2726 else
2727         MAKE_LOWER_TAGS="#"
2728 fi
2729
2730 echo "$as_me:2730: checking if -lm needed for math functions" >&5
2731 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2732 if test "${cf_cv_need_libm+set}" = set; then
2733   echo $ECHO_N "(cached) $ECHO_C" >&6
2734 else
2735
2736         cat >conftest.$ac_ext <<_ACEOF
2737 #line 2737 "configure"
2738 #include "confdefs.h"
2739
2740         #include <stdio.h>
2741         #include <stdlib.h>
2742         #include <math.h>
2743
2744 int
2745 main (void)
2746 {
2747 double x = rand(); printf("result = %g\n", pow(sin(x),x))
2748   ;
2749   return 0;
2750 }
2751 _ACEOF
2752 rm -f conftest.$ac_objext conftest$ac_exeext
2753 if { (eval echo "$as_me:2753: \"$ac_link\"") >&5
2754   (eval $ac_link) 2>&5
2755   ac_status=$?
2756   echo "$as_me:2756: \$? = $ac_status" >&5
2757   (exit $ac_status); } &&
2758          { ac_try='test -s conftest$ac_exeext'
2759   { (eval echo "$as_me:2759: \"$ac_try\"") >&5
2760   (eval $ac_try) 2>&5
2761   ac_status=$?
2762   echo "$as_me:2762: \$? = $ac_status" >&5
2763   (exit $ac_status); }; }; then
2764   cf_cv_need_libm=no
2765 else
2766   echo "$as_me: failed program was:" >&5
2767 cat conftest.$ac_ext >&5
2768 cf_cv_need_libm=yes
2769 fi
2770 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2771 fi
2772 echo "$as_me:2772: result: $cf_cv_need_libm" >&5
2773 echo "${ECHO_T}$cf_cv_need_libm" >&6
2774 if test "$cf_cv_need_libm" = yes
2775 then
2776 MATH_LIB=-lm
2777 fi
2778
2779 top_builddir=`pwd`
2780
2781 CC_G_OPT="-g"
2782 CC_SHARED_OPTS=unknown
2783 CPPFLAGS="$CPPFLAGS"
2784 DFT_DEP_SUFFIX=""
2785 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2786 DFT_UPR_MODEL="NORMAL"
2787 LD="ld"
2788 LDFLAGS_SHARED=""
2789 LDFLAGS_STATIC=""
2790 LD_MODEL=""
2791 LD_SHARED_OPTS=""
2792 LIBTOOL=""
2793 LIBTOOL_OPTS=""
2794 LIB_CLEAN=""
2795 LIB_COMPILE=""
2796 LIB_LINK='${CC}'
2797 LINK_TESTS=""
2798 LOCAL_LDFLAGS=""
2799 PACKAGE="ncurses-examples"
2800 PTHREAD="-lm"
2801 TEST_ARGS=""
2802 TEST_DEPS=""
2803 TEST_LIBS=""
2804 TINFO_LDFLAGS=''
2805 TINFO_LIBS='$(LIBS_CURSES)'
2806 cf_cv_abi_version=""
2807 cf_cv_rel_version=""
2808 includesubdir=""
2809
2810 cf_cv_screen=curses
2811 cf_cv_libtype=
2812
2813 if test "$GCC" = yes
2814 then
2815 cat > conftest.i <<EOF
2816 #ifndef GCC_PRINTF
2817 #define GCC_PRINTF 0
2818 #endif
2819 #ifndef GCC_SCANF
2820 #define GCC_SCANF 0
2821 #endif
2822 #ifndef GCC_NORETURN
2823 #define GCC_NORETURN /* nothing */
2824 #endif
2825 #ifndef GCC_UNUSED
2826 #define GCC_UNUSED /* nothing */
2827 #endif
2828 EOF
2829 if test "$GCC" = yes
2830 then
2831         { echo "$as_me:2831: checking for $CC __attribute__ directives..." >&5
2832 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2833 cat > conftest.$ac_ext <<EOF
2834 #line 2834 "${as_me:-configure}"
2835 #include "confdefs.h"
2836 #include "conftest.h"
2837 #include "conftest.i"
2838 #if     GCC_PRINTF
2839 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2840 #else
2841 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2842 #endif
2843 #if     GCC_SCANF
2844 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2845 #else
2846 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2847 #endif
2848 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2849 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2850 extern void foo(void) GCC_NORETURN;
2851 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2852 EOF
2853         cf_printf_attribute=no
2854         cf_scanf_attribute=no
2855         for cf_attribute in scanf printf unused noreturn
2856         do
2857
2858 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2859
2860                 cf_directive="__attribute__(($cf_attribute))"
2861                 echo "checking for $CC $cf_directive" 1>&5
2862
2863                 case $cf_attribute in
2864                 (printf)
2865                         cf_printf_attribute=yes
2866                         cat >conftest.h <<EOF
2867 #define GCC_$cf_ATTRIBUTE 1
2868 EOF
2869                         ;;
2870                 (scanf)
2871                         cf_scanf_attribute=yes
2872                         cat >conftest.h <<EOF
2873 #define GCC_$cf_ATTRIBUTE 1
2874 EOF
2875                         ;;
2876                 (*)
2877                         cat >conftest.h <<EOF
2878 #define GCC_$cf_ATTRIBUTE $cf_directive
2879 EOF
2880                         ;;
2881                 esac
2882
2883                 if { (eval echo "$as_me:2883: \"$ac_compile\"") >&5
2884   (eval $ac_compile) 2>&5
2885   ac_status=$?
2886   echo "$as_me:2886: \$? = $ac_status" >&5
2887   (exit $ac_status); }; then
2888                         test -n "$verbose" && echo "$as_me:2888: result: ... $cf_attribute" >&5
2889 echo "${ECHO_T}... $cf_attribute" >&6
2890                         cat conftest.h >>confdefs.h
2891                         case $cf_attribute in
2892                         (noreturn)
2893
2894 cat >>confdefs.h <<EOF
2895 #define GCC_NORETURN $cf_directive
2896 EOF
2897
2898                                 ;;
2899                         (printf)
2900                                 cf_value='/* nothing */'
2901                                 if test "$cf_printf_attribute" != no ; then
2902                                         cf_value='__attribute__((format(printf,fmt,var)))'
2903
2904 cat >>confdefs.h <<\EOF
2905 #define GCC_PRINTF 1
2906 EOF
2907
2908                                 fi
2909
2910 cat >>confdefs.h <<EOF
2911 #define GCC_PRINTFLIKE(fmt,var) $cf_value
2912 EOF
2913
2914                                 ;;
2915                         (scanf)
2916                                 cf_value='/* nothing */'
2917                                 if test "$cf_scanf_attribute" != no ; then
2918                                         cf_value='__attribute__((format(scanf,fmt,var)))'
2919
2920 cat >>confdefs.h <<\EOF
2921 #define GCC_SCANF 1
2922 EOF
2923
2924                                 fi
2925
2926 cat >>confdefs.h <<EOF
2927 #define GCC_SCANFLIKE(fmt,var) $cf_value
2928 EOF
2929
2930                                 ;;
2931                         (unused)
2932
2933 cat >>confdefs.h <<EOF
2934 #define GCC_UNUSED $cf_directive
2935 EOF
2936
2937                                 ;;
2938                         esac
2939                 fi
2940         done
2941 else
2942         fgrep define conftest.i >>confdefs.h
2943 fi
2944 rm -rf conftest*
2945 fi
2946
2947 echo "$as_me:2947: checking if you want to work around bogus compiler/loader warnings" >&5
2948 echo $ECHO_N "checking if you want to work around bogus compiler/loader warnings... $ECHO_C" >&6
2949
2950 # Check whether --enable-string-hacks or --disable-string-hacks was given.
2951 if test "${enable_string_hacks+set}" = set; then
2952   enableval="$enable_string_hacks"
2953   with_string_hacks=$enableval
2954 else
2955   with_string_hacks=no
2956 fi;
2957 echo "$as_me:2957: result: $with_string_hacks" >&5
2958 echo "${ECHO_T}$with_string_hacks" >&6
2959
2960 if test "x$with_string_hacks" = "xyes"; then
2961
2962 cat >>confdefs.h <<\EOF
2963 #define USE_STRING_HACKS 1
2964 EOF
2965
2966         { echo "$as_me:2966: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&5
2967 echo "$as_me: WARNING: enabling string-hacks to work around bogus compiler/loader warnings" >&2;}
2968         echo "$as_me:2968: checking for strlcat" >&5
2969 echo $ECHO_N "checking for strlcat... $ECHO_C" >&6
2970 if test "${ac_cv_func_strlcat+set}" = set; then
2971   echo $ECHO_N "(cached) $ECHO_C" >&6
2972 else
2973   cat >conftest.$ac_ext <<_ACEOF
2974 #line 2974 "configure"
2975 #include "confdefs.h"
2976 /* System header to define __stub macros and hopefully few prototypes,
2977     which can conflict with char strlcat (); below.  */
2978 #include <assert.h>
2979 /* Override any gcc2 internal prototype to avoid an error.  */
2980 #ifdef __cplusplus
2981 extern "C"
2982 #endif
2983 /* We use char because int might match the return type of a gcc2
2984    builtin and then its argument prototype would still apply.  */
2985 char strlcat ();
2986 char (*f) ();
2987
2988 int
2989 main (void)
2990 {
2991 /* The GNU C library defines this for functions which it implements
2992     to always fail with ENOSYS.  Some functions are actually named
2993     something starting with __ and the normal name is an alias.  */
2994 #if defined (__stub_strlcat) || defined (__stub___strlcat)
2995 choke me
2996 #else
2997 f = strlcat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
2998 #endif
2999
3000   ;
3001   return 0;
3002 }
3003 _ACEOF
3004 rm -f conftest.$ac_objext conftest$ac_exeext
3005 if { (eval echo "$as_me:3005: \"$ac_link\"") >&5
3006   (eval $ac_link) 2>&5
3007   ac_status=$?
3008   echo "$as_me:3008: \$? = $ac_status" >&5
3009   (exit $ac_status); } &&
3010          { ac_try='test -s conftest$ac_exeext'
3011   { (eval echo "$as_me:3011: \"$ac_try\"") >&5
3012   (eval $ac_try) 2>&5
3013   ac_status=$?
3014   echo "$as_me:3014: \$? = $ac_status" >&5
3015   (exit $ac_status); }; }; then
3016   ac_cv_func_strlcat=yes
3017 else
3018   echo "$as_me: failed program was:" >&5
3019 cat conftest.$ac_ext >&5
3020 ac_cv_func_strlcat=no
3021 fi
3022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3023 fi
3024 echo "$as_me:3024: result: $ac_cv_func_strlcat" >&5
3025 echo "${ECHO_T}$ac_cv_func_strlcat" >&6
3026 if test $ac_cv_func_strlcat = yes; then
3027
3028 cat >>confdefs.h <<\EOF
3029 #define HAVE_STRLCAT 1
3030 EOF
3031
3032 else
3033
3034                 echo "$as_me:3034: checking for strlcat in -lbsd" >&5
3035 echo $ECHO_N "checking for strlcat in -lbsd... $ECHO_C" >&6
3036 if test "${ac_cv_lib_bsd_strlcat+set}" = set; then
3037   echo $ECHO_N "(cached) $ECHO_C" >&6
3038 else
3039   ac_check_lib_save_LIBS=$LIBS
3040 LIBS="-lbsd  $LIBS"
3041 cat >conftest.$ac_ext <<_ACEOF
3042 #line 3042 "configure"
3043 #include "confdefs.h"
3044
3045 /* Override any gcc2 internal prototype to avoid an error.  */
3046 #ifdef __cplusplus
3047 extern "C"
3048 #endif
3049 /* We use char because int might match the return type of a gcc2
3050    builtin and then its argument prototype would still apply.  */
3051 char strlcat ();
3052 int
3053 main (void)
3054 {
3055 strlcat ();
3056   ;
3057   return 0;
3058 }
3059 _ACEOF
3060 rm -f conftest.$ac_objext conftest$ac_exeext
3061 if { (eval echo "$as_me:3061: \"$ac_link\"") >&5
3062   (eval $ac_link) 2>&5
3063   ac_status=$?
3064   echo "$as_me:3064: \$? = $ac_status" >&5
3065   (exit $ac_status); } &&
3066          { ac_try='test -s conftest$ac_exeext'
3067   { (eval echo "$as_me:3067: \"$ac_try\"") >&5
3068   (eval $ac_try) 2>&5
3069   ac_status=$?
3070   echo "$as_me:3070: \$? = $ac_status" >&5
3071   (exit $ac_status); }; }; then
3072   ac_cv_lib_bsd_strlcat=yes
3073 else
3074   echo "$as_me: failed program was:" >&5
3075 cat conftest.$ac_ext >&5
3076 ac_cv_lib_bsd_strlcat=no
3077 fi
3078 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3079 LIBS=$ac_check_lib_save_LIBS
3080 fi
3081 echo "$as_me:3081: result: $ac_cv_lib_bsd_strlcat" >&5
3082 echo "${ECHO_T}$ac_cv_lib_bsd_strlcat" >&6
3083 if test $ac_cv_lib_bsd_strlcat = yes; then
3084
3085 cf_add_libs="-lbsd"
3086 # Filter out duplicates - this happens with badly-designed ".pc" files...
3087 for cf_add_1lib in $LIBS
3088 do
3089         for cf_add_2lib in $cf_add_libs
3090         do
3091                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
3092                 then
3093                         cf_add_1lib=
3094                         break
3095                 fi
3096         done
3097         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
3098 done
3099 LIBS="$cf_add_libs"
3100
3101 for ac_header in bsd/string.h
3102 do
3103 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
3104 echo "$as_me:3104: checking for $ac_header" >&5
3105 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
3106 if eval "test \"\${$as_ac_Header+set}\" = set"; then
3107   echo $ECHO_N "(cached) $ECHO_C" >&6
3108 else
3109   cat >conftest.$ac_ext <<_ACEOF
3110 #line 3110 "configure"
3111 #include "confdefs.h"
3112 #include <$ac_header>
3113 _ACEOF
3114 if { (eval echo "$as_me:3114: \"$ac_cpp conftest.$ac_ext\"") >&5
3115   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
3116   ac_status=$?
3117   egrep -v '^ *\+' conftest.er1 >conftest.err
3118   rm -f conftest.er1
3119   cat conftest.err >&5
3120   echo "$as_me:3120: \$? = $ac_status" >&5
3121   (exit $ac_status); } >/dev/null; then
3122   if test -s conftest.err; then
3123     ac_cpp_err=$ac_c_preproc_warn_flag
3124   else
3125     ac_cpp_err=
3126   fi
3127 else
3128   ac_cpp_err=yes
3129 fi
3130 if test -z "$ac_cpp_err"; then
3131   eval "$as_ac_Header=yes"
3132 else
3133   echo "$as_me: failed program was:" >&5
3134   cat conftest.$ac_ext >&5
3135   eval "$as_ac_Header=no"
3136 fi
3137 rm -f conftest.err conftest.$ac_ext
3138 fi
3139 echo "$as_me:3139: result: `eval echo '${'$as_ac_Header'}'`" >&5
3140 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
3141 if test `eval echo '${'$as_ac_Header'}'` = yes; then
3142   cat >>confdefs.h <<EOF
3143 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
3144 EOF
3145
3146 fi
3147 done
3148
3149 cat >>confdefs.h <<\EOF
3150 #define HAVE_STRLCAT 1
3151 EOF
3152
3153 fi
3154
3155 fi
3156
3157 for ac_func in strlcpy snprintf
3158 do
3159 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
3160 echo "$as_me:3160: checking for $ac_func" >&5
3161 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
3162 if eval "test \"\${$as_ac_var+set}\" = set"; then
3163   echo $ECHO_N "(cached) $ECHO_C" >&6
3164 else
3165   cat >conftest.$ac_ext <<_ACEOF
3166 #line 3166 "configure"
3167 #include "confdefs.h"
3168 /* System header to define __stub macros and hopefully few prototypes,
3169     which can conflict with char $ac_func (); below.  */
3170 #include <assert.h>
3171 /* Override any gcc2 internal prototype to avoid an error.  */
3172 #ifdef __cplusplus
3173 extern "C"
3174 #endif
3175 /* We use char because int might match the return type of a gcc2
3176    builtin and then its argument prototype would still apply.  */
3177 char $ac_func ();
3178 char (*f) ();
3179
3180 int
3181 main (void)
3182 {
3183 /* The GNU C library defines this for functions which it implements
3184     to always fail with ENOSYS.  Some functions are actually named
3185     something starting with __ and the normal name is an alias.  */
3186 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
3187 choke me
3188 #else
3189 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
3190 #endif
3191
3192   ;
3193   return 0;
3194 }
3195 _ACEOF
3196 rm -f conftest.$ac_objext conftest$ac_exeext
3197 if { (eval echo "$as_me:3197: \"$ac_link\"") >&5
3198   (eval $ac_link) 2>&5
3199   ac_status=$?
3200   echo "$as_me:3200: \$? = $ac_status" >&5
3201   (exit $ac_status); } &&
3202          { ac_try='test -s conftest$ac_exeext'
3203   { (eval echo "$as_me:3203: \"$ac_try\"") >&5
3204   (eval $ac_try) 2>&5
3205   ac_status=$?
3206   echo "$as_me:3206: \$? = $ac_status" >&5
3207   (exit $ac_status); }; }; then
3208   eval "$as_ac_var=yes"
3209 else
3210   echo "$as_me: failed program was:" >&5
3211 cat conftest.$ac_ext >&5
3212 eval "$as_ac_var=no"
3213 fi
3214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
3215 fi
3216 echo "$as_me:3216: result: `eval echo '${'$as_ac_var'}'`" >&5
3217 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
3218 if test `eval echo '${'$as_ac_var'}'` = yes; then
3219   cat >>confdefs.h <<EOF
3220 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
3221 EOF
3222
3223 fi
3224 done
3225
3226 fi
3227
3228 cf_XOPEN_SOURCE=600
3229 cf_POSIX_C_SOURCE=199506L
3230 cf_xopen_source=
3231
3232 case $host_os in
3233 (aix[4-7]*)
3234         cf_xopen_source="-D_ALL_SOURCE"
3235         ;;
3236 (msys)
3237         cf_XOPEN_SOURCE=600
3238         ;;
3239 (darwin[0-8].*)
3240         cf_xopen_source="-D_APPLE_C_SOURCE"
3241         ;;
3242 (darwin*)
3243         cf_xopen_source="-D_DARWIN_C_SOURCE"
3244         cf_XOPEN_SOURCE=
3245         ;;
3246 (freebsd*|dragonfly*)
3247         # 5.x headers associate
3248         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
3249         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
3250         cf_POSIX_C_SOURCE=200112L
3251         cf_XOPEN_SOURCE=600
3252         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3253         ;;
3254 (hpux11*)
3255         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
3256         ;;
3257 (hpux*)
3258         cf_xopen_source="-D_HPUX_SOURCE"
3259         ;;
3260 (irix[56].*)
3261         cf_xopen_source="-D_SGI_SOURCE"
3262         cf_XOPEN_SOURCE=
3263         ;;
3264 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
3265
3266 cf_gnu_xopen_source=$cf_XOPEN_SOURCE
3267
3268 echo "$as_me:3268: checking if this is the GNU C library" >&5
3269 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6
3270 if test "${cf_cv_gnu_library+set}" = set; then
3271   echo $ECHO_N "(cached) $ECHO_C" >&6
3272 else
3273
3274 cat >conftest.$ac_ext <<_ACEOF
3275 #line 3275 "configure"
3276 #include "confdefs.h"
3277 #include <sys/types.h>
3278 int
3279 main (void)
3280 {
3281
3282         #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
3283                 return 0;
3284         #else
3285         #       error not GNU C library
3286         #endif
3287   ;
3288   return 0;
3289 }
3290 _ACEOF
3291 rm -f conftest.$ac_objext
3292 if { (eval echo "$as_me:3292: \"$ac_compile\"") >&5
3293   (eval $ac_compile) 2>&5
3294   ac_status=$?
3295   echo "$as_me:3295: \$? = $ac_status" >&5
3296   (exit $ac_status); } &&
3297          { ac_try='test -s conftest.$ac_objext'
3298   { (eval echo "$as_me:3298: \"$ac_try\"") >&5
3299   (eval $ac_try) 2>&5
3300   ac_status=$?
3301   echo "$as_me:3301: \$? = $ac_status" >&5
3302   (exit $ac_status); }; }; then
3303   cf_cv_gnu_library=yes
3304 else
3305   echo "$as_me: failed program was:" >&5
3306 cat conftest.$ac_ext >&5
3307 cf_cv_gnu_library=no
3308 fi
3309 rm -f conftest.$ac_objext conftest.$ac_ext
3310
3311 fi
3312 echo "$as_me:3312: result: $cf_cv_gnu_library" >&5
3313 echo "${ECHO_T}$cf_cv_gnu_library" >&6
3314
3315 if test x$cf_cv_gnu_library = xyes; then
3316
3317         # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
3318         # was changed to help a little...
3319         echo "$as_me:3319: checking if _DEFAULT_SOURCE can be used as a basis" >&5
3320 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6
3321 if test "${cf_cv_gnu_library_219+set}" = set; then
3322   echo $ECHO_N "(cached) $ECHO_C" >&6
3323 else
3324
3325                 cf_save="$CPPFLAGS"
3326                 CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3327                 cat >conftest.$ac_ext <<_ACEOF
3328 #line 3328 "configure"
3329 #include "confdefs.h"
3330 #include <sys/types.h>
3331 int
3332 main (void)
3333 {
3334
3335                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3336                                 return 0;
3337                         #else
3338                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3339                         #endif
3340   ;
3341   return 0;
3342 }
3343 _ACEOF
3344 rm -f conftest.$ac_objext
3345 if { (eval echo "$as_me:3345: \"$ac_compile\"") >&5
3346   (eval $ac_compile) 2>&5
3347   ac_status=$?
3348   echo "$as_me:3348: \$? = $ac_status" >&5
3349   (exit $ac_status); } &&
3350          { ac_try='test -s conftest.$ac_objext'
3351   { (eval echo "$as_me:3351: \"$ac_try\"") >&5
3352   (eval $ac_try) 2>&5
3353   ac_status=$?
3354   echo "$as_me:3354: \$? = $ac_status" >&5
3355   (exit $ac_status); }; }; then
3356   cf_cv_gnu_library_219=yes
3357 else
3358   echo "$as_me: failed program was:" >&5
3359 cat conftest.$ac_ext >&5
3360 cf_cv_gnu_library_219=no
3361 fi
3362 rm -f conftest.$ac_objext conftest.$ac_ext
3363                 CPPFLAGS="$cf_save"
3364
3365 fi
3366 echo "$as_me:3366: result: $cf_cv_gnu_library_219" >&5
3367 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3368
3369         if test "x$cf_cv_gnu_library_219" = xyes; then
3370                 echo "$as_me:3370: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3371 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3372 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3373   echo $ECHO_N "(cached) $ECHO_C" >&6
3374 else
3375
3376                         cf_save="$CPPFLAGS"
3377                         CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source"
3378                         cat >conftest.$ac_ext <<_ACEOF
3379 #line 3379 "configure"
3380 #include "confdefs.h"
3381
3382                                 #include <limits.h>
3383                                 #include <sys/types.h>
3384
3385 int
3386 main (void)
3387 {
3388
3389                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3390                                         return 0;
3391                                 #else
3392                                 #       error GNU C library is too old
3393                                 #endif
3394   ;
3395   return 0;
3396 }
3397 _ACEOF
3398 rm -f conftest.$ac_objext
3399 if { (eval echo "$as_me:3399: \"$ac_compile\"") >&5
3400   (eval $ac_compile) 2>&5
3401   ac_status=$?
3402   echo "$as_me:3402: \$? = $ac_status" >&5
3403   (exit $ac_status); } &&
3404          { ac_try='test -s conftest.$ac_objext'
3405   { (eval echo "$as_me:3405: \"$ac_try\"") >&5
3406   (eval $ac_try) 2>&5
3407   ac_status=$?
3408   echo "$as_me:3408: \$? = $ac_status" >&5
3409   (exit $ac_status); }; }; then
3410   cf_cv_gnu_dftsrc_219=yes
3411 else
3412   echo "$as_me: failed program was:" >&5
3413 cat conftest.$ac_ext >&5
3414 cf_cv_gnu_dftsrc_219=no
3415 fi
3416 rm -f conftest.$ac_objext conftest.$ac_ext
3417
3418 fi
3419 echo "$as_me:3419: result: $cf_cv_gnu_dftsrc_219" >&5
3420 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3421                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3422         else
3423                 cf_cv_gnu_dftsrc_219=maybe
3424         fi
3425
3426         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3427
3428                 echo "$as_me:3428: checking if we must define _GNU_SOURCE" >&5
3429 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3430 if test "${cf_cv_gnu_source+set}" = set; then
3431   echo $ECHO_N "(cached) $ECHO_C" >&6
3432 else
3433
3434                 cat >conftest.$ac_ext <<_ACEOF
3435 #line 3435 "configure"
3436 #include "confdefs.h"
3437 #include <sys/types.h>
3438 int
3439 main (void)
3440 {
3441
3442                         #ifndef _XOPEN_SOURCE
3443                         #error  expected _XOPEN_SOURCE to be defined
3444                         #endif
3445   ;
3446   return 0;
3447 }
3448 _ACEOF
3449 rm -f conftest.$ac_objext
3450 if { (eval echo "$as_me:3450: \"$ac_compile\"") >&5
3451   (eval $ac_compile) 2>&5
3452   ac_status=$?
3453   echo "$as_me:3453: \$? = $ac_status" >&5
3454   (exit $ac_status); } &&
3455          { ac_try='test -s conftest.$ac_objext'
3456   { (eval echo "$as_me:3456: \"$ac_try\"") >&5
3457   (eval $ac_try) 2>&5
3458   ac_status=$?
3459   echo "$as_me:3459: \$? = $ac_status" >&5
3460   (exit $ac_status); }; }; then
3461   cf_cv_gnu_source=no
3462 else
3463   echo "$as_me: failed program was:" >&5
3464 cat conftest.$ac_ext >&5
3465 cf_save="$CPPFLAGS"
3466                          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3467                          cat >conftest.$ac_ext <<_ACEOF
3468 #line 3468 "configure"
3469 #include "confdefs.h"
3470 #include <sys/types.h>
3471 int
3472 main (void)
3473 {
3474
3475                                 #ifdef _XOPEN_SOURCE
3476                                 #error  expected _XOPEN_SOURCE to be undefined
3477                                 #endif
3478   ;
3479   return 0;
3480 }
3481 _ACEOF
3482 rm -f conftest.$ac_objext
3483 if { (eval echo "$as_me:3483: \"$ac_compile\"") >&5
3484   (eval $ac_compile) 2>&5
3485   ac_status=$?
3486   echo "$as_me:3486: \$? = $ac_status" >&5
3487   (exit $ac_status); } &&
3488          { ac_try='test -s conftest.$ac_objext'
3489   { (eval echo "$as_me:3489: \"$ac_try\"") >&5
3490   (eval $ac_try) 2>&5
3491   ac_status=$?
3492   echo "$as_me:3492: \$? = $ac_status" >&5
3493   (exit $ac_status); }; }; then
3494   cf_cv_gnu_source=no
3495 else
3496   echo "$as_me: failed program was:" >&5
3497 cat conftest.$ac_ext >&5
3498 cf_cv_gnu_source=yes
3499 fi
3500 rm -f conftest.$ac_objext conftest.$ac_ext
3501                         CPPFLAGS="$cf_save"
3502
3503 fi
3504 rm -f conftest.$ac_objext conftest.$ac_ext
3505
3506 fi
3507 echo "$as_me:3507: result: $cf_cv_gnu_source" >&5
3508 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3509
3510                 if test "$cf_cv_gnu_source" = yes
3511                 then
3512                 echo "$as_me:3512: checking if we should also define _DEFAULT_SOURCE" >&5
3513 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3514 if test "${cf_cv_default_source+set}" = set; then
3515   echo $ECHO_N "(cached) $ECHO_C" >&6
3516 else
3517
3518                         CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3519                         cat >conftest.$ac_ext <<_ACEOF
3520 #line 3520 "configure"
3521 #include "confdefs.h"
3522 #include <sys/types.h>
3523 int
3524 main (void)
3525 {
3526
3527                                 #ifdef _DEFAULT_SOURCE
3528                                 #error  expected _DEFAULT_SOURCE to be undefined
3529                                 #endif
3530   ;
3531   return 0;
3532 }
3533 _ACEOF
3534 rm -f conftest.$ac_objext
3535 if { (eval echo "$as_me:3535: \"$ac_compile\"") >&5
3536   (eval $ac_compile) 2>&5
3537   ac_status=$?
3538   echo "$as_me:3538: \$? = $ac_status" >&5
3539   (exit $ac_status); } &&
3540          { ac_try='test -s conftest.$ac_objext'
3541   { (eval echo "$as_me:3541: \"$ac_try\"") >&5
3542   (eval $ac_try) 2>&5
3543   ac_status=$?
3544   echo "$as_me:3544: \$? = $ac_status" >&5
3545   (exit $ac_status); }; }; then
3546   cf_cv_default_source=no
3547 else
3548   echo "$as_me: failed program was:" >&5
3549 cat conftest.$ac_ext >&5
3550 cf_cv_default_source=yes
3551 fi
3552 rm -f conftest.$ac_objext conftest.$ac_ext
3553
3554 fi
3555 echo "$as_me:3555: result: $cf_cv_default_source" >&5
3556 echo "${ECHO_T}$cf_cv_default_source" >&6
3557                         test "$cf_cv_default_source" = yes && CPPFLAGS="$CPPFLAGS -D_DEFAULT_SOURCE"
3558                 fi
3559         fi
3560
3561 fi
3562
3563         ;;
3564 (minix*)
3565         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3566         ;;
3567 (mirbsd*)
3568         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3569         cf_XOPEN_SOURCE=
3570
3571 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3572
3573 cf_save_CFLAGS="$CFLAGS"
3574 cf_save_CPPFLAGS="$CPPFLAGS"
3575
3576 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3577         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3578                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3579
3580 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3581         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3582                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3583
3584 echo "$as_me:3584: checking if we should define _POSIX_C_SOURCE" >&5
3585 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3586 if test "${cf_cv_posix_c_source+set}" = set; then
3587   echo $ECHO_N "(cached) $ECHO_C" >&6
3588 else
3589
3590 echo "${as_me:-configure}:3590: testing if the symbol is already defined go no further ..." 1>&5
3591
3592         cat >conftest.$ac_ext <<_ACEOF
3593 #line 3593 "configure"
3594 #include "confdefs.h"
3595 #include <sys/types.h>
3596 int
3597 main (void)
3598 {
3599
3600 #ifndef _POSIX_C_SOURCE
3601 make an error
3602 #endif
3603   ;
3604   return 0;
3605 }
3606 _ACEOF
3607 rm -f conftest.$ac_objext
3608 if { (eval echo "$as_me:3608: \"$ac_compile\"") >&5
3609   (eval $ac_compile) 2>&5
3610   ac_status=$?
3611   echo "$as_me:3611: \$? = $ac_status" >&5
3612   (exit $ac_status); } &&
3613          { ac_try='test -s conftest.$ac_objext'
3614   { (eval echo "$as_me:3614: \"$ac_try\"") >&5
3615   (eval $ac_try) 2>&5
3616   ac_status=$?
3617   echo "$as_me:3617: \$? = $ac_status" >&5
3618   (exit $ac_status); }; }; then
3619   cf_cv_posix_c_source=no
3620 else
3621   echo "$as_me: failed program was:" >&5
3622 cat conftest.$ac_ext >&5
3623 cf_want_posix_source=no
3624          case .$cf_POSIX_C_SOURCE in
3625          (.[12]??*)
3626                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3627                 ;;
3628          (.2)
3629                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3630                 cf_want_posix_source=yes
3631                 ;;
3632          (.*)
3633                 cf_want_posix_source=yes
3634                 ;;
3635          esac
3636          if test "$cf_want_posix_source" = yes ; then
3637                 cat >conftest.$ac_ext <<_ACEOF
3638 #line 3638 "configure"
3639 #include "confdefs.h"
3640 #include <sys/types.h>
3641 int
3642 main (void)
3643 {
3644
3645 #ifdef _POSIX_SOURCE
3646 make an error
3647 #endif
3648   ;
3649   return 0;
3650 }
3651 _ACEOF
3652 rm -f conftest.$ac_objext
3653 if { (eval echo "$as_me:3653: \"$ac_compile\"") >&5
3654   (eval $ac_compile) 2>&5
3655   ac_status=$?
3656   echo "$as_me:3656: \$? = $ac_status" >&5
3657   (exit $ac_status); } &&
3658          { ac_try='test -s conftest.$ac_objext'
3659   { (eval echo "$as_me:3659: \"$ac_try\"") >&5
3660   (eval $ac_try) 2>&5
3661   ac_status=$?
3662   echo "$as_me:3662: \$? = $ac_status" >&5
3663   (exit $ac_status); }; }; then
3664   :
3665 else
3666   echo "$as_me: failed program was:" >&5
3667 cat conftest.$ac_ext >&5
3668 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3669 fi
3670 rm -f conftest.$ac_objext conftest.$ac_ext
3671          fi
3672
3673 echo "${as_me:-configure}:3673: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3674
3675          CFLAGS="$cf_trim_CFLAGS"
3676          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3677
3678 echo "${as_me:-configure}:3678: testing if the second compile does not leave our definition intact error ..." 1>&5
3679
3680          cat >conftest.$ac_ext <<_ACEOF
3681 #line 3681 "configure"
3682 #include "confdefs.h"
3683 #include <sys/types.h>
3684 int
3685 main (void)
3686 {
3687
3688 #ifndef _POSIX_C_SOURCE
3689 make an error
3690 #endif
3691   ;
3692   return 0;
3693 }
3694 _ACEOF
3695 rm -f conftest.$ac_objext
3696 if { (eval echo "$as_me:3696: \"$ac_compile\"") >&5
3697   (eval $ac_compile) 2>&5
3698   ac_status=$?
3699   echo "$as_me:3699: \$? = $ac_status" >&5
3700   (exit $ac_status); } &&
3701          { ac_try='test -s conftest.$ac_objext'
3702   { (eval echo "$as_me:3702: \"$ac_try\"") >&5
3703   (eval $ac_try) 2>&5
3704   ac_status=$?
3705   echo "$as_me:3705: \$? = $ac_status" >&5
3706   (exit $ac_status); }; }; then
3707   :
3708 else
3709   echo "$as_me: failed program was:" >&5
3710 cat conftest.$ac_ext >&5
3711 cf_cv_posix_c_source=no
3712 fi
3713 rm -f conftest.$ac_objext conftest.$ac_ext
3714          CFLAGS="$cf_save_CFLAGS"
3715          CPPFLAGS="$cf_save_CPPFLAGS"
3716
3717 fi
3718 rm -f conftest.$ac_objext conftest.$ac_ext
3719
3720 fi
3721 echo "$as_me:3721: result: $cf_cv_posix_c_source" >&5
3722 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3723
3724 if test "$cf_cv_posix_c_source" != no ; then
3725         CFLAGS="$cf_trim_CFLAGS"
3726         CPPFLAGS="$cf_trim_CPPFLAGS"
3727
3728 cf_fix_cppflags=no
3729 cf_new_cflags=
3730 cf_new_cppflags=
3731 cf_new_extra_cppflags=
3732
3733 for cf_add_cflags in $cf_cv_posix_c_source
3734 do
3735 case $cf_fix_cppflags in
3736 (no)
3737         case $cf_add_cflags in
3738         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3739                 case $cf_add_cflags in
3740                 (-D*)
3741                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3742
3743                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3744                                 && test -z "${cf_tst_cflags}" \
3745                                 && cf_fix_cppflags=yes
3746
3747                         if test $cf_fix_cppflags = yes ; then
3748
3749         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3750         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3751
3752                                 continue
3753                         elif test "${cf_tst_cflags}" = "\"'" ; then
3754
3755         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3756         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3757
3758                                 continue
3759                         fi
3760                         ;;
3761                 esac
3762                 case "$CPPFLAGS" in
3763                 (*$cf_add_cflags)
3764                         ;;
3765                 (*)
3766                         case $cf_add_cflags in
3767                         (-D*)
3768                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3769
3770 CPPFLAGS=`echo "$CPPFLAGS" | \
3771         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3772                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3773
3774                                 ;;
3775                         esac
3776
3777         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3778         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3779
3780                         ;;
3781                 esac
3782                 ;;
3783         (*)
3784
3785         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3786         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3787
3788                 ;;
3789         esac
3790         ;;
3791 (yes)
3792
3793         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3794         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3795
3796         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3797
3798         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3799                 && test -z "${cf_tst_cflags}" \
3800                 && cf_fix_cppflags=no
3801         ;;
3802 esac
3803 done
3804
3805 if test -n "$cf_new_cflags" ; then
3806
3807         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3808         CFLAGS="${CFLAGS}$cf_new_cflags"
3809
3810 fi
3811
3812 if test -n "$cf_new_cppflags" ; then
3813
3814         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3815         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3816
3817 fi
3818
3819 if test -n "$cf_new_extra_cppflags" ; then
3820
3821         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3822         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3823
3824 fi
3825
3826 fi
3827
3828         ;;
3829 (netbsd*)
3830         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3831         ;;
3832 (openbsd[4-9]*)
3833         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3834         cf_xopen_source="-D_BSD_SOURCE"
3835         cf_XOPEN_SOURCE=600
3836         ;;
3837 (openbsd*)
3838         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3839         ;;
3840 (osf[45]*)
3841         cf_xopen_source="-D_OSF_SOURCE"
3842         ;;
3843 (nto-qnx*)
3844         cf_xopen_source="-D_QNX_SOURCE"
3845         ;;
3846 (sco*)
3847         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3848         ;;
3849 (solaris2.*)
3850         cf_xopen_source="-D__EXTENSIONS__"
3851         cf_cv_xopen_source=broken
3852         ;;
3853 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
3854         cf_XOPEN_SOURCE=
3855         cf_POSIX_C_SOURCE=
3856         ;;
3857 (*)
3858
3859 echo "$as_me:3859: checking if we should define _XOPEN_SOURCE" >&5
3860 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3861 if test "${cf_cv_xopen_source+set}" = set; then
3862   echo $ECHO_N "(cached) $ECHO_C" >&6
3863 else
3864
3865         cat >conftest.$ac_ext <<_ACEOF
3866 #line 3866 "configure"
3867 #include "confdefs.h"
3868
3869 #include <stdlib.h>
3870 #include <string.h>
3871 #include <sys/types.h>
3872
3873 int
3874 main (void)
3875 {
3876
3877 #ifndef _XOPEN_SOURCE
3878 make an error
3879 #endif
3880   ;
3881   return 0;
3882 }
3883 _ACEOF
3884 rm -f conftest.$ac_objext
3885 if { (eval echo "$as_me:3885: \"$ac_compile\"") >&5
3886   (eval $ac_compile) 2>&5
3887   ac_status=$?
3888   echo "$as_me:3888: \$? = $ac_status" >&5
3889   (exit $ac_status); } &&
3890          { ac_try='test -s conftest.$ac_objext'
3891   { (eval echo "$as_me:3891: \"$ac_try\"") >&5
3892   (eval $ac_try) 2>&5
3893   ac_status=$?
3894   echo "$as_me:3894: \$? = $ac_status" >&5
3895   (exit $ac_status); }; }; then
3896   cf_cv_xopen_source=no
3897 else
3898   echo "$as_me: failed program was:" >&5
3899 cat conftest.$ac_ext >&5
3900 cf_save="$CPPFLAGS"
3901          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3902          cat >conftest.$ac_ext <<_ACEOF
3903 #line 3903 "configure"
3904 #include "confdefs.h"
3905
3906 #include <stdlib.h>
3907 #include <string.h>
3908 #include <sys/types.h>
3909
3910 int
3911 main (void)
3912 {
3913
3914 #ifdef _XOPEN_SOURCE
3915 make an error
3916 #endif
3917   ;
3918   return 0;
3919 }
3920 _ACEOF
3921 rm -f conftest.$ac_objext
3922 if { (eval echo "$as_me:3922: \"$ac_compile\"") >&5
3923   (eval $ac_compile) 2>&5
3924   ac_status=$?
3925   echo "$as_me:3925: \$? = $ac_status" >&5
3926   (exit $ac_status); } &&
3927          { ac_try='test -s conftest.$ac_objext'
3928   { (eval echo "$as_me:3928: \"$ac_try\"") >&5
3929   (eval $ac_try) 2>&5
3930   ac_status=$?
3931   echo "$as_me:3931: \$? = $ac_status" >&5
3932   (exit $ac_status); }; }; then
3933   cf_cv_xopen_source=no
3934 else
3935   echo "$as_me: failed program was:" >&5
3936 cat conftest.$ac_ext >&5
3937 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3938 fi
3939 rm -f conftest.$ac_objext conftest.$ac_ext
3940         CPPFLAGS="$cf_save"
3941
3942 fi
3943 rm -f conftest.$ac_objext conftest.$ac_ext
3944
3945 fi
3946 echo "$as_me:3946: result: $cf_cv_xopen_source" >&5
3947 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3948
3949 if test "$cf_cv_xopen_source" != no ; then
3950
3951 CFLAGS=`echo "$CFLAGS" | \
3952         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3953                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3954
3955 CPPFLAGS=`echo "$CPPFLAGS" | \
3956         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3957                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3958
3959         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3960
3961 cf_fix_cppflags=no
3962 cf_new_cflags=
3963 cf_new_cppflags=
3964 cf_new_extra_cppflags=
3965
3966 for cf_add_cflags in $cf_temp_xopen_source
3967 do
3968 case $cf_fix_cppflags in
3969 (no)
3970         case $cf_add_cflags in
3971         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3972                 case $cf_add_cflags in
3973                 (-D*)
3974                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3975
3976                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3977                                 && test -z "${cf_tst_cflags}" \
3978                                 && cf_fix_cppflags=yes
3979
3980                         if test $cf_fix_cppflags = yes ; then
3981
3982         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3983         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3984
3985                                 continue
3986                         elif test "${cf_tst_cflags}" = "\"'" ; then
3987
3988         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3989         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3990
3991                                 continue
3992                         fi
3993                         ;;
3994                 esac
3995                 case "$CPPFLAGS" in
3996                 (*$cf_add_cflags)
3997                         ;;
3998                 (*)
3999                         case $cf_add_cflags in
4000                         (-D*)
4001                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4002
4003 CPPFLAGS=`echo "$CPPFLAGS" | \
4004         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4005                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4006
4007                                 ;;
4008                         esac
4009
4010         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4011         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4012
4013                         ;;
4014                 esac
4015                 ;;
4016         (*)
4017
4018         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4019         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4020
4021                 ;;
4022         esac
4023         ;;
4024 (yes)
4025
4026         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4027         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4028
4029         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4030
4031         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4032                 && test -z "${cf_tst_cflags}" \
4033                 && cf_fix_cppflags=no
4034         ;;
4035 esac
4036 done
4037
4038 if test -n "$cf_new_cflags" ; then
4039
4040         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4041         CFLAGS="${CFLAGS}$cf_new_cflags"
4042
4043 fi
4044
4045 if test -n "$cf_new_cppflags" ; then
4046
4047         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4048         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4049
4050 fi
4051
4052 if test -n "$cf_new_extra_cppflags" ; then
4053
4054         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4055         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4056
4057 fi
4058
4059 fi
4060
4061 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4062
4063 cf_save_CFLAGS="$CFLAGS"
4064 cf_save_CPPFLAGS="$CPPFLAGS"
4065
4066 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4067         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4068                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4069
4070 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4071         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4072                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4073
4074 echo "$as_me:4074: checking if we should define _POSIX_C_SOURCE" >&5
4075 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4076 if test "${cf_cv_posix_c_source+set}" = set; then
4077   echo $ECHO_N "(cached) $ECHO_C" >&6
4078 else
4079
4080 echo "${as_me:-configure}:4080: testing if the symbol is already defined go no further ..." 1>&5
4081
4082         cat >conftest.$ac_ext <<_ACEOF
4083 #line 4083 "configure"
4084 #include "confdefs.h"
4085 #include <sys/types.h>
4086 int
4087 main (void)
4088 {
4089
4090 #ifndef _POSIX_C_SOURCE
4091 make an error
4092 #endif
4093   ;
4094   return 0;
4095 }
4096 _ACEOF
4097 rm -f conftest.$ac_objext
4098 if { (eval echo "$as_me:4098: \"$ac_compile\"") >&5
4099   (eval $ac_compile) 2>&5
4100   ac_status=$?
4101   echo "$as_me:4101: \$? = $ac_status" >&5
4102   (exit $ac_status); } &&
4103          { ac_try='test -s conftest.$ac_objext'
4104   { (eval echo "$as_me:4104: \"$ac_try\"") >&5
4105   (eval $ac_try) 2>&5
4106   ac_status=$?
4107   echo "$as_me:4107: \$? = $ac_status" >&5
4108   (exit $ac_status); }; }; then
4109   cf_cv_posix_c_source=no
4110 else
4111   echo "$as_me: failed program was:" >&5
4112 cat conftest.$ac_ext >&5
4113 cf_want_posix_source=no
4114          case .$cf_POSIX_C_SOURCE in
4115          (.[12]??*)
4116                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4117                 ;;
4118          (.2)
4119                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4120                 cf_want_posix_source=yes
4121                 ;;
4122          (.*)
4123                 cf_want_posix_source=yes
4124                 ;;
4125          esac
4126          if test "$cf_want_posix_source" = yes ; then
4127                 cat >conftest.$ac_ext <<_ACEOF
4128 #line 4128 "configure"
4129 #include "confdefs.h"
4130 #include <sys/types.h>
4131 int
4132 main (void)
4133 {
4134
4135 #ifdef _POSIX_SOURCE
4136 make an error
4137 #endif
4138   ;
4139   return 0;
4140 }
4141 _ACEOF
4142 rm -f conftest.$ac_objext
4143 if { (eval echo "$as_me:4143: \"$ac_compile\"") >&5
4144   (eval $ac_compile) 2>&5
4145   ac_status=$?
4146   echo "$as_me:4146: \$? = $ac_status" >&5
4147   (exit $ac_status); } &&
4148          { ac_try='test -s conftest.$ac_objext'
4149   { (eval echo "$as_me:4149: \"$ac_try\"") >&5
4150   (eval $ac_try) 2>&5
4151   ac_status=$?
4152   echo "$as_me:4152: \$? = $ac_status" >&5
4153   (exit $ac_status); }; }; then
4154   :
4155 else
4156   echo "$as_me: failed program was:" >&5
4157 cat conftest.$ac_ext >&5
4158 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4159 fi
4160 rm -f conftest.$ac_objext conftest.$ac_ext
4161          fi
4162
4163 echo "${as_me:-configure}:4163: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4164
4165          CFLAGS="$cf_trim_CFLAGS"
4166          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
4167
4168 echo "${as_me:-configure}:4168: testing if the second compile does not leave our definition intact error ..." 1>&5
4169
4170          cat >conftest.$ac_ext <<_ACEOF
4171 #line 4171 "configure"
4172 #include "confdefs.h"
4173 #include <sys/types.h>
4174 int
4175 main (void)
4176 {
4177
4178 #ifndef _POSIX_C_SOURCE
4179 make an error
4180 #endif
4181   ;
4182   return 0;
4183 }
4184 _ACEOF
4185 rm -f conftest.$ac_objext
4186 if { (eval echo "$as_me:4186: \"$ac_compile\"") >&5
4187   (eval $ac_compile) 2>&5
4188   ac_status=$?
4189   echo "$as_me:4189: \$? = $ac_status" >&5
4190   (exit $ac_status); } &&
4191          { ac_try='test -s conftest.$ac_objext'
4192   { (eval echo "$as_me:4192: \"$ac_try\"") >&5
4193   (eval $ac_try) 2>&5
4194   ac_status=$?
4195   echo "$as_me:4195: \$? = $ac_status" >&5
4196   (exit $ac_status); }; }; then
4197   :
4198 else
4199   echo "$as_me: failed program was:" >&5
4200 cat conftest.$ac_ext >&5
4201 cf_cv_posix_c_source=no
4202 fi
4203 rm -f conftest.$ac_objext conftest.$ac_ext
4204          CFLAGS="$cf_save_CFLAGS"
4205          CPPFLAGS="$cf_save_CPPFLAGS"
4206
4207 fi
4208 rm -f conftest.$ac_objext conftest.$ac_ext
4209
4210 fi
4211 echo "$as_me:4211: result: $cf_cv_posix_c_source" >&5
4212 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4213
4214 if test "$cf_cv_posix_c_source" != no ; then
4215         CFLAGS="$cf_trim_CFLAGS"
4216         CPPFLAGS="$cf_trim_CPPFLAGS"
4217
4218 cf_fix_cppflags=no
4219 cf_new_cflags=
4220 cf_new_cppflags=
4221 cf_new_extra_cppflags=
4222
4223 for cf_add_cflags in $cf_cv_posix_c_source
4224 do
4225 case $cf_fix_cppflags in
4226 (no)
4227         case $cf_add_cflags in
4228         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4229                 case $cf_add_cflags in
4230                 (-D*)
4231                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4232
4233                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4234                                 && test -z "${cf_tst_cflags}" \
4235                                 && cf_fix_cppflags=yes
4236
4237                         if test $cf_fix_cppflags = yes ; then
4238
4239         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4240         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4241
4242                                 continue
4243                         elif test "${cf_tst_cflags}" = "\"'" ; then
4244
4245         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4246         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4247
4248                                 continue
4249                         fi
4250                         ;;
4251                 esac
4252                 case "$CPPFLAGS" in
4253                 (*$cf_add_cflags)
4254                         ;;
4255                 (*)
4256                         case $cf_add_cflags in
4257                         (-D*)
4258                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4259
4260 CPPFLAGS=`echo "$CPPFLAGS" | \
4261         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4262                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4263
4264                                 ;;
4265                         esac
4266
4267         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4268         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4269
4270                         ;;
4271                 esac
4272                 ;;
4273         (*)
4274
4275         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4276         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4277
4278                 ;;
4279         esac
4280         ;;
4281 (yes)
4282
4283         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4284         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4285
4286         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4287
4288         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4289                 && test -z "${cf_tst_cflags}" \
4290                 && cf_fix_cppflags=no
4291         ;;
4292 esac
4293 done
4294
4295 if test -n "$cf_new_cflags" ; then
4296
4297         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4298         CFLAGS="${CFLAGS}$cf_new_cflags"
4299
4300 fi
4301
4302 if test -n "$cf_new_cppflags" ; then
4303
4304         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4305         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4306
4307 fi
4308
4309 if test -n "$cf_new_extra_cppflags" ; then
4310
4311         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4312         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4313
4314 fi
4315
4316 fi
4317
4318         ;;
4319 esac
4320
4321 if test -n "$cf_xopen_source" ; then
4322
4323 cf_fix_cppflags=no
4324 cf_new_cflags=
4325 cf_new_cppflags=
4326 cf_new_extra_cppflags=
4327
4328 for cf_add_cflags in $cf_xopen_source
4329 do
4330 case $cf_fix_cppflags in
4331 (no)
4332         case $cf_add_cflags in
4333         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4334                 case $cf_add_cflags in
4335                 (-D*)
4336                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4337
4338                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4339                                 && test -z "${cf_tst_cflags}" \
4340                                 && cf_fix_cppflags=yes
4341
4342                         if test $cf_fix_cppflags = yes ; then
4343
4344         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4345         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4346
4347                                 continue
4348                         elif test "${cf_tst_cflags}" = "\"'" ; then
4349
4350         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4351         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4352
4353                                 continue
4354                         fi
4355                         ;;
4356                 esac
4357                 case "$CPPFLAGS" in
4358                 (*$cf_add_cflags)
4359                         ;;
4360                 (*)
4361                         case $cf_add_cflags in
4362                         (-D*)
4363                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4364
4365 CPPFLAGS=`echo "$CPPFLAGS" | \
4366         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4367                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4368
4369                                 ;;
4370                         esac
4371
4372         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4373         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4374
4375                         ;;
4376                 esac
4377                 ;;
4378         (*)
4379
4380         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4381         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4382
4383                 ;;
4384         esac
4385         ;;
4386 (yes)
4387
4388         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4389         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4390
4391         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4392
4393         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4394                 && test -z "${cf_tst_cflags}" \
4395                 && cf_fix_cppflags=no
4396         ;;
4397 esac
4398 done
4399
4400 if test -n "$cf_new_cflags" ; then
4401         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4402
4403 echo "${as_me:-configure}:4403: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4404
4405         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4406         CFLAGS="${CFLAGS}$cf_new_cflags"
4407
4408 fi
4409
4410 if test -n "$cf_new_cppflags" ; then
4411         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4412
4413 echo "${as_me:-configure}:4413: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4414
4415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4416         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4417
4418 fi
4419
4420 if test -n "$cf_new_extra_cppflags" ; then
4421         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4422
4423 echo "${as_me:-configure}:4423: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4424
4425         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4426         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4427
4428 fi
4429
4430 fi
4431
4432 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4433         echo "$as_me:4433: checking if _XOPEN_SOURCE really is set" >&5
4434 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4435         cat >conftest.$ac_ext <<_ACEOF
4436 #line 4436 "configure"
4437 #include "confdefs.h"
4438 #include <stdlib.h>
4439 int
4440 main (void)
4441 {
4442
4443 #ifndef _XOPEN_SOURCE
4444 make an error
4445 #endif
4446   ;
4447   return 0;
4448 }
4449 _ACEOF
4450 rm -f conftest.$ac_objext
4451 if { (eval echo "$as_me:4451: \"$ac_compile\"") >&5
4452   (eval $ac_compile) 2>&5
4453   ac_status=$?
4454   echo "$as_me:4454: \$? = $ac_status" >&5
4455   (exit $ac_status); } &&
4456          { ac_try='test -s conftest.$ac_objext'
4457   { (eval echo "$as_me:4457: \"$ac_try\"") >&5
4458   (eval $ac_try) 2>&5
4459   ac_status=$?
4460   echo "$as_me:4460: \$? = $ac_status" >&5
4461   (exit $ac_status); }; }; then
4462   cf_XOPEN_SOURCE_set=yes
4463 else
4464   echo "$as_me: failed program was:" >&5
4465 cat conftest.$ac_ext >&5
4466 cf_XOPEN_SOURCE_set=no
4467 fi
4468 rm -f conftest.$ac_objext conftest.$ac_ext
4469         echo "$as_me:4469: result: $cf_XOPEN_SOURCE_set" >&5
4470 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4471         if test $cf_XOPEN_SOURCE_set = yes
4472         then
4473                 cat >conftest.$ac_ext <<_ACEOF
4474 #line 4474 "configure"
4475 #include "confdefs.h"
4476 #include <stdlib.h>
4477 int
4478 main (void)
4479 {
4480
4481 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4482 make an error
4483 #endif
4484   ;
4485   return 0;
4486 }
4487 _ACEOF
4488 rm -f conftest.$ac_objext
4489 if { (eval echo "$as_me:4489: \"$ac_compile\"") >&5
4490   (eval $ac_compile) 2>&5
4491   ac_status=$?
4492   echo "$as_me:4492: \$? = $ac_status" >&5
4493   (exit $ac_status); } &&
4494          { ac_try='test -s conftest.$ac_objext'
4495   { (eval echo "$as_me:4495: \"$ac_try\"") >&5
4496   (eval $ac_try) 2>&5
4497   ac_status=$?
4498   echo "$as_me:4498: \$? = $ac_status" >&5
4499   (exit $ac_status); }; }; then
4500   cf_XOPEN_SOURCE_set_ok=yes
4501 else
4502   echo "$as_me: failed program was:" >&5
4503 cat conftest.$ac_ext >&5
4504 cf_XOPEN_SOURCE_set_ok=no
4505 fi
4506 rm -f conftest.$ac_objext conftest.$ac_ext
4507                 if test $cf_XOPEN_SOURCE_set_ok = no
4508                 then
4509                         { echo "$as_me:4509: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4510 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4511                 fi
4512         else
4513
4514 echo "$as_me:4514: checking if we should define _XOPEN_SOURCE" >&5
4515 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4516 if test "${cf_cv_xopen_source+set}" = set; then
4517   echo $ECHO_N "(cached) $ECHO_C" >&6
4518 else
4519
4520         cat >conftest.$ac_ext <<_ACEOF
4521 #line 4521 "configure"
4522 #include "confdefs.h"
4523
4524 #include <stdlib.h>
4525 #include <string.h>
4526 #include <sys/types.h>
4527
4528 int
4529 main (void)
4530 {
4531
4532 #ifndef _XOPEN_SOURCE
4533 make an error
4534 #endif
4535   ;
4536   return 0;
4537 }
4538 _ACEOF
4539 rm -f conftest.$ac_objext
4540 if { (eval echo "$as_me:4540: \"$ac_compile\"") >&5
4541   (eval $ac_compile) 2>&5
4542   ac_status=$?
4543   echo "$as_me:4543: \$? = $ac_status" >&5
4544   (exit $ac_status); } &&
4545          { ac_try='test -s conftest.$ac_objext'
4546   { (eval echo "$as_me:4546: \"$ac_try\"") >&5
4547   (eval $ac_try) 2>&5
4548   ac_status=$?
4549   echo "$as_me:4549: \$? = $ac_status" >&5
4550   (exit $ac_status); }; }; then
4551   cf_cv_xopen_source=no
4552 else
4553   echo "$as_me: failed program was:" >&5
4554 cat conftest.$ac_ext >&5
4555 cf_save="$CPPFLAGS"
4556          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4557          cat >conftest.$ac_ext <<_ACEOF
4558 #line 4558 "configure"
4559 #include "confdefs.h"
4560
4561 #include <stdlib.h>
4562 #include <string.h>
4563 #include <sys/types.h>
4564
4565 int
4566 main (void)
4567 {
4568
4569 #ifdef _XOPEN_SOURCE
4570 make an error
4571 #endif
4572   ;
4573   return 0;
4574 }
4575 _ACEOF
4576 rm -f conftest.$ac_objext
4577 if { (eval echo "$as_me:4577: \"$ac_compile\"") >&5
4578   (eval $ac_compile) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit $ac_status); } &&
4582          { ac_try='test -s conftest.$ac_objext'
4583   { (eval echo "$as_me:4583: \"$ac_try\"") >&5
4584   (eval $ac_try) 2>&5
4585   ac_status=$?
4586   echo "$as_me:4586: \$? = $ac_status" >&5
4587   (exit $ac_status); }; }; then
4588   cf_cv_xopen_source=no
4589 else
4590   echo "$as_me: failed program was:" >&5
4591 cat conftest.$ac_ext >&5
4592 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4593 fi
4594 rm -f conftest.$ac_objext conftest.$ac_ext
4595         CPPFLAGS="$cf_save"
4596
4597 fi
4598 rm -f conftest.$ac_objext conftest.$ac_ext
4599
4600 fi
4601 echo "$as_me:4601: result: $cf_cv_xopen_source" >&5
4602 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4603
4604 if test "$cf_cv_xopen_source" != no ; then
4605
4606 CFLAGS=`echo "$CFLAGS" | \
4607         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4608                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4609
4610 CPPFLAGS=`echo "$CPPFLAGS" | \
4611         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4612                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4613
4614         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4615
4616 cf_fix_cppflags=no
4617 cf_new_cflags=
4618 cf_new_cppflags=
4619 cf_new_extra_cppflags=
4620
4621 for cf_add_cflags in $cf_temp_xopen_source
4622 do
4623 case $cf_fix_cppflags in
4624 (no)
4625         case $cf_add_cflags in
4626         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4627                 case $cf_add_cflags in
4628                 (-D*)
4629                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4630
4631                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4632                                 && test -z "${cf_tst_cflags}" \
4633                                 && cf_fix_cppflags=yes
4634
4635                         if test $cf_fix_cppflags = yes ; then
4636
4637         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4638         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4639
4640                                 continue
4641                         elif test "${cf_tst_cflags}" = "\"'" ; then
4642
4643         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4644         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4645
4646                                 continue
4647                         fi
4648                         ;;
4649                 esac
4650                 case "$CPPFLAGS" in
4651                 (*$cf_add_cflags)
4652                         ;;
4653                 (*)
4654                         case $cf_add_cflags in
4655                         (-D*)
4656                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4657
4658 CPPFLAGS=`echo "$CPPFLAGS" | \
4659         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4660                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4661
4662                                 ;;
4663                         esac
4664
4665         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4666         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4667
4668                         ;;
4669                 esac
4670                 ;;
4671         (*)
4672
4673         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4674         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4675
4676                 ;;
4677         esac
4678         ;;
4679 (yes)
4680
4681         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4682         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4683
4684         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4685
4686         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4687                 && test -z "${cf_tst_cflags}" \
4688                 && cf_fix_cppflags=no
4689         ;;
4690 esac
4691 done
4692
4693 if test -n "$cf_new_cflags" ; then
4694
4695         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4696         CFLAGS="${CFLAGS}$cf_new_cflags"
4697
4698 fi
4699
4700 if test -n "$cf_new_cppflags" ; then
4701
4702         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4703         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4704
4705 fi
4706
4707 if test -n "$cf_new_extra_cppflags" ; then
4708
4709         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4710         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4711
4712 fi
4713
4714 fi
4715
4716         fi
4717 fi
4718
4719 echo "$as_me:4719: checking for signal global datatype" >&5
4720 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4721 if test "${cf_cv_sig_atomic_t+set}" = set; then
4722   echo $ECHO_N "(cached) $ECHO_C" >&6
4723 else
4724
4725         for cf_type in \
4726                 "volatile sig_atomic_t" \
4727                 "sig_atomic_t" \
4728                 "int"
4729         do
4730         cat >conftest.$ac_ext <<_ACEOF
4731 #line 4731 "configure"
4732 #include "confdefs.h"
4733
4734 #include <sys/types.h>
4735 #include <signal.h>
4736 #include <stdio.h>
4737
4738 extern $cf_type x;
4739 $cf_type x;
4740 static void handler(int sig)
4741 {
4742         x = 5;
4743 }
4744 int
4745 main (void)
4746 {
4747 signal(SIGINT, handler);
4748                  x = 1
4749   ;
4750   return 0;
4751 }
4752 _ACEOF
4753 rm -f conftest.$ac_objext
4754 if { (eval echo "$as_me:4754: \"$ac_compile\"") >&5
4755   (eval $ac_compile) 2>&5
4756   ac_status=$?
4757   echo "$as_me:4757: \$? = $ac_status" >&5
4758   (exit $ac_status); } &&
4759          { ac_try='test -s conftest.$ac_objext'
4760   { (eval echo "$as_me:4760: \"$ac_try\"") >&5
4761   (eval $ac_try) 2>&5
4762   ac_status=$?
4763   echo "$as_me:4763: \$? = $ac_status" >&5
4764   (exit $ac_status); }; }; then
4765   cf_cv_sig_atomic_t=$cf_type
4766 else
4767   echo "$as_me: failed program was:" >&5
4768 cat conftest.$ac_ext >&5
4769 cf_cv_sig_atomic_t=no
4770 fi
4771 rm -f conftest.$ac_objext conftest.$ac_ext
4772                 test "$cf_cv_sig_atomic_t" != no && break
4773         done
4774
4775 fi
4776
4777 echo "$as_me:4777: result: $cf_cv_sig_atomic_t" >&5
4778 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4779 test "$cf_cv_sig_atomic_t" != no &&
4780 cat >>confdefs.h <<EOF
4781 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4782 EOF
4783
4784 # Work around breakage on OS X
4785
4786 echo "$as_me:4786: checking if SIGWINCH is defined" >&5
4787 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
4788 if test "${cf_cv_define_sigwinch+set}" = set; then
4789   echo $ECHO_N "(cached) $ECHO_C" >&6
4790 else
4791
4792         cat >conftest.$ac_ext <<_ACEOF
4793 #line 4793 "configure"
4794 #include "confdefs.h"
4795
4796 #include <sys/types.h>
4797 #include <sys/signal.h>
4798
4799 int
4800 main (void)
4801 {
4802 int x = SIGWINCH
4803   ;
4804   return 0;
4805 }
4806 _ACEOF
4807 rm -f conftest.$ac_objext
4808 if { (eval echo "$as_me:4808: \"$ac_compile\"") >&5
4809   (eval $ac_compile) 2>&5
4810   ac_status=$?
4811   echo "$as_me:4811: \$? = $ac_status" >&5
4812   (exit $ac_status); } &&
4813          { ac_try='test -s conftest.$ac_objext'
4814   { (eval echo "$as_me:4814: \"$ac_try\"") >&5
4815   (eval $ac_try) 2>&5
4816   ac_status=$?
4817   echo "$as_me:4817: \$? = $ac_status" >&5
4818   (exit $ac_status); }; }; then
4819   cf_cv_define_sigwinch=yes
4820 else
4821   echo "$as_me: failed program was:" >&5
4822 cat conftest.$ac_ext >&5
4823 cat >conftest.$ac_ext <<_ACEOF
4824 #line 4824 "configure"
4825 #include "confdefs.h"
4826
4827 #undef _XOPEN_SOURCE
4828 #undef _POSIX_SOURCE
4829 #undef _POSIX_C_SOURCE
4830 #include <sys/types.h>
4831 #include <sys/signal.h>
4832
4833 int
4834 main (void)
4835 {
4836 int x = SIGWINCH
4837   ;
4838   return 0;
4839 }
4840 _ACEOF
4841 rm -f conftest.$ac_objext
4842 if { (eval echo "$as_me:4842: \"$ac_compile\"") >&5
4843   (eval $ac_compile) 2>&5
4844   ac_status=$?
4845   echo "$as_me:4845: \$? = $ac_status" >&5
4846   (exit $ac_status); } &&
4847          { ac_try='test -s conftest.$ac_objext'
4848   { (eval echo "$as_me:4848: \"$ac_try\"") >&5
4849   (eval $ac_try) 2>&5
4850   ac_status=$?
4851   echo "$as_me:4851: \$? = $ac_status" >&5
4852   (exit $ac_status); }; }; then
4853   cf_cv_define_sigwinch=maybe
4854 else
4855   echo "$as_me: failed program was:" >&5
4856 cat conftest.$ac_ext >&5
4857 cf_cv_define_sigwinch=no
4858 fi
4859 rm -f conftest.$ac_objext conftest.$ac_ext
4860
4861 fi
4862 rm -f conftest.$ac_objext conftest.$ac_ext
4863
4864 fi
4865 echo "$as_me:4865: result: $cf_cv_define_sigwinch" >&5
4866 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
4867
4868 if test "$cf_cv_define_sigwinch" = maybe ; then
4869 echo "$as_me:4869: checking for actual SIGWINCH definition" >&5
4870 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
4871 if test "${cf_cv_fixup_sigwinch+set}" = set; then
4872   echo $ECHO_N "(cached) $ECHO_C" >&6
4873 else
4874
4875 cf_cv_fixup_sigwinch=unknown
4876 cf_sigwinch=32
4877 while test $cf_sigwinch != 1
4878 do
4879         cat >conftest.$ac_ext <<_ACEOF
4880 #line 4880 "configure"
4881 #include "confdefs.h"
4882
4883 #undef _XOPEN_SOURCE
4884 #undef _POSIX_SOURCE
4885 #undef _POSIX_C_SOURCE
4886 #include <sys/types.h>
4887 #include <sys/signal.h>
4888
4889 int
4890 main (void)
4891 {
4892
4893 #if SIGWINCH != $cf_sigwinch
4894 make an error
4895 #endif
4896 int x = SIGWINCH
4897   ;
4898   return 0;
4899 }
4900 _ACEOF
4901 rm -f conftest.$ac_objext
4902 if { (eval echo "$as_me:4902: \"$ac_compile\"") >&5
4903   (eval $ac_compile) 2>&5
4904   ac_status=$?
4905   echo "$as_me:4905: \$? = $ac_status" >&5
4906   (exit $ac_status); } &&
4907          { ac_try='test -s conftest.$ac_objext'
4908   { (eval echo "$as_me:4908: \"$ac_try\"") >&5
4909   (eval $ac_try) 2>&5
4910   ac_status=$?
4911   echo "$as_me:4911: \$? = $ac_status" >&5
4912   (exit $ac_status); }; }; then
4913   cf_cv_fixup_sigwinch=$cf_sigwinch
4914          break
4915 else
4916   echo "$as_me: failed program was:" >&5
4917 cat conftest.$ac_ext >&5
4918 fi
4919 rm -f conftest.$ac_objext conftest.$ac_ext
4920
4921 cf_sigwinch=`expr $cf_sigwinch - 1`
4922 done
4923
4924 fi
4925 echo "$as_me:4925: result: $cf_cv_fixup_sigwinch" >&5
4926 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
4927
4928         if test "$cf_cv_fixup_sigwinch" != unknown ; then
4929                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
4930         fi
4931 fi
4932
4933 # Checks for CODESET support.
4934
4935 echo "$as_me:4935: checking for nl_langinfo and CODESET" >&5
4936 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
4937 if test "${am_cv_langinfo_codeset+set}" = set; then
4938   echo $ECHO_N "(cached) $ECHO_C" >&6
4939 else
4940   cat >conftest.$ac_ext <<_ACEOF
4941 #line 4941 "configure"
4942 #include "confdefs.h"
4943 #include <langinfo.h>
4944 int
4945 main (void)
4946 {
4947 char* cs = nl_langinfo(CODESET);
4948   ;
4949   return 0;
4950 }
4951 _ACEOF
4952 rm -f conftest.$ac_objext conftest$ac_exeext
4953 if { (eval echo "$as_me:4953: \"$ac_link\"") >&5
4954   (eval $ac_link) 2>&5
4955   ac_status=$?
4956   echo "$as_me:4956: \$? = $ac_status" >&5
4957   (exit $ac_status); } &&
4958          { ac_try='test -s conftest$ac_exeext'
4959   { (eval echo "$as_me:4959: \"$ac_try\"") >&5
4960   (eval $ac_try) 2>&5
4961   ac_status=$?
4962   echo "$as_me:4962: \$? = $ac_status" >&5
4963   (exit $ac_status); }; }; then
4964   am_cv_langinfo_codeset=yes
4965 else
4966   echo "$as_me: failed program was:" >&5
4967 cat conftest.$ac_ext >&5
4968 am_cv_langinfo_codeset=no
4969 fi
4970 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4971
4972 fi
4973 echo "$as_me:4973: result: $am_cv_langinfo_codeset" >&5
4974 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
4975         if test $am_cv_langinfo_codeset = yes; then
4976
4977 cat >>confdefs.h <<\EOF
4978 #define HAVE_LANGINFO_CODESET 1
4979 EOF
4980
4981         fi
4982
4983 echo "$as_me:4983: checking if you want to use pkg-config" >&5
4984 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
4985
4986 # Check whether --with-pkg-config or --without-pkg-config was given.
4987 if test "${with_pkg_config+set}" = set; then
4988   withval="$with_pkg_config"
4989   cf_pkg_config=$withval
4990 else
4991   cf_pkg_config=yes
4992 fi;
4993 echo "$as_me:4993: result: $cf_pkg_config" >&5
4994 echo "${ECHO_T}$cf_pkg_config" >&6
4995
4996 case $cf_pkg_config in
4997 (no)
4998         PKG_CONFIG=none
4999         ;;
5000 (yes)
5001
5002 if test -n "$ac_tool_prefix"; then
5003   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5004 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5005 echo "$as_me:5005: checking for $ac_word" >&5
5006 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5007 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5008   echo $ECHO_N "(cached) $ECHO_C" >&6
5009 else
5010   case $PKG_CONFIG in
5011   [\\/]* | ?:[\\/]*)
5012   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5013   ;;
5014   *)
5015   ac_save_IFS=$IFS; IFS=$ac_path_separator
5016 ac_dummy="$PATH"
5017 for ac_dir in $ac_dummy; do
5018   IFS=$ac_save_IFS
5019   test -z "$ac_dir" && ac_dir=.
5020   if $as_executable_p "$ac_dir/$ac_word"; then
5021    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5022    echo "$as_me:5022: found $ac_dir/$ac_word" >&5
5023    break
5024 fi
5025 done
5026
5027   ;;
5028 esac
5029 fi
5030 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5031
5032 if test -n "$PKG_CONFIG"; then
5033   echo "$as_me:5033: result: $PKG_CONFIG" >&5
5034 echo "${ECHO_T}$PKG_CONFIG" >&6
5035 else
5036   echo "$as_me:5036: result: no" >&5
5037 echo "${ECHO_T}no" >&6
5038 fi
5039
5040 fi
5041 if test -z "$ac_cv_path_PKG_CONFIG"; then
5042   ac_pt_PKG_CONFIG=$PKG_CONFIG
5043   # Extract the first word of "pkg-config", so it can be a program name with args.
5044 set dummy pkg-config; ac_word=$2
5045 echo "$as_me:5045: checking for $ac_word" >&5
5046 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5047 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5048   echo $ECHO_N "(cached) $ECHO_C" >&6
5049 else
5050   case $ac_pt_PKG_CONFIG in
5051   [\\/]* | ?:[\\/]*)
5052   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5053   ;;
5054   *)
5055   ac_save_IFS=$IFS; IFS=$ac_path_separator
5056 ac_dummy="$PATH"
5057 for ac_dir in $ac_dummy; do
5058   IFS=$ac_save_IFS
5059   test -z "$ac_dir" && ac_dir=.
5060   if $as_executable_p "$ac_dir/$ac_word"; then
5061    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5062    echo "$as_me:5062: found $ac_dir/$ac_word" >&5
5063    break
5064 fi
5065 done
5066
5067   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5068   ;;
5069 esac
5070 fi
5071 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5072
5073 if test -n "$ac_pt_PKG_CONFIG"; then
5074   echo "$as_me:5074: result: $ac_pt_PKG_CONFIG" >&5
5075 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5076 else
5077   echo "$as_me:5077: result: no" >&5
5078 echo "${ECHO_T}no" >&6
5079 fi
5080
5081   PKG_CONFIG=$ac_pt_PKG_CONFIG
5082 else
5083   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5084 fi
5085
5086         ;;
5087 (*)
5088         PKG_CONFIG=$withval
5089         ;;
5090 esac
5091
5092 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5093 if test "$PKG_CONFIG" != none ; then
5094
5095 if test "x$prefix" != xNONE; then
5096         cf_path_syntax="$prefix"
5097 else
5098         cf_path_syntax="$ac_default_prefix"
5099 fi
5100
5101 case ".$PKG_CONFIG" in
5102 (.\$\(*\)*|.\'*\'*)
5103         ;;
5104 (..|./*|.\\*)
5105         ;;
5106 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5107         ;;
5108 (.\${*prefix}*|.\${*dir}*)
5109         eval PKG_CONFIG="$PKG_CONFIG"
5110         case ".$PKG_CONFIG" in
5111         (.NONE/*)
5112                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5113                 ;;
5114         esac
5115         ;;
5116 (.no|.NONE/*)
5117         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5118         ;;
5119 (*)
5120         { { echo "$as_me:5120: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5121 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5122    { (exit 1); exit 1; }; }
5123         ;;
5124 esac
5125
5126 elif test "x$cf_pkg_config" != xno ; then
5127         { echo "$as_me:5127: WARNING: pkg-config is not installed" >&5
5128 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5129 fi
5130
5131 echo "$as_me:5131: checking if you want to see long compiling messages" >&5
5132 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5133
5134 # Check whether --enable-echo or --disable-echo was given.
5135 if test "${enable_echo+set}" = set; then
5136   enableval="$enable_echo"
5137   test "$enableval" != no && enableval=yes
5138         if test "$enableval" != "yes" ; then
5139
5140         ECHO_LT='--silent'
5141         ECHO_LD='@echo linking $@;'
5142         RULE_CC='@echo compiling $<'
5143         SHOW_CC='@echo compiling $@'
5144         ECHO_CC='@'
5145
5146         else
5147
5148         ECHO_LT=''
5149         ECHO_LD=''
5150         RULE_CC=''
5151         SHOW_CC=''
5152         ECHO_CC=''
5153
5154         fi
5155 else
5156   enableval=yes
5157
5158         ECHO_LT=''
5159         ECHO_LD=''
5160         RULE_CC=''
5161         SHOW_CC=''
5162         ECHO_CC=''
5163
5164 fi;
5165 echo "$as_me:5165: result: $enableval" >&5
5166 echo "${ECHO_T}$enableval" >&6
5167
5168 echo "$as_me:5168: checking for ncurses wrap-prefix" >&5
5169 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5170
5171 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5172 if test "${with_ncurses_wrap_prefix+set}" = set; then
5173   withval="$with_ncurses_wrap_prefix"
5174   NCURSES_WRAP_PREFIX=$withval
5175 else
5176   NCURSES_WRAP_PREFIX=_nc_
5177 fi;
5178 echo "$as_me:5178: result: $NCURSES_WRAP_PREFIX" >&5
5179 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5180
5181 echo "$as_me:5181: checking if you want to check for wide-character functions" >&5
5182 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5183
5184 # Check whether --enable-widec or --disable-widec was given.
5185 if test "${enable_widec+set}" = set; then
5186   enableval="$enable_widec"
5187   test "$enableval" != no && enableval=yes
5188         if test "$enableval" != "yes" ; then
5189     cf_enable_widec=no
5190         else
5191                 cf_enable_widec=yes
5192         fi
5193 else
5194   enableval=yes
5195         cf_enable_widec=yes
5196
5197 fi;
5198 echo "$as_me:5198: result: $cf_enable_widec" >&5
5199 echo "${ECHO_T}$cf_enable_widec" >&6
5200
5201 echo "$as_me:5201: checking for specific curses-directory" >&5
5202 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5203
5204 # Check whether --with-curses-dir or --without-curses-dir was given.
5205 if test "${with_curses_dir+set}" = set; then
5206   withval="$with_curses_dir"
5207   cf_cv_curses_dir=$withval
5208 else
5209   cf_cv_curses_dir=no
5210 fi;
5211 echo "$as_me:5211: result: $cf_cv_curses_dir" >&5
5212 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5213
5214 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5215 then
5216
5217 if test "x$prefix" != xNONE; then
5218         cf_path_syntax="$prefix"
5219 else
5220         cf_path_syntax="$ac_default_prefix"
5221 fi
5222
5223 case ".$withval" in
5224 (.\$\(*\)*|.\'*\'*)
5225         ;;
5226 (..|./*|.\\*)
5227         ;;
5228 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5229         ;;
5230 (.\${*prefix}*|.\${*dir}*)
5231         eval withval="$withval"
5232         case ".$withval" in
5233         (.NONE/*)
5234                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5235                 ;;
5236         esac
5237         ;;
5238 (.no|.NONE/*)
5239         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5240         ;;
5241 (*)
5242         { { echo "$as_me:5242: error: expected a pathname, not \"$withval\"" >&5
5243 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5244    { (exit 1); exit 1; }; }
5245         ;;
5246 esac
5247
5248         if test -d "$cf_cv_curses_dir"
5249         then
5250
5251 if test -n "$cf_cv_curses_dir/include" ; then
5252   for cf_add_incdir in $cf_cv_curses_dir/include
5253   do
5254         while test $cf_add_incdir != /usr/include
5255         do
5256           if test -d $cf_add_incdir
5257           then
5258                 cf_have_incdir=no
5259                 if test -n "$CFLAGS$CPPFLAGS" ; then
5260                   # a loop is needed to ensure we can add subdirs of existing dirs
5261                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5262                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5263                           cf_have_incdir=yes; break
5264                         fi
5265                   done
5266                 fi
5267
5268                 if test "$cf_have_incdir" = no ; then
5269                   if test "$cf_add_incdir" = /usr/local/include ; then
5270                         if test "$GCC" = yes
5271                         then
5272                           cf_save_CPPFLAGS=$CPPFLAGS
5273                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5274                           cat >conftest.$ac_ext <<_ACEOF
5275 #line 5275 "configure"
5276 #include "confdefs.h"
5277 #include <stdio.h>
5278 int
5279 main (void)
5280 {
5281 printf("Hello")
5282   ;
5283   return 0;
5284 }
5285 _ACEOF
5286 rm -f conftest.$ac_objext
5287 if { (eval echo "$as_me:5287: \"$ac_compile\"") >&5
5288   (eval $ac_compile) 2>&5
5289   ac_status=$?
5290   echo "$as_me:5290: \$? = $ac_status" >&5
5291   (exit $ac_status); } &&
5292          { ac_try='test -s conftest.$ac_objext'
5293   { (eval echo "$as_me:5293: \"$ac_try\"") >&5
5294   (eval $ac_try) 2>&5
5295   ac_status=$?
5296   echo "$as_me:5296: \$? = $ac_status" >&5
5297   (exit $ac_status); }; }; then
5298   :
5299 else
5300   echo "$as_me: failed program was:" >&5
5301 cat conftest.$ac_ext >&5
5302 cf_have_incdir=yes
5303 fi
5304 rm -f conftest.$ac_objext conftest.$ac_ext
5305                           CPPFLAGS=$cf_save_CPPFLAGS
5306                         fi
5307                   fi
5308                 fi
5309
5310                 if test "$cf_have_incdir" = no ; then
5311                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5312
5313 echo "${as_me:-configure}:5313: testing adding $cf_add_incdir to include-path ..." 1>&5
5314
5315                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5316
5317                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5318                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5319                   cf_add_incdir="$cf_top_incdir"
5320                 else
5321                   break
5322                 fi
5323           else
5324                 break
5325           fi
5326         done
5327   done
5328 fi
5329
5330 if test -n "$cf_cv_curses_dir/lib" ; then
5331         for cf_add_libdir in $cf_cv_curses_dir/lib
5332         do
5333                 if test $cf_add_libdir = /usr/lib ; then
5334                         :
5335                 elif test -d $cf_add_libdir
5336                 then
5337                         cf_have_libdir=no
5338                         if test -n "$LDFLAGS$LIBS" ; then
5339                                 # a loop is needed to ensure we can add subdirs of existing dirs
5340                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5341                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5342                                                 cf_have_libdir=yes; break
5343                                         fi
5344                                 done
5345                         fi
5346                         if test "$cf_have_libdir" = no ; then
5347                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5348
5349 echo "${as_me:-configure}:5349: testing adding $cf_add_libdir to library-path ..." 1>&5
5350
5351                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5352                         fi
5353                 fi
5354         done
5355 fi
5356
5357         fi
5358 fi
5359
5360 cf_cv_screen=curses
5361
5362 echo "$as_me:5362: checking for specified curses library type" >&5
5363 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5364
5365 # Check whether --with-screen or --without-screen was given.
5366 if test "${with_screen+set}" = set; then
5367   withval="$with_screen"
5368   cf_cv_screen=$withval
5369 else
5370
5371 # Check whether --with-ncursesw or --without-ncursesw was given.
5372 if test "${with_ncursesw+set}" = set; then
5373   withval="$with_ncursesw"
5374   cf_cv_screen=ncursesw
5375 else
5376
5377 # Check whether --with-ncurses or --without-ncurses was given.
5378 if test "${with_ncurses+set}" = set; then
5379   withval="$with_ncurses"
5380   cf_cv_screen=ncurses
5381 else
5382
5383 # Check whether --with-pdcurses or --without-pdcurses was given.
5384 if test "${with_pdcurses+set}" = set; then
5385   withval="$with_pdcurses"
5386   cf_cv_screen=pdcurses
5387 else
5388
5389 # Check whether --with-curses-colr or --without-curses-colr was given.
5390 if test "${with_curses_colr+set}" = set; then
5391   withval="$with_curses_colr"
5392   cf_cv_screen=curses_colr
5393 else
5394
5395 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5396 if test "${with_curses_5lib+set}" = set; then
5397   withval="$with_curses_5lib"
5398   cf_cv_screen=curses_5lib
5399 fi;
5400 fi;
5401 fi;
5402 fi;
5403 fi;
5404 fi;
5405
5406 echo "$as_me:5406: result: $cf_cv_screen" >&5
5407 echo "${ECHO_T}$cf_cv_screen" >&6
5408
5409 case $cf_cv_screen in
5410 (curses|curses_*)
5411
5412 echo "$as_me:5412: checking for extra include directories" >&5
5413 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5414 if test "${cf_cv_curses_incdir+set}" = set; then
5415   echo $ECHO_N "(cached) $ECHO_C" >&6
5416 else
5417
5418 cf_cv_curses_incdir=no
5419 case $host_os in
5420 (hpux10.*)
5421         if test "x$cf_cv_screen" = "xcurses_colr"
5422         then
5423                 test -d /usr/include/curses_colr && \
5424                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5425         fi
5426         ;;
5427 (sunos3*|sunos4*)
5428         if test "x$cf_cv_screen" = "xcurses_5lib"
5429         then
5430                 test -d /usr/5lib && \
5431                 test -d /usr/5include && \
5432                 cf_cv_curses_incdir="-I/usr/5include"
5433         fi
5434         ;;
5435 esac
5436
5437 fi
5438 echo "$as_me:5438: result: $cf_cv_curses_incdir" >&5
5439 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5440 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5441
5442 echo "$as_me:5442: checking if we have identified curses headers" >&5
5443 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5444 if test "${cf_cv_ncurses_header+set}" = set; then
5445   echo $ECHO_N "(cached) $ECHO_C" >&6
5446 else
5447
5448 cf_cv_ncurses_header=none
5449 for cf_header in \
5450         ncurses.h  \
5451         curses.h  ncurses/ncurses.h ncurses/curses.h
5452 do
5453 cat >conftest.$ac_ext <<_ACEOF
5454 #line 5454 "configure"
5455 #include "confdefs.h"
5456 #include <${cf_header}>
5457 int
5458 main (void)
5459 {
5460 initscr(); tgoto("?", 0,0)
5461   ;
5462   return 0;
5463 }
5464 _ACEOF
5465 rm -f conftest.$ac_objext
5466 if { (eval echo "$as_me:5466: \"$ac_compile\"") >&5
5467   (eval $ac_compile) 2>&5
5468   ac_status=$?
5469   echo "$as_me:5469: \$? = $ac_status" >&5
5470   (exit $ac_status); } &&
5471          { ac_try='test -s conftest.$ac_objext'
5472   { (eval echo "$as_me:5472: \"$ac_try\"") >&5
5473   (eval $ac_try) 2>&5
5474   ac_status=$?
5475   echo "$as_me:5475: \$? = $ac_status" >&5
5476   (exit $ac_status); }; }; then
5477   cf_cv_ncurses_header=$cf_header; break
5478 else
5479   echo "$as_me: failed program was:" >&5
5480 cat conftest.$ac_ext >&5
5481 fi
5482 rm -f conftest.$ac_objext conftest.$ac_ext
5483 done
5484
5485 fi
5486 echo "$as_me:5486: result: $cf_cv_ncurses_header" >&5
5487 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5488
5489 if test "$cf_cv_ncurses_header" = none ; then
5490         { { echo "$as_me:5490: error: No curses header-files found" >&5
5491 echo "$as_me: error: No curses header-files found" >&2;}
5492    { (exit 1); exit 1; }; }
5493 fi
5494
5495 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5496
5497 for ac_header in $cf_cv_ncurses_header
5498 do
5499 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5500 echo "$as_me:5500: checking for $ac_header" >&5
5501 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5502 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5503   echo $ECHO_N "(cached) $ECHO_C" >&6
5504 else
5505   cat >conftest.$ac_ext <<_ACEOF
5506 #line 5506 "configure"
5507 #include "confdefs.h"
5508 #include <$ac_header>
5509 _ACEOF
5510 if { (eval echo "$as_me:5510: \"$ac_cpp conftest.$ac_ext\"") >&5
5511   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5512   ac_status=$?
5513   egrep -v '^ *\+' conftest.er1 >conftest.err
5514   rm -f conftest.er1
5515   cat conftest.err >&5
5516   echo "$as_me:5516: \$? = $ac_status" >&5
5517   (exit $ac_status); } >/dev/null; then
5518   if test -s conftest.err; then
5519     ac_cpp_err=$ac_c_preproc_warn_flag
5520   else
5521     ac_cpp_err=
5522   fi
5523 else
5524   ac_cpp_err=yes
5525 fi
5526 if test -z "$ac_cpp_err"; then
5527   eval "$as_ac_Header=yes"
5528 else
5529   echo "$as_me: failed program was:" >&5
5530   cat conftest.$ac_ext >&5
5531   eval "$as_ac_Header=no"
5532 fi
5533 rm -f conftest.err conftest.$ac_ext
5534 fi
5535 echo "$as_me:5535: result: `eval echo '${'$as_ac_Header'}'`" >&5
5536 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5537 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5538   cat >>confdefs.h <<EOF
5539 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5540 EOF
5541
5542 fi
5543 done
5544
5545 echo "$as_me:5545: checking for terminfo header" >&5
5546 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5547 if test "${cf_cv_term_header+set}" = set; then
5548   echo $ECHO_N "(cached) $ECHO_C" >&6
5549 else
5550
5551 case ${cf_cv_ncurses_header} in
5552 (*/ncurses.h|*/ncursesw.h)
5553         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5554         ;;
5555 (*)
5556         cf_term_header=term.h
5557         ;;
5558 esac
5559
5560 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5561 do
5562 cat >conftest.$ac_ext <<_ACEOF
5563 #line 5563 "configure"
5564 #include "confdefs.h"
5565 #include <stdio.h>
5566 #include <${cf_cv_ncurses_header:-curses.h}>
5567 #include <$cf_test>
5568
5569 int
5570 main (void)
5571 {
5572 int x = auto_left_margin
5573   ;
5574   return 0;
5575 }
5576 _ACEOF
5577 rm -f conftest.$ac_objext
5578 if { (eval echo "$as_me:5578: \"$ac_compile\"") >&5
5579   (eval $ac_compile) 2>&5
5580   ac_status=$?
5581   echo "$as_me:5581: \$? = $ac_status" >&5
5582   (exit $ac_status); } &&
5583          { ac_try='test -s conftest.$ac_objext'
5584   { (eval echo "$as_me:5584: \"$ac_try\"") >&5
5585   (eval $ac_try) 2>&5
5586   ac_status=$?
5587   echo "$as_me:5587: \$? = $ac_status" >&5
5588   (exit $ac_status); }; }; then
5589
5590         cf_cv_term_header="$cf_test"
5591 else
5592   echo "$as_me: failed program was:" >&5
5593 cat conftest.$ac_ext >&5
5594
5595         cf_cv_term_header=unknown
5596
5597 fi
5598 rm -f conftest.$ac_objext conftest.$ac_ext
5599         test "$cf_cv_term_header" != unknown && break
5600 done
5601
5602 fi
5603 echo "$as_me:5603: result: $cf_cv_term_header" >&5
5604 echo "${ECHO_T}$cf_cv_term_header" >&6
5605
5606 # Set definitions to allow ifdef'ing to accommodate subdirectories
5607
5608 case $cf_cv_term_header in
5609 (*term.h)
5610
5611 cat >>confdefs.h <<\EOF
5612 #define HAVE_TERM_H 1
5613 EOF
5614
5615         ;;
5616 esac
5617
5618 case $cf_cv_term_header in
5619 (ncurses/term.h)
5620
5621 cat >>confdefs.h <<\EOF
5622 #define HAVE_NCURSES_TERM_H 1
5623 EOF
5624
5625         ;;
5626 (ncursesw/term.h)
5627
5628 cat >>confdefs.h <<\EOF
5629 #define HAVE_NCURSESW_TERM_H 1
5630 EOF
5631
5632         ;;
5633 esac
5634
5635 echo "$as_me:5635: checking for ncurses version" >&5
5636 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5637 if test "${cf_cv_ncurses_version+set}" = set; then
5638   echo $ECHO_N "(cached) $ECHO_C" >&6
5639 else
5640
5641         cf_cv_ncurses_version=no
5642         cf_tempfile=out$$
5643         rm -f $cf_tempfile
5644         if test "$cross_compiling" = yes; then
5645
5646         # This will not work if the preprocessor splits the line after the
5647         # Autoconf token.  The 'unproto' program does that.
5648         cat > conftest.$ac_ext <<EOF
5649 #include <${cf_cv_ncurses_header:-curses.h}>
5650 #undef Autoconf
5651 #ifdef NCURSES_VERSION
5652 Autoconf NCURSES_VERSION
5653 #else
5654 #ifdef __NCURSES_H
5655 Autoconf "old"
5656 #endif
5657 ;
5658 #endif
5659 EOF
5660         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5661         { (eval echo "$as_me:5661: \"$cf_try\"") >&5
5662   (eval $cf_try) 2>&5
5663   ac_status=$?
5664   echo "$as_me:5664: \$? = $ac_status" >&5
5665   (exit $ac_status); }
5666         if test -f conftest.out ; then
5667                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5668                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5669                 rm -f conftest.out
5670         fi
5671
5672 else
5673   cat >conftest.$ac_ext <<_ACEOF
5674 #line 5674 "configure"
5675 #include "confdefs.h"
5676
5677 #include <${cf_cv_ncurses_header:-curses.h}>
5678 #include <stdio.h>
5679 int main(void)
5680 {
5681         FILE *fp = fopen("$cf_tempfile", "w");
5682 #ifdef NCURSES_VERSION
5683 # ifdef NCURSES_VERSION_PATCH
5684         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5685 # else
5686         fprintf(fp, "%s\n", NCURSES_VERSION);
5687 # endif
5688 #else
5689 # ifdef __NCURSES_H
5690         fprintf(fp, "old\n");
5691 # else
5692         make an error
5693 # endif
5694 #endif
5695         ${cf_cv_main_return:-return}(0);
5696 }
5697 _ACEOF
5698 rm -f conftest$ac_exeext
5699 if { (eval echo "$as_me:5699: \"$ac_link\"") >&5
5700   (eval $ac_link) 2>&5
5701   ac_status=$?
5702   echo "$as_me:5702: \$? = $ac_status" >&5
5703   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5704   { (eval echo "$as_me:5704: \"$ac_try\"") >&5
5705   (eval $ac_try) 2>&5
5706   ac_status=$?
5707   echo "$as_me:5707: \$? = $ac_status" >&5
5708   (exit $ac_status); }; }; then
5709
5710         cf_cv_ncurses_version=`cat $cf_tempfile`
5711 else
5712   echo "$as_me: program exited with status $ac_status" >&5
5713 echo "$as_me: failed program was:" >&5
5714 cat conftest.$ac_ext >&5
5715 fi
5716 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5717 fi
5718         rm -f $cf_tempfile
5719
5720 fi
5721 echo "$as_me:5721: result: $cf_cv_ncurses_version" >&5
5722 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5723 test "$cf_cv_ncurses_version" = no ||
5724 cat >>confdefs.h <<\EOF
5725 #define NCURSES 1
5726 EOF
5727
5728 echo "$as_me:5728: checking if we have identified curses libraries" >&5
5729 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5730 cat >conftest.$ac_ext <<_ACEOF
5731 #line 5731 "configure"
5732 #include "confdefs.h"
5733 #include <${cf_cv_ncurses_header:-curses.h}>
5734 int
5735 main (void)
5736 {
5737 initscr(); tgoto("?", 0,0)
5738   ;
5739   return 0;
5740 }
5741 _ACEOF
5742 rm -f conftest.$ac_objext conftest$ac_exeext
5743 if { (eval echo "$as_me:5743: \"$ac_link\"") >&5
5744   (eval $ac_link) 2>&5
5745   ac_status=$?
5746   echo "$as_me:5746: \$? = $ac_status" >&5
5747   (exit $ac_status); } &&
5748          { ac_try='test -s conftest$ac_exeext'
5749   { (eval echo "$as_me:5749: \"$ac_try\"") >&5
5750   (eval $ac_try) 2>&5
5751   ac_status=$?
5752   echo "$as_me:5752: \$? = $ac_status" >&5
5753   (exit $ac_status); }; }; then
5754   cf_result=yes
5755 else
5756   echo "$as_me: failed program was:" >&5
5757 cat conftest.$ac_ext >&5
5758 cf_result=no
5759 fi
5760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5761 echo "$as_me:5761: result: $cf_result" >&5
5762 echo "${ECHO_T}$cf_result" >&6
5763
5764 if test "$cf_result" = no ; then
5765 case $host_os in
5766 (freebsd*)
5767         echo "$as_me:5767: checking for tgoto in -lmytinfo" >&5
5768 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5769 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5770   echo $ECHO_N "(cached) $ECHO_C" >&6
5771 else
5772   ac_check_lib_save_LIBS=$LIBS
5773 LIBS="-lmytinfo  $LIBS"
5774 cat >conftest.$ac_ext <<_ACEOF
5775 #line 5775 "configure"
5776 #include "confdefs.h"
5777
5778 /* Override any gcc2 internal prototype to avoid an error.  */
5779 #ifdef __cplusplus
5780 extern "C"
5781 #endif
5782 /* We use char because int might match the return type of a gcc2
5783    builtin and then its argument prototype would still apply.  */
5784 char tgoto ();
5785 int
5786 main (void)
5787 {
5788 tgoto ();
5789   ;
5790   return 0;
5791 }
5792 _ACEOF
5793 rm -f conftest.$ac_objext conftest$ac_exeext
5794 if { (eval echo "$as_me:5794: \"$ac_link\"") >&5
5795   (eval $ac_link) 2>&5
5796   ac_status=$?
5797   echo "$as_me:5797: \$? = $ac_status" >&5
5798   (exit $ac_status); } &&
5799          { ac_try='test -s conftest$ac_exeext'
5800   { (eval echo "$as_me:5800: \"$ac_try\"") >&5
5801   (eval $ac_try) 2>&5
5802   ac_status=$?
5803   echo "$as_me:5803: \$? = $ac_status" >&5
5804   (exit $ac_status); }; }; then
5805   ac_cv_lib_mytinfo_tgoto=yes
5806 else
5807   echo "$as_me: failed program was:" >&5
5808 cat conftest.$ac_ext >&5
5809 ac_cv_lib_mytinfo_tgoto=no
5810 fi
5811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5812 LIBS=$ac_check_lib_save_LIBS
5813 fi
5814 echo "$as_me:5814: result: $ac_cv_lib_mytinfo_tgoto" >&5
5815 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5816 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5817
5818 cf_add_libs="-lmytinfo"
5819 # Filter out duplicates - this happens with badly-designed ".pc" files...
5820 for cf_add_1lib in $LIBS
5821 do
5822         for cf_add_2lib in $cf_add_libs
5823         do
5824                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5825                 then
5826                         cf_add_1lib=
5827                         break
5828                 fi
5829         done
5830         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5831 done
5832 LIBS="$cf_add_libs"
5833
5834 fi
5835
5836         ;;
5837 (hpux10.*)
5838         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5839         # next (1998), and xcurses "newer" (2000).  There is no header file for
5840         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5841         # term.h) for cur_colr
5842         if test "x$cf_cv_screen" = "xcurses_colr"
5843         then
5844                 echo "$as_me:5844: checking for initscr in -lcur_colr" >&5
5845 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5846 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5847   echo $ECHO_N "(cached) $ECHO_C" >&6
5848 else
5849   ac_check_lib_save_LIBS=$LIBS
5850 LIBS="-lcur_colr  $LIBS"
5851 cat >conftest.$ac_ext <<_ACEOF
5852 #line 5852 "configure"
5853 #include "confdefs.h"
5854
5855 /* Override any gcc2 internal prototype to avoid an error.  */
5856 #ifdef __cplusplus
5857 extern "C"
5858 #endif
5859 /* We use char because int might match the return type of a gcc2
5860    builtin and then its argument prototype would still apply.  */
5861 char initscr ();
5862 int
5863 main (void)
5864 {
5865 initscr ();
5866   ;
5867   return 0;
5868 }
5869 _ACEOF
5870 rm -f conftest.$ac_objext conftest$ac_exeext
5871 if { (eval echo "$as_me:5871: \"$ac_link\"") >&5
5872   (eval $ac_link) 2>&5
5873   ac_status=$?
5874   echo "$as_me:5874: \$? = $ac_status" >&5
5875   (exit $ac_status); } &&
5876          { ac_try='test -s conftest$ac_exeext'
5877   { (eval echo "$as_me:5877: \"$ac_try\"") >&5
5878   (eval $ac_try) 2>&5
5879   ac_status=$?
5880   echo "$as_me:5880: \$? = $ac_status" >&5
5881   (exit $ac_status); }; }; then
5882   ac_cv_lib_cur_colr_initscr=yes
5883 else
5884   echo "$as_me: failed program was:" >&5
5885 cat conftest.$ac_ext >&5
5886 ac_cv_lib_cur_colr_initscr=no
5887 fi
5888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5889 LIBS=$ac_check_lib_save_LIBS
5890 fi
5891 echo "$as_me:5891: result: $ac_cv_lib_cur_colr_initscr" >&5
5892 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5893 if test $ac_cv_lib_cur_colr_initscr = yes; then
5894
5895 cf_add_libs="-lcur_colr"
5896 # Filter out duplicates - this happens with badly-designed ".pc" files...
5897 for cf_add_1lib in $LIBS
5898 do
5899         for cf_add_2lib in $cf_add_libs
5900         do
5901                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5902                 then
5903                         cf_add_1lib=
5904                         break
5905                 fi
5906         done
5907         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5908 done
5909 LIBS="$cf_add_libs"
5910
5911                         ac_cv_func_initscr=yes
5912
5913 else
5914
5915                 echo "$as_me:5915: checking for initscr in -lHcurses" >&5
5916 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5917 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5918   echo $ECHO_N "(cached) $ECHO_C" >&6
5919 else
5920   ac_check_lib_save_LIBS=$LIBS
5921 LIBS="-lHcurses  $LIBS"
5922 cat >conftest.$ac_ext <<_ACEOF
5923 #line 5923 "configure"
5924 #include "confdefs.h"
5925
5926 /* Override any gcc2 internal prototype to avoid an error.  */
5927 #ifdef __cplusplus
5928 extern "C"
5929 #endif
5930 /* We use char because int might match the return type of a gcc2
5931    builtin and then its argument prototype would still apply.  */
5932 char initscr ();
5933 int
5934 main (void)
5935 {
5936 initscr ();
5937   ;
5938   return 0;
5939 }
5940 _ACEOF
5941 rm -f conftest.$ac_objext conftest$ac_exeext
5942 if { (eval echo "$as_me:5942: \"$ac_link\"") >&5
5943   (eval $ac_link) 2>&5
5944   ac_status=$?
5945   echo "$as_me:5945: \$? = $ac_status" >&5
5946   (exit $ac_status); } &&
5947          { ac_try='test -s conftest$ac_exeext'
5948   { (eval echo "$as_me:5948: \"$ac_try\"") >&5
5949   (eval $ac_try) 2>&5
5950   ac_status=$?
5951   echo "$as_me:5951: \$? = $ac_status" >&5
5952   (exit $ac_status); }; }; then
5953   ac_cv_lib_Hcurses_initscr=yes
5954 else
5955   echo "$as_me: failed program was:" >&5
5956 cat conftest.$ac_ext >&5
5957 ac_cv_lib_Hcurses_initscr=no
5958 fi
5959 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5960 LIBS=$ac_check_lib_save_LIBS
5961 fi
5962 echo "$as_me:5962: result: $ac_cv_lib_Hcurses_initscr" >&5
5963 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5964 if test $ac_cv_lib_Hcurses_initscr = yes; then
5965
5966                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5967
5968 cf_add_libs="-lHcurses"
5969 # Filter out duplicates - this happens with badly-designed ".pc" files...
5970 for cf_add_1lib in $LIBS
5971 do
5972         for cf_add_2lib in $cf_add_libs
5973         do
5974                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
5975                 then
5976                         cf_add_1lib=
5977                         break
5978                 fi
5979         done
5980         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
5981 done
5982 LIBS="$cf_add_libs"
5983
5984                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5985                         ac_cv_func_initscr=yes
5986
5987 fi
5988
5989 fi
5990
5991         fi
5992         ;;
5993 (linux*)
5994         case `arch 2>/dev/null` in
5995         (x86_64)
5996                 if test -d /lib64
5997                 then
5998
5999 if test -n "/lib64" ; then
6000         for cf_add_libdir in /lib64
6001         do
6002                 if test $cf_add_libdir = /usr/lib ; then
6003                         :
6004                 elif test -d $cf_add_libdir
6005                 then
6006                         cf_have_libdir=no
6007                         if test -n "$LDFLAGS$LIBS" ; then
6008                                 # a loop is needed to ensure we can add subdirs of existing dirs
6009                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6010                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6011                                                 cf_have_libdir=yes; break
6012                                         fi
6013                                 done
6014                         fi
6015                         if test "$cf_have_libdir" = no ; then
6016                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6017
6018 echo "${as_me:-configure}:6018: testing adding $cf_add_libdir to library-path ..." 1>&5
6019
6020                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6021                         fi
6022                 fi
6023         done
6024 fi
6025
6026                 else
6027
6028 if test -n "/lib" ; then
6029         for cf_add_libdir in /lib
6030         do
6031                 if test $cf_add_libdir = /usr/lib ; then
6032                         :
6033                 elif test -d $cf_add_libdir
6034                 then
6035                         cf_have_libdir=no
6036                         if test -n "$LDFLAGS$LIBS" ; then
6037                                 # a loop is needed to ensure we can add subdirs of existing dirs
6038                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6039                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6040                                                 cf_have_libdir=yes; break
6041                                         fi
6042                                 done
6043                         fi
6044                         if test "$cf_have_libdir" = no ; then
6045                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6046
6047 echo "${as_me:-configure}:6047: testing adding $cf_add_libdir to library-path ..." 1>&5
6048
6049                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6050                         fi
6051                 fi
6052         done
6053 fi
6054
6055                 fi
6056                 ;;
6057         (*)
6058
6059 if test -n "/lib" ; then
6060         for cf_add_libdir in /lib
6061         do
6062                 if test $cf_add_libdir = /usr/lib ; then
6063                         :
6064                 elif test -d $cf_add_libdir
6065                 then
6066                         cf_have_libdir=no
6067                         if test -n "$LDFLAGS$LIBS" ; then
6068                                 # a loop is needed to ensure we can add subdirs of existing dirs
6069                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6070                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6071                                                 cf_have_libdir=yes; break
6072                                         fi
6073                                 done
6074                         fi
6075                         if test "$cf_have_libdir" = no ; then
6076                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6077
6078 echo "${as_me:-configure}:6078: testing adding $cf_add_libdir to library-path ..." 1>&5
6079
6080                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6081                         fi
6082                 fi
6083         done
6084 fi
6085
6086                 ;;
6087         esac
6088         ;;
6089 (sunos3*|sunos4*)
6090         if test "x$cf_cv_screen" = "xcurses_5lib"
6091         then
6092                 if test -d /usr/5lib ; then
6093
6094 if test -n "/usr/5lib" ; then
6095         for cf_add_libdir in /usr/5lib
6096         do
6097                 if test $cf_add_libdir = /usr/lib ; then
6098                         :
6099                 elif test -d $cf_add_libdir
6100                 then
6101                         cf_have_libdir=no
6102                         if test -n "$LDFLAGS$LIBS" ; then
6103                                 # a loop is needed to ensure we can add subdirs of existing dirs
6104                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6105                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6106                                                 cf_have_libdir=yes; break
6107                                         fi
6108                                 done
6109                         fi
6110                         if test "$cf_have_libdir" = no ; then
6111                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6112
6113 echo "${as_me:-configure}:6113: testing adding $cf_add_libdir to library-path ..." 1>&5
6114
6115                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6116                         fi
6117                 fi
6118         done
6119 fi
6120
6121 cf_add_libs="-lcurses -ltermcap"
6122 # Filter out duplicates - this happens with badly-designed ".pc" files...
6123 for cf_add_1lib in $LIBS
6124 do
6125         for cf_add_2lib in $cf_add_libs
6126         do
6127                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6128                 then
6129                         cf_add_1lib=
6130                         break
6131                 fi
6132         done
6133         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6134 done
6135 LIBS="$cf_add_libs"
6136
6137                 fi
6138         fi
6139         ac_cv_func_initscr=yes
6140         ;;
6141 esac
6142
6143 if test ".$ac_cv_func_initscr" != .yes ; then
6144         cf_save_LIBS="$LIBS"
6145
6146         if test ".${cf_cv_ncurses_version:-no}" != .no
6147         then
6148                 cf_check_list="ncurses curses cursesX"
6149         else
6150                 cf_check_list="cursesX curses ncurses"
6151         fi
6152
6153         # Check for library containing tgoto.  Do this before curses library
6154         # because it may be needed to link the test-case for initscr.
6155         if test "x$cf_term_lib" = x
6156         then
6157                 echo "$as_me:6157: checking for tgoto" >&5
6158 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6159 if test "${ac_cv_func_tgoto+set}" = set; then
6160   echo $ECHO_N "(cached) $ECHO_C" >&6
6161 else
6162   cat >conftest.$ac_ext <<_ACEOF
6163 #line 6163 "configure"
6164 #include "confdefs.h"
6165 /* System header to define __stub macros and hopefully few prototypes,
6166     which can conflict with char tgoto (); below.  */
6167 #include <assert.h>
6168 /* Override any gcc2 internal prototype to avoid an error.  */
6169 #ifdef __cplusplus
6170 extern "C"
6171 #endif
6172 /* We use char because int might match the return type of a gcc2
6173    builtin and then its argument prototype would still apply.  */
6174 char tgoto ();
6175 char (*f) ();
6176
6177 int
6178 main (void)
6179 {
6180 /* The GNU C library defines this for functions which it implements
6181     to always fail with ENOSYS.  Some functions are actually named
6182     something starting with __ and the normal name is an alias.  */
6183 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6184 choke me
6185 #else
6186 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6187 #endif
6188
6189   ;
6190   return 0;
6191 }
6192 _ACEOF
6193 rm -f conftest.$ac_objext conftest$ac_exeext
6194 if { (eval echo "$as_me:6194: \"$ac_link\"") >&5
6195   (eval $ac_link) 2>&5
6196   ac_status=$?
6197   echo "$as_me:6197: \$? = $ac_status" >&5
6198   (exit $ac_status); } &&
6199          { ac_try='test -s conftest$ac_exeext'
6200   { (eval echo "$as_me:6200: \"$ac_try\"") >&5
6201   (eval $ac_try) 2>&5
6202   ac_status=$?
6203   echo "$as_me:6203: \$? = $ac_status" >&5
6204   (exit $ac_status); }; }; then
6205   ac_cv_func_tgoto=yes
6206 else
6207   echo "$as_me: failed program was:" >&5
6208 cat conftest.$ac_ext >&5
6209 ac_cv_func_tgoto=no
6210 fi
6211 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6212 fi
6213 echo "$as_me:6213: result: $ac_cv_func_tgoto" >&5
6214 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6215 if test $ac_cv_func_tgoto = yes; then
6216   cf_term_lib=predefined
6217 else
6218
6219                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6220                         do
6221                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6222 echo "$as_me:6222: checking for tgoto in -l$cf_term_lib" >&5
6223 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6224 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6225   echo $ECHO_N "(cached) $ECHO_C" >&6
6226 else
6227   ac_check_lib_save_LIBS=$LIBS
6228 LIBS="-l$cf_term_lib  $LIBS"
6229 cat >conftest.$ac_ext <<_ACEOF
6230 #line 6230 "configure"
6231 #include "confdefs.h"
6232
6233 /* Override any gcc2 internal prototype to avoid an error.  */
6234 #ifdef __cplusplus
6235 extern "C"
6236 #endif
6237 /* We use char because int might match the return type of a gcc2
6238    builtin and then its argument prototype would still apply.  */
6239 char tgoto ();
6240 int
6241 main (void)
6242 {
6243 tgoto ();
6244   ;
6245   return 0;
6246 }
6247 _ACEOF
6248 rm -f conftest.$ac_objext conftest$ac_exeext
6249 if { (eval echo "$as_me:6249: \"$ac_link\"") >&5
6250   (eval $ac_link) 2>&5
6251   ac_status=$?
6252   echo "$as_me:6252: \$? = $ac_status" >&5
6253   (exit $ac_status); } &&
6254          { ac_try='test -s conftest$ac_exeext'
6255   { (eval echo "$as_me:6255: \"$ac_try\"") >&5
6256   (eval $ac_try) 2>&5
6257   ac_status=$?
6258   echo "$as_me:6258: \$? = $ac_status" >&5
6259   (exit $ac_status); }; }; then
6260   eval "$as_ac_Lib=yes"
6261 else
6262   echo "$as_me: failed program was:" >&5
6263 cat conftest.$ac_ext >&5
6264 eval "$as_ac_Lib=no"
6265 fi
6266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6267 LIBS=$ac_check_lib_save_LIBS
6268 fi
6269 echo "$as_me:6269: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6270 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6271 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6272
6273                                         : ${cf_nculib_root:=$cf_term_lib}
6274                                         break
6275
6276 fi
6277
6278                         done
6279
6280 fi
6281
6282         fi
6283
6284         # Check for library containing initscr
6285         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6286         if test "x$cf_curs_lib" = x
6287         then
6288                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6289                 do
6290                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6291                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6292                                 echo "$as_me:6292: checking if we can link with $cf_curs_lib library" >&5
6293 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6294                                 cat >conftest.$ac_ext <<_ACEOF
6295 #line 6295 "configure"
6296 #include "confdefs.h"
6297 #include <${cf_cv_ncurses_header:-curses.h}>
6298 int
6299 main (void)
6300 {
6301 initscr()
6302   ;
6303   return 0;
6304 }
6305 _ACEOF
6306 rm -f conftest.$ac_objext conftest$ac_exeext
6307 if { (eval echo "$as_me:6307: \"$ac_link\"") >&5
6308   (eval $ac_link) 2>&5
6309   ac_status=$?
6310   echo "$as_me:6310: \$? = $ac_status" >&5
6311   (exit $ac_status); } &&
6312          { ac_try='test -s conftest$ac_exeext'
6313   { (eval echo "$as_me:6313: \"$ac_try\"") >&5
6314   (eval $ac_try) 2>&5
6315   ac_status=$?
6316   echo "$as_me:6316: \$? = $ac_status" >&5
6317   (exit $ac_status); }; }; then
6318   cf_result=yes
6319 else
6320   echo "$as_me: failed program was:" >&5
6321 cat conftest.$ac_ext >&5
6322 cf_result=no
6323 fi
6324 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6325                                 echo "$as_me:6325: result: $cf_result" >&5
6326 echo "${ECHO_T}$cf_result" >&6
6327                                 test $cf_result = yes && break
6328                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6329                                 cf_result=no
6330                         elif test "$cf_term_lib" != predefined ; then
6331                                 echo "$as_me:6331: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6332 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6333                                 cat >conftest.$ac_ext <<_ACEOF
6334 #line 6334 "configure"
6335 #include "confdefs.h"
6336 #include <${cf_cv_ncurses_header:-curses.h}>
6337 int
6338 main (void)
6339 {
6340 initscr(); tgoto((char *)0, 0, 0);
6341   ;
6342   return 0;
6343 }
6344 _ACEOF
6345 rm -f conftest.$ac_objext conftest$ac_exeext
6346 if { (eval echo "$as_me:6346: \"$ac_link\"") >&5
6347   (eval $ac_link) 2>&5
6348   ac_status=$?
6349   echo "$as_me:6349: \$? = $ac_status" >&5
6350   (exit $ac_status); } &&
6351          { ac_try='test -s conftest$ac_exeext'
6352   { (eval echo "$as_me:6352: \"$ac_try\"") >&5
6353   (eval $ac_try) 2>&5
6354   ac_status=$?
6355   echo "$as_me:6355: \$? = $ac_status" >&5
6356   (exit $ac_status); }; }; then
6357   cf_result=no
6358 else
6359   echo "$as_me: failed program was:" >&5
6360 cat conftest.$ac_ext >&5
6361
6362                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6363                                         cat >conftest.$ac_ext <<_ACEOF
6364 #line 6364 "configure"
6365 #include "confdefs.h"
6366 #include <${cf_cv_ncurses_header:-curses.h}>
6367 int
6368 main (void)
6369 {
6370 initscr()
6371   ;
6372   return 0;
6373 }
6374 _ACEOF
6375 rm -f conftest.$ac_objext conftest$ac_exeext
6376 if { (eval echo "$as_me:6376: \"$ac_link\"") >&5
6377   (eval $ac_link) 2>&5
6378   ac_status=$?
6379   echo "$as_me:6379: \$? = $ac_status" >&5
6380   (exit $ac_status); } &&
6381          { ac_try='test -s conftest$ac_exeext'
6382   { (eval echo "$as_me:6382: \"$ac_try\"") >&5
6383   (eval $ac_try) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); }; }; then
6387   cf_result=yes
6388 else
6389   echo "$as_me: failed program was:" >&5
6390 cat conftest.$ac_ext >&5
6391 cf_result=error
6392 fi
6393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6394
6395 fi
6396 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6397                                 echo "$as_me:6397: result: $cf_result" >&5
6398 echo "${ECHO_T}$cf_result" >&6
6399                                 test $cf_result != error && break
6400                         fi
6401                 done
6402         fi
6403         test $cf_curs_lib = unknown && { { echo "$as_me:6403: error: no curses library found" >&5
6404 echo "$as_me: error: no curses library found" >&2;}
6405    { (exit 1); exit 1; }; }
6406 fi
6407 fi
6408
6409         ;;
6410 (ncursesw*)
6411
6412 echo "$as_me:6412: checking for multibyte character support" >&5
6413 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6414 if test "${cf_cv_utf8_lib+set}" = set; then
6415   echo $ECHO_N "(cached) $ECHO_C" >&6
6416 else
6417
6418         cf_save_LIBS="$LIBS"
6419         cat >conftest.$ac_ext <<_ACEOF
6420 #line 6420 "configure"
6421 #include "confdefs.h"
6422
6423 #include <stdlib.h>
6424 int
6425 main (void)
6426 {
6427 putwc(0,0);
6428   ;
6429   return 0;
6430 }
6431 _ACEOF
6432 rm -f conftest.$ac_objext conftest$ac_exeext
6433 if { (eval echo "$as_me:6433: \"$ac_link\"") >&5
6434   (eval $ac_link) 2>&5
6435   ac_status=$?
6436   echo "$as_me:6436: \$? = $ac_status" >&5
6437   (exit $ac_status); } &&
6438          { ac_try='test -s conftest$ac_exeext'
6439   { (eval echo "$as_me:6439: \"$ac_try\"") >&5
6440   (eval $ac_try) 2>&5
6441   ac_status=$?
6442   echo "$as_me:6442: \$? = $ac_status" >&5
6443   (exit $ac_status); }; }; then
6444   cf_cv_utf8_lib=yes
6445 else
6446   echo "$as_me: failed program was:" >&5
6447 cat conftest.$ac_ext >&5
6448
6449 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6450 # will be set on completion of the AC_TRY_LINK below.
6451 cf_cv_header_path_utf8=
6452 cf_cv_library_path_utf8=
6453
6454 echo "${as_me:-configure}:6454: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6455
6456 cf_save_LIBS="$LIBS"
6457
6458 cat >conftest.$ac_ext <<_ACEOF
6459 #line 6459 "configure"
6460 #include "confdefs.h"
6461
6462 #include <libutf8.h>
6463 int
6464 main (void)
6465 {
6466 putwc(0,0);
6467   ;
6468   return 0;
6469 }
6470 _ACEOF
6471 rm -f conftest.$ac_objext conftest$ac_exeext
6472 if { (eval echo "$as_me:6472: \"$ac_link\"") >&5
6473   (eval $ac_link) 2>&5
6474   ac_status=$?
6475   echo "$as_me:6475: \$? = $ac_status" >&5
6476   (exit $ac_status); } &&
6477          { ac_try='test -s conftest$ac_exeext'
6478   { (eval echo "$as_me:6478: \"$ac_try\"") >&5
6479   (eval $ac_try) 2>&5
6480   ac_status=$?
6481   echo "$as_me:6481: \$? = $ac_status" >&5
6482   (exit $ac_status); }; }; then
6483
6484         cf_cv_find_linkage_utf8=yes
6485         cf_cv_header_path_utf8=/usr/include
6486         cf_cv_library_path_utf8=/usr/lib
6487
6488 else
6489   echo "$as_me: failed program was:" >&5
6490 cat conftest.$ac_ext >&5
6491
6492 LIBS="-lutf8  $cf_save_LIBS"
6493
6494 cat >conftest.$ac_ext <<_ACEOF
6495 #line 6495 "configure"
6496 #include "confdefs.h"
6497
6498 #include <libutf8.h>
6499 int
6500 main (void)
6501 {
6502 putwc(0,0);
6503   ;
6504   return 0;
6505 }
6506 _ACEOF
6507 rm -f conftest.$ac_objext conftest$ac_exeext
6508 if { (eval echo "$as_me:6508: \"$ac_link\"") >&5
6509   (eval $ac_link) 2>&5
6510   ac_status=$?
6511   echo "$as_me:6511: \$? = $ac_status" >&5
6512   (exit $ac_status); } &&
6513          { ac_try='test -s conftest$ac_exeext'
6514   { (eval echo "$as_me:6514: \"$ac_try\"") >&5
6515   (eval $ac_try) 2>&5
6516   ac_status=$?
6517   echo "$as_me:6517: \$? = $ac_status" >&5
6518   (exit $ac_status); }; }; then
6519
6520         cf_cv_find_linkage_utf8=yes
6521         cf_cv_header_path_utf8=/usr/include
6522         cf_cv_library_path_utf8=/usr/lib
6523         cf_cv_library_file_utf8="-lutf8"
6524
6525 else
6526   echo "$as_me: failed program was:" >&5
6527 cat conftest.$ac_ext >&5
6528
6529         cf_cv_find_linkage_utf8=no
6530         LIBS="$cf_save_LIBS"
6531
6532         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6533
6534 echo "${as_me:-configure}:6534: testing find linkage for utf8 library ..." 1>&5
6535
6536 echo "${as_me:-configure}:6536: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6537
6538         cf_save_CPPFLAGS="$CPPFLAGS"
6539         cf_test_CPPFLAGS="$CPPFLAGS"
6540
6541 cf_search=
6542
6543 # collect the current set of include-directories from compiler flags
6544 cf_header_path_list=""
6545 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6546         for cf_header_path in $CPPFLAGS $CFLAGS
6547         do
6548                 case $cf_header_path in
6549                 (-I*)
6550                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6551
6552 test "x$cf_header_path" != "xNONE" && \
6553 test -d "$cf_header_path" && \
6554  {
6555         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6556         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6557         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6558         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6559         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6560         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6561 }
6562
6563                         cf_header_path_list="$cf_header_path_list $cf_search"
6564                         ;;
6565                 esac
6566         done
6567 fi
6568
6569 # add the variations for the package we are looking for
6570
6571 cf_search=
6572
6573 test "x$prefix" != "xNONE" && \
6574 test -d "$prefix" && \
6575  {
6576         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6577         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6578         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6579         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6580         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6581         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6582 }
6583
6584 for cf_subdir_prefix in \
6585         /usr \
6586         /usr/local \
6587         /usr/pkg \
6588         /opt \
6589         /opt/local \
6590         $HOME
6591 do
6592
6593 test "x$cf_subdir_prefix" != "x$prefix" && \
6594 test -d "$cf_subdir_prefix" && \
6595 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6596         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6597         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6598         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6599         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6600         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6601         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6602 }
6603
6604 done
6605
6606 test "$includedir" != NONE && \
6607 test "$includedir" != "/usr/include" && \
6608 test -d "$includedir" && {
6609         test -d $includedir &&    cf_search="$cf_search $includedir"
6610         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6611 }
6612
6613 test "$oldincludedir" != NONE && \
6614 test "$oldincludedir" != "/usr/include" && \
6615 test -d "$oldincludedir" && {
6616         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6617         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6618 }
6619
6620 cf_search="$cf_search $cf_header_path_list"
6621
6622         for cf_cv_header_path_utf8 in $cf_search
6623         do
6624                 if test -d $cf_cv_header_path_utf8 ; then
6625                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6626
6627 echo "${as_me:-configure}:6627: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6628
6629                         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
6630                         cat >conftest.$ac_ext <<_ACEOF
6631 #line 6631 "configure"
6632 #include "confdefs.h"
6633
6634 #include <libutf8.h>
6635 int
6636 main (void)
6637 {
6638 putwc(0,0);
6639   ;
6640   return 0;
6641 }
6642 _ACEOF
6643 rm -f conftest.$ac_objext
6644 if { (eval echo "$as_me:6644: \"$ac_compile\"") >&5
6645   (eval $ac_compile) 2>&5
6646   ac_status=$?
6647   echo "$as_me:6647: \$? = $ac_status" >&5
6648   (exit $ac_status); } &&
6649          { ac_try='test -s conftest.$ac_objext'
6650   { (eval echo "$as_me:6650: \"$ac_try\"") >&5
6651   (eval $ac_try) 2>&5
6652   ac_status=$?
6653   echo "$as_me:6653: \$? = $ac_status" >&5
6654   (exit $ac_status); }; }; then
6655
6656                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6657
6658 echo "${as_me:-configure}:6658: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6659
6660                                 cf_cv_find_linkage_utf8=maybe
6661                                 cf_test_CPPFLAGS="$CPPFLAGS"
6662                                 break
6663 else
6664   echo "$as_me: failed program was:" >&5
6665 cat conftest.$ac_ext >&5
6666
6667                                 CPPFLAGS="$cf_save_CPPFLAGS"
6668
6669 fi
6670 rm -f conftest.$ac_objext conftest.$ac_ext
6671                 fi
6672         done
6673
6674         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6675
6676 echo "${as_me:-configure}:6676: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6677
6678                 cf_save_LIBS="$LIBS"
6679                 cf_save_LDFLAGS="$LDFLAGS"
6680
6681                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6682
6683 cf_search=
6684 cf_library_path_list=""
6685 if test -n "${LDFLAGS}${LIBS}" ; then
6686         for cf_library_path in $LDFLAGS $LIBS
6687         do
6688                 case $cf_library_path in
6689                 (-L*)
6690                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6691
6692 test "x$cf_library_path" != "xNONE" && \
6693 test -d "$cf_library_path" && \
6694  {
6695         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6696         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6697         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6698         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6699         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6700         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6701 }
6702
6703                         cf_library_path_list="$cf_library_path_list $cf_search"
6704                         ;;
6705                 esac
6706         done
6707 fi
6708
6709 cf_search=
6710
6711 test "x$prefix" != "xNONE" && \
6712 test -d "$prefix" && \
6713  {
6714         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6715         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6716         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6717         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6718         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6719         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6720 }
6721
6722 for cf_subdir_prefix in \
6723         /usr \
6724         /usr/local \
6725         /usr/pkg \
6726         /opt \
6727         /opt/local \
6728         $HOME
6729 do
6730
6731 test "x$cf_subdir_prefix" != "x$prefix" && \
6732 test -d "$cf_subdir_prefix" && \
6733 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6734         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6735         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6736         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6737         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6738         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6739         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6740 }
6741
6742 done
6743
6744 cf_search="$cf_library_path_list $cf_search"
6745
6746                         for cf_cv_library_path_utf8 in $cf_search
6747                         do
6748                                 if test -d $cf_cv_library_path_utf8 ; then
6749                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6750
6751 echo "${as_me:-configure}:6751: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6752
6753                                         CPPFLAGS="$cf_test_CPPFLAGS"
6754                                         LIBS="-lutf8  $cf_save_LIBS"
6755                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6756                                         cat >conftest.$ac_ext <<_ACEOF
6757 #line 6757 "configure"
6758 #include "confdefs.h"
6759
6760 #include <libutf8.h>
6761 int
6762 main (void)
6763 {
6764 putwc(0,0);
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
6782                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
6783
6784 echo "${as_me:-configure}:6784: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
6785
6786                                         cf_cv_find_linkage_utf8=yes
6787                                         cf_cv_library_file_utf8="-lutf8"
6788                                         break
6789 else
6790   echo "$as_me: failed program was:" >&5
6791 cat conftest.$ac_ext >&5
6792
6793                                         CPPFLAGS="$cf_save_CPPFLAGS"
6794                                         LIBS="$cf_save_LIBS"
6795                                         LDFLAGS="$cf_save_LDFLAGS"
6796
6797 fi
6798 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6799                                 fi
6800                         done
6801                         CPPFLAGS="$cf_save_CPPFLAGS"
6802                         LDFLAGS="$cf_save_LDFLAGS"
6803                 fi
6804
6805         else
6806                 cf_cv_find_linkage_utf8=no
6807         fi
6808
6809 fi
6810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6811
6812 fi
6813 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6814
6815 LIBS="$cf_save_LIBS"
6816
6817 if test "$cf_cv_find_linkage_utf8" = yes ; then
6818 cf_cv_utf8_lib=add-on
6819 else
6820 cf_cv_utf8_lib=no
6821 fi
6822
6823 fi
6824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6825 fi
6826 echo "$as_me:6826: result: $cf_cv_utf8_lib" >&5
6827 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
6828
6829 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
6830 # ncurses/ncursesw:
6831 if test "$cf_cv_utf8_lib" = "add-on" ; then
6832
6833 cat >>confdefs.h <<\EOF
6834 #define HAVE_LIBUTF8_H 1
6835 EOF
6836
6837 if test -n "$cf_cv_header_path_utf8" ; then
6838   for cf_add_incdir in $cf_cv_header_path_utf8
6839   do
6840         while test $cf_add_incdir != /usr/include
6841         do
6842           if test -d $cf_add_incdir
6843           then
6844                 cf_have_incdir=no
6845                 if test -n "$CFLAGS$CPPFLAGS" ; then
6846                   # a loop is needed to ensure we can add subdirs of existing dirs
6847                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6848                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6849                           cf_have_incdir=yes; break
6850                         fi
6851                   done
6852                 fi
6853
6854                 if test "$cf_have_incdir" = no ; then
6855                   if test "$cf_add_incdir" = /usr/local/include ; then
6856                         if test "$GCC" = yes
6857                         then
6858                           cf_save_CPPFLAGS=$CPPFLAGS
6859                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6860                           cat >conftest.$ac_ext <<_ACEOF
6861 #line 6861 "configure"
6862 #include "confdefs.h"
6863 #include <stdio.h>
6864 int
6865 main (void)
6866 {
6867 printf("Hello")
6868   ;
6869   return 0;
6870 }
6871 _ACEOF
6872 rm -f conftest.$ac_objext
6873 if { (eval echo "$as_me:6873: \"$ac_compile\"") >&5
6874   (eval $ac_compile) 2>&5
6875   ac_status=$?
6876   echo "$as_me:6876: \$? = $ac_status" >&5
6877   (exit $ac_status); } &&
6878          { ac_try='test -s conftest.$ac_objext'
6879   { (eval echo "$as_me:6879: \"$ac_try\"") >&5
6880   (eval $ac_try) 2>&5
6881   ac_status=$?
6882   echo "$as_me:6882: \$? = $ac_status" >&5
6883   (exit $ac_status); }; }; then
6884   :
6885 else
6886   echo "$as_me: failed program was:" >&5
6887 cat conftest.$ac_ext >&5
6888 cf_have_incdir=yes
6889 fi
6890 rm -f conftest.$ac_objext conftest.$ac_ext
6891                           CPPFLAGS=$cf_save_CPPFLAGS
6892                         fi
6893                   fi
6894                 fi
6895
6896                 if test "$cf_have_incdir" = no ; then
6897                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6898
6899 echo "${as_me:-configure}:6899: testing adding $cf_add_incdir to include-path ..." 1>&5
6900
6901                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6902
6903                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6904                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6905                   cf_add_incdir="$cf_top_incdir"
6906                 else
6907                   break
6908                 fi
6909           else
6910                 break
6911           fi
6912         done
6913   done
6914 fi
6915
6916 if test -n "$cf_cv_library_path_utf8" ; then
6917         for cf_add_libdir in $cf_cv_library_path_utf8
6918         do
6919                 if test $cf_add_libdir = /usr/lib ; then
6920                         :
6921                 elif test -d $cf_add_libdir
6922                 then
6923                         cf_have_libdir=no
6924                         if test -n "$LDFLAGS$LIBS" ; then
6925                                 # a loop is needed to ensure we can add subdirs of existing dirs
6926                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6927                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6928                                                 cf_have_libdir=yes; break
6929                                         fi
6930                                 done
6931                         fi
6932                         if test "$cf_have_libdir" = no ; then
6933                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6934
6935 echo "${as_me:-configure}:6935: testing adding $cf_add_libdir to library-path ..." 1>&5
6936
6937                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6938                         fi
6939                 fi
6940         done
6941 fi
6942
6943 cf_add_libs="$cf_cv_library_file_utf8"
6944 # Filter out duplicates - this happens with badly-designed ".pc" files...
6945 for cf_add_1lib in $LIBS
6946 do
6947         for cf_add_2lib in $cf_add_libs
6948         do
6949                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6950                 then
6951                         cf_add_1lib=
6952                         break
6953                 fi
6954         done
6955         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6956 done
6957 LIBS="$cf_add_libs"
6958
6959 fi
6960
6961 cf_ncuconfig_root=$cf_cv_screen
6962 cf_have_ncuconfig=no
6963
6964 if test "x${PKG_CONFIG:=none}" != xnone; then
6965         echo "$as_me:6965: checking pkg-config for $cf_ncuconfig_root" >&5
6966 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
6967         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
6968                 echo "$as_me:6968: result: yes" >&5
6969 echo "${ECHO_T}yes" >&6
6970
6971                 echo "$as_me:6971: checking if the $cf_ncuconfig_root package files work" >&5
6972 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
6973                 cf_have_ncuconfig=unknown
6974
6975                 cf_save_CPPFLAGS="$CPPFLAGS"
6976                 cf_save_LIBS="$LIBS"
6977
6978                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
6979
6980 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
6981 # Filter out duplicates - this happens with badly-designed ".pc" files...
6982 for cf_add_1lib in $LIBS
6983 do
6984         for cf_add_2lib in $cf_add_libs
6985         do
6986                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6987                 then
6988                         cf_add_1lib=
6989                         break
6990                 fi
6991         done
6992         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6993 done
6994 LIBS="$cf_add_libs"
6995
6996                 cat >conftest.$ac_ext <<_ACEOF
6997 #line 6997 "configure"
6998 #include "confdefs.h"
6999 #include <${cf_cv_ncurses_header:-curses.h}>
7000 int
7001 main (void)
7002 {
7003 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7004   ;
7005   return 0;
7006 }
7007 _ACEOF
7008 rm -f conftest.$ac_objext conftest$ac_exeext
7009 if { (eval echo "$as_me:7009: \"$ac_link\"") >&5
7010   (eval $ac_link) 2>&5
7011   ac_status=$?
7012   echo "$as_me:7012: \$? = $ac_status" >&5
7013   (exit $ac_status); } &&
7014          { ac_try='test -s conftest$ac_exeext'
7015   { (eval echo "$as_me:7015: \"$ac_try\"") >&5
7016   (eval $ac_try) 2>&5
7017   ac_status=$?
7018   echo "$as_me:7018: \$? = $ac_status" >&5
7019   (exit $ac_status); }; }; then
7020   if test "$cross_compiling" = yes; then
7021   cf_have_ncuconfig=maybe
7022 else
7023   cat >conftest.$ac_ext <<_ACEOF
7024 #line 7024 "configure"
7025 #include "confdefs.h"
7026 #include <${cf_cv_ncurses_header:-curses.h}>
7027                                 int main(void)
7028                                 { char *xx = curses_version(); return (xx == 0); }
7029 _ACEOF
7030 rm -f conftest$ac_exeext
7031 if { (eval echo "$as_me:7031: \"$ac_link\"") >&5
7032   (eval $ac_link) 2>&5
7033   ac_status=$?
7034   echo "$as_me:7034: \$? = $ac_status" >&5
7035   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7036   { (eval echo "$as_me:7036: \"$ac_try\"") >&5
7037   (eval $ac_try) 2>&5
7038   ac_status=$?
7039   echo "$as_me:7039: \$? = $ac_status" >&5
7040   (exit $ac_status); }; }; then
7041   cf_have_ncuconfig=yes
7042 else
7043   echo "$as_me: program exited with status $ac_status" >&5
7044 echo "$as_me: failed program was:" >&5
7045 cat conftest.$ac_ext >&5
7046 cf_have_ncuconfig=no
7047 fi
7048 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7049 fi
7050 else
7051   echo "$as_me: failed program was:" >&5
7052 cat conftest.$ac_ext >&5
7053 cf_have_ncuconfig=no
7054 fi
7055 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7056                 echo "$as_me:7056: result: $cf_have_ncuconfig" >&5
7057 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7058                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7059                 if test "$cf_have_ncuconfig" != "yes"
7060                 then
7061                         CPPFLAGS="$cf_save_CPPFLAGS"
7062                         LIBS="$cf_save_LIBS"
7063                         NCURSES_CONFIG_PKG=none
7064                 else
7065
7066 cat >>confdefs.h <<\EOF
7067 #define NCURSES 1
7068 EOF
7069
7070                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7071
7072 echo "$as_me:7072: checking for terminfo header" >&5
7073 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7074 if test "${cf_cv_term_header+set}" = set; then
7075   echo $ECHO_N "(cached) $ECHO_C" >&6
7076 else
7077
7078 case ${cf_cv_ncurses_header} in
7079 (*/ncurses.h|*/ncursesw.h)
7080         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7081         ;;
7082 (*)
7083         cf_term_header=term.h
7084         ;;
7085 esac
7086
7087 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7088 do
7089 cat >conftest.$ac_ext <<_ACEOF
7090 #line 7090 "configure"
7091 #include "confdefs.h"
7092 #include <stdio.h>
7093 #include <${cf_cv_ncurses_header:-curses.h}>
7094 #include <$cf_test>
7095
7096 int
7097 main (void)
7098 {
7099 int x = auto_left_margin
7100   ;
7101   return 0;
7102 }
7103 _ACEOF
7104 rm -f conftest.$ac_objext
7105 if { (eval echo "$as_me:7105: \"$ac_compile\"") >&5
7106   (eval $ac_compile) 2>&5
7107   ac_status=$?
7108   echo "$as_me:7108: \$? = $ac_status" >&5
7109   (exit $ac_status); } &&
7110          { ac_try='test -s conftest.$ac_objext'
7111   { (eval echo "$as_me:7111: \"$ac_try\"") >&5
7112   (eval $ac_try) 2>&5
7113   ac_status=$?
7114   echo "$as_me:7114: \$? = $ac_status" >&5
7115   (exit $ac_status); }; }; then
7116
7117         cf_cv_term_header="$cf_test"
7118 else
7119   echo "$as_me: failed program was:" >&5
7120 cat conftest.$ac_ext >&5
7121
7122         cf_cv_term_header=unknown
7123
7124 fi
7125 rm -f conftest.$ac_objext conftest.$ac_ext
7126         test "$cf_cv_term_header" != unknown && break
7127 done
7128
7129 fi
7130 echo "$as_me:7130: result: $cf_cv_term_header" >&5
7131 echo "${ECHO_T}$cf_cv_term_header" >&6
7132
7133 # Set definitions to allow ifdef'ing to accommodate subdirectories
7134
7135 case $cf_cv_term_header in
7136 (*term.h)
7137
7138 cat >>confdefs.h <<\EOF
7139 #define HAVE_TERM_H 1
7140 EOF
7141
7142         ;;
7143 esac
7144
7145 case $cf_cv_term_header in
7146 (ncurses/term.h)
7147
7148 cat >>confdefs.h <<\EOF
7149 #define HAVE_NCURSES_TERM_H 1
7150 EOF
7151
7152         ;;
7153 (ncursesw/term.h)
7154
7155 cat >>confdefs.h <<\EOF
7156 #define HAVE_NCURSESW_TERM_H 1
7157 EOF
7158
7159         ;;
7160 esac
7161
7162                 fi
7163
7164         else
7165                 echo "$as_me:7165: result: no" >&5
7166 echo "${ECHO_T}no" >&6
7167                 NCURSES_CONFIG_PKG=none
7168         fi
7169 else
7170         NCURSES_CONFIG_PKG=none
7171 fi
7172
7173 if test "x$cf_have_ncuconfig" = "xno"; then
7174         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7175
7176 if test -n "$ac_tool_prefix"; then
7177   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7178   do
7179     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7180 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7181 echo "$as_me:7181: checking for $ac_word" >&5
7182 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7183 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7184   echo $ECHO_N "(cached) $ECHO_C" >&6
7185 else
7186   if test -n "$NCURSES_CONFIG"; then
7187   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7188 else
7189   ac_save_IFS=$IFS; IFS=$ac_path_separator
7190 ac_dummy="$PATH"
7191 for ac_dir in $ac_dummy; do
7192   IFS=$ac_save_IFS
7193   test -z "$ac_dir" && ac_dir=.
7194   $as_executable_p "$ac_dir/$ac_word" || continue
7195 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7196 echo "$as_me:7196: found $ac_dir/$ac_word" >&5
7197 break
7198 done
7199
7200 fi
7201 fi
7202 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7203 if test -n "$NCURSES_CONFIG"; then
7204   echo "$as_me:7204: result: $NCURSES_CONFIG" >&5
7205 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7206 else
7207   echo "$as_me:7207: result: no" >&5
7208 echo "${ECHO_T}no" >&6
7209 fi
7210
7211     test -n "$NCURSES_CONFIG" && break
7212   done
7213 fi
7214 if test -z "$NCURSES_CONFIG"; then
7215   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7216   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7217 do
7218   # Extract the first word of "$ac_prog", so it can be a program name with args.
7219 set dummy $ac_prog; ac_word=$2
7220 echo "$as_me:7220: checking for $ac_word" >&5
7221 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7222 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7223   echo $ECHO_N "(cached) $ECHO_C" >&6
7224 else
7225   if test -n "$ac_ct_NCURSES_CONFIG"; then
7226   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7227 else
7228   ac_save_IFS=$IFS; IFS=$ac_path_separator
7229 ac_dummy="$PATH"
7230 for ac_dir in $ac_dummy; do
7231   IFS=$ac_save_IFS
7232   test -z "$ac_dir" && ac_dir=.
7233   $as_executable_p "$ac_dir/$ac_word" || continue
7234 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7235 echo "$as_me:7235: found $ac_dir/$ac_word" >&5
7236 break
7237 done
7238
7239 fi
7240 fi
7241 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7242 if test -n "$ac_ct_NCURSES_CONFIG"; then
7243   echo "$as_me:7243: result: $ac_ct_NCURSES_CONFIG" >&5
7244 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7245 else
7246   echo "$as_me:7246: result: no" >&5
7247 echo "${ECHO_T}no" >&6
7248 fi
7249
7250   test -n "$ac_ct_NCURSES_CONFIG" && break
7251 done
7252 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7253
7254   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7255 fi
7256
7257         if test "$NCURSES_CONFIG" != none ; then
7258
7259                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
7260
7261 cf_add_libs="`$NCURSES_CONFIG --libs`"
7262 # Filter out duplicates - this happens with badly-designed ".pc" files...
7263 for cf_add_1lib in $LIBS
7264 do
7265         for cf_add_2lib in $cf_add_libs
7266         do
7267                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7268                 then
7269                         cf_add_1lib=
7270                         break
7271                 fi
7272         done
7273         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7274 done
7275 LIBS="$cf_add_libs"
7276
7277                 # even with config script, some packages use no-override for curses.h
7278
7279 echo "$as_me:7279: checking if we have identified curses headers" >&5
7280 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7281 if test "${cf_cv_ncurses_header+set}" = set; then
7282   echo $ECHO_N "(cached) $ECHO_C" >&6
7283 else
7284
7285 cf_cv_ncurses_header=none
7286 for cf_header in \
7287         ncurses.h $cf_cv_screen/ncurses.h \
7288         curses.h $cf_cv_screen/curses.h
7289 do
7290 cat >conftest.$ac_ext <<_ACEOF
7291 #line 7291 "configure"
7292 #include "confdefs.h"
7293 #include <${cf_header}>
7294 int
7295 main (void)
7296 {
7297 initscr(); tgoto("?", 0,0)
7298   ;
7299   return 0;
7300 }
7301 _ACEOF
7302 rm -f conftest.$ac_objext
7303 if { (eval echo "$as_me:7303: \"$ac_compile\"") >&5
7304   (eval $ac_compile) 2>&5
7305   ac_status=$?
7306   echo "$as_me:7306: \$? = $ac_status" >&5
7307   (exit $ac_status); } &&
7308          { ac_try='test -s conftest.$ac_objext'
7309   { (eval echo "$as_me:7309: \"$ac_try\"") >&5
7310   (eval $ac_try) 2>&5
7311   ac_status=$?
7312   echo "$as_me:7312: \$? = $ac_status" >&5
7313   (exit $ac_status); }; }; then
7314   cf_cv_ncurses_header=$cf_header; break
7315 else
7316   echo "$as_me: failed program was:" >&5
7317 cat conftest.$ac_ext >&5
7318 fi
7319 rm -f conftest.$ac_objext conftest.$ac_ext
7320 done
7321
7322 fi
7323 echo "$as_me:7323: result: $cf_cv_ncurses_header" >&5
7324 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7325
7326 if test "$cf_cv_ncurses_header" = none ; then
7327         { { echo "$as_me:7327: error: No curses header-files found" >&5
7328 echo "$as_me: error: No curses header-files found" >&2;}
7329    { (exit 1); exit 1; }; }
7330 fi
7331
7332 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7333
7334 for ac_header in $cf_cv_ncurses_header
7335 do
7336 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7337 echo "$as_me:7337: checking for $ac_header" >&5
7338 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7339 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7340   echo $ECHO_N "(cached) $ECHO_C" >&6
7341 else
7342   cat >conftest.$ac_ext <<_ACEOF
7343 #line 7343 "configure"
7344 #include "confdefs.h"
7345 #include <$ac_header>
7346 _ACEOF
7347 if { (eval echo "$as_me:7347: \"$ac_cpp conftest.$ac_ext\"") >&5
7348   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7349   ac_status=$?
7350   egrep -v '^ *\+' conftest.er1 >conftest.err
7351   rm -f conftest.er1
7352   cat conftest.err >&5
7353   echo "$as_me:7353: \$? = $ac_status" >&5
7354   (exit $ac_status); } >/dev/null; then
7355   if test -s conftest.err; then
7356     ac_cpp_err=$ac_c_preproc_warn_flag
7357   else
7358     ac_cpp_err=
7359   fi
7360 else
7361   ac_cpp_err=yes
7362 fi
7363 if test -z "$ac_cpp_err"; then
7364   eval "$as_ac_Header=yes"
7365 else
7366   echo "$as_me: failed program was:" >&5
7367   cat conftest.$ac_ext >&5
7368   eval "$as_ac_Header=no"
7369 fi
7370 rm -f conftest.err conftest.$ac_ext
7371 fi
7372 echo "$as_me:7372: result: `eval echo '${'$as_ac_Header'}'`" >&5
7373 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7374 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7375   cat >>confdefs.h <<EOF
7376 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7377 EOF
7378
7379 fi
7380 done
7381
7382 cat >>confdefs.h <<\EOF
7383 #define NCURSES 1
7384 EOF
7385
7386 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7387
7388                 cat >>confdefs.h <<EOF
7389 #define $cf_nculib_ROOT 1
7390 EOF
7391
7392                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7393
7394         else
7395
7396 cf_ncuhdr_root=$cf_cv_screen
7397
7398 test -n "$cf_cv_curses_dir" && \
7399 test "$cf_cv_curses_dir" != "no" && { \
7400
7401 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7402   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7403   do
7404         while test $cf_add_incdir != /usr/include
7405         do
7406           if test -d $cf_add_incdir
7407           then
7408                 cf_have_incdir=no
7409                 if test -n "$CFLAGS$CPPFLAGS" ; then
7410                   # a loop is needed to ensure we can add subdirs of existing dirs
7411                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7412                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7413                           cf_have_incdir=yes; break
7414                         fi
7415                   done
7416                 fi
7417
7418                 if test "$cf_have_incdir" = no ; then
7419                   if test "$cf_add_incdir" = /usr/local/include ; then
7420                         if test "$GCC" = yes
7421                         then
7422                           cf_save_CPPFLAGS=$CPPFLAGS
7423                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7424                           cat >conftest.$ac_ext <<_ACEOF
7425 #line 7425 "configure"
7426 #include "confdefs.h"
7427 #include <stdio.h>
7428 int
7429 main (void)
7430 {
7431 printf("Hello")
7432   ;
7433   return 0;
7434 }
7435 _ACEOF
7436 rm -f conftest.$ac_objext
7437 if { (eval echo "$as_me:7437: \"$ac_compile\"") >&5
7438   (eval $ac_compile) 2>&5
7439   ac_status=$?
7440   echo "$as_me:7440: \$? = $ac_status" >&5
7441   (exit $ac_status); } &&
7442          { ac_try='test -s conftest.$ac_objext'
7443   { (eval echo "$as_me:7443: \"$ac_try\"") >&5
7444   (eval $ac_try) 2>&5
7445   ac_status=$?
7446   echo "$as_me:7446: \$? = $ac_status" >&5
7447   (exit $ac_status); }; }; then
7448   :
7449 else
7450   echo "$as_me: failed program was:" >&5
7451 cat conftest.$ac_ext >&5
7452 cf_have_incdir=yes
7453 fi
7454 rm -f conftest.$ac_objext conftest.$ac_ext
7455                           CPPFLAGS=$cf_save_CPPFLAGS
7456                         fi
7457                   fi
7458                 fi
7459
7460                 if test "$cf_have_incdir" = no ; then
7461                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7462
7463 echo "${as_me:-configure}:7463: testing adding $cf_add_incdir to include-path ..." 1>&5
7464
7465                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7466
7467                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7468                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7469                   cf_add_incdir="$cf_top_incdir"
7470                 else
7471                   break
7472                 fi
7473           else
7474                 break
7475           fi
7476         done
7477   done
7478 fi
7479
7480 }
7481
7482 echo "$as_me:7482: checking for $cf_ncuhdr_root header in include-path" >&5
7483 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7484 if test "${cf_cv_ncurses_h+set}" = set; then
7485   echo $ECHO_N "(cached) $ECHO_C" >&6
7486 else
7487
7488         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7489         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7490         for cf_header in $cf_header_list
7491         do
7492
7493         cat >conftest.$ac_ext <<_ACEOF
7494 #line 7494 "configure"
7495 #include "confdefs.h"
7496
7497 #include <$cf_header>
7498 int
7499 main (void)
7500 {
7501
7502 #ifdef NCURSES_VERSION
7503
7504 printf("%s\n", NCURSES_VERSION);
7505 #else
7506 #ifdef __NCURSES_H
7507 printf("old\n");
7508 #else
7509         make an error
7510 #endif
7511 #endif
7512
7513   ;
7514   return 0;
7515 }
7516 _ACEOF
7517 rm -f conftest.$ac_objext
7518 if { (eval echo "$as_me:7518: \"$ac_compile\"") >&5
7519   (eval $ac_compile) 2>&5
7520   ac_status=$?
7521   echo "$as_me:7521: \$? = $ac_status" >&5
7522   (exit $ac_status); } &&
7523          { ac_try='test -s conftest.$ac_objext'
7524   { (eval echo "$as_me:7524: \"$ac_try\"") >&5
7525   (eval $ac_try) 2>&5
7526   ac_status=$?
7527   echo "$as_me:7527: \$? = $ac_status" >&5
7528   (exit $ac_status); }; }; then
7529   cf_cv_ncurses_h=$cf_header
7530
7531 else
7532   echo "$as_me: failed program was:" >&5
7533 cat conftest.$ac_ext >&5
7534 cf_cv_ncurses_h=no
7535 fi
7536 rm -f conftest.$ac_objext conftest.$ac_ext
7537
7538                 test "$cf_cv_ncurses_h" != no && break
7539         done
7540
7541 fi
7542 echo "$as_me:7542: result: $cf_cv_ncurses_h" >&5
7543 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7544
7545 if test "$cf_cv_ncurses_h" != no ; then
7546         cf_cv_ncurses_header=$cf_cv_ncurses_h
7547 else
7548
7549 echo "$as_me:7549: checking for $cf_ncuhdr_root include-path" >&5
7550 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7551 if test "${cf_cv_ncurses_h2+set}" = set; then
7552   echo $ECHO_N "(cached) $ECHO_C" >&6
7553 else
7554
7555         test -n "$verbose" && echo
7556
7557 cf_search=
7558
7559 # collect the current set of include-directories from compiler flags
7560 cf_header_path_list=""
7561 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7562         for cf_header_path in $CPPFLAGS $CFLAGS
7563         do
7564                 case $cf_header_path in
7565                 (-I*)
7566                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7567
7568 test "x$cf_header_path" != "xNONE" && \
7569 test -d "$cf_header_path" && \
7570  {
7571         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7572         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7573         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
7574         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
7575         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
7576         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"
7577 }
7578
7579                         cf_header_path_list="$cf_header_path_list $cf_search"
7580                         ;;
7581                 esac
7582         done
7583 fi
7584
7585 # add the variations for the package we are looking for
7586
7587 cf_search=
7588
7589 test "x$prefix" != "xNONE" && \
7590 test -d "$prefix" && \
7591  {
7592         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7593         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
7594         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
7595         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
7596         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
7597         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
7598 }
7599
7600 for cf_subdir_prefix in \
7601         /usr \
7602         /usr/local \
7603         /usr/pkg \
7604         /opt \
7605         /opt/local \
7606         $HOME
7607 do
7608
7609 test "x$cf_subdir_prefix" != "x$prefix" && \
7610 test -d "$cf_subdir_prefix" && \
7611 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
7612         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
7613         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
7614         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
7615         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
7616         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
7617         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"
7618 }
7619
7620 done
7621
7622 test "$includedir" != NONE && \
7623 test "$includedir" != "/usr/include" && \
7624 test -d "$includedir" && {
7625         test -d $includedir &&    cf_search="$cf_search $includedir"
7626         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
7627 }
7628
7629 test "$oldincludedir" != NONE && \
7630 test "$oldincludedir" != "/usr/include" && \
7631 test -d "$oldincludedir" && {
7632         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
7633         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
7634 }
7635
7636 cf_search="$cf_search $cf_header_path_list"
7637
7638         test -n "$verbose" && echo search path $cf_search
7639         cf_save2_CPPFLAGS="$CPPFLAGS"
7640         for cf_incdir in $cf_search
7641         do
7642
7643 if test -n "$cf_incdir" ; then
7644   for cf_add_incdir in $cf_incdir
7645   do
7646         while test $cf_add_incdir != /usr/include
7647         do
7648           if test -d $cf_add_incdir
7649           then
7650                 cf_have_incdir=no
7651                 if test -n "$CFLAGS$CPPFLAGS" ; then
7652                   # a loop is needed to ensure we can add subdirs of existing dirs
7653                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7654                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7655                           cf_have_incdir=yes; break
7656                         fi
7657                   done
7658                 fi
7659
7660                 if test "$cf_have_incdir" = no ; then
7661                   if test "$cf_add_incdir" = /usr/local/include ; then
7662                         if test "$GCC" = yes
7663                         then
7664                           cf_save_CPPFLAGS=$CPPFLAGS
7665                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7666                           cat >conftest.$ac_ext <<_ACEOF
7667 #line 7667 "configure"
7668 #include "confdefs.h"
7669 #include <stdio.h>
7670 int
7671 main (void)
7672 {
7673 printf("Hello")
7674   ;
7675   return 0;
7676 }
7677 _ACEOF
7678 rm -f conftest.$ac_objext
7679 if { (eval echo "$as_me:7679: \"$ac_compile\"") >&5
7680   (eval $ac_compile) 2>&5
7681   ac_status=$?
7682   echo "$as_me:7682: \$? = $ac_status" >&5
7683   (exit $ac_status); } &&
7684          { ac_try='test -s conftest.$ac_objext'
7685   { (eval echo "$as_me:7685: \"$ac_try\"") >&5
7686   (eval $ac_try) 2>&5
7687   ac_status=$?
7688   echo "$as_me:7688: \$? = $ac_status" >&5
7689   (exit $ac_status); }; }; then
7690   :
7691 else
7692   echo "$as_me: failed program was:" >&5
7693 cat conftest.$ac_ext >&5
7694 cf_have_incdir=yes
7695 fi
7696 rm -f conftest.$ac_objext conftest.$ac_ext
7697                           CPPFLAGS=$cf_save_CPPFLAGS
7698                         fi
7699                   fi
7700                 fi
7701
7702                 if test "$cf_have_incdir" = no ; then
7703                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7704
7705 echo "${as_me:-configure}:7705: testing adding $cf_add_incdir to include-path ..." 1>&5
7706
7707                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7708
7709                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7710                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7711                   cf_add_incdir="$cf_top_incdir"
7712                 else
7713                   break
7714                 fi
7715           else
7716                 break
7717           fi
7718         done
7719   done
7720 fi
7721
7722                 for cf_header in \
7723                         ncurses.h \
7724                         curses.h
7725                 do
7726
7727         cat >conftest.$ac_ext <<_ACEOF
7728 #line 7728 "configure"
7729 #include "confdefs.h"
7730
7731 #include <$cf_header>
7732 int
7733 main (void)
7734 {
7735
7736 #ifdef NCURSES_VERSION
7737
7738 printf("%s\n", NCURSES_VERSION);
7739 #else
7740 #ifdef __NCURSES_H
7741 printf("old\n");
7742 #else
7743         make an error
7744 #endif
7745 #endif
7746
7747   ;
7748   return 0;
7749 }
7750 _ACEOF
7751 rm -f conftest.$ac_objext
7752 if { (eval echo "$as_me:7752: \"$ac_compile\"") >&5
7753   (eval $ac_compile) 2>&5
7754   ac_status=$?
7755   echo "$as_me:7755: \$? = $ac_status" >&5
7756   (exit $ac_status); } &&
7757          { ac_try='test -s conftest.$ac_objext'
7758   { (eval echo "$as_me:7758: \"$ac_try\"") >&5
7759   (eval $ac_try) 2>&5
7760   ac_status=$?
7761   echo "$as_me:7761: \$? = $ac_status" >&5
7762   (exit $ac_status); }; }; then
7763   cf_cv_ncurses_h2=$cf_header
7764
7765 else
7766   echo "$as_me: failed program was:" >&5
7767 cat conftest.$ac_ext >&5
7768 cf_cv_ncurses_h2=no
7769 fi
7770 rm -f conftest.$ac_objext conftest.$ac_ext
7771
7772                         if test "$cf_cv_ncurses_h2" != no ; then
7773                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7774                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7775                                 break
7776                         fi
7777                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7778                 done
7779                 CPPFLAGS="$cf_save2_CPPFLAGS"
7780                 test "$cf_cv_ncurses_h2" != no && break
7781         done
7782         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7782: error: not found" >&5
7783 echo "$as_me: error: not found" >&2;}
7784    { (exit 1); exit 1; }; }
7785
7786 fi
7787 echo "$as_me:7787: result: $cf_cv_ncurses_h2" >&5
7788 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7789
7790         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7791         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7792         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7793                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7794         fi
7795
7796 if test -n "$cf_1st_incdir" ; then
7797   for cf_add_incdir in $cf_1st_incdir
7798   do
7799         while test $cf_add_incdir != /usr/include
7800         do
7801           if test -d $cf_add_incdir
7802           then
7803                 cf_have_incdir=no
7804                 if test -n "$CFLAGS$CPPFLAGS" ; then
7805                   # a loop is needed to ensure we can add subdirs of existing dirs
7806                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7807                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7808                           cf_have_incdir=yes; break
7809                         fi
7810                   done
7811                 fi
7812
7813                 if test "$cf_have_incdir" = no ; then
7814                   if test "$cf_add_incdir" = /usr/local/include ; then
7815                         if test "$GCC" = yes
7816                         then
7817                           cf_save_CPPFLAGS=$CPPFLAGS
7818                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7819                           cat >conftest.$ac_ext <<_ACEOF
7820 #line 7820 "configure"
7821 #include "confdefs.h"
7822 #include <stdio.h>
7823 int
7824 main (void)
7825 {
7826 printf("Hello")
7827   ;
7828   return 0;
7829 }
7830 _ACEOF
7831 rm -f conftest.$ac_objext
7832 if { (eval echo "$as_me:7832: \"$ac_compile\"") >&5
7833   (eval $ac_compile) 2>&5
7834   ac_status=$?
7835   echo "$as_me:7835: \$? = $ac_status" >&5
7836   (exit $ac_status); } &&
7837          { ac_try='test -s conftest.$ac_objext'
7838   { (eval echo "$as_me:7838: \"$ac_try\"") >&5
7839   (eval $ac_try) 2>&5
7840   ac_status=$?
7841   echo "$as_me:7841: \$? = $ac_status" >&5
7842   (exit $ac_status); }; }; then
7843   :
7844 else
7845   echo "$as_me: failed program was:" >&5
7846 cat conftest.$ac_ext >&5
7847 cf_have_incdir=yes
7848 fi
7849 rm -f conftest.$ac_objext conftest.$ac_ext
7850                           CPPFLAGS=$cf_save_CPPFLAGS
7851                         fi
7852                   fi
7853                 fi
7854
7855                 if test "$cf_have_incdir" = no ; then
7856                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7857
7858 echo "${as_me:-configure}:7858: testing adding $cf_add_incdir to include-path ..." 1>&5
7859
7860                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7861
7862                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7863                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7864                   cf_add_incdir="$cf_top_incdir"
7865                 else
7866                   break
7867                 fi
7868           else
7869                 break
7870           fi
7871         done
7872   done
7873 fi
7874
7875 fi
7876
7877 # Set definitions to allow ifdef'ing for ncurses.h
7878
7879 case $cf_cv_ncurses_header in
7880 (*ncurses.h)
7881
7882 cat >>confdefs.h <<\EOF
7883 #define HAVE_NCURSES_H 1
7884 EOF
7885
7886         ;;
7887 esac
7888
7889 case $cf_cv_ncurses_header in
7890 (ncurses/curses.h|ncurses/ncurses.h)
7891
7892 cat >>confdefs.h <<\EOF
7893 #define HAVE_NCURSES_NCURSES_H 1
7894 EOF
7895
7896         ;;
7897 (ncursesw/curses.h|ncursesw/ncurses.h)
7898
7899 cat >>confdefs.h <<\EOF
7900 #define HAVE_NCURSESW_NCURSES_H 1
7901 EOF
7902
7903         ;;
7904 esac
7905
7906 echo "$as_me:7906: checking for terminfo header" >&5
7907 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7908 if test "${cf_cv_term_header+set}" = set; then
7909   echo $ECHO_N "(cached) $ECHO_C" >&6
7910 else
7911
7912 case ${cf_cv_ncurses_header} in
7913 (*/ncurses.h|*/ncursesw.h)
7914         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7915         ;;
7916 (*)
7917         cf_term_header=term.h
7918         ;;
7919 esac
7920
7921 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7922 do
7923 cat >conftest.$ac_ext <<_ACEOF
7924 #line 7924 "configure"
7925 #include "confdefs.h"
7926 #include <stdio.h>
7927 #include <${cf_cv_ncurses_header:-curses.h}>
7928 #include <$cf_test>
7929
7930 int
7931 main (void)
7932 {
7933 int x = auto_left_margin
7934   ;
7935   return 0;
7936 }
7937 _ACEOF
7938 rm -f conftest.$ac_objext
7939 if { (eval echo "$as_me:7939: \"$ac_compile\"") >&5
7940   (eval $ac_compile) 2>&5
7941   ac_status=$?
7942   echo "$as_me:7942: \$? = $ac_status" >&5
7943   (exit $ac_status); } &&
7944          { ac_try='test -s conftest.$ac_objext'
7945   { (eval echo "$as_me:7945: \"$ac_try\"") >&5
7946   (eval $ac_try) 2>&5
7947   ac_status=$?
7948   echo "$as_me:7948: \$? = $ac_status" >&5
7949   (exit $ac_status); }; }; then
7950
7951         cf_cv_term_header="$cf_test"
7952 else
7953   echo "$as_me: failed program was:" >&5
7954 cat conftest.$ac_ext >&5
7955
7956         cf_cv_term_header=unknown
7957
7958 fi
7959 rm -f conftest.$ac_objext conftest.$ac_ext
7960         test "$cf_cv_term_header" != unknown && break
7961 done
7962
7963 fi
7964 echo "$as_me:7964: result: $cf_cv_term_header" >&5
7965 echo "${ECHO_T}$cf_cv_term_header" >&6
7966
7967 # Set definitions to allow ifdef'ing to accommodate subdirectories
7968
7969 case $cf_cv_term_header in
7970 (*term.h)
7971
7972 cat >>confdefs.h <<\EOF
7973 #define HAVE_TERM_H 1
7974 EOF
7975
7976         ;;
7977 esac
7978
7979 case $cf_cv_term_header in
7980 (ncurses/term.h)
7981
7982 cat >>confdefs.h <<\EOF
7983 #define HAVE_NCURSES_TERM_H 1
7984 EOF
7985
7986         ;;
7987 (ncursesw/term.h)
7988
7989 cat >>confdefs.h <<\EOF
7990 #define HAVE_NCURSESW_TERM_H 1
7991 EOF
7992
7993         ;;
7994 esac
7995
7996 # some applications need this, but should check for NCURSES_VERSION
7997
7998 cat >>confdefs.h <<\EOF
7999 #define NCURSES 1
8000 EOF
8001
8002 echo "$as_me:8002: checking for ncurses version" >&5
8003 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8004 if test "${cf_cv_ncurses_version+set}" = set; then
8005   echo $ECHO_N "(cached) $ECHO_C" >&6
8006 else
8007
8008         cf_cv_ncurses_version=no
8009         cf_tempfile=out$$
8010         rm -f $cf_tempfile
8011         if test "$cross_compiling" = yes; then
8012
8013         # This will not work if the preprocessor splits the line after the
8014         # Autoconf token.  The 'unproto' program does that.
8015         cat > conftest.$ac_ext <<EOF
8016 #include <${cf_cv_ncurses_header:-curses.h}>
8017 #undef Autoconf
8018 #ifdef NCURSES_VERSION
8019 Autoconf NCURSES_VERSION
8020 #else
8021 #ifdef __NCURSES_H
8022 Autoconf "old"
8023 #endif
8024 ;
8025 #endif
8026 EOF
8027         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8028         { (eval echo "$as_me:8028: \"$cf_try\"") >&5
8029   (eval $cf_try) 2>&5
8030   ac_status=$?
8031   echo "$as_me:8031: \$? = $ac_status" >&5
8032   (exit $ac_status); }
8033         if test -f conftest.out ; then
8034                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8035                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8036                 rm -f conftest.out
8037         fi
8038
8039 else
8040   cat >conftest.$ac_ext <<_ACEOF
8041 #line 8041 "configure"
8042 #include "confdefs.h"
8043
8044 #include <${cf_cv_ncurses_header:-curses.h}>
8045 #include <stdio.h>
8046 int main(void)
8047 {
8048         FILE *fp = fopen("$cf_tempfile", "w");
8049 #ifdef NCURSES_VERSION
8050 # ifdef NCURSES_VERSION_PATCH
8051         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8052 # else
8053         fprintf(fp, "%s\n", NCURSES_VERSION);
8054 # endif
8055 #else
8056 # ifdef __NCURSES_H
8057         fprintf(fp, "old\n");
8058 # else
8059         make an error
8060 # endif
8061 #endif
8062         ${cf_cv_main_return:-return}(0);
8063 }
8064 _ACEOF
8065 rm -f conftest$ac_exeext
8066 if { (eval echo "$as_me:8066: \"$ac_link\"") >&5
8067   (eval $ac_link) 2>&5
8068   ac_status=$?
8069   echo "$as_me:8069: \$? = $ac_status" >&5
8070   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8071   { (eval echo "$as_me:8071: \"$ac_try\"") >&5
8072   (eval $ac_try) 2>&5
8073   ac_status=$?
8074   echo "$as_me:8074: \$? = $ac_status" >&5
8075   (exit $ac_status); }; }; then
8076
8077         cf_cv_ncurses_version=`cat $cf_tempfile`
8078 else
8079   echo "$as_me: program exited with status $ac_status" >&5
8080 echo "$as_me: failed program was:" >&5
8081 cat conftest.$ac_ext >&5
8082 fi
8083 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8084 fi
8085         rm -f $cf_tempfile
8086
8087 fi
8088 echo "$as_me:8088: result: $cf_cv_ncurses_version" >&5
8089 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8090 test "$cf_cv_ncurses_version" = no ||
8091 cat >>confdefs.h <<\EOF
8092 #define NCURSES 1
8093 EOF
8094
8095 cf_nculib_root=$cf_cv_screen
8096         # This works, except for the special case where we find gpm, but
8097         # ncurses is in a nonstandard location via $LIBS, and we really want
8098         # to link gpm.
8099 cf_ncurses_LIBS=""
8100 cf_ncurses_SAVE="$LIBS"
8101 echo "$as_me:8101: checking for Gpm_Open in -lgpm" >&5
8102 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8103 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8104   echo $ECHO_N "(cached) $ECHO_C" >&6
8105 else
8106   ac_check_lib_save_LIBS=$LIBS
8107 LIBS="-lgpm  $LIBS"
8108 cat >conftest.$ac_ext <<_ACEOF
8109 #line 8109 "configure"
8110 #include "confdefs.h"
8111
8112 /* Override any gcc2 internal prototype to avoid an error.  */
8113 #ifdef __cplusplus
8114 extern "C"
8115 #endif
8116 /* We use char because int might match the return type of a gcc2
8117    builtin and then its argument prototype would still apply.  */
8118 char Gpm_Open ();
8119 int
8120 main (void)
8121 {
8122 Gpm_Open ();
8123   ;
8124   return 0;
8125 }
8126 _ACEOF
8127 rm -f conftest.$ac_objext conftest$ac_exeext
8128 if { (eval echo "$as_me:8128: \"$ac_link\"") >&5
8129   (eval $ac_link) 2>&5
8130   ac_status=$?
8131   echo "$as_me:8131: \$? = $ac_status" >&5
8132   (exit $ac_status); } &&
8133          { ac_try='test -s conftest$ac_exeext'
8134   { (eval echo "$as_me:8134: \"$ac_try\"") >&5
8135   (eval $ac_try) 2>&5
8136   ac_status=$?
8137   echo "$as_me:8137: \$? = $ac_status" >&5
8138   (exit $ac_status); }; }; then
8139   ac_cv_lib_gpm_Gpm_Open=yes
8140 else
8141   echo "$as_me: failed program was:" >&5
8142 cat conftest.$ac_ext >&5
8143 ac_cv_lib_gpm_Gpm_Open=no
8144 fi
8145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8146 LIBS=$ac_check_lib_save_LIBS
8147 fi
8148 echo "$as_me:8148: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8149 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8150 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8151   echo "$as_me:8151: checking for initscr in -lgpm" >&5
8152 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8153 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8154   echo $ECHO_N "(cached) $ECHO_C" >&6
8155 else
8156   ac_check_lib_save_LIBS=$LIBS
8157 LIBS="-lgpm  $LIBS"
8158 cat >conftest.$ac_ext <<_ACEOF
8159 #line 8159 "configure"
8160 #include "confdefs.h"
8161
8162 /* Override any gcc2 internal prototype to avoid an error.  */
8163 #ifdef __cplusplus
8164 extern "C"
8165 #endif
8166 /* We use char because int might match the return type of a gcc2
8167    builtin and then its argument prototype would still apply.  */
8168 char initscr ();
8169 int
8170 main (void)
8171 {
8172 initscr ();
8173   ;
8174   return 0;
8175 }
8176 _ACEOF
8177 rm -f conftest.$ac_objext conftest$ac_exeext
8178 if { (eval echo "$as_me:8178: \"$ac_link\"") >&5
8179   (eval $ac_link) 2>&5
8180   ac_status=$?
8181   echo "$as_me:8181: \$? = $ac_status" >&5
8182   (exit $ac_status); } &&
8183          { ac_try='test -s conftest$ac_exeext'
8184   { (eval echo "$as_me:8184: \"$ac_try\"") >&5
8185   (eval $ac_try) 2>&5
8186   ac_status=$?
8187   echo "$as_me:8187: \$? = $ac_status" >&5
8188   (exit $ac_status); }; }; then
8189   ac_cv_lib_gpm_initscr=yes
8190 else
8191   echo "$as_me: failed program was:" >&5
8192 cat conftest.$ac_ext >&5
8193 ac_cv_lib_gpm_initscr=no
8194 fi
8195 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8196 LIBS=$ac_check_lib_save_LIBS
8197 fi
8198 echo "$as_me:8198: result: $ac_cv_lib_gpm_initscr" >&5
8199 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8200 if test $ac_cv_lib_gpm_initscr = yes; then
8201   LIBS="$cf_ncurses_SAVE"
8202 else
8203   cf_ncurses_LIBS="-lgpm"
8204 fi
8205
8206 fi
8207
8208 case $host_os in
8209 (freebsd*)
8210         # This is only necessary if you are linking against an obsolete
8211         # version of ncurses (but it should do no harm, since it's static).
8212         if test "$cf_nculib_root" = ncurses ; then
8213                 echo "$as_me:8213: checking for tgoto in -lmytinfo" >&5
8214 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8215 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8216   echo $ECHO_N "(cached) $ECHO_C" >&6
8217 else
8218   ac_check_lib_save_LIBS=$LIBS
8219 LIBS="-lmytinfo  $LIBS"
8220 cat >conftest.$ac_ext <<_ACEOF
8221 #line 8221 "configure"
8222 #include "confdefs.h"
8223
8224 /* Override any gcc2 internal prototype to avoid an error.  */
8225 #ifdef __cplusplus
8226 extern "C"
8227 #endif
8228 /* We use char because int might match the return type of a gcc2
8229    builtin and then its argument prototype would still apply.  */
8230 char tgoto ();
8231 int
8232 main (void)
8233 {
8234 tgoto ();
8235   ;
8236   return 0;
8237 }
8238 _ACEOF
8239 rm -f conftest.$ac_objext conftest$ac_exeext
8240 if { (eval echo "$as_me:8240: \"$ac_link\"") >&5
8241   (eval $ac_link) 2>&5
8242   ac_status=$?
8243   echo "$as_me:8243: \$? = $ac_status" >&5
8244   (exit $ac_status); } &&
8245          { ac_try='test -s conftest$ac_exeext'
8246   { (eval echo "$as_me:8246: \"$ac_try\"") >&5
8247   (eval $ac_try) 2>&5
8248   ac_status=$?
8249   echo "$as_me:8249: \$? = $ac_status" >&5
8250   (exit $ac_status); }; }; then
8251   ac_cv_lib_mytinfo_tgoto=yes
8252 else
8253   echo "$as_me: failed program was:" >&5
8254 cat conftest.$ac_ext >&5
8255 ac_cv_lib_mytinfo_tgoto=no
8256 fi
8257 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8258 LIBS=$ac_check_lib_save_LIBS
8259 fi
8260 echo "$as_me:8260: result: $ac_cv_lib_mytinfo_tgoto" >&5
8261 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8262 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8263   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8264 fi
8265
8266         fi
8267         ;;
8268 esac
8269
8270 cf_add_libs="$cf_ncurses_LIBS"
8271 # Filter out duplicates - this happens with badly-designed ".pc" files...
8272 for cf_add_1lib in $LIBS
8273 do
8274         for cf_add_2lib in $cf_add_libs
8275         do
8276                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8277                 then
8278                         cf_add_1lib=
8279                         break
8280                 fi
8281         done
8282         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8283 done
8284 LIBS="$cf_add_libs"
8285
8286 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8287 then
8288
8289 cf_add_libs="-l$cf_nculib_root"
8290 # Filter out duplicates - this happens with badly-designed ".pc" files...
8291 for cf_add_1lib in $LIBS
8292 do
8293         for cf_add_2lib in $cf_add_libs
8294         do
8295                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8296                 then
8297                         cf_add_1lib=
8298                         break
8299                 fi
8300         done
8301         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8302 done
8303 LIBS="$cf_add_libs"
8304
8305 else
8306
8307         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8308         cf_libdir=""
8309         echo "$as_me:8309: checking for initscr" >&5
8310 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8311 if test "${ac_cv_func_initscr+set}" = set; then
8312   echo $ECHO_N "(cached) $ECHO_C" >&6
8313 else
8314   cat >conftest.$ac_ext <<_ACEOF
8315 #line 8315 "configure"
8316 #include "confdefs.h"
8317 /* System header to define __stub macros and hopefully few prototypes,
8318     which can conflict with char initscr (); below.  */
8319 #include <assert.h>
8320 /* Override any gcc2 internal prototype to avoid an error.  */
8321 #ifdef __cplusplus
8322 extern "C"
8323 #endif
8324 /* We use char because int might match the return type of a gcc2
8325    builtin and then its argument prototype would still apply.  */
8326 char initscr ();
8327 char (*f) ();
8328
8329 int
8330 main (void)
8331 {
8332 /* The GNU C library defines this for functions which it implements
8333     to always fail with ENOSYS.  Some functions are actually named
8334     something starting with __ and the normal name is an alias.  */
8335 #if defined (__stub_initscr) || defined (__stub___initscr)
8336 choke me
8337 #else
8338 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8339 #endif
8340
8341   ;
8342   return 0;
8343 }
8344 _ACEOF
8345 rm -f conftest.$ac_objext conftest$ac_exeext
8346 if { (eval echo "$as_me:8346: \"$ac_link\"") >&5
8347   (eval $ac_link) 2>&5
8348   ac_status=$?
8349   echo "$as_me:8349: \$? = $ac_status" >&5
8350   (exit $ac_status); } &&
8351          { ac_try='test -s conftest$ac_exeext'
8352   { (eval echo "$as_me:8352: \"$ac_try\"") >&5
8353   (eval $ac_try) 2>&5
8354   ac_status=$?
8355   echo "$as_me:8355: \$? = $ac_status" >&5
8356   (exit $ac_status); }; }; then
8357   ac_cv_func_initscr=yes
8358 else
8359   echo "$as_me: failed program was:" >&5
8360 cat conftest.$ac_ext >&5
8361 ac_cv_func_initscr=no
8362 fi
8363 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8364 fi
8365 echo "$as_me:8365: result: $ac_cv_func_initscr" >&5
8366 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8367 if test $ac_cv_func_initscr = yes; then
8368   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8369 else
8370
8371                 cf_save_LIBS="$LIBS"
8372                 echo "$as_me:8372: checking for initscr in -l$cf_nculib_root" >&5
8373 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8374                 LIBS="-l$cf_nculib_root $LIBS"
8375                 cat >conftest.$ac_ext <<_ACEOF
8376 #line 8376 "configure"
8377 #include "confdefs.h"
8378 #include <${cf_cv_ncurses_header:-curses.h}>
8379 int
8380 main (void)
8381 {
8382 initscr()
8383   ;
8384   return 0;
8385 }
8386 _ACEOF
8387 rm -f conftest.$ac_objext conftest$ac_exeext
8388 if { (eval echo "$as_me:8388: \"$ac_link\"") >&5
8389   (eval $ac_link) 2>&5
8390   ac_status=$?
8391   echo "$as_me:8391: \$? = $ac_status" >&5
8392   (exit $ac_status); } &&
8393          { ac_try='test -s conftest$ac_exeext'
8394   { (eval echo "$as_me:8394: \"$ac_try\"") >&5
8395   (eval $ac_try) 2>&5
8396   ac_status=$?
8397   echo "$as_me:8397: \$? = $ac_status" >&5
8398   (exit $ac_status); }; }; then
8399   echo "$as_me:8399: result: yes" >&5
8400 echo "${ECHO_T}yes" >&6
8401                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8402
8403 else
8404   echo "$as_me: failed program was:" >&5
8405 cat conftest.$ac_ext >&5
8406 echo "$as_me:8406: result: no" >&5
8407 echo "${ECHO_T}no" >&6
8408
8409 cf_search=
8410 cf_library_path_list=""
8411 if test -n "${LDFLAGS}${LIBS}" ; then
8412         for cf_library_path in $LDFLAGS $LIBS
8413         do
8414                 case $cf_library_path in
8415                 (-L*)
8416                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8417
8418 test "x$cf_library_path" != "xNONE" && \
8419 test -d "$cf_library_path" && \
8420  {
8421         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8422         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8423         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8424         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8425         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8426         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"
8427 }
8428
8429                         cf_library_path_list="$cf_library_path_list $cf_search"
8430                         ;;
8431                 esac
8432         done
8433 fi
8434
8435 cf_search=
8436
8437 test "x$prefix" != "xNONE" && \
8438 test -d "$prefix" && \
8439  {
8440         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8441         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8442         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8443         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8444         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8445         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8446 }
8447
8448 for cf_subdir_prefix in \
8449         /usr \
8450         /usr/local \
8451         /usr/pkg \
8452         /opt \
8453         /opt/local \
8454         $HOME
8455 do
8456
8457 test "x$cf_subdir_prefix" != "x$prefix" && \
8458 test -d "$cf_subdir_prefix" && \
8459 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8460         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8461         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8462         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8463         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8464         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8465         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"
8466 }
8467
8468 done
8469
8470 cf_search="$cf_library_path_list $cf_search"
8471
8472                         for cf_libdir in $cf_search
8473                         do
8474                                 echo "$as_me:8474: checking for -l$cf_nculib_root in $cf_libdir" >&5
8475 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8476                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8477                                 cat >conftest.$ac_ext <<_ACEOF
8478 #line 8478 "configure"
8479 #include "confdefs.h"
8480 #include <${cf_cv_ncurses_header:-curses.h}>
8481 int
8482 main (void)
8483 {
8484 initscr()
8485   ;
8486   return 0;
8487 }
8488 _ACEOF
8489 rm -f conftest.$ac_objext conftest$ac_exeext
8490 if { (eval echo "$as_me:8490: \"$ac_link\"") >&5
8491   (eval $ac_link) 2>&5
8492   ac_status=$?
8493   echo "$as_me:8493: \$? = $ac_status" >&5
8494   (exit $ac_status); } &&
8495          { ac_try='test -s conftest$ac_exeext'
8496   { (eval echo "$as_me:8496: \"$ac_try\"") >&5
8497   (eval $ac_try) 2>&5
8498   ac_status=$?
8499   echo "$as_me:8499: \$? = $ac_status" >&5
8500   (exit $ac_status); }; }; then
8501   echo "$as_me:8501: result: yes" >&5
8502 echo "${ECHO_T}yes" >&6
8503                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8504                                          break
8505 else
8506   echo "$as_me: failed program was:" >&5
8507 cat conftest.$ac_ext >&5
8508 echo "$as_me:8508: result: no" >&5
8509 echo "${ECHO_T}no" >&6
8510                                          LIBS="$cf_save_LIBS"
8511 fi
8512 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8513                         done
8514
8515 fi
8516 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8517
8518 fi
8519
8520 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8521
8522 if test $cf_found_library = no ; then
8523         { { echo "$as_me:8523: error: Cannot link $cf_nculib_root library" >&5
8524 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8525    { (exit 1); exit 1; }; }
8526 fi
8527
8528 fi
8529
8530 if test -n "$cf_ncurses_LIBS" ; then
8531         echo "$as_me:8531: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8532 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8533         cf_ncurses_SAVE="$LIBS"
8534         for p in $cf_ncurses_LIBS ; do
8535                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8536                 if test "$q" != "$LIBS" ; then
8537                         LIBS="$q"
8538                 fi
8539         done
8540         cat >conftest.$ac_ext <<_ACEOF
8541 #line 8541 "configure"
8542 #include "confdefs.h"
8543 #include <${cf_cv_ncurses_header:-curses.h}>
8544 int
8545 main (void)
8546 {
8547 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8548   ;
8549   return 0;
8550 }
8551 _ACEOF
8552 rm -f conftest.$ac_objext conftest$ac_exeext
8553 if { (eval echo "$as_me:8553: \"$ac_link\"") >&5
8554   (eval $ac_link) 2>&5
8555   ac_status=$?
8556   echo "$as_me:8556: \$? = $ac_status" >&5
8557   (exit $ac_status); } &&
8558          { ac_try='test -s conftest$ac_exeext'
8559   { (eval echo "$as_me:8559: \"$ac_try\"") >&5
8560   (eval $ac_try) 2>&5
8561   ac_status=$?
8562   echo "$as_me:8562: \$? = $ac_status" >&5
8563   (exit $ac_status); }; }; then
8564   echo "$as_me:8564: result: yes" >&5
8565 echo "${ECHO_T}yes" >&6
8566 else
8567   echo "$as_me: failed program was:" >&5
8568 cat conftest.$ac_ext >&5
8569 echo "$as_me:8569: result: no" >&5
8570 echo "${ECHO_T}no" >&6
8571                  LIBS="$cf_ncurses_SAVE"
8572 fi
8573 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8574 fi
8575
8576 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8577
8578 cat >>confdefs.h <<EOF
8579 #define $cf_nculib_ROOT 1
8580 EOF
8581
8582         fi
8583 else
8584         NCURSES_CONFIG=none
8585 fi
8586
8587         ;;
8588 (ncurses*)
8589
8590 cf_ncuconfig_root=$cf_cv_screen
8591 cf_have_ncuconfig=no
8592
8593 if test "x${PKG_CONFIG:=none}" != xnone; then
8594         echo "$as_me:8594: checking pkg-config for $cf_ncuconfig_root" >&5
8595 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
8596         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
8597                 echo "$as_me:8597: result: yes" >&5
8598 echo "${ECHO_T}yes" >&6
8599
8600                 echo "$as_me:8600: checking if the $cf_ncuconfig_root package files work" >&5
8601 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
8602                 cf_have_ncuconfig=unknown
8603
8604                 cf_save_CPPFLAGS="$CPPFLAGS"
8605                 cf_save_LIBS="$LIBS"
8606
8607                 CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags $cf_ncuconfig_root`"
8608
8609 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
8610 # Filter out duplicates - this happens with badly-designed ".pc" files...
8611 for cf_add_1lib in $LIBS
8612 do
8613         for cf_add_2lib in $cf_add_libs
8614         do
8615                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8616                 then
8617                         cf_add_1lib=
8618                         break
8619                 fi
8620         done
8621         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8622 done
8623 LIBS="$cf_add_libs"
8624
8625                 cat >conftest.$ac_ext <<_ACEOF
8626 #line 8626 "configure"
8627 #include "confdefs.h"
8628 #include <${cf_cv_ncurses_header:-curses.h}>
8629 int
8630 main (void)
8631 {
8632 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8633   ;
8634   return 0;
8635 }
8636 _ACEOF
8637 rm -f conftest.$ac_objext conftest$ac_exeext
8638 if { (eval echo "$as_me:8638: \"$ac_link\"") >&5
8639   (eval $ac_link) 2>&5
8640   ac_status=$?
8641   echo "$as_me:8641: \$? = $ac_status" >&5
8642   (exit $ac_status); } &&
8643          { ac_try='test -s conftest$ac_exeext'
8644   { (eval echo "$as_me:8644: \"$ac_try\"") >&5
8645   (eval $ac_try) 2>&5
8646   ac_status=$?
8647   echo "$as_me:8647: \$? = $ac_status" >&5
8648   (exit $ac_status); }; }; then
8649   if test "$cross_compiling" = yes; then
8650   cf_have_ncuconfig=maybe
8651 else
8652   cat >conftest.$ac_ext <<_ACEOF
8653 #line 8653 "configure"
8654 #include "confdefs.h"
8655 #include <${cf_cv_ncurses_header:-curses.h}>
8656                                 int main(void)
8657                                 { char *xx = curses_version(); return (xx == 0); }
8658 _ACEOF
8659 rm -f conftest$ac_exeext
8660 if { (eval echo "$as_me:8660: \"$ac_link\"") >&5
8661   (eval $ac_link) 2>&5
8662   ac_status=$?
8663   echo "$as_me:8663: \$? = $ac_status" >&5
8664   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8665   { (eval echo "$as_me:8665: \"$ac_try\"") >&5
8666   (eval $ac_try) 2>&5
8667   ac_status=$?
8668   echo "$as_me:8668: \$? = $ac_status" >&5
8669   (exit $ac_status); }; }; then
8670   cf_have_ncuconfig=yes
8671 else
8672   echo "$as_me: program exited with status $ac_status" >&5
8673 echo "$as_me: failed program was:" >&5
8674 cat conftest.$ac_ext >&5
8675 cf_have_ncuconfig=no
8676 fi
8677 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8678 fi
8679 else
8680   echo "$as_me: failed program was:" >&5
8681 cat conftest.$ac_ext >&5
8682 cf_have_ncuconfig=no
8683 fi
8684 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8685                 echo "$as_me:8685: result: $cf_have_ncuconfig" >&5
8686 echo "${ECHO_T}$cf_have_ncuconfig" >&6
8687                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
8688                 if test "$cf_have_ncuconfig" != "yes"
8689                 then
8690                         CPPFLAGS="$cf_save_CPPFLAGS"
8691                         LIBS="$cf_save_LIBS"
8692                         NCURSES_CONFIG_PKG=none
8693                 else
8694
8695 cat >>confdefs.h <<\EOF
8696 #define NCURSES 1
8697 EOF
8698
8699                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
8700
8701 echo "$as_me:8701: checking for terminfo header" >&5
8702 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8703 if test "${cf_cv_term_header+set}" = set; then
8704   echo $ECHO_N "(cached) $ECHO_C" >&6
8705 else
8706
8707 case ${cf_cv_ncurses_header} in
8708 (*/ncurses.h|*/ncursesw.h)
8709         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8710         ;;
8711 (*)
8712         cf_term_header=term.h
8713         ;;
8714 esac
8715
8716 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8717 do
8718 cat >conftest.$ac_ext <<_ACEOF
8719 #line 8719 "configure"
8720 #include "confdefs.h"
8721 #include <stdio.h>
8722 #include <${cf_cv_ncurses_header:-curses.h}>
8723 #include <$cf_test>
8724
8725 int
8726 main (void)
8727 {
8728 int x = auto_left_margin
8729   ;
8730   return 0;
8731 }
8732 _ACEOF
8733 rm -f conftest.$ac_objext
8734 if { (eval echo "$as_me:8734: \"$ac_compile\"") >&5
8735   (eval $ac_compile) 2>&5
8736   ac_status=$?
8737   echo "$as_me:8737: \$? = $ac_status" >&5
8738   (exit $ac_status); } &&
8739          { ac_try='test -s conftest.$ac_objext'
8740   { (eval echo "$as_me:8740: \"$ac_try\"") >&5
8741   (eval $ac_try) 2>&5
8742   ac_status=$?
8743   echo "$as_me:8743: \$? = $ac_status" >&5
8744   (exit $ac_status); }; }; then
8745
8746         cf_cv_term_header="$cf_test"
8747 else
8748   echo "$as_me: failed program was:" >&5
8749 cat conftest.$ac_ext >&5
8750
8751         cf_cv_term_header=unknown
8752
8753 fi
8754 rm -f conftest.$ac_objext conftest.$ac_ext
8755         test "$cf_cv_term_header" != unknown && break
8756 done
8757
8758 fi
8759 echo "$as_me:8759: result: $cf_cv_term_header" >&5
8760 echo "${ECHO_T}$cf_cv_term_header" >&6
8761
8762 # Set definitions to allow ifdef'ing to accommodate subdirectories
8763
8764 case $cf_cv_term_header in
8765 (*term.h)
8766
8767 cat >>confdefs.h <<\EOF
8768 #define HAVE_TERM_H 1
8769 EOF
8770
8771         ;;
8772 esac
8773
8774 case $cf_cv_term_header in
8775 (ncurses/term.h)
8776
8777 cat >>confdefs.h <<\EOF
8778 #define HAVE_NCURSES_TERM_H 1
8779 EOF
8780
8781         ;;
8782 (ncursesw/term.h)
8783
8784 cat >>confdefs.h <<\EOF
8785 #define HAVE_NCURSESW_TERM_H 1
8786 EOF
8787
8788         ;;
8789 esac
8790
8791                 fi
8792
8793         else
8794                 echo "$as_me:8794: result: no" >&5
8795 echo "${ECHO_T}no" >&6
8796                 NCURSES_CONFIG_PKG=none
8797         fi
8798 else
8799         NCURSES_CONFIG_PKG=none
8800 fi
8801
8802 if test "x$cf_have_ncuconfig" = "xno"; then
8803         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
8804
8805 if test -n "$ac_tool_prefix"; then
8806   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8807   do
8808     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8809 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8810 echo "$as_me:8810: checking for $ac_word" >&5
8811 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8812 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8813   echo $ECHO_N "(cached) $ECHO_C" >&6
8814 else
8815   if test -n "$NCURSES_CONFIG"; then
8816   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8817 else
8818   ac_save_IFS=$IFS; IFS=$ac_path_separator
8819 ac_dummy="$PATH"
8820 for ac_dir in $ac_dummy; do
8821   IFS=$ac_save_IFS
8822   test -z "$ac_dir" && ac_dir=.
8823   $as_executable_p "$ac_dir/$ac_word" || continue
8824 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8825 echo "$as_me:8825: found $ac_dir/$ac_word" >&5
8826 break
8827 done
8828
8829 fi
8830 fi
8831 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8832 if test -n "$NCURSES_CONFIG"; then
8833   echo "$as_me:8833: result: $NCURSES_CONFIG" >&5
8834 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8835 else
8836   echo "$as_me:8836: result: no" >&5
8837 echo "${ECHO_T}no" >&6
8838 fi
8839
8840     test -n "$NCURSES_CONFIG" && break
8841   done
8842 fi
8843 if test -z "$NCURSES_CONFIG"; then
8844   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8845   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8846 do
8847   # Extract the first word of "$ac_prog", so it can be a program name with args.
8848 set dummy $ac_prog; ac_word=$2
8849 echo "$as_me:8849: checking for $ac_word" >&5
8850 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8851 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8852   echo $ECHO_N "(cached) $ECHO_C" >&6
8853 else
8854   if test -n "$ac_ct_NCURSES_CONFIG"; then
8855   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8856 else
8857   ac_save_IFS=$IFS; IFS=$ac_path_separator
8858 ac_dummy="$PATH"
8859 for ac_dir in $ac_dummy; do
8860   IFS=$ac_save_IFS
8861   test -z "$ac_dir" && ac_dir=.
8862   $as_executable_p "$ac_dir/$ac_word" || continue
8863 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8864 echo "$as_me:8864: found $ac_dir/$ac_word" >&5
8865 break
8866 done
8867
8868 fi
8869 fi
8870 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8871 if test -n "$ac_ct_NCURSES_CONFIG"; then
8872   echo "$as_me:8872: result: $ac_ct_NCURSES_CONFIG" >&5
8873 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8874 else
8875   echo "$as_me:8875: result: no" >&5
8876 echo "${ECHO_T}no" >&6
8877 fi
8878
8879   test -n "$ac_ct_NCURSES_CONFIG" && break
8880 done
8881 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8882
8883   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8884 fi
8885
8886         if test "$NCURSES_CONFIG" != none ; then
8887
8888                 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8889
8890 cf_add_libs="`$NCURSES_CONFIG --libs`"
8891 # Filter out duplicates - this happens with badly-designed ".pc" files...
8892 for cf_add_1lib in $LIBS
8893 do
8894         for cf_add_2lib in $cf_add_libs
8895         do
8896                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8897                 then
8898                         cf_add_1lib=
8899                         break
8900                 fi
8901         done
8902         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8903 done
8904 LIBS="$cf_add_libs"
8905
8906                 # even with config script, some packages use no-override for curses.h
8907
8908 echo "$as_me:8908: checking if we have identified curses headers" >&5
8909 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8910 if test "${cf_cv_ncurses_header+set}" = set; then
8911   echo $ECHO_N "(cached) $ECHO_C" >&6
8912 else
8913
8914 cf_cv_ncurses_header=none
8915 for cf_header in \
8916         ncurses.h $cf_cv_screen/ncurses.h \
8917         curses.h $cf_cv_screen/curses.h
8918 do
8919 cat >conftest.$ac_ext <<_ACEOF
8920 #line 8920 "configure"
8921 #include "confdefs.h"
8922 #include <${cf_header}>
8923 int
8924 main (void)
8925 {
8926 initscr(); tgoto("?", 0,0)
8927   ;
8928   return 0;
8929 }
8930 _ACEOF
8931 rm -f conftest.$ac_objext
8932 if { (eval echo "$as_me:8932: \"$ac_compile\"") >&5
8933   (eval $ac_compile) 2>&5
8934   ac_status=$?
8935   echo "$as_me:8935: \$? = $ac_status" >&5
8936   (exit $ac_status); } &&
8937          { ac_try='test -s conftest.$ac_objext'
8938   { (eval echo "$as_me:8938: \"$ac_try\"") >&5
8939   (eval $ac_try) 2>&5
8940   ac_status=$?
8941   echo "$as_me:8941: \$? = $ac_status" >&5
8942   (exit $ac_status); }; }; then
8943   cf_cv_ncurses_header=$cf_header; break
8944 else
8945   echo "$as_me: failed program was:" >&5
8946 cat conftest.$ac_ext >&5
8947 fi
8948 rm -f conftest.$ac_objext conftest.$ac_ext
8949 done
8950
8951 fi
8952 echo "$as_me:8952: result: $cf_cv_ncurses_header" >&5
8953 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8954
8955 if test "$cf_cv_ncurses_header" = none ; then
8956         { { echo "$as_me:8956: error: No curses header-files found" >&5
8957 echo "$as_me: error: No curses header-files found" >&2;}
8958    { (exit 1); exit 1; }; }
8959 fi
8960
8961 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8962
8963 for ac_header in $cf_cv_ncurses_header
8964 do
8965 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8966 echo "$as_me:8966: checking for $ac_header" >&5
8967 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8968 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8969   echo $ECHO_N "(cached) $ECHO_C" >&6
8970 else
8971   cat >conftest.$ac_ext <<_ACEOF
8972 #line 8972 "configure"
8973 #include "confdefs.h"
8974 #include <$ac_header>
8975 _ACEOF
8976 if { (eval echo "$as_me:8976: \"$ac_cpp conftest.$ac_ext\"") >&5
8977   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8978   ac_status=$?
8979   egrep -v '^ *\+' conftest.er1 >conftest.err
8980   rm -f conftest.er1
8981   cat conftest.err >&5
8982   echo "$as_me:8982: \$? = $ac_status" >&5
8983   (exit $ac_status); } >/dev/null; then
8984   if test -s conftest.err; then
8985     ac_cpp_err=$ac_c_preproc_warn_flag
8986   else
8987     ac_cpp_err=
8988   fi
8989 else
8990   ac_cpp_err=yes
8991 fi
8992 if test -z "$ac_cpp_err"; then
8993   eval "$as_ac_Header=yes"
8994 else
8995   echo "$as_me: failed program was:" >&5
8996   cat conftest.$ac_ext >&5
8997   eval "$as_ac_Header=no"
8998 fi
8999 rm -f conftest.err conftest.$ac_ext
9000 fi
9001 echo "$as_me:9001: result: `eval echo '${'$as_ac_Header'}'`" >&5
9002 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9003 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9004   cat >>confdefs.h <<EOF
9005 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9006 EOF
9007
9008 fi
9009 done
9010
9011 cat >>confdefs.h <<\EOF
9012 #define NCURSES 1
9013 EOF
9014
9015 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9016
9017                 cat >>confdefs.h <<EOF
9018 #define $cf_nculib_ROOT 1
9019 EOF
9020
9021                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9022
9023         else
9024
9025 cf_ncuhdr_root=$cf_cv_screen
9026
9027 test -n "$cf_cv_curses_dir" && \
9028 test "$cf_cv_curses_dir" != "no" && { \
9029
9030 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9031   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9032   do
9033         while test $cf_add_incdir != /usr/include
9034         do
9035           if test -d $cf_add_incdir
9036           then
9037                 cf_have_incdir=no
9038                 if test -n "$CFLAGS$CPPFLAGS" ; then
9039                   # a loop is needed to ensure we can add subdirs of existing dirs
9040                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9041                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9042                           cf_have_incdir=yes; break
9043                         fi
9044                   done
9045                 fi
9046
9047                 if test "$cf_have_incdir" = no ; then
9048                   if test "$cf_add_incdir" = /usr/local/include ; then
9049                         if test "$GCC" = yes
9050                         then
9051                           cf_save_CPPFLAGS=$CPPFLAGS
9052                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9053                           cat >conftest.$ac_ext <<_ACEOF
9054 #line 9054 "configure"
9055 #include "confdefs.h"
9056 #include <stdio.h>
9057 int
9058 main (void)
9059 {
9060 printf("Hello")
9061   ;
9062   return 0;
9063 }
9064 _ACEOF
9065 rm -f conftest.$ac_objext
9066 if { (eval echo "$as_me:9066: \"$ac_compile\"") >&5
9067   (eval $ac_compile) 2>&5
9068   ac_status=$?
9069   echo "$as_me:9069: \$? = $ac_status" >&5
9070   (exit $ac_status); } &&
9071          { ac_try='test -s conftest.$ac_objext'
9072   { (eval echo "$as_me:9072: \"$ac_try\"") >&5
9073   (eval $ac_try) 2>&5
9074   ac_status=$?
9075   echo "$as_me:9075: \$? = $ac_status" >&5
9076   (exit $ac_status); }; }; then
9077   :
9078 else
9079   echo "$as_me: failed program was:" >&5
9080 cat conftest.$ac_ext >&5
9081 cf_have_incdir=yes
9082 fi
9083 rm -f conftest.$ac_objext conftest.$ac_ext
9084                           CPPFLAGS=$cf_save_CPPFLAGS
9085                         fi
9086                   fi
9087                 fi
9088
9089                 if test "$cf_have_incdir" = no ; then
9090                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9091
9092 echo "${as_me:-configure}:9092: testing adding $cf_add_incdir to include-path ..." 1>&5
9093
9094                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9095
9096                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9097                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9098                   cf_add_incdir="$cf_top_incdir"
9099                 else
9100                   break
9101                 fi
9102           else
9103                 break
9104           fi
9105         done
9106   done
9107 fi
9108
9109 }
9110
9111 echo "$as_me:9111: checking for $cf_ncuhdr_root header in include-path" >&5
9112 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9113 if test "${cf_cv_ncurses_h+set}" = set; then
9114   echo $ECHO_N "(cached) $ECHO_C" >&6
9115 else
9116
9117         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9118         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9119         for cf_header in $cf_header_list
9120         do
9121
9122         cat >conftest.$ac_ext <<_ACEOF
9123 #line 9123 "configure"
9124 #include "confdefs.h"
9125
9126 #include <$cf_header>
9127 int
9128 main (void)
9129 {
9130
9131 #ifdef NCURSES_VERSION
9132
9133 printf("%s\n", NCURSES_VERSION);
9134 #else
9135 #ifdef __NCURSES_H
9136 printf("old\n");
9137 #else
9138         make an error
9139 #endif
9140 #endif
9141
9142   ;
9143   return 0;
9144 }
9145 _ACEOF
9146 rm -f conftest.$ac_objext
9147 if { (eval echo "$as_me:9147: \"$ac_compile\"") >&5
9148   (eval $ac_compile) 2>&5
9149   ac_status=$?
9150   echo "$as_me:9150: \$? = $ac_status" >&5
9151   (exit $ac_status); } &&
9152          { ac_try='test -s conftest.$ac_objext'
9153   { (eval echo "$as_me:9153: \"$ac_try\"") >&5
9154   (eval $ac_try) 2>&5
9155   ac_status=$?
9156   echo "$as_me:9156: \$? = $ac_status" >&5
9157   (exit $ac_status); }; }; then
9158   cf_cv_ncurses_h=$cf_header
9159
9160 else
9161   echo "$as_me: failed program was:" >&5
9162 cat conftest.$ac_ext >&5
9163 cf_cv_ncurses_h=no
9164 fi
9165 rm -f conftest.$ac_objext conftest.$ac_ext
9166
9167                 test "$cf_cv_ncurses_h" != no && break
9168         done
9169
9170 fi
9171 echo "$as_me:9171: result: $cf_cv_ncurses_h" >&5
9172 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9173
9174 if test "$cf_cv_ncurses_h" != no ; then
9175         cf_cv_ncurses_header=$cf_cv_ncurses_h
9176 else
9177
9178 echo "$as_me:9178: checking for $cf_ncuhdr_root include-path" >&5
9179 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9180 if test "${cf_cv_ncurses_h2+set}" = set; then
9181   echo $ECHO_N "(cached) $ECHO_C" >&6
9182 else
9183
9184         test -n "$verbose" && echo
9185
9186 cf_search=
9187
9188 # collect the current set of include-directories from compiler flags
9189 cf_header_path_list=""
9190 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9191         for cf_header_path in $CPPFLAGS $CFLAGS
9192         do
9193                 case $cf_header_path in
9194                 (-I*)
9195                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9196
9197 test "x$cf_header_path" != "xNONE" && \
9198 test -d "$cf_header_path" && \
9199  {
9200         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9201         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9202         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9203         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9204         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9205         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"
9206 }
9207
9208                         cf_header_path_list="$cf_header_path_list $cf_search"
9209                         ;;
9210                 esac
9211         done
9212 fi
9213
9214 # add the variations for the package we are looking for
9215
9216 cf_search=
9217
9218 test "x$prefix" != "xNONE" && \
9219 test -d "$prefix" && \
9220  {
9221         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9222         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9223         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9224         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9225         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9226         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9227 }
9228
9229 for cf_subdir_prefix in \
9230         /usr \
9231         /usr/local \
9232         /usr/pkg \
9233         /opt \
9234         /opt/local \
9235         $HOME
9236 do
9237
9238 test "x$cf_subdir_prefix" != "x$prefix" && \
9239 test -d "$cf_subdir_prefix" && \
9240 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9241         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9242         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9243         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9244         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9245         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9246         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"
9247 }
9248
9249 done
9250
9251 test "$includedir" != NONE && \
9252 test "$includedir" != "/usr/include" && \
9253 test -d "$includedir" && {
9254         test -d $includedir &&    cf_search="$cf_search $includedir"
9255         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9256 }
9257
9258 test "$oldincludedir" != NONE && \
9259 test "$oldincludedir" != "/usr/include" && \
9260 test -d "$oldincludedir" && {
9261         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9262         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9263 }
9264
9265 cf_search="$cf_search $cf_header_path_list"
9266
9267         test -n "$verbose" && echo search path $cf_search
9268         cf_save2_CPPFLAGS="$CPPFLAGS"
9269         for cf_incdir in $cf_search
9270         do
9271
9272 if test -n "$cf_incdir" ; then
9273   for cf_add_incdir in $cf_incdir
9274   do
9275         while test $cf_add_incdir != /usr/include
9276         do
9277           if test -d $cf_add_incdir
9278           then
9279                 cf_have_incdir=no
9280                 if test -n "$CFLAGS$CPPFLAGS" ; then
9281                   # a loop is needed to ensure we can add subdirs of existing dirs
9282                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9283                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9284                           cf_have_incdir=yes; break
9285                         fi
9286                   done
9287                 fi
9288
9289                 if test "$cf_have_incdir" = no ; then
9290                   if test "$cf_add_incdir" = /usr/local/include ; then
9291                         if test "$GCC" = yes
9292                         then
9293                           cf_save_CPPFLAGS=$CPPFLAGS
9294                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9295                           cat >conftest.$ac_ext <<_ACEOF
9296 #line 9296 "configure"
9297 #include "confdefs.h"
9298 #include <stdio.h>
9299 int
9300 main (void)
9301 {
9302 printf("Hello")
9303   ;
9304   return 0;
9305 }
9306 _ACEOF
9307 rm -f conftest.$ac_objext
9308 if { (eval echo "$as_me:9308: \"$ac_compile\"") >&5
9309   (eval $ac_compile) 2>&5
9310   ac_status=$?
9311   echo "$as_me:9311: \$? = $ac_status" >&5
9312   (exit $ac_status); } &&
9313          { ac_try='test -s conftest.$ac_objext'
9314   { (eval echo "$as_me:9314: \"$ac_try\"") >&5
9315   (eval $ac_try) 2>&5
9316   ac_status=$?
9317   echo "$as_me:9317: \$? = $ac_status" >&5
9318   (exit $ac_status); }; }; then
9319   :
9320 else
9321   echo "$as_me: failed program was:" >&5
9322 cat conftest.$ac_ext >&5
9323 cf_have_incdir=yes
9324 fi
9325 rm -f conftest.$ac_objext conftest.$ac_ext
9326                           CPPFLAGS=$cf_save_CPPFLAGS
9327                         fi
9328                   fi
9329                 fi
9330
9331                 if test "$cf_have_incdir" = no ; then
9332                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9333
9334 echo "${as_me:-configure}:9334: testing adding $cf_add_incdir to include-path ..." 1>&5
9335
9336                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9337
9338                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9339                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9340                   cf_add_incdir="$cf_top_incdir"
9341                 else
9342                   break
9343                 fi
9344           else
9345                 break
9346           fi
9347         done
9348   done
9349 fi
9350
9351                 for cf_header in \
9352                         ncurses.h \
9353                         curses.h
9354                 do
9355
9356         cat >conftest.$ac_ext <<_ACEOF
9357 #line 9357 "configure"
9358 #include "confdefs.h"
9359
9360 #include <$cf_header>
9361 int
9362 main (void)
9363 {
9364
9365 #ifdef NCURSES_VERSION
9366
9367 printf("%s\n", NCURSES_VERSION);
9368 #else
9369 #ifdef __NCURSES_H
9370 printf("old\n");
9371 #else
9372         make an error
9373 #endif
9374 #endif
9375
9376   ;
9377   return 0;
9378 }
9379 _ACEOF
9380 rm -f conftest.$ac_objext
9381 if { (eval echo "$as_me:9381: \"$ac_compile\"") >&5
9382   (eval $ac_compile) 2>&5
9383   ac_status=$?
9384   echo "$as_me:9384: \$? = $ac_status" >&5
9385   (exit $ac_status); } &&
9386          { ac_try='test -s conftest.$ac_objext'
9387   { (eval echo "$as_me:9387: \"$ac_try\"") >&5
9388   (eval $ac_try) 2>&5
9389   ac_status=$?
9390   echo "$as_me:9390: \$? = $ac_status" >&5
9391   (exit $ac_status); }; }; then
9392   cf_cv_ncurses_h2=$cf_header
9393
9394 else
9395   echo "$as_me: failed program was:" >&5
9396 cat conftest.$ac_ext >&5
9397 cf_cv_ncurses_h2=no
9398 fi
9399 rm -f conftest.$ac_objext conftest.$ac_ext
9400
9401                         if test "$cf_cv_ncurses_h2" != no ; then
9402                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9403                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9404                                 break
9405                         fi
9406                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9407                 done
9408                 CPPFLAGS="$cf_save2_CPPFLAGS"
9409                 test "$cf_cv_ncurses_h2" != no && break
9410         done
9411         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9411: error: not found" >&5
9412 echo "$as_me: error: not found" >&2;}
9413    { (exit 1); exit 1; }; }
9414
9415 fi
9416 echo "$as_me:9416: result: $cf_cv_ncurses_h2" >&5
9417 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9418
9419         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9420         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9421         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9422                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9423         fi
9424
9425 if test -n "$cf_1st_incdir" ; then
9426   for cf_add_incdir in $cf_1st_incdir
9427   do
9428         while test $cf_add_incdir != /usr/include
9429         do
9430           if test -d $cf_add_incdir
9431           then
9432                 cf_have_incdir=no
9433                 if test -n "$CFLAGS$CPPFLAGS" ; then
9434                   # a loop is needed to ensure we can add subdirs of existing dirs
9435                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9436                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9437                           cf_have_incdir=yes; break
9438                         fi
9439                   done
9440                 fi
9441
9442                 if test "$cf_have_incdir" = no ; then
9443                   if test "$cf_add_incdir" = /usr/local/include ; then
9444                         if test "$GCC" = yes
9445                         then
9446                           cf_save_CPPFLAGS=$CPPFLAGS
9447                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9448                           cat >conftest.$ac_ext <<_ACEOF
9449 #line 9449 "configure"
9450 #include "confdefs.h"
9451 #include <stdio.h>
9452 int
9453 main (void)
9454 {
9455 printf("Hello")
9456   ;
9457   return 0;
9458 }
9459 _ACEOF
9460 rm -f conftest.$ac_objext
9461 if { (eval echo "$as_me:9461: \"$ac_compile\"") >&5
9462   (eval $ac_compile) 2>&5
9463   ac_status=$?
9464   echo "$as_me:9464: \$? = $ac_status" >&5
9465   (exit $ac_status); } &&
9466          { ac_try='test -s conftest.$ac_objext'
9467   { (eval echo "$as_me:9467: \"$ac_try\"") >&5
9468   (eval $ac_try) 2>&5
9469   ac_status=$?
9470   echo "$as_me:9470: \$? = $ac_status" >&5
9471   (exit $ac_status); }; }; then
9472   :
9473 else
9474   echo "$as_me: failed program was:" >&5
9475 cat conftest.$ac_ext >&5
9476 cf_have_incdir=yes
9477 fi
9478 rm -f conftest.$ac_objext conftest.$ac_ext
9479                           CPPFLAGS=$cf_save_CPPFLAGS
9480                         fi
9481                   fi
9482                 fi
9483
9484                 if test "$cf_have_incdir" = no ; then
9485                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9486
9487 echo "${as_me:-configure}:9487: testing adding $cf_add_incdir to include-path ..." 1>&5
9488
9489                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9490
9491                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9492                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9493                   cf_add_incdir="$cf_top_incdir"
9494                 else
9495                   break
9496                 fi
9497           else
9498                 break
9499           fi
9500         done
9501   done
9502 fi
9503
9504 fi
9505
9506 # Set definitions to allow ifdef'ing for ncurses.h
9507
9508 case $cf_cv_ncurses_header in
9509 (*ncurses.h)
9510
9511 cat >>confdefs.h <<\EOF
9512 #define HAVE_NCURSES_H 1
9513 EOF
9514
9515         ;;
9516 esac
9517
9518 case $cf_cv_ncurses_header in
9519 (ncurses/curses.h|ncurses/ncurses.h)
9520
9521 cat >>confdefs.h <<\EOF
9522 #define HAVE_NCURSES_NCURSES_H 1
9523 EOF
9524
9525         ;;
9526 (ncursesw/curses.h|ncursesw/ncurses.h)
9527
9528 cat >>confdefs.h <<\EOF
9529 #define HAVE_NCURSESW_NCURSES_H 1
9530 EOF
9531
9532         ;;
9533 esac
9534
9535 echo "$as_me:9535: checking for terminfo header" >&5
9536 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9537 if test "${cf_cv_term_header+set}" = set; then
9538   echo $ECHO_N "(cached) $ECHO_C" >&6
9539 else
9540
9541 case ${cf_cv_ncurses_header} in
9542 (*/ncurses.h|*/ncursesw.h)
9543         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9544         ;;
9545 (*)
9546         cf_term_header=term.h
9547         ;;
9548 esac
9549
9550 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9551 do
9552 cat >conftest.$ac_ext <<_ACEOF
9553 #line 9553 "configure"
9554 #include "confdefs.h"
9555 #include <stdio.h>
9556 #include <${cf_cv_ncurses_header:-curses.h}>
9557 #include <$cf_test>
9558
9559 int
9560 main (void)
9561 {
9562 int x = auto_left_margin
9563   ;
9564   return 0;
9565 }
9566 _ACEOF
9567 rm -f conftest.$ac_objext
9568 if { (eval echo "$as_me:9568: \"$ac_compile\"") >&5
9569   (eval $ac_compile) 2>&5
9570   ac_status=$?
9571   echo "$as_me:9571: \$? = $ac_status" >&5
9572   (exit $ac_status); } &&
9573          { ac_try='test -s conftest.$ac_objext'
9574   { (eval echo "$as_me:9574: \"$ac_try\"") >&5
9575   (eval $ac_try) 2>&5
9576   ac_status=$?
9577   echo "$as_me:9577: \$? = $ac_status" >&5
9578   (exit $ac_status); }; }; then
9579
9580         cf_cv_term_header="$cf_test"
9581 else
9582   echo "$as_me: failed program was:" >&5
9583 cat conftest.$ac_ext >&5
9584
9585         cf_cv_term_header=unknown
9586
9587 fi
9588 rm -f conftest.$ac_objext conftest.$ac_ext
9589         test "$cf_cv_term_header" != unknown && break
9590 done
9591
9592 fi
9593 echo "$as_me:9593: result: $cf_cv_term_header" >&5
9594 echo "${ECHO_T}$cf_cv_term_header" >&6
9595
9596 # Set definitions to allow ifdef'ing to accommodate subdirectories
9597
9598 case $cf_cv_term_header in
9599 (*term.h)
9600
9601 cat >>confdefs.h <<\EOF
9602 #define HAVE_TERM_H 1
9603 EOF
9604
9605         ;;
9606 esac
9607
9608 case $cf_cv_term_header in
9609 (ncurses/term.h)
9610
9611 cat >>confdefs.h <<\EOF
9612 #define HAVE_NCURSES_TERM_H 1
9613 EOF
9614
9615         ;;
9616 (ncursesw/term.h)
9617
9618 cat >>confdefs.h <<\EOF
9619 #define HAVE_NCURSESW_TERM_H 1
9620 EOF
9621
9622         ;;
9623 esac
9624
9625 # some applications need this, but should check for NCURSES_VERSION
9626
9627 cat >>confdefs.h <<\EOF
9628 #define NCURSES 1
9629 EOF
9630
9631 echo "$as_me:9631: checking for ncurses version" >&5
9632 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9633 if test "${cf_cv_ncurses_version+set}" = set; then
9634   echo $ECHO_N "(cached) $ECHO_C" >&6
9635 else
9636
9637         cf_cv_ncurses_version=no
9638         cf_tempfile=out$$
9639         rm -f $cf_tempfile
9640         if test "$cross_compiling" = yes; then
9641
9642         # This will not work if the preprocessor splits the line after the
9643         # Autoconf token.  The 'unproto' program does that.
9644         cat > conftest.$ac_ext <<EOF
9645 #include <${cf_cv_ncurses_header:-curses.h}>
9646 #undef Autoconf
9647 #ifdef NCURSES_VERSION
9648 Autoconf NCURSES_VERSION
9649 #else
9650 #ifdef __NCURSES_H
9651 Autoconf "old"
9652 #endif
9653 ;
9654 #endif
9655 EOF
9656         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9657         { (eval echo "$as_me:9657: \"$cf_try\"") >&5
9658   (eval $cf_try) 2>&5
9659   ac_status=$?
9660   echo "$as_me:9660: \$? = $ac_status" >&5
9661   (exit $ac_status); }
9662         if test -f conftest.out ; then
9663                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9664                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9665                 rm -f conftest.out
9666         fi
9667
9668 else
9669   cat >conftest.$ac_ext <<_ACEOF
9670 #line 9670 "configure"
9671 #include "confdefs.h"
9672
9673 #include <${cf_cv_ncurses_header:-curses.h}>
9674 #include <stdio.h>
9675 int main(void)
9676 {
9677         FILE *fp = fopen("$cf_tempfile", "w");
9678 #ifdef NCURSES_VERSION
9679 # ifdef NCURSES_VERSION_PATCH
9680         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9681 # else
9682         fprintf(fp, "%s\n", NCURSES_VERSION);
9683 # endif
9684 #else
9685 # ifdef __NCURSES_H
9686         fprintf(fp, "old\n");
9687 # else
9688         make an error
9689 # endif
9690 #endif
9691         ${cf_cv_main_return:-return}(0);
9692 }
9693 _ACEOF
9694 rm -f conftest$ac_exeext
9695 if { (eval echo "$as_me:9695: \"$ac_link\"") >&5
9696   (eval $ac_link) 2>&5
9697   ac_status=$?
9698   echo "$as_me:9698: \$? = $ac_status" >&5
9699   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9700   { (eval echo "$as_me:9700: \"$ac_try\"") >&5
9701   (eval $ac_try) 2>&5
9702   ac_status=$?
9703   echo "$as_me:9703: \$? = $ac_status" >&5
9704   (exit $ac_status); }; }; then
9705
9706         cf_cv_ncurses_version=`cat $cf_tempfile`
9707 else
9708   echo "$as_me: program exited with status $ac_status" >&5
9709 echo "$as_me: failed program was:" >&5
9710 cat conftest.$ac_ext >&5
9711 fi
9712 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9713 fi
9714         rm -f $cf_tempfile
9715
9716 fi
9717 echo "$as_me:9717: result: $cf_cv_ncurses_version" >&5
9718 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9719 test "$cf_cv_ncurses_version" = no ||
9720 cat >>confdefs.h <<\EOF
9721 #define NCURSES 1
9722 EOF
9723
9724 cf_nculib_root=$cf_cv_screen
9725         # This works, except for the special case where we find gpm, but
9726         # ncurses is in a nonstandard location via $LIBS, and we really want
9727         # to link gpm.
9728 cf_ncurses_LIBS=""
9729 cf_ncurses_SAVE="$LIBS"
9730 echo "$as_me:9730: checking for Gpm_Open in -lgpm" >&5
9731 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9732 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9733   echo $ECHO_N "(cached) $ECHO_C" >&6
9734 else
9735   ac_check_lib_save_LIBS=$LIBS
9736 LIBS="-lgpm  $LIBS"
9737 cat >conftest.$ac_ext <<_ACEOF
9738 #line 9738 "configure"
9739 #include "confdefs.h"
9740
9741 /* Override any gcc2 internal prototype to avoid an error.  */
9742 #ifdef __cplusplus
9743 extern "C"
9744 #endif
9745 /* We use char because int might match the return type of a gcc2
9746    builtin and then its argument prototype would still apply.  */
9747 char Gpm_Open ();
9748 int
9749 main (void)
9750 {
9751 Gpm_Open ();
9752   ;
9753   return 0;
9754 }
9755 _ACEOF
9756 rm -f conftest.$ac_objext conftest$ac_exeext
9757 if { (eval echo "$as_me:9757: \"$ac_link\"") >&5
9758   (eval $ac_link) 2>&5
9759   ac_status=$?
9760   echo "$as_me:9760: \$? = $ac_status" >&5
9761   (exit $ac_status); } &&
9762          { ac_try='test -s conftest$ac_exeext'
9763   { (eval echo "$as_me:9763: \"$ac_try\"") >&5
9764   (eval $ac_try) 2>&5
9765   ac_status=$?
9766   echo "$as_me:9766: \$? = $ac_status" >&5
9767   (exit $ac_status); }; }; then
9768   ac_cv_lib_gpm_Gpm_Open=yes
9769 else
9770   echo "$as_me: failed program was:" >&5
9771 cat conftest.$ac_ext >&5
9772 ac_cv_lib_gpm_Gpm_Open=no
9773 fi
9774 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9775 LIBS=$ac_check_lib_save_LIBS
9776 fi
9777 echo "$as_me:9777: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9778 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9779 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9780   echo "$as_me:9780: checking for initscr in -lgpm" >&5
9781 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9782 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9783   echo $ECHO_N "(cached) $ECHO_C" >&6
9784 else
9785   ac_check_lib_save_LIBS=$LIBS
9786 LIBS="-lgpm  $LIBS"
9787 cat >conftest.$ac_ext <<_ACEOF
9788 #line 9788 "configure"
9789 #include "confdefs.h"
9790
9791 /* Override any gcc2 internal prototype to avoid an error.  */
9792 #ifdef __cplusplus
9793 extern "C"
9794 #endif
9795 /* We use char because int might match the return type of a gcc2
9796    builtin and then its argument prototype would still apply.  */
9797 char initscr ();
9798 int
9799 main (void)
9800 {
9801 initscr ();
9802   ;
9803   return 0;
9804 }
9805 _ACEOF
9806 rm -f conftest.$ac_objext conftest$ac_exeext
9807 if { (eval echo "$as_me:9807: \"$ac_link\"") >&5
9808   (eval $ac_link) 2>&5
9809   ac_status=$?
9810   echo "$as_me:9810: \$? = $ac_status" >&5
9811   (exit $ac_status); } &&
9812          { ac_try='test -s conftest$ac_exeext'
9813   { (eval echo "$as_me:9813: \"$ac_try\"") >&5
9814   (eval $ac_try) 2>&5
9815   ac_status=$?
9816   echo "$as_me:9816: \$? = $ac_status" >&5
9817   (exit $ac_status); }; }; then
9818   ac_cv_lib_gpm_initscr=yes
9819 else
9820   echo "$as_me: failed program was:" >&5
9821 cat conftest.$ac_ext >&5
9822 ac_cv_lib_gpm_initscr=no
9823 fi
9824 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9825 LIBS=$ac_check_lib_save_LIBS
9826 fi
9827 echo "$as_me:9827: result: $ac_cv_lib_gpm_initscr" >&5
9828 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9829 if test $ac_cv_lib_gpm_initscr = yes; then
9830   LIBS="$cf_ncurses_SAVE"
9831 else
9832   cf_ncurses_LIBS="-lgpm"
9833 fi
9834
9835 fi
9836
9837 case $host_os in
9838 (freebsd*)
9839         # This is only necessary if you are linking against an obsolete
9840         # version of ncurses (but it should do no harm, since it's static).
9841         if test "$cf_nculib_root" = ncurses ; then
9842                 echo "$as_me:9842: checking for tgoto in -lmytinfo" >&5
9843 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9844 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9845   echo $ECHO_N "(cached) $ECHO_C" >&6
9846 else
9847   ac_check_lib_save_LIBS=$LIBS
9848 LIBS="-lmytinfo  $LIBS"
9849 cat >conftest.$ac_ext <<_ACEOF
9850 #line 9850 "configure"
9851 #include "confdefs.h"
9852
9853 /* Override any gcc2 internal prototype to avoid an error.  */
9854 #ifdef __cplusplus
9855 extern "C"
9856 #endif
9857 /* We use char because int might match the return type of a gcc2
9858    builtin and then its argument prototype would still apply.  */
9859 char tgoto ();
9860 int
9861 main (void)
9862 {
9863 tgoto ();
9864   ;
9865   return 0;
9866 }
9867 _ACEOF
9868 rm -f conftest.$ac_objext conftest$ac_exeext
9869 if { (eval echo "$as_me:9869: \"$ac_link\"") >&5
9870   (eval $ac_link) 2>&5
9871   ac_status=$?
9872   echo "$as_me:9872: \$? = $ac_status" >&5
9873   (exit $ac_status); } &&
9874          { ac_try='test -s conftest$ac_exeext'
9875   { (eval echo "$as_me:9875: \"$ac_try\"") >&5
9876   (eval $ac_try) 2>&5
9877   ac_status=$?
9878   echo "$as_me:9878: \$? = $ac_status" >&5
9879   (exit $ac_status); }; }; then
9880   ac_cv_lib_mytinfo_tgoto=yes
9881 else
9882   echo "$as_me: failed program was:" >&5
9883 cat conftest.$ac_ext >&5
9884 ac_cv_lib_mytinfo_tgoto=no
9885 fi
9886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9887 LIBS=$ac_check_lib_save_LIBS
9888 fi
9889 echo "$as_me:9889: result: $ac_cv_lib_mytinfo_tgoto" >&5
9890 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9891 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9892   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9893 fi
9894
9895         fi
9896         ;;
9897 esac
9898
9899 cf_add_libs="$cf_ncurses_LIBS"
9900 # Filter out duplicates - this happens with badly-designed ".pc" files...
9901 for cf_add_1lib in $LIBS
9902 do
9903         for cf_add_2lib in $cf_add_libs
9904         do
9905                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9906                 then
9907                         cf_add_1lib=
9908                         break
9909                 fi
9910         done
9911         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9912 done
9913 LIBS="$cf_add_libs"
9914
9915 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9916 then
9917
9918 cf_add_libs="-l$cf_nculib_root"
9919 # Filter out duplicates - this happens with badly-designed ".pc" files...
9920 for cf_add_1lib in $LIBS
9921 do
9922         for cf_add_2lib in $cf_add_libs
9923         do
9924                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9925                 then
9926                         cf_add_1lib=
9927                         break
9928                 fi
9929         done
9930         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9931 done
9932 LIBS="$cf_add_libs"
9933
9934 else
9935
9936         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9937         cf_libdir=""
9938         echo "$as_me:9938: checking for initscr" >&5
9939 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9940 if test "${ac_cv_func_initscr+set}" = set; then
9941   echo $ECHO_N "(cached) $ECHO_C" >&6
9942 else
9943   cat >conftest.$ac_ext <<_ACEOF
9944 #line 9944 "configure"
9945 #include "confdefs.h"
9946 /* System header to define __stub macros and hopefully few prototypes,
9947     which can conflict with char initscr (); below.  */
9948 #include <assert.h>
9949 /* Override any gcc2 internal prototype to avoid an error.  */
9950 #ifdef __cplusplus
9951 extern "C"
9952 #endif
9953 /* We use char because int might match the return type of a gcc2
9954    builtin and then its argument prototype would still apply.  */
9955 char initscr ();
9956 char (*f) ();
9957
9958 int
9959 main (void)
9960 {
9961 /* The GNU C library defines this for functions which it implements
9962     to always fail with ENOSYS.  Some functions are actually named
9963     something starting with __ and the normal name is an alias.  */
9964 #if defined (__stub_initscr) || defined (__stub___initscr)
9965 choke me
9966 #else
9967 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9968 #endif
9969
9970   ;
9971   return 0;
9972 }
9973 _ACEOF
9974 rm -f conftest.$ac_objext conftest$ac_exeext
9975 if { (eval echo "$as_me:9975: \"$ac_link\"") >&5
9976   (eval $ac_link) 2>&5
9977   ac_status=$?
9978   echo "$as_me:9978: \$? = $ac_status" >&5
9979   (exit $ac_status); } &&
9980          { ac_try='test -s conftest$ac_exeext'
9981   { (eval echo "$as_me:9981: \"$ac_try\"") >&5
9982   (eval $ac_try) 2>&5
9983   ac_status=$?
9984   echo "$as_me:9984: \$? = $ac_status" >&5
9985   (exit $ac_status); }; }; then
9986   ac_cv_func_initscr=yes
9987 else
9988   echo "$as_me: failed program was:" >&5
9989 cat conftest.$ac_ext >&5
9990 ac_cv_func_initscr=no
9991 fi
9992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9993 fi
9994 echo "$as_me:9994: result: $ac_cv_func_initscr" >&5
9995 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9996 if test $ac_cv_func_initscr = yes; then
9997   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9998 else
9999
10000                 cf_save_LIBS="$LIBS"
10001                 echo "$as_me:10001: checking for initscr in -l$cf_nculib_root" >&5
10002 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10003                 LIBS="-l$cf_nculib_root $LIBS"
10004                 cat >conftest.$ac_ext <<_ACEOF
10005 #line 10005 "configure"
10006 #include "confdefs.h"
10007 #include <${cf_cv_ncurses_header:-curses.h}>
10008 int
10009 main (void)
10010 {
10011 initscr()
10012   ;
10013   return 0;
10014 }
10015 _ACEOF
10016 rm -f conftest.$ac_objext conftest$ac_exeext
10017 if { (eval echo "$as_me:10017: \"$ac_link\"") >&5
10018   (eval $ac_link) 2>&5
10019   ac_status=$?
10020   echo "$as_me:10020: \$? = $ac_status" >&5
10021   (exit $ac_status); } &&
10022          { ac_try='test -s conftest$ac_exeext'
10023   { (eval echo "$as_me:10023: \"$ac_try\"") >&5
10024   (eval $ac_try) 2>&5
10025   ac_status=$?
10026   echo "$as_me:10026: \$? = $ac_status" >&5
10027   (exit $ac_status); }; }; then
10028   echo "$as_me:10028: result: yes" >&5
10029 echo "${ECHO_T}yes" >&6
10030                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10031
10032 else
10033   echo "$as_me: failed program was:" >&5
10034 cat conftest.$ac_ext >&5
10035 echo "$as_me:10035: result: no" >&5
10036 echo "${ECHO_T}no" >&6
10037
10038 cf_search=
10039 cf_library_path_list=""
10040 if test -n "${LDFLAGS}${LIBS}" ; then
10041         for cf_library_path in $LDFLAGS $LIBS
10042         do
10043                 case $cf_library_path in
10044                 (-L*)
10045                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10046
10047 test "x$cf_library_path" != "xNONE" && \
10048 test -d "$cf_library_path" && \
10049  {
10050         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10051         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10052         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10053         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10054         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10055         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"
10056 }
10057
10058                         cf_library_path_list="$cf_library_path_list $cf_search"
10059                         ;;
10060                 esac
10061         done
10062 fi
10063
10064 cf_search=
10065
10066 test "x$prefix" != "xNONE" && \
10067 test -d "$prefix" && \
10068  {
10069         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10070         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10071         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10072         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10073         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10074         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10075 }
10076
10077 for cf_subdir_prefix in \
10078         /usr \
10079         /usr/local \
10080         /usr/pkg \
10081         /opt \
10082         /opt/local \
10083         $HOME
10084 do
10085
10086 test "x$cf_subdir_prefix" != "x$prefix" && \
10087 test -d "$cf_subdir_prefix" && \
10088 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10089         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10090         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10091         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10092         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10093         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10094         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"
10095 }
10096
10097 done
10098
10099 cf_search="$cf_library_path_list $cf_search"
10100
10101                         for cf_libdir in $cf_search
10102                         do
10103                                 echo "$as_me:10103: checking for -l$cf_nculib_root in $cf_libdir" >&5
10104 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10105                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10106                                 cat >conftest.$ac_ext <<_ACEOF
10107 #line 10107 "configure"
10108 #include "confdefs.h"
10109 #include <${cf_cv_ncurses_header:-curses.h}>
10110 int
10111 main (void)
10112 {
10113 initscr()
10114   ;
10115   return 0;
10116 }
10117 _ACEOF
10118 rm -f conftest.$ac_objext conftest$ac_exeext
10119 if { (eval echo "$as_me:10119: \"$ac_link\"") >&5
10120   (eval $ac_link) 2>&5
10121   ac_status=$?
10122   echo "$as_me:10122: \$? = $ac_status" >&5
10123   (exit $ac_status); } &&
10124          { ac_try='test -s conftest$ac_exeext'
10125   { (eval echo "$as_me:10125: \"$ac_try\"") >&5
10126   (eval $ac_try) 2>&5
10127   ac_status=$?
10128   echo "$as_me:10128: \$? = $ac_status" >&5
10129   (exit $ac_status); }; }; then
10130   echo "$as_me:10130: result: yes" >&5
10131 echo "${ECHO_T}yes" >&6
10132                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10133                                          break
10134 else
10135   echo "$as_me: failed program was:" >&5
10136 cat conftest.$ac_ext >&5
10137 echo "$as_me:10137: result: no" >&5
10138 echo "${ECHO_T}no" >&6
10139                                          LIBS="$cf_save_LIBS"
10140 fi
10141 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10142                         done
10143
10144 fi
10145 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10146
10147 fi
10148
10149 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10150
10151 if test $cf_found_library = no ; then
10152         { { echo "$as_me:10152: error: Cannot link $cf_nculib_root library" >&5
10153 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10154    { (exit 1); exit 1; }; }
10155 fi
10156
10157 fi
10158
10159 if test -n "$cf_ncurses_LIBS" ; then
10160         echo "$as_me:10160: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10161 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10162         cf_ncurses_SAVE="$LIBS"
10163         for p in $cf_ncurses_LIBS ; do
10164                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10165                 if test "$q" != "$LIBS" ; then
10166                         LIBS="$q"
10167                 fi
10168         done
10169         cat >conftest.$ac_ext <<_ACEOF
10170 #line 10170 "configure"
10171 #include "confdefs.h"
10172 #include <${cf_cv_ncurses_header:-curses.h}>
10173 int
10174 main (void)
10175 {
10176 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10177   ;
10178   return 0;
10179 }
10180 _ACEOF
10181 rm -f conftest.$ac_objext conftest$ac_exeext
10182 if { (eval echo "$as_me:10182: \"$ac_link\"") >&5
10183   (eval $ac_link) 2>&5
10184   ac_status=$?
10185   echo "$as_me:10185: \$? = $ac_status" >&5
10186   (exit $ac_status); } &&
10187          { ac_try='test -s conftest$ac_exeext'
10188   { (eval echo "$as_me:10188: \"$ac_try\"") >&5
10189   (eval $ac_try) 2>&5
10190   ac_status=$?
10191   echo "$as_me:10191: \$? = $ac_status" >&5
10192   (exit $ac_status); }; }; then
10193   echo "$as_me:10193: result: yes" >&5
10194 echo "${ECHO_T}yes" >&6
10195 else
10196   echo "$as_me: failed program was:" >&5
10197 cat conftest.$ac_ext >&5
10198 echo "$as_me:10198: result: no" >&5
10199 echo "${ECHO_T}no" >&6
10200                  LIBS="$cf_ncurses_SAVE"
10201 fi
10202 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10203 fi
10204
10205 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10206
10207 cat >>confdefs.h <<EOF
10208 #define $cf_nculib_ROOT 1
10209 EOF
10210
10211         fi
10212 else
10213         NCURSES_CONFIG=none
10214 fi
10215
10216         ;;
10217 (pdcurses)
10218         echo "$as_me:10218: checking for X" >&5
10219 echo $ECHO_N "checking for X... $ECHO_C" >&6
10220
10221 # Check whether --with-x or --without-x was given.
10222 if test "${with_x+set}" = set; then
10223   withval="$with_x"
10224
10225 fi;
10226 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10227 if test "x$with_x" = xno; then
10228   # The user explicitly disabled X.
10229   have_x=disabled
10230 else
10231   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10232     # Both variables are already set.
10233     have_x=yes
10234   else
10235     if test "${ac_cv_have_x+set}" = set; then
10236   echo $ECHO_N "(cached) $ECHO_C" >&6
10237 else
10238   # One or both of the vars are not set, and there is no cached value.
10239 ac_x_includes=no ac_x_libraries=no
10240 rm -fr conftest.dir
10241 if mkdir conftest.dir; then
10242   cd conftest.dir
10243   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10244   cat >Imakefile <<'EOF'
10245 acfindx:
10246         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10247 EOF
10248   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10249     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10250     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10251     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10252     for ac_extension in a so sl dylib dll; do
10253       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10254          test -f $ac_im_libdir/libX11.$ac_extension; then
10255         ac_im_usrlibdir=$ac_im_libdir; break
10256       fi
10257     done
10258     # Screen out bogus values from the imake configuration.  They are
10259     # bogus both because they are the default anyway, and because
10260     # using them would break gcc on systems where it needs fixed includes.
10261     case $ac_im_incroot in
10262         /usr/include) ;;
10263         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10264     esac
10265     case $ac_im_usrlibdir in
10266         /usr/lib | /lib) ;;
10267         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10268     esac
10269   fi
10270   cd ..
10271   rm -fr conftest.dir
10272 fi
10273
10274 # Standard set of common directories for X headers.
10275 # Check X11 before X11Rn because it is often a symlink to the current release.
10276 ac_x_header_dirs='
10277 /usr/X11/include
10278 /usr/X11R6/include
10279 /usr/X11R5/include
10280 /usr/X11R4/include
10281
10282 /usr/include/X11
10283 /usr/include/X11R6
10284 /usr/include/X11R5
10285 /usr/include/X11R4
10286
10287 /usr/local/X11/include
10288 /usr/local/X11R6/include
10289 /usr/local/X11R5/include
10290 /usr/local/X11R4/include
10291
10292 /usr/local/include/X11
10293 /usr/local/include/X11R6
10294 /usr/local/include/X11R5
10295 /usr/local/include/X11R4
10296
10297 /usr/X386/include
10298 /usr/x386/include
10299 /usr/XFree86/include/X11
10300
10301 /usr/include
10302 /usr/local/include
10303 /usr/unsupported/include
10304 /usr/athena/include
10305 /usr/local/x11r5/include
10306 /usr/lpp/Xamples/include
10307
10308 /usr/openwin/include
10309 /usr/openwin/share/include'
10310
10311 if test "$ac_x_includes" = no; then
10312   # Guess where to find include files, by looking for Intrinsic.h.
10313   # First, try using that file with no special directory specified.
10314   cat >conftest.$ac_ext <<_ACEOF
10315 #line 10315 "configure"
10316 #include "confdefs.h"
10317 #include <X11/Intrinsic.h>
10318 _ACEOF
10319 if { (eval echo "$as_me:10319: \"$ac_cpp conftest.$ac_ext\"") >&5
10320   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10321   ac_status=$?
10322   egrep -v '^ *\+' conftest.er1 >conftest.err
10323   rm -f conftest.er1
10324   cat conftest.err >&5
10325   echo "$as_me:10325: \$? = $ac_status" >&5
10326   (exit $ac_status); } >/dev/null; then
10327   if test -s conftest.err; then
10328     ac_cpp_err=$ac_c_preproc_warn_flag
10329   else
10330     ac_cpp_err=
10331   fi
10332 else
10333   ac_cpp_err=yes
10334 fi
10335 if test -z "$ac_cpp_err"; then
10336   # We can compile using X headers with no special include directory.
10337 ac_x_includes=
10338 else
10339   echo "$as_me: failed program was:" >&5
10340   cat conftest.$ac_ext >&5
10341   for ac_dir in $ac_x_header_dirs; do
10342   if test -r "$ac_dir/X11/Intrinsic.h"; then
10343     ac_x_includes=$ac_dir
10344     break
10345   fi
10346 done
10347 fi
10348 rm -f conftest.err conftest.$ac_ext
10349 fi # $ac_x_includes = no
10350
10351 if test "$ac_x_libraries" = no; then
10352   # Check for the libraries.
10353   # See if we find them without any special options.
10354   # Don't add to $LIBS permanently.
10355   ac_save_LIBS=$LIBS
10356   LIBS="-lXt $LIBS"
10357   cat >conftest.$ac_ext <<_ACEOF
10358 #line 10358 "configure"
10359 #include "confdefs.h"
10360 #include <X11/Intrinsic.h>
10361 int
10362 main (void)
10363 {
10364 XtMalloc (0)
10365   ;
10366   return 0;
10367 }
10368 _ACEOF
10369 rm -f conftest.$ac_objext conftest$ac_exeext
10370 if { (eval echo "$as_me:10370: \"$ac_link\"") >&5
10371   (eval $ac_link) 2>&5
10372   ac_status=$?
10373   echo "$as_me:10373: \$? = $ac_status" >&5
10374   (exit $ac_status); } &&
10375          { ac_try='test -s conftest$ac_exeext'
10376   { (eval echo "$as_me:10376: \"$ac_try\"") >&5
10377   (eval $ac_try) 2>&5
10378   ac_status=$?
10379   echo "$as_me:10379: \$? = $ac_status" >&5
10380   (exit $ac_status); }; }; then
10381   LIBS=$ac_save_LIBS
10382 # We can link X programs with no special library path.
10383 ac_x_libraries=
10384 else
10385   echo "$as_me: failed program was:" >&5
10386 cat conftest.$ac_ext >&5
10387 LIBS=$ac_save_LIBS
10388 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10389 do
10390   # Don't even attempt the hair of trying to link an X program!
10391   for ac_extension in a so sl dylib dll; do
10392     if test -r $ac_dir/libXt.$ac_extension; then
10393       ac_x_libraries=$ac_dir
10394       break 2
10395     fi
10396   done
10397 done
10398 fi
10399 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10400 fi # $ac_x_libraries = no
10401
10402 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10403   # Didn't find X anywhere.  Cache the known absence of X.
10404   ac_cv_have_x="have_x=no"
10405 else
10406   # Record where we found X for the cache.
10407   ac_cv_have_x="have_x=yes \
10408                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10409 fi
10410 fi
10411
10412   fi
10413   eval "$ac_cv_have_x"
10414 fi # $with_x != no
10415
10416 if test "$have_x" != yes; then
10417   echo "$as_me:10417: result: $have_x" >&5
10418 echo "${ECHO_T}$have_x" >&6
10419   no_x=yes
10420 else
10421   # If each of the values was on the command line, it overrides each guess.
10422   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10423   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10424   # Update the cache value to reflect the command line values.
10425   ac_cv_have_x="have_x=yes \
10426                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10427   echo "$as_me:10427: result: libraries $x_libraries, headers $x_includes" >&5
10428 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10429 fi
10430
10431 if test "$no_x" = yes; then
10432   # Not all programs may use this symbol, but it does not hurt to define it.
10433
10434 cat >>confdefs.h <<\EOF
10435 #define X_DISPLAY_MISSING 1
10436 EOF
10437
10438   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10439 else
10440   if test -n "$x_includes"; then
10441     X_CFLAGS="$X_CFLAGS -I$x_includes"
10442   fi
10443
10444   # It would also be nice to do this for all -L options, not just this one.
10445   if test -n "$x_libraries"; then
10446     X_LIBS="$X_LIBS -L$x_libraries"
10447     # For Solaris; some versions of Sun CC require a space after -R and
10448     # others require no space.  Words are not sufficient . . . .
10449     case `(uname -sr) 2>/dev/null` in
10450     "SunOS 5"*)
10451       echo "$as_me:10451: checking whether -R must be followed by a space" >&5
10452 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10453       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10454       cat >conftest.$ac_ext <<_ACEOF
10455 #line 10455 "configure"
10456 #include "confdefs.h"
10457
10458 int
10459 main (void)
10460 {
10461
10462   ;
10463   return 0;
10464 }
10465 _ACEOF
10466 rm -f conftest.$ac_objext conftest$ac_exeext
10467 if { (eval echo "$as_me:10467: \"$ac_link\"") >&5
10468   (eval $ac_link) 2>&5
10469   ac_status=$?
10470   echo "$as_me:10470: \$? = $ac_status" >&5
10471   (exit $ac_status); } &&
10472          { ac_try='test -s conftest$ac_exeext'
10473   { (eval echo "$as_me:10473: \"$ac_try\"") >&5
10474   (eval $ac_try) 2>&5
10475   ac_status=$?
10476   echo "$as_me:10476: \$? = $ac_status" >&5
10477   (exit $ac_status); }; }; then
10478   ac_R_nospace=yes
10479 else
10480   echo "$as_me: failed program was:" >&5
10481 cat conftest.$ac_ext >&5
10482 ac_R_nospace=no
10483 fi
10484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10485       if test $ac_R_nospace = yes; then
10486         echo "$as_me:10486: result: no" >&5
10487 echo "${ECHO_T}no" >&6
10488         X_LIBS="$X_LIBS -R$x_libraries"
10489       else
10490         LIBS="$ac_xsave_LIBS -R $x_libraries"
10491         cat >conftest.$ac_ext <<_ACEOF
10492 #line 10492 "configure"
10493 #include "confdefs.h"
10494
10495 int
10496 main (void)
10497 {
10498
10499   ;
10500   return 0;
10501 }
10502 _ACEOF
10503 rm -f conftest.$ac_objext conftest$ac_exeext
10504 if { (eval echo "$as_me:10504: \"$ac_link\"") >&5
10505   (eval $ac_link) 2>&5
10506   ac_status=$?
10507   echo "$as_me:10507: \$? = $ac_status" >&5
10508   (exit $ac_status); } &&
10509          { ac_try='test -s conftest$ac_exeext'
10510   { (eval echo "$as_me:10510: \"$ac_try\"") >&5
10511   (eval $ac_try) 2>&5
10512   ac_status=$?
10513   echo "$as_me:10513: \$? = $ac_status" >&5
10514   (exit $ac_status); }; }; then
10515   ac_R_space=yes
10516 else
10517   echo "$as_me: failed program was:" >&5
10518 cat conftest.$ac_ext >&5
10519 ac_R_space=no
10520 fi
10521 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10522         if test $ac_R_space = yes; then
10523           echo "$as_me:10523: result: yes" >&5
10524 echo "${ECHO_T}yes" >&6
10525           X_LIBS="$X_LIBS -R $x_libraries"
10526         else
10527           echo "$as_me:10527: result: neither works" >&5
10528 echo "${ECHO_T}neither works" >&6
10529         fi
10530       fi
10531       LIBS=$ac_xsave_LIBS
10532     esac
10533   fi
10534
10535   # Check for system-dependent libraries X programs must link with.
10536   # Do this before checking for the system-independent R6 libraries
10537   # (-lICE), since we may need -lsocket or whatever for X linking.
10538
10539   if test "$ISC" = yes; then
10540     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10541   else
10542     # Martyn Johnson says this is needed for Ultrix, if the X
10543     # libraries were built with DECnet support.  And Karl Berry says
10544     # the Alpha needs dnet_stub (dnet does not exist).
10545     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10546     cat >conftest.$ac_ext <<_ACEOF
10547 #line 10547 "configure"
10548 #include "confdefs.h"
10549
10550 /* Override any gcc2 internal prototype to avoid an error.  */
10551 #ifdef __cplusplus
10552 extern "C"
10553 #endif
10554 /* We use char because int might match the return type of a gcc2
10555    builtin and then its argument prototype would still apply.  */
10556 char XOpenDisplay ();
10557 int
10558 main (void)
10559 {
10560 XOpenDisplay ();
10561   ;
10562   return 0;
10563 }
10564 _ACEOF
10565 rm -f conftest.$ac_objext conftest$ac_exeext
10566 if { (eval echo "$as_me:10566: \"$ac_link\"") >&5
10567   (eval $ac_link) 2>&5
10568   ac_status=$?
10569   echo "$as_me:10569: \$? = $ac_status" >&5
10570   (exit $ac_status); } &&
10571          { ac_try='test -s conftest$ac_exeext'
10572   { (eval echo "$as_me:10572: \"$ac_try\"") >&5
10573   (eval $ac_try) 2>&5
10574   ac_status=$?
10575   echo "$as_me:10575: \$? = $ac_status" >&5
10576   (exit $ac_status); }; }; then
10577   :
10578 else
10579   echo "$as_me: failed program was:" >&5
10580 cat conftest.$ac_ext >&5
10581 echo "$as_me:10581: checking for dnet_ntoa in -ldnet" >&5
10582 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10583 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10584   echo $ECHO_N "(cached) $ECHO_C" >&6
10585 else
10586   ac_check_lib_save_LIBS=$LIBS
10587 LIBS="-ldnet  $LIBS"
10588 cat >conftest.$ac_ext <<_ACEOF
10589 #line 10589 "configure"
10590 #include "confdefs.h"
10591
10592 /* Override any gcc2 internal prototype to avoid an error.  */
10593 #ifdef __cplusplus
10594 extern "C"
10595 #endif
10596 /* We use char because int might match the return type of a gcc2
10597    builtin and then its argument prototype would still apply.  */
10598 char dnet_ntoa ();
10599 int
10600 main (void)
10601 {
10602 dnet_ntoa ();
10603   ;
10604   return 0;
10605 }
10606 _ACEOF
10607 rm -f conftest.$ac_objext conftest$ac_exeext
10608 if { (eval echo "$as_me:10608: \"$ac_link\"") >&5
10609   (eval $ac_link) 2>&5
10610   ac_status=$?
10611   echo "$as_me:10611: \$? = $ac_status" >&5
10612   (exit $ac_status); } &&
10613          { ac_try='test -s conftest$ac_exeext'
10614   { (eval echo "$as_me:10614: \"$ac_try\"") >&5
10615   (eval $ac_try) 2>&5
10616   ac_status=$?
10617   echo "$as_me:10617: \$? = $ac_status" >&5
10618   (exit $ac_status); }; }; then
10619   ac_cv_lib_dnet_dnet_ntoa=yes
10620 else
10621   echo "$as_me: failed program was:" >&5
10622 cat conftest.$ac_ext >&5
10623 ac_cv_lib_dnet_dnet_ntoa=no
10624 fi
10625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10626 LIBS=$ac_check_lib_save_LIBS
10627 fi
10628 echo "$as_me:10628: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10629 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10630 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10631   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10632 fi
10633
10634     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10635       echo "$as_me:10635: checking for dnet_ntoa in -ldnet_stub" >&5
10636 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10637 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10638   echo $ECHO_N "(cached) $ECHO_C" >&6
10639 else
10640   ac_check_lib_save_LIBS=$LIBS
10641 LIBS="-ldnet_stub  $LIBS"
10642 cat >conftest.$ac_ext <<_ACEOF
10643 #line 10643 "configure"
10644 #include "confdefs.h"
10645
10646 /* Override any gcc2 internal prototype to avoid an error.  */
10647 #ifdef __cplusplus
10648 extern "C"
10649 #endif
10650 /* We use char because int might match the return type of a gcc2
10651    builtin and then its argument prototype would still apply.  */
10652 char dnet_ntoa ();
10653 int
10654 main (void)
10655 {
10656 dnet_ntoa ();
10657   ;
10658   return 0;
10659 }
10660 _ACEOF
10661 rm -f conftest.$ac_objext conftest$ac_exeext
10662 if { (eval echo "$as_me:10662: \"$ac_link\"") >&5
10663   (eval $ac_link) 2>&5
10664   ac_status=$?
10665   echo "$as_me:10665: \$? = $ac_status" >&5
10666   (exit $ac_status); } &&
10667          { ac_try='test -s conftest$ac_exeext'
10668   { (eval echo "$as_me:10668: \"$ac_try\"") >&5
10669   (eval $ac_try) 2>&5
10670   ac_status=$?
10671   echo "$as_me:10671: \$? = $ac_status" >&5
10672   (exit $ac_status); }; }; then
10673   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10674 else
10675   echo "$as_me: failed program was:" >&5
10676 cat conftest.$ac_ext >&5
10677 ac_cv_lib_dnet_stub_dnet_ntoa=no
10678 fi
10679 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10680 LIBS=$ac_check_lib_save_LIBS
10681 fi
10682 echo "$as_me:10682: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10683 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10684 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10685   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10686 fi
10687
10688     fi
10689 fi
10690 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10691     LIBS="$ac_xsave_LIBS"
10692
10693     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10694     # to get the SysV transport functions.
10695     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10696     # needs -lnsl.
10697     # The nsl library prevents programs from opening the X display
10698     # on Irix 5.2, according to T.E. Dickey.
10699     # The functions gethostbyname, getservbyname, and inet_addr are
10700     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10701     echo "$as_me:10701: checking for gethostbyname" >&5
10702 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10703 if test "${ac_cv_func_gethostbyname+set}" = set; then
10704   echo $ECHO_N "(cached) $ECHO_C" >&6
10705 else
10706   cat >conftest.$ac_ext <<_ACEOF
10707 #line 10707 "configure"
10708 #include "confdefs.h"
10709 /* System header to define __stub macros and hopefully few prototypes,
10710     which can conflict with char gethostbyname (); below.  */
10711 #include <assert.h>
10712 /* Override any gcc2 internal prototype to avoid an error.  */
10713 #ifdef __cplusplus
10714 extern "C"
10715 #endif
10716 /* We use char because int might match the return type of a gcc2
10717    builtin and then its argument prototype would still apply.  */
10718 char gethostbyname ();
10719 char (*f) ();
10720
10721 int
10722 main (void)
10723 {
10724 /* The GNU C library defines this for functions which it implements
10725     to always fail with ENOSYS.  Some functions are actually named
10726     something starting with __ and the normal name is an alias.  */
10727 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10728 choke me
10729 #else
10730 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10731 #endif
10732
10733   ;
10734   return 0;
10735 }
10736 _ACEOF
10737 rm -f conftest.$ac_objext conftest$ac_exeext
10738 if { (eval echo "$as_me:10738: \"$ac_link\"") >&5
10739   (eval $ac_link) 2>&5
10740   ac_status=$?
10741   echo "$as_me:10741: \$? = $ac_status" >&5
10742   (exit $ac_status); } &&
10743          { ac_try='test -s conftest$ac_exeext'
10744   { (eval echo "$as_me:10744: \"$ac_try\"") >&5
10745   (eval $ac_try) 2>&5
10746   ac_status=$?
10747   echo "$as_me:10747: \$? = $ac_status" >&5
10748   (exit $ac_status); }; }; then
10749   ac_cv_func_gethostbyname=yes
10750 else
10751   echo "$as_me: failed program was:" >&5
10752 cat conftest.$ac_ext >&5
10753 ac_cv_func_gethostbyname=no
10754 fi
10755 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10756 fi
10757 echo "$as_me:10757: result: $ac_cv_func_gethostbyname" >&5
10758 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10759
10760     if test $ac_cv_func_gethostbyname = no; then
10761       echo "$as_me:10761: checking for gethostbyname in -lnsl" >&5
10762 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10763 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10764   echo $ECHO_N "(cached) $ECHO_C" >&6
10765 else
10766   ac_check_lib_save_LIBS=$LIBS
10767 LIBS="-lnsl  $LIBS"
10768 cat >conftest.$ac_ext <<_ACEOF
10769 #line 10769 "configure"
10770 #include "confdefs.h"
10771
10772 /* Override any gcc2 internal prototype to avoid an error.  */
10773 #ifdef __cplusplus
10774 extern "C"
10775 #endif
10776 /* We use char because int might match the return type of a gcc2
10777    builtin and then its argument prototype would still apply.  */
10778 char gethostbyname ();
10779 int
10780 main (void)
10781 {
10782 gethostbyname ();
10783   ;
10784   return 0;
10785 }
10786 _ACEOF
10787 rm -f conftest.$ac_objext conftest$ac_exeext
10788 if { (eval echo "$as_me:10788: \"$ac_link\"") >&5
10789   (eval $ac_link) 2>&5
10790   ac_status=$?
10791   echo "$as_me:10791: \$? = $ac_status" >&5
10792   (exit $ac_status); } &&
10793          { ac_try='test -s conftest$ac_exeext'
10794   { (eval echo "$as_me:10794: \"$ac_try\"") >&5
10795   (eval $ac_try) 2>&5
10796   ac_status=$?
10797   echo "$as_me:10797: \$? = $ac_status" >&5
10798   (exit $ac_status); }; }; then
10799   ac_cv_lib_nsl_gethostbyname=yes
10800 else
10801   echo "$as_me: failed program was:" >&5
10802 cat conftest.$ac_ext >&5
10803 ac_cv_lib_nsl_gethostbyname=no
10804 fi
10805 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10806 LIBS=$ac_check_lib_save_LIBS
10807 fi
10808 echo "$as_me:10808: result: $ac_cv_lib_nsl_gethostbyname" >&5
10809 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10810 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10811   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10812 fi
10813
10814       if test $ac_cv_lib_nsl_gethostbyname = no; then
10815         echo "$as_me:10815: checking for gethostbyname in -lbsd" >&5
10816 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10817 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10818   echo $ECHO_N "(cached) $ECHO_C" >&6
10819 else
10820   ac_check_lib_save_LIBS=$LIBS
10821 LIBS="-lbsd  $LIBS"
10822 cat >conftest.$ac_ext <<_ACEOF
10823 #line 10823 "configure"
10824 #include "confdefs.h"
10825
10826 /* Override any gcc2 internal prototype to avoid an error.  */
10827 #ifdef __cplusplus
10828 extern "C"
10829 #endif
10830 /* We use char because int might match the return type of a gcc2
10831    builtin and then its argument prototype would still apply.  */
10832 char gethostbyname ();
10833 int
10834 main (void)
10835 {
10836 gethostbyname ();
10837   ;
10838   return 0;
10839 }
10840 _ACEOF
10841 rm -f conftest.$ac_objext conftest$ac_exeext
10842 if { (eval echo "$as_me:10842: \"$ac_link\"") >&5
10843   (eval $ac_link) 2>&5
10844   ac_status=$?
10845   echo "$as_me:10845: \$? = $ac_status" >&5
10846   (exit $ac_status); } &&
10847          { ac_try='test -s conftest$ac_exeext'
10848   { (eval echo "$as_me:10848: \"$ac_try\"") >&5
10849   (eval $ac_try) 2>&5
10850   ac_status=$?
10851   echo "$as_me:10851: \$? = $ac_status" >&5
10852   (exit $ac_status); }; }; then
10853   ac_cv_lib_bsd_gethostbyname=yes
10854 else
10855   echo "$as_me: failed program was:" >&5
10856 cat conftest.$ac_ext >&5
10857 ac_cv_lib_bsd_gethostbyname=no
10858 fi
10859 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10860 LIBS=$ac_check_lib_save_LIBS
10861 fi
10862 echo "$as_me:10862: result: $ac_cv_lib_bsd_gethostbyname" >&5
10863 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10864 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10865   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10866 fi
10867
10868       fi
10869     fi
10870
10871     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10872     # socket/setsockopt and other routines are undefined under SCO ODT
10873     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10874     # on later versions), says Simon Leinen: it contains gethostby*
10875     # variants that don't use the nameserver (or something).  -lsocket
10876     # must be given before -lnsl if both are needed.  We assume that
10877     # if connect needs -lnsl, so does gethostbyname.
10878     echo "$as_me:10878: checking for connect" >&5
10879 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10880 if test "${ac_cv_func_connect+set}" = set; then
10881   echo $ECHO_N "(cached) $ECHO_C" >&6
10882 else
10883   cat >conftest.$ac_ext <<_ACEOF
10884 #line 10884 "configure"
10885 #include "confdefs.h"
10886 /* System header to define __stub macros and hopefully few prototypes,
10887     which can conflict with char connect (); below.  */
10888 #include <assert.h>
10889 /* Override any gcc2 internal prototype to avoid an error.  */
10890 #ifdef __cplusplus
10891 extern "C"
10892 #endif
10893 /* We use char because int might match the return type of a gcc2
10894    builtin and then its argument prototype would still apply.  */
10895 char connect ();
10896 char (*f) ();
10897
10898 int
10899 main (void)
10900 {
10901 /* The GNU C library defines this for functions which it implements
10902     to always fail with ENOSYS.  Some functions are actually named
10903     something starting with __ and the normal name is an alias.  */
10904 #if defined (__stub_connect) || defined (__stub___connect)
10905 choke me
10906 #else
10907 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10908 #endif
10909
10910   ;
10911   return 0;
10912 }
10913 _ACEOF
10914 rm -f conftest.$ac_objext conftest$ac_exeext
10915 if { (eval echo "$as_me:10915: \"$ac_link\"") >&5
10916   (eval $ac_link) 2>&5
10917   ac_status=$?
10918   echo "$as_me:10918: \$? = $ac_status" >&5
10919   (exit $ac_status); } &&
10920          { ac_try='test -s conftest$ac_exeext'
10921   { (eval echo "$as_me:10921: \"$ac_try\"") >&5
10922   (eval $ac_try) 2>&5
10923   ac_status=$?
10924   echo "$as_me:10924: \$? = $ac_status" >&5
10925   (exit $ac_status); }; }; then
10926   ac_cv_func_connect=yes
10927 else
10928   echo "$as_me: failed program was:" >&5
10929 cat conftest.$ac_ext >&5
10930 ac_cv_func_connect=no
10931 fi
10932 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10933 fi
10934 echo "$as_me:10934: result: $ac_cv_func_connect" >&5
10935 echo "${ECHO_T}$ac_cv_func_connect" >&6
10936
10937     if test $ac_cv_func_connect = no; then
10938       echo "$as_me:10938: checking for connect in -lsocket" >&5
10939 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10940 if test "${ac_cv_lib_socket_connect+set}" = set; then
10941   echo $ECHO_N "(cached) $ECHO_C" >&6
10942 else
10943   ac_check_lib_save_LIBS=$LIBS
10944 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10945 cat >conftest.$ac_ext <<_ACEOF
10946 #line 10946 "configure"
10947 #include "confdefs.h"
10948
10949 /* Override any gcc2 internal prototype to avoid an error.  */
10950 #ifdef __cplusplus
10951 extern "C"
10952 #endif
10953 /* We use char because int might match the return type of a gcc2
10954    builtin and then its argument prototype would still apply.  */
10955 char connect ();
10956 int
10957 main (void)
10958 {
10959 connect ();
10960   ;
10961   return 0;
10962 }
10963 _ACEOF
10964 rm -f conftest.$ac_objext conftest$ac_exeext
10965 if { (eval echo "$as_me:10965: \"$ac_link\"") >&5
10966   (eval $ac_link) 2>&5
10967   ac_status=$?
10968   echo "$as_me:10968: \$? = $ac_status" >&5
10969   (exit $ac_status); } &&
10970          { ac_try='test -s conftest$ac_exeext'
10971   { (eval echo "$as_me:10971: \"$ac_try\"") >&5
10972   (eval $ac_try) 2>&5
10973   ac_status=$?
10974   echo "$as_me:10974: \$? = $ac_status" >&5
10975   (exit $ac_status); }; }; then
10976   ac_cv_lib_socket_connect=yes
10977 else
10978   echo "$as_me: failed program was:" >&5
10979 cat conftest.$ac_ext >&5
10980 ac_cv_lib_socket_connect=no
10981 fi
10982 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10983 LIBS=$ac_check_lib_save_LIBS
10984 fi
10985 echo "$as_me:10985: result: $ac_cv_lib_socket_connect" >&5
10986 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10987 if test $ac_cv_lib_socket_connect = yes; then
10988   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10989 fi
10990
10991     fi
10992
10993     # Guillermo Gomez says -lposix is necessary on A/UX.
10994     echo "$as_me:10994: checking for remove" >&5
10995 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10996 if test "${ac_cv_func_remove+set}" = set; then
10997   echo $ECHO_N "(cached) $ECHO_C" >&6
10998 else
10999   cat >conftest.$ac_ext <<_ACEOF
11000 #line 11000 "configure"
11001 #include "confdefs.h"
11002 /* System header to define __stub macros and hopefully few prototypes,
11003     which can conflict with char remove (); below.  */
11004 #include <assert.h>
11005 /* Override any gcc2 internal prototype to avoid an error.  */
11006 #ifdef __cplusplus
11007 extern "C"
11008 #endif
11009 /* We use char because int might match the return type of a gcc2
11010    builtin and then its argument prototype would still apply.  */
11011 char remove ();
11012 char (*f) ();
11013
11014 int
11015 main (void)
11016 {
11017 /* The GNU C library defines this for functions which it implements
11018     to always fail with ENOSYS.  Some functions are actually named
11019     something starting with __ and the normal name is an alias.  */
11020 #if defined (__stub_remove) || defined (__stub___remove)
11021 choke me
11022 #else
11023 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11024 #endif
11025
11026   ;
11027   return 0;
11028 }
11029 _ACEOF
11030 rm -f conftest.$ac_objext conftest$ac_exeext
11031 if { (eval echo "$as_me:11031: \"$ac_link\"") >&5
11032   (eval $ac_link) 2>&5
11033   ac_status=$?
11034   echo "$as_me:11034: \$? = $ac_status" >&5
11035   (exit $ac_status); } &&
11036          { ac_try='test -s conftest$ac_exeext'
11037   { (eval echo "$as_me:11037: \"$ac_try\"") >&5
11038   (eval $ac_try) 2>&5
11039   ac_status=$?
11040   echo "$as_me:11040: \$? = $ac_status" >&5
11041   (exit $ac_status); }; }; then
11042   ac_cv_func_remove=yes
11043 else
11044   echo "$as_me: failed program was:" >&5
11045 cat conftest.$ac_ext >&5
11046 ac_cv_func_remove=no
11047 fi
11048 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11049 fi
11050 echo "$as_me:11050: result: $ac_cv_func_remove" >&5
11051 echo "${ECHO_T}$ac_cv_func_remove" >&6
11052
11053     if test $ac_cv_func_remove = no; then
11054       echo "$as_me:11054: checking for remove in -lposix" >&5
11055 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11056 if test "${ac_cv_lib_posix_remove+set}" = set; then
11057   echo $ECHO_N "(cached) $ECHO_C" >&6
11058 else
11059   ac_check_lib_save_LIBS=$LIBS
11060 LIBS="-lposix  $LIBS"
11061 cat >conftest.$ac_ext <<_ACEOF
11062 #line 11062 "configure"
11063 #include "confdefs.h"
11064
11065 /* Override any gcc2 internal prototype to avoid an error.  */
11066 #ifdef __cplusplus
11067 extern "C"
11068 #endif
11069 /* We use char because int might match the return type of a gcc2
11070    builtin and then its argument prototype would still apply.  */
11071 char remove ();
11072 int
11073 main (void)
11074 {
11075 remove ();
11076   ;
11077   return 0;
11078 }
11079 _ACEOF
11080 rm -f conftest.$ac_objext conftest$ac_exeext
11081 if { (eval echo "$as_me:11081: \"$ac_link\"") >&5
11082   (eval $ac_link) 2>&5
11083   ac_status=$?
11084   echo "$as_me:11084: \$? = $ac_status" >&5
11085   (exit $ac_status); } &&
11086          { ac_try='test -s conftest$ac_exeext'
11087   { (eval echo "$as_me:11087: \"$ac_try\"") >&5
11088   (eval $ac_try) 2>&5
11089   ac_status=$?
11090   echo "$as_me:11090: \$? = $ac_status" >&5
11091   (exit $ac_status); }; }; then
11092   ac_cv_lib_posix_remove=yes
11093 else
11094   echo "$as_me: failed program was:" >&5
11095 cat conftest.$ac_ext >&5
11096 ac_cv_lib_posix_remove=no
11097 fi
11098 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11099 LIBS=$ac_check_lib_save_LIBS
11100 fi
11101 echo "$as_me:11101: result: $ac_cv_lib_posix_remove" >&5
11102 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11103 if test $ac_cv_lib_posix_remove = yes; then
11104   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11105 fi
11106
11107     fi
11108
11109     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11110     echo "$as_me:11110: checking for shmat" >&5
11111 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11112 if test "${ac_cv_func_shmat+set}" = set; then
11113   echo $ECHO_N "(cached) $ECHO_C" >&6
11114 else
11115   cat >conftest.$ac_ext <<_ACEOF
11116 #line 11116 "configure"
11117 #include "confdefs.h"
11118 /* System header to define __stub macros and hopefully few prototypes,
11119     which can conflict with char shmat (); below.  */
11120 #include <assert.h>
11121 /* Override any gcc2 internal prototype to avoid an error.  */
11122 #ifdef __cplusplus
11123 extern "C"
11124 #endif
11125 /* We use char because int might match the return type of a gcc2
11126    builtin and then its argument prototype would still apply.  */
11127 char shmat ();
11128 char (*f) ();
11129
11130 int
11131 main (void)
11132 {
11133 /* The GNU C library defines this for functions which it implements
11134     to always fail with ENOSYS.  Some functions are actually named
11135     something starting with __ and the normal name is an alias.  */
11136 #if defined (__stub_shmat) || defined (__stub___shmat)
11137 choke me
11138 #else
11139 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11140 #endif
11141
11142   ;
11143   return 0;
11144 }
11145 _ACEOF
11146 rm -f conftest.$ac_objext conftest$ac_exeext
11147 if { (eval echo "$as_me:11147: \"$ac_link\"") >&5
11148   (eval $ac_link) 2>&5
11149   ac_status=$?
11150   echo "$as_me:11150: \$? = $ac_status" >&5
11151   (exit $ac_status); } &&
11152          { ac_try='test -s conftest$ac_exeext'
11153   { (eval echo "$as_me:11153: \"$ac_try\"") >&5
11154   (eval $ac_try) 2>&5
11155   ac_status=$?
11156   echo "$as_me:11156: \$? = $ac_status" >&5
11157   (exit $ac_status); }; }; then
11158   ac_cv_func_shmat=yes
11159 else
11160   echo "$as_me: failed program was:" >&5
11161 cat conftest.$ac_ext >&5
11162 ac_cv_func_shmat=no
11163 fi
11164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11165 fi
11166 echo "$as_me:11166: result: $ac_cv_func_shmat" >&5
11167 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11168
11169     if test $ac_cv_func_shmat = no; then
11170       echo "$as_me:11170: checking for shmat in -lipc" >&5
11171 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11172 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11173   echo $ECHO_N "(cached) $ECHO_C" >&6
11174 else
11175   ac_check_lib_save_LIBS=$LIBS
11176 LIBS="-lipc  $LIBS"
11177 cat >conftest.$ac_ext <<_ACEOF
11178 #line 11178 "configure"
11179 #include "confdefs.h"
11180
11181 /* Override any gcc2 internal prototype to avoid an error.  */
11182 #ifdef __cplusplus
11183 extern "C"
11184 #endif
11185 /* We use char because int might match the return type of a gcc2
11186    builtin and then its argument prototype would still apply.  */
11187 char shmat ();
11188 int
11189 main (void)
11190 {
11191 shmat ();
11192   ;
11193   return 0;
11194 }
11195 _ACEOF
11196 rm -f conftest.$ac_objext conftest$ac_exeext
11197 if { (eval echo "$as_me:11197: \"$ac_link\"") >&5
11198   (eval $ac_link) 2>&5
11199   ac_status=$?
11200   echo "$as_me:11200: \$? = $ac_status" >&5
11201   (exit $ac_status); } &&
11202          { ac_try='test -s conftest$ac_exeext'
11203   { (eval echo "$as_me:11203: \"$ac_try\"") >&5
11204   (eval $ac_try) 2>&5
11205   ac_status=$?
11206   echo "$as_me:11206: \$? = $ac_status" >&5
11207   (exit $ac_status); }; }; then
11208   ac_cv_lib_ipc_shmat=yes
11209 else
11210   echo "$as_me: failed program was:" >&5
11211 cat conftest.$ac_ext >&5
11212 ac_cv_lib_ipc_shmat=no
11213 fi
11214 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11215 LIBS=$ac_check_lib_save_LIBS
11216 fi
11217 echo "$as_me:11217: result: $ac_cv_lib_ipc_shmat" >&5
11218 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11219 if test $ac_cv_lib_ipc_shmat = yes; then
11220   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11221 fi
11222
11223     fi
11224   fi
11225
11226   # Check for libraries that X11R6 Xt/Xaw programs need.
11227   ac_save_LDFLAGS=$LDFLAGS
11228   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11229   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11230   # check for ICE first), but we must link in the order -lSM -lICE or
11231   # we get undefined symbols.  So assume we have SM if we have ICE.
11232   # These have to be linked with before -lX11, unlike the other
11233   # libraries we check for below, so use a different variable.
11234   # John Interrante, Karl Berry
11235   echo "$as_me:11235: checking for IceConnectionNumber in -lICE" >&5
11236 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11237 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11238   echo $ECHO_N "(cached) $ECHO_C" >&6
11239 else
11240   ac_check_lib_save_LIBS=$LIBS
11241 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11242 cat >conftest.$ac_ext <<_ACEOF
11243 #line 11243 "configure"
11244 #include "confdefs.h"
11245
11246 /* Override any gcc2 internal prototype to avoid an error.  */
11247 #ifdef __cplusplus
11248 extern "C"
11249 #endif
11250 /* We use char because int might match the return type of a gcc2
11251    builtin and then its argument prototype would still apply.  */
11252 char IceConnectionNumber ();
11253 int
11254 main (void)
11255 {
11256 IceConnectionNumber ();
11257   ;
11258   return 0;
11259 }
11260 _ACEOF
11261 rm -f conftest.$ac_objext conftest$ac_exeext
11262 if { (eval echo "$as_me:11262: \"$ac_link\"") >&5
11263   (eval $ac_link) 2>&5
11264   ac_status=$?
11265   echo "$as_me:11265: \$? = $ac_status" >&5
11266   (exit $ac_status); } &&
11267          { ac_try='test -s conftest$ac_exeext'
11268   { (eval echo "$as_me:11268: \"$ac_try\"") >&5
11269   (eval $ac_try) 2>&5
11270   ac_status=$?
11271   echo "$as_me:11271: \$? = $ac_status" >&5
11272   (exit $ac_status); }; }; then
11273   ac_cv_lib_ICE_IceConnectionNumber=yes
11274 else
11275   echo "$as_me: failed program was:" >&5
11276 cat conftest.$ac_ext >&5
11277 ac_cv_lib_ICE_IceConnectionNumber=no
11278 fi
11279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11280 LIBS=$ac_check_lib_save_LIBS
11281 fi
11282 echo "$as_me:11282: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11283 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11284 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11285   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11286 fi
11287
11288   LDFLAGS=$ac_save_LDFLAGS
11289
11290 fi
11291
11292 cf_x_athena=${cf_x_athena:-Xaw}
11293
11294 echo "$as_me:11294: checking if you want to link with Xaw 3d library" >&5
11295 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11296 withval=
11297
11298 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11299 if test "${with_Xaw3d+set}" = set; then
11300   withval="$with_Xaw3d"
11301
11302 fi;
11303 if test "$withval" = yes ; then
11304         cf_x_athena=Xaw3d
11305         echo "$as_me:11305: result: yes" >&5
11306 echo "${ECHO_T}yes" >&6
11307 else
11308         echo "$as_me:11308: result: no" >&5
11309 echo "${ECHO_T}no" >&6
11310 fi
11311
11312 echo "$as_me:11312: checking if you want to link with Xaw 3d xft library" >&5
11313 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11314 withval=
11315
11316 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11317 if test "${with_Xaw3dxft+set}" = set; then
11318   withval="$with_Xaw3dxft"
11319
11320 fi;
11321 if test "$withval" = yes ; then
11322         cf_x_athena=Xaw3dxft
11323         echo "$as_me:11323: result: yes" >&5
11324 echo "${ECHO_T}yes" >&6
11325 else
11326         echo "$as_me:11326: result: no" >&5
11327 echo "${ECHO_T}no" >&6
11328 fi
11329
11330 echo "$as_me:11330: checking if you want to link with neXT Athena library" >&5
11331 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11332 withval=
11333
11334 # Check whether --with-neXtaw or --without-neXtaw was given.
11335 if test "${with_neXtaw+set}" = set; then
11336   withval="$with_neXtaw"
11337
11338 fi;
11339 if test "$withval" = yes ; then
11340         cf_x_athena=neXtaw
11341         echo "$as_me:11341: result: yes" >&5
11342 echo "${ECHO_T}yes" >&6
11343 else
11344         echo "$as_me:11344: result: no" >&5
11345 echo "${ECHO_T}no" >&6
11346 fi
11347
11348 echo "$as_me:11348: checking if you want to link with Athena-Plus library" >&5
11349 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11350 withval=
11351
11352 # Check whether --with-XawPlus or --without-XawPlus was given.
11353 if test "${with_XawPlus+set}" = set; then
11354   withval="$with_XawPlus"
11355
11356 fi;
11357 if test "$withval" = yes ; then
11358         cf_x_athena=XawPlus
11359         echo "$as_me:11359: result: yes" >&5
11360 echo "${ECHO_T}yes" >&6
11361 else
11362         echo "$as_me:11362: result: no" >&5
11363 echo "${ECHO_T}no" >&6
11364 fi
11365
11366 cf_x_athena_lib=""
11367
11368 if test "$PKG_CONFIG" != none ; then
11369         cf_athena_list=
11370         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11371         for cf_athena_pkg in \
11372                 $cf_athena_list \
11373                 ${cf_x_athena} \
11374                 ${cf_x_athena}-devel \
11375                 lib${cf_x_athena} \
11376                 lib${cf_x_athena}-devel
11377         do
11378
11379 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11380         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11381
11382 echo "${as_me:-configure}:11382: testing found package $cf_athena_pkg ..." 1>&5
11383
11384         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11385         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11386         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11387
11388 echo "${as_me:-configure}:11388: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11389
11390         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11391
11392 echo "${as_me:-configure}:11392: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11393
11394 cf_fix_cppflags=no
11395 cf_new_cflags=
11396 cf_new_cppflags=
11397 cf_new_extra_cppflags=
11398
11399 for cf_add_cflags in $cf_pkgconfig_incs
11400 do
11401 case $cf_fix_cppflags in
11402 (no)
11403         case $cf_add_cflags in
11404         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11405                 case $cf_add_cflags in
11406                 (-D*)
11407                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11408
11409                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11410                                 && test -z "${cf_tst_cflags}" \
11411                                 && cf_fix_cppflags=yes
11412
11413                         if test $cf_fix_cppflags = yes ; then
11414
11415         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11416         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11417
11418                                 continue
11419                         elif test "${cf_tst_cflags}" = "\"'" ; then
11420
11421         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11422         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11423
11424                                 continue
11425                         fi
11426                         ;;
11427                 esac
11428                 case "$CPPFLAGS" in
11429                 (*$cf_add_cflags)
11430                         ;;
11431                 (*)
11432                         case $cf_add_cflags in
11433                         (-D*)
11434                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11435
11436 CPPFLAGS=`echo "$CPPFLAGS" | \
11437         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11438                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11439
11440                                 ;;
11441                         esac
11442
11443         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11444         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11445
11446                         ;;
11447                 esac
11448                 ;;
11449         (*)
11450
11451         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11452         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11453
11454                 ;;
11455         esac
11456         ;;
11457 (yes)
11458
11459         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11460         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11461
11462         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11463
11464         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11465                 && test -z "${cf_tst_cflags}" \
11466                 && cf_fix_cppflags=no
11467         ;;
11468 esac
11469 done
11470
11471 if test -n "$cf_new_cflags" ; then
11472
11473         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11474         CFLAGS="${CFLAGS}$cf_new_cflags"
11475
11476 fi
11477
11478 if test -n "$cf_new_cppflags" ; then
11479
11480         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11481         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11482
11483 fi
11484
11485 if test -n "$cf_new_extra_cppflags" ; then
11486
11487         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11488         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11489
11490 fi
11491
11492 cf_add_libs="$cf_pkgconfig_libs"
11493 # Filter out duplicates - this happens with badly-designed ".pc" files...
11494 for cf_add_1lib in $LIBS
11495 do
11496         for cf_add_2lib in $cf_add_libs
11497         do
11498                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11499                 then
11500                         cf_add_1lib=
11501                         break
11502                 fi
11503         done
11504         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11505 done
11506 LIBS="$cf_add_libs"
11507
11508                         cf_x_athena_lib="$cf_pkgconfig_libs"
11509
11510 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11511
11512                         cat >>confdefs.h <<EOF
11513 #define $cf_x_athena_LIBS 1
11514 EOF
11515
11516         for cf_trim_lib in Xmu Xt X11
11517         do
11518                 case "$LIBS" in
11519                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11520                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11521                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11522
11523 echo "${as_me:-configure}:11523: testing ..trimmed $LIBS ..." 1>&5
11524
11525                         ;;
11526                 esac
11527         done
11528
11529 echo "$as_me:11529: checking for usable $cf_x_athena/Xmu package" >&5
11530 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11531 if test "${cf_cv_xaw_compat+set}" = set; then
11532   echo $ECHO_N "(cached) $ECHO_C" >&6
11533 else
11534
11535 cat >conftest.$ac_ext <<_ACEOF
11536 #line 11536 "configure"
11537 #include "confdefs.h"
11538
11539 #include <X11/Xmu/CharSet.h>
11540
11541 int
11542 main (void)
11543 {
11544
11545 int check = XmuCompareISOLatin1("big", "small")
11546
11547   ;
11548   return 0;
11549 }
11550 _ACEOF
11551 rm -f conftest.$ac_objext conftest$ac_exeext
11552 if { (eval echo "$as_me:11552: \"$ac_link\"") >&5
11553   (eval $ac_link) 2>&5
11554   ac_status=$?
11555   echo "$as_me:11555: \$? = $ac_status" >&5
11556   (exit $ac_status); } &&
11557          { ac_try='test -s conftest$ac_exeext'
11558   { (eval echo "$as_me:11558: \"$ac_try\"") >&5
11559   (eval $ac_try) 2>&5
11560   ac_status=$?
11561   echo "$as_me:11561: \$? = $ac_status" >&5
11562   (exit $ac_status); }; }; then
11563   cf_cv_xaw_compat=yes
11564 else
11565   echo "$as_me: failed program was:" >&5
11566 cat conftest.$ac_ext >&5
11567 cf_cv_xaw_compat=no
11568 fi
11569 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11570 fi
11571 echo "$as_me:11571: result: $cf_cv_xaw_compat" >&5
11572 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11573
11574                         if test "$cf_cv_xaw_compat" = no
11575                         then
11576                                 # workaround for broken ".pc" files...
11577                                 case "$cf_x_athena_lib" in
11578                                 (*-lXmu*)
11579                                         ;;
11580                                 (*)
11581                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11582
11583 echo "${as_me:-configure}:11583: testing work around broken package ..." 1>&5
11584
11585                                         cf_save_xmu="$LIBS"
11586                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
11587
11588 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11589         test -n "$verbose" && echo "    found package xmu" 1>&6
11590
11591 echo "${as_me:-configure}:11591: testing found package xmu ..." 1>&5
11592
11593         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11594         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11595         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11596
11597 echo "${as_me:-configure}:11597: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11598
11599         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11600
11601 echo "${as_me:-configure}:11601: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11602
11603 cf_fix_cppflags=no
11604 cf_new_cflags=
11605 cf_new_cppflags=
11606 cf_new_extra_cppflags=
11607
11608 for cf_add_cflags in $cf_pkgconfig_incs
11609 do
11610 case $cf_fix_cppflags in
11611 (no)
11612         case $cf_add_cflags in
11613         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11614                 case $cf_add_cflags in
11615                 (-D*)
11616                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11617
11618                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11619                                 && test -z "${cf_tst_cflags}" \
11620                                 && cf_fix_cppflags=yes
11621
11622                         if test $cf_fix_cppflags = yes ; then
11623
11624         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11625         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11626
11627                                 continue
11628                         elif test "${cf_tst_cflags}" = "\"'" ; then
11629
11630         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11631         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11632
11633                                 continue
11634                         fi
11635                         ;;
11636                 esac
11637                 case "$CPPFLAGS" in
11638                 (*$cf_add_cflags)
11639                         ;;
11640                 (*)
11641                         case $cf_add_cflags in
11642                         (-D*)
11643                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11644
11645 CPPFLAGS=`echo "$CPPFLAGS" | \
11646         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11647                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11648
11649                                 ;;
11650                         esac
11651
11652         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11653         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11654
11655                         ;;
11656                 esac
11657                 ;;
11658         (*)
11659
11660         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11661         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11662
11663                 ;;
11664         esac
11665         ;;
11666 (yes)
11667
11668         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11669         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11670
11671         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11672
11673         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11674                 && test -z "${cf_tst_cflags}" \
11675                 && cf_fix_cppflags=no
11676         ;;
11677 esac
11678 done
11679
11680 if test -n "$cf_new_cflags" ; then
11681
11682         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11683         CFLAGS="${CFLAGS}$cf_new_cflags"
11684
11685 fi
11686
11687 if test -n "$cf_new_cppflags" ; then
11688
11689         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11690         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11691
11692 fi
11693
11694 if test -n "$cf_new_extra_cppflags" ; then
11695
11696         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11697         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11698
11699 fi
11700
11701 cf_add_libs="$cf_pkgconfig_libs"
11702 # Filter out duplicates - this happens with badly-designed ".pc" files...
11703 for cf_add_1lib in $LIBS
11704 do
11705         for cf_add_2lib in $cf_add_libs
11706         do
11707                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11708                 then
11709                         cf_add_1lib=
11710                         break
11711                 fi
11712         done
11713         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11714 done
11715 LIBS="$cf_add_libs"
11716
11717                                                         LIBS="$cf_save_xmu"
11718
11719 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11720
11721 echo "${as_me:-configure}:11721: testing ...before $LIBS ..." 1>&5
11722
11723 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
11724 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11725
11726 echo "${as_me:-configure}:11726: testing ...after  $LIBS ..." 1>&5
11727
11728 else
11729         cf_pkgconfig_incs=
11730         cf_pkgconfig_libs=
11731
11732 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11733
11734 echo "${as_me:-configure}:11734: testing ...before $LIBS ..." 1>&5
11735
11736 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
11737 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11738
11739 echo "${as_me:-configure}:11739: testing ...after  $LIBS ..." 1>&5
11740
11741 fi
11742
11743         for cf_trim_lib in Xmu Xt X11
11744         do
11745                 case "$LIBS" in
11746                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
11747                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
11748                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
11749
11750 echo "${as_me:-configure}:11750: testing ..trimmed $LIBS ..." 1>&5
11751
11752                         ;;
11753                 esac
11754         done
11755
11756                                         ;;
11757                                 esac
11758                         fi
11759
11760                         break
11761 else
11762         cf_pkgconfig_incs=
11763         cf_pkgconfig_libs=
11764         :
11765 fi
11766
11767         done
11768 fi
11769
11770 if test -z "$cf_x_athena_lib" ; then
11771
11772 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11773         test -n "$verbose" && echo "    found package Xext" 1>&6
11774
11775 echo "${as_me:-configure}:11775: testing found package Xext ..." 1>&5
11776
11777         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11778         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11779         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11780
11781 echo "${as_me:-configure}:11781: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11782
11783         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11784
11785 echo "${as_me:-configure}:11785: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11786
11787 cf_fix_cppflags=no
11788 cf_new_cflags=
11789 cf_new_cppflags=
11790 cf_new_extra_cppflags=
11791
11792 for cf_add_cflags in $cf_pkgconfig_incs
11793 do
11794 case $cf_fix_cppflags in
11795 (no)
11796         case $cf_add_cflags in
11797         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
11798                 case $cf_add_cflags in
11799                 (-D*)
11800                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11801
11802                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11803                                 && test -z "${cf_tst_cflags}" \
11804                                 && cf_fix_cppflags=yes
11805
11806                         if test $cf_fix_cppflags = yes ; then
11807
11808         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11809         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11810
11811                                 continue
11812                         elif test "${cf_tst_cflags}" = "\"'" ; then
11813
11814         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11815         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11816
11817                                 continue
11818                         fi
11819                         ;;
11820                 esac
11821                 case "$CPPFLAGS" in
11822                 (*$cf_add_cflags)
11823                         ;;
11824                 (*)
11825                         case $cf_add_cflags in
11826                         (-D*)
11827                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11828
11829 CPPFLAGS=`echo "$CPPFLAGS" | \
11830         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11831                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11832
11833                                 ;;
11834                         esac
11835
11836         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
11837         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
11838
11839                         ;;
11840                 esac
11841                 ;;
11842         (*)
11843
11844         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
11845         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
11846
11847                 ;;
11848         esac
11849         ;;
11850 (yes)
11851
11852         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
11853         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
11854
11855         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11856
11857         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
11858                 && test -z "${cf_tst_cflags}" \
11859                 && cf_fix_cppflags=no
11860         ;;
11861 esac
11862 done
11863
11864 if test -n "$cf_new_cflags" ; then
11865
11866         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
11867         CFLAGS="${CFLAGS}$cf_new_cflags"
11868
11869 fi
11870
11871 if test -n "$cf_new_cppflags" ; then
11872
11873         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
11874         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
11875
11876 fi
11877
11878 if test -n "$cf_new_extra_cppflags" ; then
11879
11880         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
11881         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
11882
11883 fi
11884
11885 cf_add_libs="$cf_pkgconfig_libs"
11886 # Filter out duplicates - this happens with badly-designed ".pc" files...
11887 for cf_add_1lib in $LIBS
11888 do
11889         for cf_add_2lib in $cf_add_libs
11890         do
11891                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11892                 then
11893                         cf_add_1lib=
11894                         break
11895                 fi
11896         done
11897         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11898 done
11899 LIBS="$cf_add_libs"
11900
11901         :
11902 else
11903         cf_pkgconfig_incs=
11904         cf_pkgconfig_libs=
11905
11906         echo "$as_me:11906: checking for XextCreateExtension in -lXext" >&5
11907 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11908 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11909   echo $ECHO_N "(cached) $ECHO_C" >&6
11910 else
11911   ac_check_lib_save_LIBS=$LIBS
11912 LIBS="-lXext  $LIBS"
11913 cat >conftest.$ac_ext <<_ACEOF
11914 #line 11914 "configure"
11915 #include "confdefs.h"
11916
11917 /* Override any gcc2 internal prototype to avoid an error.  */
11918 #ifdef __cplusplus
11919 extern "C"
11920 #endif
11921 /* We use char because int might match the return type of a gcc2
11922    builtin and then its argument prototype would still apply.  */
11923 char XextCreateExtension ();
11924 int
11925 main (void)
11926 {
11927 XextCreateExtension ();
11928   ;
11929   return 0;
11930 }
11931 _ACEOF
11932 rm -f conftest.$ac_objext conftest$ac_exeext
11933 if { (eval echo "$as_me:11933: \"$ac_link\"") >&5
11934   (eval $ac_link) 2>&5
11935   ac_status=$?
11936   echo "$as_me:11936: \$? = $ac_status" >&5
11937   (exit $ac_status); } &&
11938          { ac_try='test -s conftest$ac_exeext'
11939   { (eval echo "$as_me:11939: \"$ac_try\"") >&5
11940   (eval $ac_try) 2>&5
11941   ac_status=$?
11942   echo "$as_me:11942: \$? = $ac_status" >&5
11943   (exit $ac_status); }; }; then
11944   ac_cv_lib_Xext_XextCreateExtension=yes
11945 else
11946   echo "$as_me: failed program was:" >&5
11947 cat conftest.$ac_ext >&5
11948 ac_cv_lib_Xext_XextCreateExtension=no
11949 fi
11950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11951 LIBS=$ac_check_lib_save_LIBS
11952 fi
11953 echo "$as_me:11953: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11954 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11955 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11956
11957 cf_add_libs="-lXext"
11958 # Filter out duplicates - this happens with badly-designed ".pc" files...
11959 for cf_add_1lib in $LIBS
11960 do
11961         for cf_add_2lib in $cf_add_libs
11962         do
11963                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
11964                 then
11965                         cf_add_1lib=
11966                         break
11967                 fi
11968         done
11969         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
11970 done
11971 LIBS="$cf_add_libs"
11972
11973 fi
11974
11975 fi
11976
11977 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
11978 # in some cases has installed dummy files in the former, other cases replaced
11979 # it with a link to the new location).  This complicates the configure script.
11980 # Check for that pitfall, and recover using pkg-config
11981 #
11982 # If none of these are set, the configuration is almost certainly broken.
11983 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
11984 then
11985
11986 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11987         test -n "$verbose" && echo "    found package x11" 1>&6
11988
11989 echo "${as_me:-configure}:11989: testing found package x11 ..." 1>&5
11990
11991         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11992         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11993         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11994
11995 echo "${as_me:-configure}:11995: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11996
11997         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11998
11999 echo "${as_me:-configure}:11999: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12000
12001 cf_fix_cppflags=no
12002 cf_new_cflags=
12003 cf_new_cppflags=
12004 cf_new_extra_cppflags=
12005
12006 for cf_add_cflags in $cf_pkgconfig_incs
12007 do
12008 case $cf_fix_cppflags in
12009 (no)
12010         case $cf_add_cflags in
12011         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12012                 case $cf_add_cflags in
12013                 (-D*)
12014                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12015
12016                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12017                                 && test -z "${cf_tst_cflags}" \
12018                                 && cf_fix_cppflags=yes
12019
12020                         if test $cf_fix_cppflags = yes ; then
12021
12022         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12023         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12024
12025                                 continue
12026                         elif test "${cf_tst_cflags}" = "\"'" ; then
12027
12028         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12029         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12030
12031                                 continue
12032                         fi
12033                         ;;
12034                 esac
12035                 case "$CPPFLAGS" in
12036                 (*$cf_add_cflags)
12037                         ;;
12038                 (*)
12039                         case $cf_add_cflags in
12040                         (-D*)
12041                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12042
12043 CPPFLAGS=`echo "$CPPFLAGS" | \
12044         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12045                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12046
12047                                 ;;
12048                         esac
12049
12050         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12051         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12052
12053                         ;;
12054                 esac
12055                 ;;
12056         (*)
12057
12058         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12059         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12060
12061                 ;;
12062         esac
12063         ;;
12064 (yes)
12065
12066         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12067         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12068
12069         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12070
12071         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12072                 && test -z "${cf_tst_cflags}" \
12073                 && cf_fix_cppflags=no
12074         ;;
12075 esac
12076 done
12077
12078 if test -n "$cf_new_cflags" ; then
12079
12080         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12081         CFLAGS="${CFLAGS}$cf_new_cflags"
12082
12083 fi
12084
12085 if test -n "$cf_new_cppflags" ; then
12086
12087         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12088         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12089
12090 fi
12091
12092 if test -n "$cf_new_extra_cppflags" ; then
12093
12094         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12095         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12096
12097 fi
12098
12099 cf_add_libs="$cf_pkgconfig_libs"
12100 # Filter out duplicates - this happens with badly-designed ".pc" files...
12101 for cf_add_1lib in $LIBS
12102 do
12103         for cf_add_2lib in $cf_add_libs
12104         do
12105                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12106                 then
12107                         cf_add_1lib=
12108                         break
12109                 fi
12110         done
12111         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12112 done
12113 LIBS="$cf_add_libs"
12114
12115         :
12116 else
12117         cf_pkgconfig_incs=
12118         cf_pkgconfig_libs=
12119         { echo "$as_me:12119: WARNING: unable to find X11 library" >&5
12120 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12121 fi
12122
12123 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12124         test -n "$verbose" && echo "    found package ice" 1>&6
12125
12126 echo "${as_me:-configure}:12126: testing found package ice ..." 1>&5
12127
12128         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12129         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12130         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12131
12132 echo "${as_me:-configure}:12132: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12133
12134         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12135
12136 echo "${as_me:-configure}:12136: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12137
12138 cf_fix_cppflags=no
12139 cf_new_cflags=
12140 cf_new_cppflags=
12141 cf_new_extra_cppflags=
12142
12143 for cf_add_cflags in $cf_pkgconfig_incs
12144 do
12145 case $cf_fix_cppflags in
12146 (no)
12147         case $cf_add_cflags in
12148         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12149                 case $cf_add_cflags in
12150                 (-D*)
12151                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12152
12153                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12154                                 && test -z "${cf_tst_cflags}" \
12155                                 && cf_fix_cppflags=yes
12156
12157                         if test $cf_fix_cppflags = yes ; then
12158
12159         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12160         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12161
12162                                 continue
12163                         elif test "${cf_tst_cflags}" = "\"'" ; then
12164
12165         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12166         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12167
12168                                 continue
12169                         fi
12170                         ;;
12171                 esac
12172                 case "$CPPFLAGS" in
12173                 (*$cf_add_cflags)
12174                         ;;
12175                 (*)
12176                         case $cf_add_cflags in
12177                         (-D*)
12178                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12179
12180 CPPFLAGS=`echo "$CPPFLAGS" | \
12181         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12182                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12183
12184                                 ;;
12185                         esac
12186
12187         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12188         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12189
12190                         ;;
12191                 esac
12192                 ;;
12193         (*)
12194
12195         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12196         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12197
12198                 ;;
12199         esac
12200         ;;
12201 (yes)
12202
12203         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12204         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12205
12206         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12207
12208         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12209                 && test -z "${cf_tst_cflags}" \
12210                 && cf_fix_cppflags=no
12211         ;;
12212 esac
12213 done
12214
12215 if test -n "$cf_new_cflags" ; then
12216
12217         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12218         CFLAGS="${CFLAGS}$cf_new_cflags"
12219
12220 fi
12221
12222 if test -n "$cf_new_cppflags" ; then
12223
12224         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12225         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12226
12227 fi
12228
12229 if test -n "$cf_new_extra_cppflags" ; then
12230
12231         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12232         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12233
12234 fi
12235
12236 cf_add_libs="$cf_pkgconfig_libs"
12237 # Filter out duplicates - this happens with badly-designed ".pc" files...
12238 for cf_add_1lib in $LIBS
12239 do
12240         for cf_add_2lib in $cf_add_libs
12241         do
12242                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12243                 then
12244                         cf_add_1lib=
12245                         break
12246                 fi
12247         done
12248         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12249 done
12250 LIBS="$cf_add_libs"
12251
12252         :
12253 else
12254         cf_pkgconfig_incs=
12255         cf_pkgconfig_libs=
12256         { echo "$as_me:12256: WARNING: unable to find ICE library" >&5
12257 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12258 fi
12259
12260 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12261         test -n "$verbose" && echo "    found package sm" 1>&6
12262
12263 echo "${as_me:-configure}:12263: testing found package sm ..." 1>&5
12264
12265         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12266         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12267         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12268
12269 echo "${as_me:-configure}:12269: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12270
12271         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12272
12273 echo "${as_me:-configure}:12273: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12274
12275 cf_fix_cppflags=no
12276 cf_new_cflags=
12277 cf_new_cppflags=
12278 cf_new_extra_cppflags=
12279
12280 for cf_add_cflags in $cf_pkgconfig_incs
12281 do
12282 case $cf_fix_cppflags in
12283 (no)
12284         case $cf_add_cflags in
12285         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12286                 case $cf_add_cflags in
12287                 (-D*)
12288                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12289
12290                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12291                                 && test -z "${cf_tst_cflags}" \
12292                                 && cf_fix_cppflags=yes
12293
12294                         if test $cf_fix_cppflags = yes ; then
12295
12296         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12297         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12298
12299                                 continue
12300                         elif test "${cf_tst_cflags}" = "\"'" ; then
12301
12302         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12303         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12304
12305                                 continue
12306                         fi
12307                         ;;
12308                 esac
12309                 case "$CPPFLAGS" in
12310                 (*$cf_add_cflags)
12311                         ;;
12312                 (*)
12313                         case $cf_add_cflags in
12314                         (-D*)
12315                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12316
12317 CPPFLAGS=`echo "$CPPFLAGS" | \
12318         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12319                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12320
12321                                 ;;
12322                         esac
12323
12324         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12325         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12326
12327                         ;;
12328                 esac
12329                 ;;
12330         (*)
12331
12332         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12333         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12334
12335                 ;;
12336         esac
12337         ;;
12338 (yes)
12339
12340         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12341         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12342
12343         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12344
12345         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12346                 && test -z "${cf_tst_cflags}" \
12347                 && cf_fix_cppflags=no
12348         ;;
12349 esac
12350 done
12351
12352 if test -n "$cf_new_cflags" ; then
12353
12354         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12355         CFLAGS="${CFLAGS}$cf_new_cflags"
12356
12357 fi
12358
12359 if test -n "$cf_new_cppflags" ; then
12360
12361         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12362         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12363
12364 fi
12365
12366 if test -n "$cf_new_extra_cppflags" ; then
12367
12368         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12369         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12370
12371 fi
12372
12373 cf_add_libs="$cf_pkgconfig_libs"
12374 # Filter out duplicates - this happens with badly-designed ".pc" files...
12375 for cf_add_1lib in $LIBS
12376 do
12377         for cf_add_2lib in $cf_add_libs
12378         do
12379                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12380                 then
12381                         cf_add_1lib=
12382                         break
12383                 fi
12384         done
12385         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12386 done
12387 LIBS="$cf_add_libs"
12388
12389         :
12390 else
12391         cf_pkgconfig_incs=
12392         cf_pkgconfig_libs=
12393         { echo "$as_me:12393: WARNING: unable to find SM library" >&5
12394 echo "$as_me: WARNING: unable to find SM library" >&2;}
12395 fi
12396
12397 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12398         test -n "$verbose" && echo "    found package xt" 1>&6
12399
12400 echo "${as_me:-configure}:12400: testing found package xt ..." 1>&5
12401
12402         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12403         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12404         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12405
12406 echo "${as_me:-configure}:12406: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12407
12408         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12409
12410 echo "${as_me:-configure}:12410: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12411
12412 cf_fix_cppflags=no
12413 cf_new_cflags=
12414 cf_new_cppflags=
12415 cf_new_extra_cppflags=
12416
12417 for cf_add_cflags in $cf_pkgconfig_incs
12418 do
12419 case $cf_fix_cppflags in
12420 (no)
12421         case $cf_add_cflags in
12422         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12423                 case $cf_add_cflags in
12424                 (-D*)
12425                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12426
12427                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12428                                 && test -z "${cf_tst_cflags}" \
12429                                 && cf_fix_cppflags=yes
12430
12431                         if test $cf_fix_cppflags = yes ; 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                         elif test "${cf_tst_cflags}" = "\"'" ; then
12438
12439         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12440         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12441
12442                                 continue
12443                         fi
12444                         ;;
12445                 esac
12446                 case "$CPPFLAGS" in
12447                 (*$cf_add_cflags)
12448                         ;;
12449                 (*)
12450                         case $cf_add_cflags in
12451                         (-D*)
12452                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12453
12454 CPPFLAGS=`echo "$CPPFLAGS" | \
12455         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12456                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12457
12458                                 ;;
12459                         esac
12460
12461         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12462         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12463
12464                         ;;
12465                 esac
12466                 ;;
12467         (*)
12468
12469         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12470         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12471
12472                 ;;
12473         esac
12474         ;;
12475 (yes)
12476
12477         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12478         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12479
12480         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12481
12482         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12483                 && test -z "${cf_tst_cflags}" \
12484                 && cf_fix_cppflags=no
12485         ;;
12486 esac
12487 done
12488
12489 if test -n "$cf_new_cflags" ; then
12490
12491         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12492         CFLAGS="${CFLAGS}$cf_new_cflags"
12493
12494 fi
12495
12496 if test -n "$cf_new_cppflags" ; then
12497
12498         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12499         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12500
12501 fi
12502
12503 if test -n "$cf_new_extra_cppflags" ; then
12504
12505         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12506         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12507
12508 fi
12509
12510 cf_add_libs="$cf_pkgconfig_libs"
12511 # Filter out duplicates - this happens with badly-designed ".pc" files...
12512 for cf_add_1lib in $LIBS
12513 do
12514         for cf_add_2lib in $cf_add_libs
12515         do
12516                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12517                 then
12518                         cf_add_1lib=
12519                         break
12520                 fi
12521         done
12522         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12523 done
12524 LIBS="$cf_add_libs"
12525
12526         :
12527 else
12528         cf_pkgconfig_incs=
12529         cf_pkgconfig_libs=
12530         { echo "$as_me:12530: WARNING: unable to find Xt library" >&5
12531 echo "$as_me: WARNING: unable to find Xt library" >&2;}
12532 fi
12533
12534 fi
12535
12536 cf_have_X_LIBS=no
12537
12538 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
12539         test -n "$verbose" && echo "    found package xt" 1>&6
12540
12541 echo "${as_me:-configure}:12541: testing found package xt ..." 1>&5
12542
12543         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
12544         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
12545         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
12546
12547 echo "${as_me:-configure}:12547: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12548
12549         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
12550
12551 echo "${as_me:-configure}:12551: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
12552
12553 cf_fix_cppflags=no
12554 cf_new_cflags=
12555 cf_new_cppflags=
12556 cf_new_extra_cppflags=
12557
12558 for cf_add_cflags in $cf_pkgconfig_incs
12559 do
12560 case $cf_fix_cppflags in
12561 (no)
12562         case $cf_add_cflags in
12563         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12564                 case $cf_add_cflags in
12565                 (-D*)
12566                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12567
12568                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12569                                 && test -z "${cf_tst_cflags}" \
12570                                 && cf_fix_cppflags=yes
12571
12572                         if test $cf_fix_cppflags = yes ; then
12573
12574         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12575         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12576
12577                                 continue
12578                         elif test "${cf_tst_cflags}" = "\"'" ; then
12579
12580         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12581         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12582
12583                                 continue
12584                         fi
12585                         ;;
12586                 esac
12587                 case "$CPPFLAGS" in
12588                 (*$cf_add_cflags)
12589                         ;;
12590                 (*)
12591                         case $cf_add_cflags in
12592                         (-D*)
12593                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12594
12595 CPPFLAGS=`echo "$CPPFLAGS" | \
12596         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12597                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12598
12599                                 ;;
12600                         esac
12601
12602         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12603         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12604
12605                         ;;
12606                 esac
12607                 ;;
12608         (*)
12609
12610         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12611         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12612
12613                 ;;
12614         esac
12615         ;;
12616 (yes)
12617
12618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12620
12621         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12622
12623         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12624                 && test -z "${cf_tst_cflags}" \
12625                 && cf_fix_cppflags=no
12626         ;;
12627 esac
12628 done
12629
12630 if test -n "$cf_new_cflags" ; then
12631
12632         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12633         CFLAGS="${CFLAGS}$cf_new_cflags"
12634
12635 fi
12636
12637 if test -n "$cf_new_cppflags" ; then
12638
12639         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12640         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12641
12642 fi
12643
12644 if test -n "$cf_new_extra_cppflags" ; then
12645
12646         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12647         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12648
12649 fi
12650
12651 cf_add_libs="$cf_pkgconfig_libs"
12652 # Filter out duplicates - this happens with badly-designed ".pc" files...
12653 for cf_add_1lib in $LIBS
12654 do
12655         for cf_add_2lib in $cf_add_libs
12656         do
12657                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12658                 then
12659                         cf_add_1lib=
12660                         break
12661                 fi
12662         done
12663         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12664 done
12665 LIBS="$cf_add_libs"
12666
12667         case "x$LIBS" in
12668         (*-lX11*)
12669                 ;;
12670         (*)
12671 # we have an "xt" package, but it may omit Xt's dependency on X11
12672 echo "$as_me:12672: checking for usable X dependency" >&5
12673 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
12674 if test "${cf_cv_xt_x11_compat+set}" = set; then
12675   echo $ECHO_N "(cached) $ECHO_C" >&6
12676 else
12677
12678 cat >conftest.$ac_ext <<_ACEOF
12679 #line 12679 "configure"
12680 #include "confdefs.h"
12681
12682 #include <X11/Xlib.h>
12683
12684 int
12685 main (void)
12686 {
12687
12688         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
12689         int rc2 = XClearWindow((Display*) 0, (Window) 0);
12690         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
12691         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
12692
12693   ;
12694   return 0;
12695 }
12696 _ACEOF
12697 rm -f conftest.$ac_objext conftest$ac_exeext
12698 if { (eval echo "$as_me:12698: \"$ac_link\"") >&5
12699   (eval $ac_link) 2>&5
12700   ac_status=$?
12701   echo "$as_me:12701: \$? = $ac_status" >&5
12702   (exit $ac_status); } &&
12703          { ac_try='test -s conftest$ac_exeext'
12704   { (eval echo "$as_me:12704: \"$ac_try\"") >&5
12705   (eval $ac_try) 2>&5
12706   ac_status=$?
12707   echo "$as_me:12707: \$? = $ac_status" >&5
12708   (exit $ac_status); }; }; then
12709   cf_cv_xt_x11_compat=yes
12710 else
12711   echo "$as_me: failed program was:" >&5
12712 cat conftest.$ac_ext >&5
12713 cf_cv_xt_x11_compat=no
12714 fi
12715 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12716 fi
12717 echo "$as_me:12717: result: $cf_cv_xt_x11_compat" >&5
12718 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
12719                 if test "$cf_cv_xt_x11_compat" = no
12720                 then
12721                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
12722
12723 echo "${as_me:-configure}:12723: testing work around broken X11 dependency ..." 1>&5
12724
12725                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
12726
12727 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12728         test -n "$verbose" && echo "    found package x11" 1>&6
12729
12730 echo "${as_me:-configure}:12730: testing found package x11 ..." 1>&5
12731
12732         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12733         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12734         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12735
12736 echo "${as_me:-configure}:12736: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12737
12738         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12739
12740 echo "${as_me:-configure}:12740: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12741
12742 cf_fix_cppflags=no
12743 cf_new_cflags=
12744 cf_new_cppflags=
12745 cf_new_extra_cppflags=
12746
12747 for cf_add_cflags in $cf_pkgconfig_incs
12748 do
12749 case $cf_fix_cppflags in
12750 (no)
12751         case $cf_add_cflags in
12752         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12753                 case $cf_add_cflags in
12754                 (-D*)
12755                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12756
12757                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12758                                 && test -z "${cf_tst_cflags}" \
12759                                 && cf_fix_cppflags=yes
12760
12761                         if test $cf_fix_cppflags = yes ; then
12762
12763         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12764         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12765
12766                                 continue
12767                         elif test "${cf_tst_cflags}" = "\"'" ; then
12768
12769         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12770         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12771
12772                                 continue
12773                         fi
12774                         ;;
12775                 esac
12776                 case "$CPPFLAGS" in
12777                 (*$cf_add_cflags)
12778                         ;;
12779                 (*)
12780                         case $cf_add_cflags in
12781                         (-D*)
12782                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12783
12784 CPPFLAGS=`echo "$CPPFLAGS" | \
12785         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12786                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12787
12788                                 ;;
12789                         esac
12790
12791         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12792         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12793
12794                         ;;
12795                 esac
12796                 ;;
12797         (*)
12798
12799         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12800         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12801
12802                 ;;
12803         esac
12804         ;;
12805 (yes)
12806
12807         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12808         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12809
12810         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12811
12812         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12813                 && test -z "${cf_tst_cflags}" \
12814                 && cf_fix_cppflags=no
12815         ;;
12816 esac
12817 done
12818
12819 if test -n "$cf_new_cflags" ; then
12820
12821         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12822         CFLAGS="${CFLAGS}$cf_new_cflags"
12823
12824 fi
12825
12826 if test -n "$cf_new_cppflags" ; then
12827
12828         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12829         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12830
12831 fi
12832
12833 if test -n "$cf_new_extra_cppflags" ; then
12834
12835         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12836         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12837
12838 fi
12839
12840 cf_add_libs="$cf_pkgconfig_libs"
12841 # Filter out duplicates - this happens with badly-designed ".pc" files...
12842 for cf_add_1lib in $LIBS
12843 do
12844         for cf_add_2lib in $cf_add_libs
12845         do
12846                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12847                 then
12848                         cf_add_1lib=
12849                         break
12850                 fi
12851         done
12852         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12853 done
12854 LIBS="$cf_add_libs"
12855
12856         :
12857 else
12858         cf_pkgconfig_incs=
12859         cf_pkgconfig_libs=
12860
12861 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12862
12863 echo "${as_me:-configure}:12863: testing ...before $LIBS ..." 1>&5
12864
12865 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
12866 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12867
12868 echo "${as_me:-configure}:12868: testing ...after  $LIBS ..." 1>&5
12869
12870 fi
12871
12872                 fi
12873                 ;;
12874         esac
12875
12876 echo "$as_me:12876: checking for usable X Toolkit package" >&5
12877 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
12878 if test "${cf_cv_xt_ice_compat+set}" = set; then
12879   echo $ECHO_N "(cached) $ECHO_C" >&6
12880 else
12881
12882 cat >conftest.$ac_ext <<_ACEOF
12883 #line 12883 "configure"
12884 #include "confdefs.h"
12885
12886 #include <X11/Shell.h>
12887
12888 int
12889 main (void)
12890 {
12891 int num = IceConnectionNumber(0)
12892
12893   ;
12894   return 0;
12895 }
12896 _ACEOF
12897 rm -f conftest.$ac_objext conftest$ac_exeext
12898 if { (eval echo "$as_me:12898: \"$ac_link\"") >&5
12899   (eval $ac_link) 2>&5
12900   ac_status=$?
12901   echo "$as_me:12901: \$? = $ac_status" >&5
12902   (exit $ac_status); } &&
12903          { ac_try='test -s conftest$ac_exeext'
12904   { (eval echo "$as_me:12904: \"$ac_try\"") >&5
12905   (eval $ac_try) 2>&5
12906   ac_status=$?
12907   echo "$as_me:12907: \$? = $ac_status" >&5
12908   (exit $ac_status); }; }; then
12909   cf_cv_xt_ice_compat=yes
12910 else
12911   echo "$as_me: failed program was:" >&5
12912 cat conftest.$ac_ext >&5
12913 cf_cv_xt_ice_compat=no
12914 fi
12915 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12916 fi
12917 echo "$as_me:12917: result: $cf_cv_xt_ice_compat" >&5
12918 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
12919
12920         if test "$cf_cv_xt_ice_compat" = no
12921         then
12922                 # workaround for broken ".pc" files used for X Toolkit.
12923                 case "x$X_PRE_LIBS" in
12924                 (*-lICE*)
12925                         case "x$LIBS" in
12926                         (*-lICE*)
12927                                 ;;
12928                         (*)
12929                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
12930
12931 echo "${as_me:-configure}:12931: testing work around broken ICE dependency ..." 1>&5
12932
12933 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12934         test -n "$verbose" && echo "    found package ice" 1>&6
12935
12936 echo "${as_me:-configure}:12936: testing found package ice ..." 1>&5
12937
12938         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12939         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12940         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12941
12942 echo "${as_me:-configure}:12942: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12943
12944         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12945
12946 echo "${as_me:-configure}:12946: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12947
12948 cf_fix_cppflags=no
12949 cf_new_cflags=
12950 cf_new_cppflags=
12951 cf_new_extra_cppflags=
12952
12953 for cf_add_cflags in $cf_pkgconfig_incs
12954 do
12955 case $cf_fix_cppflags in
12956 (no)
12957         case $cf_add_cflags in
12958         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12959                 case $cf_add_cflags in
12960                 (-D*)
12961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12962
12963                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12964                                 && test -z "${cf_tst_cflags}" \
12965                                 && cf_fix_cppflags=yes
12966
12967                         if test $cf_fix_cppflags = yes ; then
12968
12969         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12970         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12971
12972                                 continue
12973                         elif test "${cf_tst_cflags}" = "\"'" ; then
12974
12975         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12976         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12977
12978                                 continue
12979                         fi
12980                         ;;
12981                 esac
12982                 case "$CPPFLAGS" in
12983                 (*$cf_add_cflags)
12984                         ;;
12985                 (*)
12986                         case $cf_add_cflags in
12987                         (-D*)
12988                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12989
12990 CPPFLAGS=`echo "$CPPFLAGS" | \
12991         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12992                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12993
12994                                 ;;
12995                         esac
12996
12997         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12998         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12999
13000                         ;;
13001                 esac
13002                 ;;
13003         (*)
13004
13005         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13006         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13007
13008                 ;;
13009         esac
13010         ;;
13011 (yes)
13012
13013         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13014         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13015
13016         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13017
13018         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13019                 && test -z "${cf_tst_cflags}" \
13020                 && cf_fix_cppflags=no
13021         ;;
13022 esac
13023 done
13024
13025 if test -n "$cf_new_cflags" ; then
13026
13027         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13028         CFLAGS="${CFLAGS}$cf_new_cflags"
13029
13030 fi
13031
13032 if test -n "$cf_new_cppflags" ; then
13033
13034         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13035         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13036
13037 fi
13038
13039 if test -n "$cf_new_extra_cppflags" ; then
13040
13041         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13042         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13043
13044 fi
13045
13046 cf_add_libs="$cf_pkgconfig_libs"
13047 # Filter out duplicates - this happens with badly-designed ".pc" files...
13048 for cf_add_1lib in $LIBS
13049 do
13050         for cf_add_2lib in $cf_add_libs
13051         do
13052                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13053                 then
13054                         cf_add_1lib=
13055                         break
13056                 fi
13057         done
13058         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13059 done
13060 LIBS="$cf_add_libs"
13061
13062 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13063         test -n "$verbose" && echo "    found package sm" 1>&6
13064
13065 echo "${as_me:-configure}:13065: testing found package sm ..." 1>&5
13066
13067         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13068         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13069         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13070
13071 echo "${as_me:-configure}:13071: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13072
13073         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13074
13075 echo "${as_me:-configure}:13075: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13076
13077 cf_fix_cppflags=no
13078 cf_new_cflags=
13079 cf_new_cppflags=
13080 cf_new_extra_cppflags=
13081
13082 for cf_add_cflags in $cf_pkgconfig_incs
13083 do
13084 case $cf_fix_cppflags in
13085 (no)
13086         case $cf_add_cflags in
13087         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13088                 case $cf_add_cflags in
13089                 (-D*)
13090                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13091
13092                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13093                                 && test -z "${cf_tst_cflags}" \
13094                                 && cf_fix_cppflags=yes
13095
13096                         if test $cf_fix_cppflags = yes ; then
13097
13098         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13099         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13100
13101                                 continue
13102                         elif test "${cf_tst_cflags}" = "\"'" ; then
13103
13104         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13105         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13106
13107                                 continue
13108                         fi
13109                         ;;
13110                 esac
13111                 case "$CPPFLAGS" in
13112                 (*$cf_add_cflags)
13113                         ;;
13114                 (*)
13115                         case $cf_add_cflags in
13116                         (-D*)
13117                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13118
13119 CPPFLAGS=`echo "$CPPFLAGS" | \
13120         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13121                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13122
13123                                 ;;
13124                         esac
13125
13126         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13127         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13128
13129                         ;;
13130                 esac
13131                 ;;
13132         (*)
13133
13134         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13135         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13136
13137                 ;;
13138         esac
13139         ;;
13140 (yes)
13141
13142         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13143         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13144
13145         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13146
13147         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13148                 && test -z "${cf_tst_cflags}" \
13149                 && cf_fix_cppflags=no
13150         ;;
13151 esac
13152 done
13153
13154 if test -n "$cf_new_cflags" ; then
13155
13156         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13157         CFLAGS="${CFLAGS}$cf_new_cflags"
13158
13159 fi
13160
13161 if test -n "$cf_new_cppflags" ; then
13162
13163         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13164         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13165
13166 fi
13167
13168 if test -n "$cf_new_extra_cppflags" ; then
13169
13170         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13171         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13172
13173 fi
13174
13175 cf_add_libs="$cf_pkgconfig_libs"
13176 # Filter out duplicates - this happens with badly-designed ".pc" files...
13177 for cf_add_1lib in $LIBS
13178 do
13179         for cf_add_2lib in $cf_add_libs
13180         do
13181                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13182                 then
13183                         cf_add_1lib=
13184                         break
13185                 fi
13186         done
13187         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13188 done
13189 LIBS="$cf_add_libs"
13190
13191         :
13192 else
13193         cf_pkgconfig_incs=
13194         cf_pkgconfig_libs=
13195         :
13196 fi
13197
13198 else
13199         cf_pkgconfig_incs=
13200         cf_pkgconfig_libs=
13201
13202 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13203
13204 echo "${as_me:-configure}:13204: testing ...before $LIBS ..." 1>&5
13205
13206 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
13207 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13208
13209 echo "${as_me:-configure}:13209: testing ...after  $LIBS ..." 1>&5
13210
13211 fi
13212
13213                                 ;;
13214                         esac
13215                         ;;
13216                 esac
13217         fi
13218
13219         cf_have_X_LIBS=yes
13220
13221 else
13222         cf_pkgconfig_incs=
13223         cf_pkgconfig_libs=
13224
13225         LDFLAGS="$X_LIBS $LDFLAGS"
13226
13227 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13228
13229 echo "${as_me:-configure}:13229: testing checking additions to CFLAGS ..." 1>&5
13230
13231 cf_check_cflags="$CFLAGS"
13232 cf_check_cppflags="$CPPFLAGS"
13233
13234 cf_fix_cppflags=no
13235 cf_new_cflags=
13236 cf_new_cppflags=
13237 cf_new_extra_cppflags=
13238
13239 for cf_add_cflags in $X_CFLAGS
13240 do
13241 case $cf_fix_cppflags in
13242 (no)
13243         case $cf_add_cflags in
13244         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13245                 case $cf_add_cflags in
13246                 (-D*)
13247                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13248
13249                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13250                                 && test -z "${cf_tst_cflags}" \
13251                                 && cf_fix_cppflags=yes
13252
13253                         if test $cf_fix_cppflags = yes ; then
13254
13255         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13256         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13257
13258                                 continue
13259                         elif test "${cf_tst_cflags}" = "\"'" ; then
13260
13261         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13262         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13263
13264                                 continue
13265                         fi
13266                         ;;
13267                 esac
13268                 case "$CPPFLAGS" in
13269                 (*$cf_add_cflags)
13270                         ;;
13271                 (*)
13272                         case $cf_add_cflags in
13273                         (-D*)
13274                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13275
13276 CPPFLAGS=`echo "$CPPFLAGS" | \
13277         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13278                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13279
13280                                 ;;
13281                         esac
13282
13283         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13284         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13285
13286                         ;;
13287                 esac
13288                 ;;
13289         (*)
13290
13291         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13292         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13293
13294                 ;;
13295         esac
13296         ;;
13297 (yes)
13298
13299         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13300         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13301
13302         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13303
13304         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13305                 && test -z "${cf_tst_cflags}" \
13306                 && cf_fix_cppflags=no
13307         ;;
13308 esac
13309 done
13310
13311 if test -n "$cf_new_cflags" ; then
13312         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13313
13314 echo "${as_me:-configure}:13314: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13315
13316         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13317         CFLAGS="${CFLAGS}$cf_new_cflags"
13318
13319 fi
13320
13321 if test -n "$cf_new_cppflags" ; then
13322         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13323
13324 echo "${as_me:-configure}:13324: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13325
13326         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13327         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13328
13329 fi
13330
13331 if test -n "$cf_new_extra_cppflags" ; then
13332         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13333
13334 echo "${as_me:-configure}:13334: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13335
13336         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13337         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13338
13339 fi
13340
13341 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13342 cat >conftest.$ac_ext <<_ACEOF
13343 #line 13343 "configure"
13344 #include "confdefs.h"
13345 #include <stdio.h>
13346 int
13347 main (void)
13348 {
13349 printf("Hello world");
13350   ;
13351   return 0;
13352 }
13353 _ACEOF
13354 rm -f conftest.$ac_objext conftest$ac_exeext
13355 if { (eval echo "$as_me:13355: \"$ac_link\"") >&5
13356   (eval $ac_link) 2>&5
13357   ac_status=$?
13358   echo "$as_me:13358: \$? = $ac_status" >&5
13359   (exit $ac_status); } &&
13360          { ac_try='test -s conftest$ac_exeext'
13361   { (eval echo "$as_me:13361: \"$ac_try\"") >&5
13362   (eval $ac_try) 2>&5
13363   ac_status=$?
13364   echo "$as_me:13364: \$? = $ac_status" >&5
13365   (exit $ac_status); }; }; then
13366   :
13367 else
13368   echo "$as_me: failed program was:" >&5
13369 cat conftest.$ac_ext >&5
13370 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
13371
13372 echo "${as_me:-configure}:13372: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
13373
13374          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
13375                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
13376
13377 echo "${as_me:-configure}:13377: testing but keeping change to \$CPPFLAGS ..." 1>&5
13378
13379          fi
13380          CFLAGS="$cf_check_flags"
13381 fi
13382 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13383 fi
13384
13385         echo "$as_me:13385: checking for XOpenDisplay" >&5
13386 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
13387 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
13388   echo $ECHO_N "(cached) $ECHO_C" >&6
13389 else
13390   cat >conftest.$ac_ext <<_ACEOF
13391 #line 13391 "configure"
13392 #include "confdefs.h"
13393 /* System header to define __stub macros and hopefully few prototypes,
13394     which can conflict with char XOpenDisplay (); below.  */
13395 #include <assert.h>
13396 /* Override any gcc2 internal prototype to avoid an error.  */
13397 #ifdef __cplusplus
13398 extern "C"
13399 #endif
13400 /* We use char because int might match the return type of a gcc2
13401    builtin and then its argument prototype would still apply.  */
13402 char XOpenDisplay ();
13403 char (*f) ();
13404
13405 int
13406 main (void)
13407 {
13408 /* The GNU C library defines this for functions which it implements
13409     to always fail with ENOSYS.  Some functions are actually named
13410     something starting with __ and the normal name is an alias.  */
13411 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
13412 choke me
13413 #else
13414 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13415 #endif
13416
13417   ;
13418   return 0;
13419 }
13420 _ACEOF
13421 rm -f conftest.$ac_objext conftest$ac_exeext
13422 if { (eval echo "$as_me:13422: \"$ac_link\"") >&5
13423   (eval $ac_link) 2>&5
13424   ac_status=$?
13425   echo "$as_me:13425: \$? = $ac_status" >&5
13426   (exit $ac_status); } &&
13427          { ac_try='test -s conftest$ac_exeext'
13428   { (eval echo "$as_me:13428: \"$ac_try\"") >&5
13429   (eval $ac_try) 2>&5
13430   ac_status=$?
13431   echo "$as_me:13431: \$? = $ac_status" >&5
13432   (exit $ac_status); }; }; then
13433   ac_cv_func_XOpenDisplay=yes
13434 else
13435   echo "$as_me: failed program was:" >&5
13436 cat conftest.$ac_ext >&5
13437 ac_cv_func_XOpenDisplay=no
13438 fi
13439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13440 fi
13441 echo "$as_me:13441: result: $ac_cv_func_XOpenDisplay" >&5
13442 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
13443 if test $ac_cv_func_XOpenDisplay = yes; then
13444   :
13445 else
13446
13447         echo "$as_me:13447: checking for XOpenDisplay in -lX11" >&5
13448 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
13449 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
13450   echo $ECHO_N "(cached) $ECHO_C" >&6
13451 else
13452   ac_check_lib_save_LIBS=$LIBS
13453 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13454 cat >conftest.$ac_ext <<_ACEOF
13455 #line 13455 "configure"
13456 #include "confdefs.h"
13457
13458 /* Override any gcc2 internal prototype to avoid an error.  */
13459 #ifdef __cplusplus
13460 extern "C"
13461 #endif
13462 /* We use char because int might match the return type of a gcc2
13463    builtin and then its argument prototype would still apply.  */
13464 char XOpenDisplay ();
13465 int
13466 main (void)
13467 {
13468 XOpenDisplay ();
13469   ;
13470   return 0;
13471 }
13472 _ACEOF
13473 rm -f conftest.$ac_objext conftest$ac_exeext
13474 if { (eval echo "$as_me:13474: \"$ac_link\"") >&5
13475   (eval $ac_link) 2>&5
13476   ac_status=$?
13477   echo "$as_me:13477: \$? = $ac_status" >&5
13478   (exit $ac_status); } &&
13479          { ac_try='test -s conftest$ac_exeext'
13480   { (eval echo "$as_me:13480: \"$ac_try\"") >&5
13481   (eval $ac_try) 2>&5
13482   ac_status=$?
13483   echo "$as_me:13483: \$? = $ac_status" >&5
13484   (exit $ac_status); }; }; then
13485   ac_cv_lib_X11_XOpenDisplay=yes
13486 else
13487   echo "$as_me: failed program was:" >&5
13488 cat conftest.$ac_ext >&5
13489 ac_cv_lib_X11_XOpenDisplay=no
13490 fi
13491 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13492 LIBS=$ac_check_lib_save_LIBS
13493 fi
13494 echo "$as_me:13494: result: $ac_cv_lib_X11_XOpenDisplay" >&5
13495 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
13496 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13497
13498 cf_add_libs="-lX11"
13499 # Filter out duplicates - this happens with badly-designed ".pc" files...
13500 for cf_add_1lib in $LIBS
13501 do
13502         for cf_add_2lib in $cf_add_libs
13503         do
13504                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13505                 then
13506                         cf_add_1lib=
13507                         break
13508                 fi
13509         done
13510         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13511 done
13512 LIBS="$cf_add_libs"
13513
13514 fi
13515
13516 fi
13517
13518         echo "$as_me:13518: checking for XtAppInitialize" >&5
13519 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
13520 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
13521   echo $ECHO_N "(cached) $ECHO_C" >&6
13522 else
13523   cat >conftest.$ac_ext <<_ACEOF
13524 #line 13524 "configure"
13525 #include "confdefs.h"
13526 /* System header to define __stub macros and hopefully few prototypes,
13527     which can conflict with char XtAppInitialize (); below.  */
13528 #include <assert.h>
13529 /* Override any gcc2 internal prototype to avoid an error.  */
13530 #ifdef __cplusplus
13531 extern "C"
13532 #endif
13533 /* We use char because int might match the return type of a gcc2
13534    builtin and then its argument prototype would still apply.  */
13535 char XtAppInitialize ();
13536 char (*f) ();
13537
13538 int
13539 main (void)
13540 {
13541 /* The GNU C library defines this for functions which it implements
13542     to always fail with ENOSYS.  Some functions are actually named
13543     something starting with __ and the normal name is an alias.  */
13544 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
13545 choke me
13546 #else
13547 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13548 #endif
13549
13550   ;
13551   return 0;
13552 }
13553 _ACEOF
13554 rm -f conftest.$ac_objext conftest$ac_exeext
13555 if { (eval echo "$as_me:13555: \"$ac_link\"") >&5
13556   (eval $ac_link) 2>&5
13557   ac_status=$?
13558   echo "$as_me:13558: \$? = $ac_status" >&5
13559   (exit $ac_status); } &&
13560          { ac_try='test -s conftest$ac_exeext'
13561   { (eval echo "$as_me:13561: \"$ac_try\"") >&5
13562   (eval $ac_try) 2>&5
13563   ac_status=$?
13564   echo "$as_me:13564: \$? = $ac_status" >&5
13565   (exit $ac_status); }; }; then
13566   ac_cv_func_XtAppInitialize=yes
13567 else
13568   echo "$as_me: failed program was:" >&5
13569 cat conftest.$ac_ext >&5
13570 ac_cv_func_XtAppInitialize=no
13571 fi
13572 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13573 fi
13574 echo "$as_me:13574: result: $ac_cv_func_XtAppInitialize" >&5
13575 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
13576 if test $ac_cv_func_XtAppInitialize = yes; then
13577   :
13578 else
13579
13580         echo "$as_me:13580: checking for XtAppInitialize in -lXt" >&5
13581 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
13582 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
13583   echo $ECHO_N "(cached) $ECHO_C" >&6
13584 else
13585   ac_check_lib_save_LIBS=$LIBS
13586 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
13587 cat >conftest.$ac_ext <<_ACEOF
13588 #line 13588 "configure"
13589 #include "confdefs.h"
13590
13591 /* Override any gcc2 internal prototype to avoid an error.  */
13592 #ifdef __cplusplus
13593 extern "C"
13594 #endif
13595 /* We use char because int might match the return type of a gcc2
13596    builtin and then its argument prototype would still apply.  */
13597 char XtAppInitialize ();
13598 int
13599 main (void)
13600 {
13601 XtAppInitialize ();
13602   ;
13603   return 0;
13604 }
13605 _ACEOF
13606 rm -f conftest.$ac_objext conftest$ac_exeext
13607 if { (eval echo "$as_me:13607: \"$ac_link\"") >&5
13608   (eval $ac_link) 2>&5
13609   ac_status=$?
13610   echo "$as_me:13610: \$? = $ac_status" >&5
13611   (exit $ac_status); } &&
13612          { ac_try='test -s conftest$ac_exeext'
13613   { (eval echo "$as_me:13613: \"$ac_try\"") >&5
13614   (eval $ac_try) 2>&5
13615   ac_status=$?
13616   echo "$as_me:13616: \$? = $ac_status" >&5
13617   (exit $ac_status); }; }; then
13618   ac_cv_lib_Xt_XtAppInitialize=yes
13619 else
13620   echo "$as_me: failed program was:" >&5
13621 cat conftest.$ac_ext >&5
13622 ac_cv_lib_Xt_XtAppInitialize=no
13623 fi
13624 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13625 LIBS=$ac_check_lib_save_LIBS
13626 fi
13627 echo "$as_me:13627: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
13628 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
13629 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
13630
13631 cat >>confdefs.h <<\EOF
13632 #define HAVE_LIBXT 1
13633 EOF
13634
13635                  cf_have_X_LIBS=Xt
13636                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
13637 fi
13638
13639 fi
13640
13641 fi
13642
13643 if test $cf_have_X_LIBS = no ; then
13644         { echo "$as_me:13644: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13645 test program.  You will have to check and add the proper libraries by hand
13646 to makefile." >&5
13647 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
13648 test program.  You will have to check and add the proper libraries by hand
13649 to makefile." >&2;}
13650 fi
13651
13652 cf_x_athena_root=$cf_x_athena
13653 cf_x_athena_inc=""
13654
13655 for cf_path in default \
13656         /usr/contrib/X11R6 \
13657         /usr/contrib/X11R5 \
13658         /usr/lib/X11R5 \
13659         /usr/local
13660 do
13661         if test -z "$cf_x_athena_inc" ; then
13662                 cf_save="$CPPFLAGS"
13663                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
13664                 if test $cf_path != default ; then
13665                         CPPFLAGS="$cf_save -I$cf_path/include"
13666                         echo "$as_me:13666: checking for $cf_test in $cf_path" >&5
13667 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
13668                 else
13669                         echo "$as_me:13669: checking for $cf_test" >&5
13670 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
13671                 fi
13672                 cat >conftest.$ac_ext <<_ACEOF
13673 #line 13673 "configure"
13674 #include "confdefs.h"
13675
13676 #include <X11/Intrinsic.h>
13677 #include <$cf_test>
13678 int
13679 main (void)
13680 {
13681
13682   ;
13683   return 0;
13684 }
13685 _ACEOF
13686 rm -f conftest.$ac_objext
13687 if { (eval echo "$as_me:13687: \"$ac_compile\"") >&5
13688   (eval $ac_compile) 2>&5
13689   ac_status=$?
13690   echo "$as_me:13690: \$? = $ac_status" >&5
13691   (exit $ac_status); } &&
13692          { ac_try='test -s conftest.$ac_objext'
13693   { (eval echo "$as_me:13693: \"$ac_try\"") >&5
13694   (eval $ac_try) 2>&5
13695   ac_status=$?
13696   echo "$as_me:13696: \$? = $ac_status" >&5
13697   (exit $ac_status); }; }; then
13698   cf_result=yes
13699 else
13700   echo "$as_me: failed program was:" >&5
13701 cat conftest.$ac_ext >&5
13702 cf_result=no
13703 fi
13704 rm -f conftest.$ac_objext conftest.$ac_ext
13705                 echo "$as_me:13705: result: $cf_result" >&5
13706 echo "${ECHO_T}$cf_result" >&6
13707                 if test "$cf_result" = yes ; then
13708                         cf_x_athena_inc=$cf_path
13709                         break
13710                 else
13711                         CPPFLAGS="$cf_save"
13712                 fi
13713         fi
13714 done
13715
13716 if test -z "$cf_x_athena_inc" ; then
13717         { echo "$as_me:13717: WARNING: Unable to successfully find Athena header files with test program" >&5
13718 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
13719 elif test "$cf_x_athena_inc" != default ; then
13720         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
13721 fi
13722
13723 cf_x_athena_root=$cf_x_athena
13724 cf_x_athena_lib=""
13725
13726 for cf_path in default \
13727         /usr/contrib/X11R6 \
13728         /usr/contrib/X11R5 \
13729         /usr/lib/X11R5 \
13730         /usr/local
13731 do
13732         for cf_lib in \
13733                 ${cf_x_athena_root} \
13734                 ${cf_x_athena_root}7 \
13735                 ${cf_x_athena_root}6
13736         do
13737         for cf_libs in \
13738                 "-l$cf_lib -lXmu" \
13739                 "-l$cf_lib -lXpm -lXmu" \
13740                 "-l${cf_lib}_s -lXmu_s"
13741         do
13742                 if test -z "$cf_x_athena_lib" ; then
13743                         cf_save="$LIBS"
13744                         cf_test=XawSimpleMenuAddGlobalActions
13745                         if test $cf_path != default ; then
13746
13747 cf_add_libs="-L$cf_path/lib $cf_libs"
13748 # Filter out duplicates - this happens with badly-designed ".pc" files...
13749 for cf_add_1lib in $LIBS
13750 do
13751         for cf_add_2lib in $cf_add_libs
13752         do
13753                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13754                 then
13755                         cf_add_1lib=
13756                         break
13757                 fi
13758         done
13759         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13760 done
13761 LIBS="$cf_add_libs"
13762
13763                                 echo "$as_me:13763: checking for $cf_libs in $cf_path" >&5
13764 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
13765                         else
13766
13767 cf_add_libs="$cf_libs"
13768 # Filter out duplicates - this happens with badly-designed ".pc" files...
13769 for cf_add_1lib in $LIBS
13770 do
13771         for cf_add_2lib in $cf_add_libs
13772         do
13773                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13774                 then
13775                         cf_add_1lib=
13776                         break
13777                 fi
13778         done
13779         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13780 done
13781 LIBS="$cf_add_libs"
13782
13783                                 echo "$as_me:13783: checking for $cf_test in $cf_libs" >&5
13784 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
13785                         fi
13786                         cat >conftest.$ac_ext <<_ACEOF
13787 #line 13787 "configure"
13788 #include "confdefs.h"
13789
13790 #include <X11/Intrinsic.h>
13791 #include <X11/$cf_x_athena_root/SimpleMenu.h>
13792
13793 int
13794 main (void)
13795 {
13796
13797 $cf_test((XtAppContext) 0)
13798   ;
13799   return 0;
13800 }
13801 _ACEOF
13802 rm -f conftest.$ac_objext conftest$ac_exeext
13803 if { (eval echo "$as_me:13803: \"$ac_link\"") >&5
13804   (eval $ac_link) 2>&5
13805   ac_status=$?
13806   echo "$as_me:13806: \$? = $ac_status" >&5
13807   (exit $ac_status); } &&
13808          { ac_try='test -s conftest$ac_exeext'
13809   { (eval echo "$as_me:13809: \"$ac_try\"") >&5
13810   (eval $ac_try) 2>&5
13811   ac_status=$?
13812   echo "$as_me:13812: \$? = $ac_status" >&5
13813   (exit $ac_status); }; }; then
13814   cf_result=yes
13815 else
13816   echo "$as_me: failed program was:" >&5
13817 cat conftest.$ac_ext >&5
13818 cf_result=no
13819 fi
13820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13821                         echo "$as_me:13821: result: $cf_result" >&5
13822 echo "${ECHO_T}$cf_result" >&6
13823                         if test "$cf_result" = yes ; then
13824                                 cf_x_athena_lib="$cf_libs"
13825                                 break
13826                         fi
13827                         LIBS="$cf_save"
13828                 fi
13829         done # cf_libs
13830                 test -n "$cf_x_athena_lib" && break
13831         done # cf_lib
13832 done
13833
13834 if test -z "$cf_x_athena_lib" ; then
13835         { { echo "$as_me:13835: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
13836 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
13837    { (exit 1); exit 1; }; }
13838 fi
13839
13840 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
13841
13842 cat >>confdefs.h <<EOF
13843 #define $cf_x_athena_LIBS 1
13844 EOF
13845
13846 fi
13847
13848 if test -n "$ac_tool_prefix"; then
13849   for ac_prog in xcurses-config
13850   do
13851     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
13852 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
13853 echo "$as_me:13853: checking for $ac_word" >&5
13854 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13855 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
13856   echo $ECHO_N "(cached) $ECHO_C" >&6
13857 else
13858   if test -n "$XCURSES_CONFIG"; then
13859   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
13860 else
13861   ac_save_IFS=$IFS; IFS=$ac_path_separator
13862 ac_dummy="$PATH"
13863 for ac_dir in $ac_dummy; do
13864   IFS=$ac_save_IFS
13865   test -z "$ac_dir" && ac_dir=.
13866   $as_executable_p "$ac_dir/$ac_word" || continue
13867 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
13868 echo "$as_me:13868: found $ac_dir/$ac_word" >&5
13869 break
13870 done
13871
13872 fi
13873 fi
13874 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
13875 if test -n "$XCURSES_CONFIG"; then
13876   echo "$as_me:13876: result: $XCURSES_CONFIG" >&5
13877 echo "${ECHO_T}$XCURSES_CONFIG" >&6
13878 else
13879   echo "$as_me:13879: result: no" >&5
13880 echo "${ECHO_T}no" >&6
13881 fi
13882
13883     test -n "$XCURSES_CONFIG" && break
13884   done
13885 fi
13886 if test -z "$XCURSES_CONFIG"; then
13887   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
13888   for ac_prog in xcurses-config
13889 do
13890   # Extract the first word of "$ac_prog", so it can be a program name with args.
13891 set dummy $ac_prog; ac_word=$2
13892 echo "$as_me:13892: checking for $ac_word" >&5
13893 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
13894 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
13895   echo $ECHO_N "(cached) $ECHO_C" >&6
13896 else
13897   if test -n "$ac_ct_XCURSES_CONFIG"; then
13898   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
13899 else
13900   ac_save_IFS=$IFS; IFS=$ac_path_separator
13901 ac_dummy="$PATH"
13902 for ac_dir in $ac_dummy; do
13903   IFS=$ac_save_IFS
13904   test -z "$ac_dir" && ac_dir=.
13905   $as_executable_p "$ac_dir/$ac_word" || continue
13906 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
13907 echo "$as_me:13907: found $ac_dir/$ac_word" >&5
13908 break
13909 done
13910
13911 fi
13912 fi
13913 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
13914 if test -n "$ac_ct_XCURSES_CONFIG"; then
13915   echo "$as_me:13915: result: $ac_ct_XCURSES_CONFIG" >&5
13916 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
13917 else
13918   echo "$as_me:13918: result: no" >&5
13919 echo "${ECHO_T}no" >&6
13920 fi
13921
13922   test -n "$ac_ct_XCURSES_CONFIG" && break
13923 done
13924 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
13925
13926   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
13927 fi
13928
13929 if test "$XCURSES_CONFIG" != none ; then
13930
13931 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
13932
13933 cf_add_libs="`$XCURSES_CONFIG --libs`"
13934 # Filter out duplicates - this happens with badly-designed ".pc" files...
13935 for cf_add_1lib in $LIBS
13936 do
13937         for cf_add_2lib in $cf_add_libs
13938         do
13939                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13940                 then
13941                         cf_add_1lib=
13942                         break
13943                 fi
13944         done
13945         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13946 done
13947 LIBS="$cf_add_libs"
13948
13949 cf_cv_lib_XCurses=yes
13950
13951 else
13952
13953 LDFLAGS="$LDFLAGS $X_LIBS"
13954
13955 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13956
13957 echo "${as_me:-configure}:13957: testing checking additions to CFLAGS ..." 1>&5
13958
13959 cf_check_cflags="$CFLAGS"
13960 cf_check_cppflags="$CPPFLAGS"
13961
13962 cf_fix_cppflags=no
13963 cf_new_cflags=
13964 cf_new_cppflags=
13965 cf_new_extra_cppflags=
13966
13967 for cf_add_cflags in $X_CFLAGS
13968 do
13969 case $cf_fix_cppflags in
13970 (no)
13971         case $cf_add_cflags in
13972         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13973                 case $cf_add_cflags in
13974                 (-D*)
13975                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13976
13977                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13978                                 && test -z "${cf_tst_cflags}" \
13979                                 && cf_fix_cppflags=yes
13980
13981                         if test $cf_fix_cppflags = yes ; then
13982
13983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13985
13986                                 continue
13987                         elif test "${cf_tst_cflags}" = "\"'" ; then
13988
13989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13991
13992                                 continue
13993                         fi
13994                         ;;
13995                 esac
13996                 case "$CPPFLAGS" in
13997                 (*$cf_add_cflags)
13998                         ;;
13999                 (*)
14000                         case $cf_add_cflags in
14001                         (-D*)
14002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14003
14004 CPPFLAGS=`echo "$CPPFLAGS" | \
14005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14007
14008                                 ;;
14009                         esac
14010
14011         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14012         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14013
14014                         ;;
14015                 esac
14016                 ;;
14017         (*)
14018
14019         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14020         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14021
14022                 ;;
14023         esac
14024         ;;
14025 (yes)
14026
14027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14029
14030         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14031
14032         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14033                 && test -z "${cf_tst_cflags}" \
14034                 && cf_fix_cppflags=no
14035         ;;
14036 esac
14037 done
14038
14039 if test -n "$cf_new_cflags" ; then
14040         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14041
14042 echo "${as_me:-configure}:14042: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14043
14044         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14045         CFLAGS="${CFLAGS}$cf_new_cflags"
14046
14047 fi
14048
14049 if test -n "$cf_new_cppflags" ; then
14050         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14051
14052 echo "${as_me:-configure}:14052: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14053
14054         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14055         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14056
14057 fi
14058
14059 if test -n "$cf_new_extra_cppflags" ; then
14060         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14061
14062 echo "${as_me:-configure}:14062: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14063
14064         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14065         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14066
14067 fi
14068
14069 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14070 cat >conftest.$ac_ext <<_ACEOF
14071 #line 14071 "configure"
14072 #include "confdefs.h"
14073 #include <stdio.h>
14074 int
14075 main (void)
14076 {
14077 printf("Hello world");
14078   ;
14079   return 0;
14080 }
14081 _ACEOF
14082 rm -f conftest.$ac_objext conftest$ac_exeext
14083 if { (eval echo "$as_me:14083: \"$ac_link\"") >&5
14084   (eval $ac_link) 2>&5
14085   ac_status=$?
14086   echo "$as_me:14086: \$? = $ac_status" >&5
14087   (exit $ac_status); } &&
14088          { ac_try='test -s conftest$ac_exeext'
14089   { (eval echo "$as_me:14089: \"$ac_try\"") >&5
14090   (eval $ac_try) 2>&5
14091   ac_status=$?
14092   echo "$as_me:14092: \$? = $ac_status" >&5
14093   (exit $ac_status); }; }; then
14094   :
14095 else
14096   echo "$as_me: failed program was:" >&5
14097 cat conftest.$ac_ext >&5
14098 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14099
14100 echo "${as_me:-configure}:14100: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14101
14102          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14103                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14104
14105 echo "${as_me:-configure}:14105: testing but keeping change to \$CPPFLAGS ..." 1>&5
14106
14107          fi
14108          CFLAGS="$cf_check_flags"
14109 fi
14110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14111 fi
14112
14113 echo "$as_me:14113: checking for XOpenDisplay in -lX11" >&5
14114 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14115 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14116   echo $ECHO_N "(cached) $ECHO_C" >&6
14117 else
14118   ac_check_lib_save_LIBS=$LIBS
14119 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14120 cat >conftest.$ac_ext <<_ACEOF
14121 #line 14121 "configure"
14122 #include "confdefs.h"
14123
14124 /* Override any gcc2 internal prototype to avoid an error.  */
14125 #ifdef __cplusplus
14126 extern "C"
14127 #endif
14128 /* We use char because int might match the return type of a gcc2
14129    builtin and then its argument prototype would still apply.  */
14130 char XOpenDisplay ();
14131 int
14132 main (void)
14133 {
14134 XOpenDisplay ();
14135   ;
14136   return 0;
14137 }
14138 _ACEOF
14139 rm -f conftest.$ac_objext conftest$ac_exeext
14140 if { (eval echo "$as_me:14140: \"$ac_link\"") >&5
14141   (eval $ac_link) 2>&5
14142   ac_status=$?
14143   echo "$as_me:14143: \$? = $ac_status" >&5
14144   (exit $ac_status); } &&
14145          { ac_try='test -s conftest$ac_exeext'
14146   { (eval echo "$as_me:14146: \"$ac_try\"") >&5
14147   (eval $ac_try) 2>&5
14148   ac_status=$?
14149   echo "$as_me:14149: \$? = $ac_status" >&5
14150   (exit $ac_status); }; }; then
14151   ac_cv_lib_X11_XOpenDisplay=yes
14152 else
14153   echo "$as_me: failed program was:" >&5
14154 cat conftest.$ac_ext >&5
14155 ac_cv_lib_X11_XOpenDisplay=no
14156 fi
14157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14158 LIBS=$ac_check_lib_save_LIBS
14159 fi
14160 echo "$as_me:14160: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14161 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14162 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14163
14164 cf_add_libs="-lX11"
14165 # Filter out duplicates - this happens with badly-designed ".pc" files...
14166 for cf_add_1lib in $LIBS
14167 do
14168         for cf_add_2lib in $cf_add_libs
14169         do
14170                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14171                 then
14172                         cf_add_1lib=
14173                         break
14174                 fi
14175         done
14176         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14177 done
14178 LIBS="$cf_add_libs"
14179
14180 fi
14181
14182 echo "$as_me:14182: checking for XCurses library" >&5
14183 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
14184 if test "${cf_cv_lib_XCurses+set}" = set; then
14185   echo $ECHO_N "(cached) $ECHO_C" >&6
14186 else
14187
14188 cf_add_libs="-lXCurses"
14189 # Filter out duplicates - this happens with badly-designed ".pc" files...
14190 for cf_add_1lib in $LIBS
14191 do
14192         for cf_add_2lib in $cf_add_libs
14193         do
14194                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14195                 then
14196                         cf_add_1lib=
14197                         break
14198                 fi
14199         done
14200         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14201 done
14202 LIBS="$cf_add_libs"
14203
14204 cat >conftest.$ac_ext <<_ACEOF
14205 #line 14205 "configure"
14206 #include "confdefs.h"
14207
14208 #include <xcurses.h>
14209 char *XCursesProgramName = "test";
14210
14211 int
14212 main (void)
14213 {
14214 XCursesExit();
14215   ;
14216   return 0;
14217 }
14218 _ACEOF
14219 rm -f conftest.$ac_objext conftest$ac_exeext
14220 if { (eval echo "$as_me:14220: \"$ac_link\"") >&5
14221   (eval $ac_link) 2>&5
14222   ac_status=$?
14223   echo "$as_me:14223: \$? = $ac_status" >&5
14224   (exit $ac_status); } &&
14225          { ac_try='test -s conftest$ac_exeext'
14226   { (eval echo "$as_me:14226: \"$ac_try\"") >&5
14227   (eval $ac_try) 2>&5
14228   ac_status=$?
14229   echo "$as_me:14229: \$? = $ac_status" >&5
14230   (exit $ac_status); }; }; then
14231   cf_cv_lib_XCurses=yes
14232 else
14233   echo "$as_me: failed program was:" >&5
14234 cat conftest.$ac_ext >&5
14235 cf_cv_lib_XCurses=no
14236 fi
14237 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14238
14239 fi
14240 echo "$as_me:14240: result: $cf_cv_lib_XCurses" >&5
14241 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14242
14243 fi
14244
14245 if test $cf_cv_lib_XCurses = yes ; then
14246
14247 cat >>confdefs.h <<\EOF
14248 #define UNIX 1
14249 EOF
14250
14251 cat >>confdefs.h <<\EOF
14252 #define XCURSES 1
14253 EOF
14254
14255         echo "$as_me:14255: checking for xcurses.h" >&5
14256 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14257 if test "${ac_cv_header_xcurses_h+set}" = set; then
14258   echo $ECHO_N "(cached) $ECHO_C" >&6
14259 else
14260   cat >conftest.$ac_ext <<_ACEOF
14261 #line 14261 "configure"
14262 #include "confdefs.h"
14263 #include <xcurses.h>
14264 _ACEOF
14265 if { (eval echo "$as_me:14265: \"$ac_cpp conftest.$ac_ext\"") >&5
14266   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
14267   ac_status=$?
14268   egrep -v '^ *\+' conftest.er1 >conftest.err
14269   rm -f conftest.er1
14270   cat conftest.err >&5
14271   echo "$as_me:14271: \$? = $ac_status" >&5
14272   (exit $ac_status); } >/dev/null; then
14273   if test -s conftest.err; then
14274     ac_cpp_err=$ac_c_preproc_warn_flag
14275   else
14276     ac_cpp_err=
14277   fi
14278 else
14279   ac_cpp_err=yes
14280 fi
14281 if test -z "$ac_cpp_err"; then
14282   ac_cv_header_xcurses_h=yes
14283 else
14284   echo "$as_me: failed program was:" >&5
14285   cat conftest.$ac_ext >&5
14286   ac_cv_header_xcurses_h=no
14287 fi
14288 rm -f conftest.err conftest.$ac_ext
14289 fi
14290 echo "$as_me:14290: result: $ac_cv_header_xcurses_h" >&5
14291 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
14292 if test $ac_cv_header_xcurses_h = yes; then
14293
14294 cat >>confdefs.h <<\EOF
14295 #define HAVE_XCURSES 1
14296 EOF
14297
14298 fi
14299
14300 else
14301         { { echo "$as_me:14301: error: Cannot link with XCurses" >&5
14302 echo "$as_me: error: Cannot link with XCurses" >&2;}
14303    { (exit 1); exit 1; }; }
14304 fi
14305
14306         ;;
14307 (*)
14308         { { echo "$as_me:14308: error: unexpected screen-value: $cf_cv_screen" >&5
14309 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
14310    { (exit 1); exit 1; }; }
14311         ;;
14312 esac
14313
14314 : ${cf_nculib_root:=$cf_cv_screen}
14315 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
14316 echo "$as_me:14316: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
14317 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
14318 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14319   echo $ECHO_N "(cached) $ECHO_C" >&6
14320 else
14321   ac_check_lib_save_LIBS=$LIBS
14322 LIBS="-l$cf_nculib_root  $LIBS"
14323 cat >conftest.$ac_ext <<_ACEOF
14324 #line 14324 "configure"
14325 #include "confdefs.h"
14326
14327 /* Override any gcc2 internal prototype to avoid an error.  */
14328 #ifdef __cplusplus
14329 extern "C"
14330 #endif
14331 /* We use char because int might match the return type of a gcc2
14332    builtin and then its argument prototype would still apply.  */
14333 char _nc_init_pthreads ();
14334 int
14335 main (void)
14336 {
14337 _nc_init_pthreads ();
14338   ;
14339   return 0;
14340 }
14341 _ACEOF
14342 rm -f conftest.$ac_objext conftest$ac_exeext
14343 if { (eval echo "$as_me:14343: \"$ac_link\"") >&5
14344   (eval $ac_link) 2>&5
14345   ac_status=$?
14346   echo "$as_me:14346: \$? = $ac_status" >&5
14347   (exit $ac_status); } &&
14348          { ac_try='test -s conftest$ac_exeext'
14349   { (eval echo "$as_me:14349: \"$ac_try\"") >&5
14350   (eval $ac_try) 2>&5
14351   ac_status=$?
14352   echo "$as_me:14352: \$? = $ac_status" >&5
14353   (exit $ac_status); }; }; then
14354   eval "$as_ac_Lib=yes"
14355 else
14356   echo "$as_me: failed program was:" >&5
14357 cat conftest.$ac_ext >&5
14358 eval "$as_ac_Lib=no"
14359 fi
14360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14361 LIBS=$ac_check_lib_save_LIBS
14362 fi
14363 echo "$as_me:14363: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14364 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14365 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14366   cf_cv_ncurses_pthreads=yes
14367 else
14368   cf_cv_ncurses_pthreads=no
14369 fi
14370
14371 if test "$cf_cv_ncurses_pthreads" = yes
14372 then
14373
14374 cf_add_libs="-lpthread"
14375 # Filter out duplicates - this happens with badly-designed ".pc" files...
14376 for cf_add_1lib in $LIBS
14377 do
14378         for cf_add_2lib in $cf_add_libs
14379         do
14380                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14381                 then
14382                         cf_add_1lib=
14383                         break
14384                 fi
14385         done
14386         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14387 done
14388 LIBS="$cf_add_libs"
14389
14390 fi
14391
14392 case $cf_cv_screen in
14393 (ncurses*)
14394         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
14395         ;;
14396 esac
14397
14398 echo "$as_me:14398: checking for X11 rgb file" >&5
14399 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
14400
14401 # Check whether --with-x11-rgb or --without-x11-rgb was given.
14402 if test "${with_x11_rgb+set}" = set; then
14403   withval="$with_x11_rgb"
14404   RGB_PATH=$withval
14405 else
14406   RGB_PATH=auto
14407 fi;
14408
14409 if test "x$RGB_PATH" = xauto
14410 then
14411         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
14412         for cf_path in \
14413                 /opt/local/share/X11/rgb.txt \
14414                 /opt/X11/share/X11/rgb.txt \
14415                 /usr/share/X11/rgb.txt \
14416                 /usr/X11/share/X11/rgb.txt \
14417                 /usr/X11/lib/X11/rgb.txt \
14418                 /usr/lib/X11/rgb.txt \
14419                 /etc/X11/rgb.txt \
14420                 /usr/pkg/lib/X11/rgb.txt \
14421                 /usr/X11R7/lib/X11/rgb.txt \
14422                 /usr/X11R6/lib/X11/rgb.txt \
14423                 /usr/X11R5/lib/X11/rgb.txt \
14424                 /usr/X11R4/lib/X11/rgb.txt \
14425                 /usr/local/lib/X11/rgb.txt \
14426                 /usr/local/share/X11/rgb.txt \
14427                 /usr/lib64/X11/rgb.txt
14428         do
14429                 if test -f "$cf_path" ; then
14430                         RGB_PATH="$cf_path"
14431                         break
14432                 fi
14433         done
14434 else
14435         cf_path=$RGB_PATH
14436
14437 if test "x$prefix" != xNONE; then
14438         cf_path_syntax="$prefix"
14439 else
14440         cf_path_syntax="$ac_default_prefix"
14441 fi
14442
14443 case ".$cf_path" in
14444 (.\$\(*\)*|.\'*\'*)
14445         ;;
14446 (..|./*|.\\*)
14447         ;;
14448 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
14449         ;;
14450 (.\${*prefix}*|.\${*dir}*)
14451         eval cf_path="$cf_path"
14452         case ".$cf_path" in
14453         (.NONE/*)
14454                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14455                 ;;
14456         esac
14457         ;;
14458 (.no|.NONE/*)
14459         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
14460         ;;
14461 (*)
14462         { { echo "$as_me:14462: error: expected a pathname, not \"$cf_path\"" >&5
14463 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
14464    { (exit 1); exit 1; }; }
14465         ;;
14466 esac
14467
14468 fi
14469
14470 echo "$as_me:14470: result: $RGB_PATH" >&5
14471 echo "${ECHO_T}$RGB_PATH" >&6
14472
14473 cat >>confdefs.h <<EOF
14474 #define RGB_PATH "$cf_path"
14475 EOF
14476
14477 no_x11_rgb=
14478 if test "$RGB_PATH" = no
14479 then
14480         no_x11_rgb="#"
14481 fi
14482
14483 cf_curses_headers=
14484
14485 case $cf_cv_screen in
14486 (pdcurses)
14487         cf_default_panel=no
14488         cf_default_form=no
14489         cf_default_menu=no
14490         cf_default_tinfo=no
14491         ;;
14492 (xcurses|bsdcurses)
14493         cf_default_panel=no
14494         cf_default_form=no
14495         cf_default_menu=no
14496         cf_default_tinfo=yes
14497         ;;
14498 (*)
14499         cf_default_panel=yes
14500         cf_default_form=yes
14501         cf_default_menu=yes
14502         cf_default_tinfo=yes
14503         case $cf_cv_screen in
14504         (ncurses*)
14505                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
14506                 ;;
14507         esac
14508         ;;
14509 esac
14510
14511 echo "$as_me:14511: checking if you want to check for panel functions" >&5
14512 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
14513
14514 # Check whether --enable-panel or --disable-panel was given.
14515 if test "${enable_panel+set}" = set; then
14516   enableval="$enable_panel"
14517   test "$enableval" != no && enableval=yes
14518         if test "$enableval" != "yes" ; then
14519     cf_enable_panel=no
14520         else
14521                 cf_enable_panel=$cf_default_panel
14522         fi
14523 else
14524   enableval=yes
14525         cf_enable_panel=$cf_default_panel
14526
14527 fi;
14528 echo "$as_me:14528: result: $cf_enable_panel" >&5
14529 echo "${ECHO_T}$cf_enable_panel" >&6
14530 if test $cf_enable_panel = yes
14531 then
14532
14533 cf_have_curses_lib=no
14534
14535 : ${NCURSES_CONFIG_PKG:=none}
14536 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14537         :
14538 elif test "x${PKG_CONFIG:=none}" != xnone; then
14539         echo "$as_me:14539: checking pkg-config for panel$cf_cv_libtype" >&5
14540 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
14541         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
14542                 echo "$as_me:14542: result: yes" >&5
14543 echo "${ECHO_T}yes" >&6
14544
14545                 echo "$as_me:14545: checking if the panel$cf_cv_libtype package files work" >&5
14546 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
14547
14548                 cf_save_CPPFLAGS="$CPPFLAGS"
14549                 cf_save_LIBS="$LIBS"
14550
14551 cf_fix_cppflags=no
14552 cf_new_cflags=
14553 cf_new_cppflags=
14554 cf_new_extra_cppflags=
14555
14556 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
14557 do
14558 case $cf_fix_cppflags in
14559 (no)
14560         case $cf_add_cflags in
14561         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14562                 case $cf_add_cflags in
14563                 (-D*)
14564                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14565
14566                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14567                                 && test -z "${cf_tst_cflags}" \
14568                                 && cf_fix_cppflags=yes
14569
14570                         if test $cf_fix_cppflags = yes ; then
14571
14572         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14573         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14574
14575                                 continue
14576                         elif test "${cf_tst_cflags}" = "\"'" ; then
14577
14578         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14579         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14580
14581                                 continue
14582                         fi
14583                         ;;
14584                 esac
14585                 case "$CPPFLAGS" in
14586                 (*$cf_add_cflags)
14587                         ;;
14588                 (*)
14589                         case $cf_add_cflags in
14590                         (-D*)
14591                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14592
14593 CPPFLAGS=`echo "$CPPFLAGS" | \
14594         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14595                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14596
14597                                 ;;
14598                         esac
14599
14600         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14601         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14602
14603                         ;;
14604                 esac
14605                 ;;
14606         (*)
14607
14608         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14609         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14610
14611                 ;;
14612         esac
14613         ;;
14614 (yes)
14615
14616         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14617         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14618
14619         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14620
14621         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14622                 && test -z "${cf_tst_cflags}" \
14623                 && cf_fix_cppflags=no
14624         ;;
14625 esac
14626 done
14627
14628 if test -n "$cf_new_cflags" ; then
14629
14630         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14631         CFLAGS="${CFLAGS}$cf_new_cflags"
14632
14633 fi
14634
14635 if test -n "$cf_new_cppflags" ; then
14636
14637         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14638         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14639
14640 fi
14641
14642 if test -n "$cf_new_extra_cppflags" ; then
14643
14644         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14645         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14646
14647 fi
14648
14649 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
14650 # Filter out duplicates - this happens with badly-designed ".pc" files...
14651 for cf_add_1lib in $LIBS
14652 do
14653         for cf_add_2lib in $cf_add_libs
14654         do
14655                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14656                 then
14657                         cf_add_1lib=
14658                         break
14659                 fi
14660         done
14661         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14662 done
14663 LIBS="$cf_add_libs"
14664
14665                 cat >conftest.$ac_ext <<_ACEOF
14666 #line 14666 "configure"
14667 #include "confdefs.h"
14668 #include <panel.h>
14669 int
14670 main (void)
14671 {
14672 (void) new_panel ( 0 );
14673   ;
14674   return 0;
14675 }
14676 _ACEOF
14677 rm -f conftest.$ac_objext conftest$ac_exeext
14678 if { (eval echo "$as_me:14678: \"$ac_link\"") >&5
14679   (eval $ac_link) 2>&5
14680   ac_status=$?
14681   echo "$as_me:14681: \$? = $ac_status" >&5
14682   (exit $ac_status); } &&
14683          { ac_try='test -s conftest$ac_exeext'
14684   { (eval echo "$as_me:14684: \"$ac_try\"") >&5
14685   (eval $ac_try) 2>&5
14686   ac_status=$?
14687   echo "$as_me:14687: \$? = $ac_status" >&5
14688   (exit $ac_status); }; }; then
14689   if test "$cross_compiling" = yes; then
14690   cf_have_curses_lib=maybe
14691 else
14692   cat >conftest.$ac_ext <<_ACEOF
14693 #line 14693 "configure"
14694 #include "confdefs.h"
14695 #include <panel.h>
14696                                 int main(void)
14697                                 { (void) new_panel ( 0 ); return 0; }
14698 _ACEOF
14699 rm -f conftest$ac_exeext
14700 if { (eval echo "$as_me:14700: \"$ac_link\"") >&5
14701   (eval $ac_link) 2>&5
14702   ac_status=$?
14703   echo "$as_me:14703: \$? = $ac_status" >&5
14704   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14705   { (eval echo "$as_me:14705: \"$ac_try\"") >&5
14706   (eval $ac_try) 2>&5
14707   ac_status=$?
14708   echo "$as_me:14708: \$? = $ac_status" >&5
14709   (exit $ac_status); }; }; then
14710   cf_have_curses_lib=yes
14711 else
14712   echo "$as_me: program exited with status $ac_status" >&5
14713 echo "$as_me: failed program was:" >&5
14714 cat conftest.$ac_ext >&5
14715 cf_have_curses_lib=no
14716 fi
14717 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14718 fi
14719 else
14720   echo "$as_me: failed program was:" >&5
14721 cat conftest.$ac_ext >&5
14722 cf_have_curses_lib=no
14723 fi
14724 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14725                 echo "$as_me:14725: result: $cf_have_curses_lib" >&5
14726 echo "${ECHO_T}$cf_have_curses_lib" >&6
14727                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
14728                 if test "$cf_have_curses_lib" != "yes"
14729                 then
14730                         CPPFLAGS="$cf_save_CPPFLAGS"
14731                         LIBS="$cf_save_LIBS"
14732                 else
14733
14734 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14735
14736                         cat >>confdefs.h <<EOF
14737 #define $cf_upper 1
14738 EOF
14739
14740                 fi
14741         fi
14742 fi
14743 if test "$cf_have_curses_lib" = no; then
14744         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
14745 echo "$as_me:14745: checking for new_panel in -lpanel$cf_cv_libtype" >&5
14746 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
14747 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
14748   echo $ECHO_N "(cached) $ECHO_C" >&6
14749 else
14750   ac_check_lib_save_LIBS=$LIBS
14751 LIBS="-lpanel$cf_cv_libtype  $LIBS"
14752 cat >conftest.$ac_ext <<_ACEOF
14753 #line 14753 "configure"
14754 #include "confdefs.h"
14755
14756 /* Override any gcc2 internal prototype to avoid an error.  */
14757 #ifdef __cplusplus
14758 extern "C"
14759 #endif
14760 /* We use char because int might match the return type of a gcc2
14761    builtin and then its argument prototype would still apply.  */
14762 char new_panel ();
14763 int
14764 main (void)
14765 {
14766 new_panel ();
14767   ;
14768   return 0;
14769 }
14770 _ACEOF
14771 rm -f conftest.$ac_objext conftest$ac_exeext
14772 if { (eval echo "$as_me:14772: \"$ac_link\"") >&5
14773   (eval $ac_link) 2>&5
14774   ac_status=$?
14775   echo "$as_me:14775: \$? = $ac_status" >&5
14776   (exit $ac_status); } &&
14777          { ac_try='test -s conftest$ac_exeext'
14778   { (eval echo "$as_me:14778: \"$ac_try\"") >&5
14779   (eval $ac_try) 2>&5
14780   ac_status=$?
14781   echo "$as_me:14781: \$? = $ac_status" >&5
14782   (exit $ac_status); }; }; then
14783   eval "$as_ac_Lib=yes"
14784 else
14785   echo "$as_me: failed program was:" >&5
14786 cat conftest.$ac_ext >&5
14787 eval "$as_ac_Lib=no"
14788 fi
14789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14790 LIBS=$ac_check_lib_save_LIBS
14791 fi
14792 echo "$as_me:14792: result: `eval echo '${'$as_ac_Lib'}'`" >&5
14793 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
14794 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
14795
14796 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14797
14798 cf_add_libs="-lpanel$cf_cv_libtype"
14799 # Filter out duplicates - this happens with badly-designed ".pc" files...
14800 for cf_add_1lib in $LIBS
14801 do
14802         for cf_add_2lib in $cf_add_libs
14803         do
14804                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14805                 then
14806                         cf_add_1lib=
14807                         break
14808                 fi
14809         done
14810         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14811 done
14812 LIBS="$cf_add_libs"
14813
14814                 cat >>confdefs.h <<EOF
14815 #define $cf_upper 1
14816 EOF
14817
14818 fi
14819
14820 fi
14821
14822         cf_curses_headers="$cf_curses_headers panel.h"
14823 fi
14824
14825 echo "$as_me:14825: checking if you want to check for menu functions" >&5
14826 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
14827
14828 # Check whether --enable-menu or --disable-menu was given.
14829 if test "${enable_menu+set}" = set; then
14830   enableval="$enable_menu"
14831   test "$enableval" != no && enableval=yes
14832         if test "$enableval" != "yes" ; then
14833     cf_enable_menu=no
14834         else
14835                 cf_enable_menu=$cf_default_menu
14836         fi
14837 else
14838   enableval=yes
14839         cf_enable_menu=$cf_default_menu
14840
14841 fi;
14842 echo "$as_me:14842: result: $cf_enable_menu" >&5
14843 echo "${ECHO_T}$cf_enable_menu" >&6
14844 if test $cf_enable_menu = yes
14845 then
14846         case $cf_cv_screen in
14847         (ncurses*)
14848                 ;;
14849         (curses*)
14850
14851 echo "$as_me:14851: checking for NetBSD menu.h" >&5
14852 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
14853 if test "${cf_cv_netbsd_menu_h+set}" = set; then
14854   echo $ECHO_N "(cached) $ECHO_C" >&6
14855 else
14856
14857 cat >conftest.$ac_ext <<_ACEOF
14858 #line 14858 "configure"
14859 #include "confdefs.h"
14860
14861 #include <${cf_cv_ncurses_header:-curses.h}>
14862 #include <menu.h>
14863
14864 int
14865 main (void)
14866 {
14867
14868         MENU *menu;
14869         int y = menu->max_item_width;
14870
14871   ;
14872   return 0;
14873 }
14874 _ACEOF
14875 rm -f conftest.$ac_objext
14876 if { (eval echo "$as_me:14876: \"$ac_compile\"") >&5
14877   (eval $ac_compile) 2>&5
14878   ac_status=$?
14879   echo "$as_me:14879: \$? = $ac_status" >&5
14880   (exit $ac_status); } &&
14881          { ac_try='test -s conftest.$ac_objext'
14882   { (eval echo "$as_me:14882: \"$ac_try\"") >&5
14883   (eval $ac_try) 2>&5
14884   ac_status=$?
14885   echo "$as_me:14885: \$? = $ac_status" >&5
14886   (exit $ac_status); }; }; then
14887   cf_cv_netbsd_menu_h=yes
14888
14889 else
14890   echo "$as_me: failed program was:" >&5
14891 cat conftest.$ac_ext >&5
14892 cf_cv_netbsd_menu_h=no
14893 fi
14894 rm -f conftest.$ac_objext conftest.$ac_ext
14895
14896 fi
14897 echo "$as_me:14897: result: $cf_cv_netbsd_menu_h" >&5
14898 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
14899
14900 test "$cf_cv_netbsd_menu_h" = yes &&
14901 cat >>confdefs.h <<\EOF
14902 #define HAVE_NETBSD_MENU_H 1
14903 EOF
14904
14905                 ;;
14906         esac
14907
14908 cf_have_curses_lib=no
14909
14910 : ${NCURSES_CONFIG_PKG:=none}
14911 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
14912         :
14913 elif test "x${PKG_CONFIG:=none}" != xnone; then
14914         echo "$as_me:14914: checking pkg-config for menu$cf_cv_libtype" >&5
14915 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
14916         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
14917                 echo "$as_me:14917: result: yes" >&5
14918 echo "${ECHO_T}yes" >&6
14919
14920                 echo "$as_me:14920: checking if the menu$cf_cv_libtype package files work" >&5
14921 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
14922
14923                 cf_save_CPPFLAGS="$CPPFLAGS"
14924                 cf_save_LIBS="$LIBS"
14925
14926 cf_fix_cppflags=no
14927 cf_new_cflags=
14928 cf_new_cppflags=
14929 cf_new_extra_cppflags=
14930
14931 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
14932 do
14933 case $cf_fix_cppflags in
14934 (no)
14935         case $cf_add_cflags in
14936         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14937                 case $cf_add_cflags in
14938                 (-D*)
14939                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14940
14941                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14942                                 && test -z "${cf_tst_cflags}" \
14943                                 && cf_fix_cppflags=yes
14944
14945                         if test $cf_fix_cppflags = yes ; then
14946
14947         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14948         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14949
14950                                 continue
14951                         elif test "${cf_tst_cflags}" = "\"'" ; then
14952
14953         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14954         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14955
14956                                 continue
14957                         fi
14958                         ;;
14959                 esac
14960                 case "$CPPFLAGS" in
14961                 (*$cf_add_cflags)
14962                         ;;
14963                 (*)
14964                         case $cf_add_cflags in
14965                         (-D*)
14966                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14967
14968 CPPFLAGS=`echo "$CPPFLAGS" | \
14969         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14970                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14971
14972                                 ;;
14973                         esac
14974
14975         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14976         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14977
14978                         ;;
14979                 esac
14980                 ;;
14981         (*)
14982
14983         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14984         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14985
14986                 ;;
14987         esac
14988         ;;
14989 (yes)
14990
14991         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14992         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14993
14994         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14995
14996         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14997                 && test -z "${cf_tst_cflags}" \
14998                 && cf_fix_cppflags=no
14999         ;;
15000 esac
15001 done
15002
15003 if test -n "$cf_new_cflags" ; then
15004
15005         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15006         CFLAGS="${CFLAGS}$cf_new_cflags"
15007
15008 fi
15009
15010 if test -n "$cf_new_cppflags" ; then
15011
15012         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15013         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15014
15015 fi
15016
15017 if test -n "$cf_new_extra_cppflags" ; then
15018
15019         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15020         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15021
15022 fi
15023
15024 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15025 # Filter out duplicates - this happens with badly-designed ".pc" files...
15026 for cf_add_1lib in $LIBS
15027 do
15028         for cf_add_2lib in $cf_add_libs
15029         do
15030                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15031                 then
15032                         cf_add_1lib=
15033                         break
15034                 fi
15035         done
15036         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15037 done
15038 LIBS="$cf_add_libs"
15039
15040                 cat >conftest.$ac_ext <<_ACEOF
15041 #line 15041 "configure"
15042 #include "confdefs.h"
15043 #include <menu.h>
15044 int
15045 main (void)
15046 {
15047 (void) menu_driver ( 0,0 );
15048   ;
15049   return 0;
15050 }
15051 _ACEOF
15052 rm -f conftest.$ac_objext conftest$ac_exeext
15053 if { (eval echo "$as_me:15053: \"$ac_link\"") >&5
15054   (eval $ac_link) 2>&5
15055   ac_status=$?
15056   echo "$as_me:15056: \$? = $ac_status" >&5
15057   (exit $ac_status); } &&
15058          { ac_try='test -s conftest$ac_exeext'
15059   { (eval echo "$as_me:15059: \"$ac_try\"") >&5
15060   (eval $ac_try) 2>&5
15061   ac_status=$?
15062   echo "$as_me:15062: \$? = $ac_status" >&5
15063   (exit $ac_status); }; }; then
15064   if test "$cross_compiling" = yes; then
15065   cf_have_curses_lib=maybe
15066 else
15067   cat >conftest.$ac_ext <<_ACEOF
15068 #line 15068 "configure"
15069 #include "confdefs.h"
15070 #include <menu.h>
15071                                 int main(void)
15072                                 { (void) menu_driver ( 0,0 ); return 0; }
15073 _ACEOF
15074 rm -f conftest$ac_exeext
15075 if { (eval echo "$as_me:15075: \"$ac_link\"") >&5
15076   (eval $ac_link) 2>&5
15077   ac_status=$?
15078   echo "$as_me:15078: \$? = $ac_status" >&5
15079   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15080   { (eval echo "$as_me:15080: \"$ac_try\"") >&5
15081   (eval $ac_try) 2>&5
15082   ac_status=$?
15083   echo "$as_me:15083: \$? = $ac_status" >&5
15084   (exit $ac_status); }; }; then
15085   cf_have_curses_lib=yes
15086 else
15087   echo "$as_me: program exited with status $ac_status" >&5
15088 echo "$as_me: failed program was:" >&5
15089 cat conftest.$ac_ext >&5
15090 cf_have_curses_lib=no
15091 fi
15092 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15093 fi
15094 else
15095   echo "$as_me: failed program was:" >&5
15096 cat conftest.$ac_ext >&5
15097 cf_have_curses_lib=no
15098 fi
15099 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15100                 echo "$as_me:15100: result: $cf_have_curses_lib" >&5
15101 echo "${ECHO_T}$cf_have_curses_lib" >&6
15102                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15103                 if test "$cf_have_curses_lib" != "yes"
15104                 then
15105                         CPPFLAGS="$cf_save_CPPFLAGS"
15106                         LIBS="$cf_save_LIBS"
15107                 else
15108
15109 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15110
15111                         cat >>confdefs.h <<EOF
15112 #define $cf_upper 1
15113 EOF
15114
15115                 fi
15116         fi
15117 fi
15118 if test "$cf_have_curses_lib" = no; then
15119         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
15120 echo "$as_me:15120: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
15121 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
15122 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15123   echo $ECHO_N "(cached) $ECHO_C" >&6
15124 else
15125   ac_check_lib_save_LIBS=$LIBS
15126 LIBS="-lmenu$cf_cv_libtype  $LIBS"
15127 cat >conftest.$ac_ext <<_ACEOF
15128 #line 15128 "configure"
15129 #include "confdefs.h"
15130
15131 /* Override any gcc2 internal prototype to avoid an error.  */
15132 #ifdef __cplusplus
15133 extern "C"
15134 #endif
15135 /* We use char because int might match the return type of a gcc2
15136    builtin and then its argument prototype would still apply.  */
15137 char menu_driver ();
15138 int
15139 main (void)
15140 {
15141 menu_driver ();
15142   ;
15143   return 0;
15144 }
15145 _ACEOF
15146 rm -f conftest.$ac_objext conftest$ac_exeext
15147 if { (eval echo "$as_me:15147: \"$ac_link\"") >&5
15148   (eval $ac_link) 2>&5
15149   ac_status=$?
15150   echo "$as_me:15150: \$? = $ac_status" >&5
15151   (exit $ac_status); } &&
15152          { ac_try='test -s conftest$ac_exeext'
15153   { (eval echo "$as_me:15153: \"$ac_try\"") >&5
15154   (eval $ac_try) 2>&5
15155   ac_status=$?
15156   echo "$as_me:15156: \$? = $ac_status" >&5
15157   (exit $ac_status); }; }; then
15158   eval "$as_ac_Lib=yes"
15159 else
15160   echo "$as_me: failed program was:" >&5
15161 cat conftest.$ac_ext >&5
15162 eval "$as_ac_Lib=no"
15163 fi
15164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15165 LIBS=$ac_check_lib_save_LIBS
15166 fi
15167 echo "$as_me:15167: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15168 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15169 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15170
15171 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15172
15173 cf_add_libs="-lmenu$cf_cv_libtype"
15174 # Filter out duplicates - this happens with badly-designed ".pc" files...
15175 for cf_add_1lib in $LIBS
15176 do
15177         for cf_add_2lib in $cf_add_libs
15178         do
15179                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15180                 then
15181                         cf_add_1lib=
15182                         break
15183                 fi
15184         done
15185         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15186 done
15187 LIBS="$cf_add_libs"
15188
15189                 cat >>confdefs.h <<EOF
15190 #define $cf_upper 1
15191 EOF
15192
15193 fi
15194
15195 fi
15196
15197         cf_curses_headers="$cf_curses_headers menu.h"
15198 fi
15199
15200 echo "$as_me:15200: checking if you want to check for form functions" >&5
15201 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
15202
15203 # Check whether --enable-form or --disable-form was given.
15204 if test "${enable_form+set}" = set; then
15205   enableval="$enable_form"
15206   test "$enableval" != no && enableval=yes
15207         if test "$enableval" != "yes" ; then
15208     cf_enable_form=no
15209         else
15210                 cf_enable_form=$cf_default_form
15211         fi
15212 else
15213   enableval=yes
15214         cf_enable_form=$cf_default_form
15215
15216 fi;
15217 echo "$as_me:15217: result: $cf_enable_form" >&5
15218 echo "${ECHO_T}$cf_enable_form" >&6
15219 if test $cf_enable_form = yes
15220 then
15221         case $cf_cv_screen in
15222         (ncurses*)
15223                 ;;
15224         (curses*)
15225
15226 echo "$as_me:15226: checking for NetBSD form.h" >&5
15227 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
15228 if test "${cf_cv_netbsd_form_h+set}" = set; then
15229   echo $ECHO_N "(cached) $ECHO_C" >&6
15230 else
15231
15232 cat >conftest.$ac_ext <<_ACEOF
15233 #line 15233 "configure"
15234 #include "confdefs.h"
15235
15236 #include <${cf_cv_ncurses_header:-curses.h}>
15237 #include <form.h>
15238
15239 int
15240 main (void)
15241 {
15242
15243         FORM *form;
15244         int y = current_field(form)->cursor_ypos;
15245         int x = current_field(form)->cursor_xpos;
15246
15247   ;
15248   return 0;
15249 }
15250 _ACEOF
15251 rm -f conftest.$ac_objext
15252 if { (eval echo "$as_me:15252: \"$ac_compile\"") >&5
15253   (eval $ac_compile) 2>&5
15254   ac_status=$?
15255   echo "$as_me:15255: \$? = $ac_status" >&5
15256   (exit $ac_status); } &&
15257          { ac_try='test -s conftest.$ac_objext'
15258   { (eval echo "$as_me:15258: \"$ac_try\"") >&5
15259   (eval $ac_try) 2>&5
15260   ac_status=$?
15261   echo "$as_me:15261: \$? = $ac_status" >&5
15262   (exit $ac_status); }; }; then
15263   cf_cv_netbsd_form_h=yes
15264
15265 else
15266   echo "$as_me: failed program was:" >&5
15267 cat conftest.$ac_ext >&5
15268 cf_cv_netbsd_form_h=no
15269 fi
15270 rm -f conftest.$ac_objext conftest.$ac_ext
15271
15272 fi
15273 echo "$as_me:15273: result: $cf_cv_netbsd_form_h" >&5
15274 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
15275
15276 test "$cf_cv_netbsd_form_h" = yes &&
15277 cat >>confdefs.h <<\EOF
15278 #define HAVE_NETBSD_FORM_H 1
15279 EOF
15280
15281                 ;;
15282         esac
15283
15284 cf_have_curses_lib=no
15285
15286 : ${NCURSES_CONFIG_PKG:=none}
15287 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15288         :
15289 elif test "x${PKG_CONFIG:=none}" != xnone; then
15290         echo "$as_me:15290: checking pkg-config for form$cf_cv_libtype" >&5
15291 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
15292         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
15293                 echo "$as_me:15293: result: yes" >&5
15294 echo "${ECHO_T}yes" >&6
15295
15296                 echo "$as_me:15296: checking if the form$cf_cv_libtype package files work" >&5
15297 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
15298
15299                 cf_save_CPPFLAGS="$CPPFLAGS"
15300                 cf_save_LIBS="$LIBS"
15301
15302 cf_fix_cppflags=no
15303 cf_new_cflags=
15304 cf_new_cppflags=
15305 cf_new_extra_cppflags=
15306
15307 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
15308 do
15309 case $cf_fix_cppflags in
15310 (no)
15311         case $cf_add_cflags in
15312         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15313                 case $cf_add_cflags in
15314                 (-D*)
15315                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15316
15317                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15318                                 && test -z "${cf_tst_cflags}" \
15319                                 && cf_fix_cppflags=yes
15320
15321                         if test $cf_fix_cppflags = yes ; then
15322
15323         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15324         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15325
15326                                 continue
15327                         elif test "${cf_tst_cflags}" = "\"'" ; then
15328
15329         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15330         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15331
15332                                 continue
15333                         fi
15334                         ;;
15335                 esac
15336                 case "$CPPFLAGS" in
15337                 (*$cf_add_cflags)
15338                         ;;
15339                 (*)
15340                         case $cf_add_cflags in
15341                         (-D*)
15342                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15343
15344 CPPFLAGS=`echo "$CPPFLAGS" | \
15345         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15346                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15347
15348                                 ;;
15349                         esac
15350
15351         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15352         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15353
15354                         ;;
15355                 esac
15356                 ;;
15357         (*)
15358
15359         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15360         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15361
15362                 ;;
15363         esac
15364         ;;
15365 (yes)
15366
15367         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15368         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15369
15370         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15371
15372         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15373                 && test -z "${cf_tst_cflags}" \
15374                 && cf_fix_cppflags=no
15375         ;;
15376 esac
15377 done
15378
15379 if test -n "$cf_new_cflags" ; then
15380
15381         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15382         CFLAGS="${CFLAGS}$cf_new_cflags"
15383
15384 fi
15385
15386 if test -n "$cf_new_cppflags" ; then
15387
15388         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15389         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15390
15391 fi
15392
15393 if test -n "$cf_new_extra_cppflags" ; then
15394
15395         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15396         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15397
15398 fi
15399
15400 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
15401 # Filter out duplicates - this happens with badly-designed ".pc" files...
15402 for cf_add_1lib in $LIBS
15403 do
15404         for cf_add_2lib in $cf_add_libs
15405         do
15406                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15407                 then
15408                         cf_add_1lib=
15409                         break
15410                 fi
15411         done
15412         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15413 done
15414 LIBS="$cf_add_libs"
15415
15416                 cat >conftest.$ac_ext <<_ACEOF
15417 #line 15417 "configure"
15418 #include "confdefs.h"
15419 #include <form.h>
15420 int
15421 main (void)
15422 {
15423 (void) form_driver ( 0,0 );
15424   ;
15425   return 0;
15426 }
15427 _ACEOF
15428 rm -f conftest.$ac_objext conftest$ac_exeext
15429 if { (eval echo "$as_me:15429: \"$ac_link\"") >&5
15430   (eval $ac_link) 2>&5
15431   ac_status=$?
15432   echo "$as_me:15432: \$? = $ac_status" >&5
15433   (exit $ac_status); } &&
15434          { ac_try='test -s conftest$ac_exeext'
15435   { (eval echo "$as_me:15435: \"$ac_try\"") >&5
15436   (eval $ac_try) 2>&5
15437   ac_status=$?
15438   echo "$as_me:15438: \$? = $ac_status" >&5
15439   (exit $ac_status); }; }; then
15440   if test "$cross_compiling" = yes; then
15441   cf_have_curses_lib=maybe
15442 else
15443   cat >conftest.$ac_ext <<_ACEOF
15444 #line 15444 "configure"
15445 #include "confdefs.h"
15446 #include <form.h>
15447                                 int main(void)
15448                                 { (void) form_driver ( 0,0 ); return 0; }
15449 _ACEOF
15450 rm -f conftest$ac_exeext
15451 if { (eval echo "$as_me:15451: \"$ac_link\"") >&5
15452   (eval $ac_link) 2>&5
15453   ac_status=$?
15454   echo "$as_me:15454: \$? = $ac_status" >&5
15455   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15456   { (eval echo "$as_me:15456: \"$ac_try\"") >&5
15457   (eval $ac_try) 2>&5
15458   ac_status=$?
15459   echo "$as_me:15459: \$? = $ac_status" >&5
15460   (exit $ac_status); }; }; then
15461   cf_have_curses_lib=yes
15462 else
15463   echo "$as_me: program exited with status $ac_status" >&5
15464 echo "$as_me: failed program was:" >&5
15465 cat conftest.$ac_ext >&5
15466 cf_have_curses_lib=no
15467 fi
15468 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15469 fi
15470 else
15471   echo "$as_me: failed program was:" >&5
15472 cat conftest.$ac_ext >&5
15473 cf_have_curses_lib=no
15474 fi
15475 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15476                 echo "$as_me:15476: result: $cf_have_curses_lib" >&5
15477 echo "${ECHO_T}$cf_have_curses_lib" >&6
15478                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15479                 if test "$cf_have_curses_lib" != "yes"
15480                 then
15481                         CPPFLAGS="$cf_save_CPPFLAGS"
15482                         LIBS="$cf_save_LIBS"
15483                 else
15484
15485 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15486
15487                         cat >>confdefs.h <<EOF
15488 #define $cf_upper 1
15489 EOF
15490
15491                 fi
15492         fi
15493 fi
15494 if test "$cf_have_curses_lib" = no; then
15495         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
15496 echo "$as_me:15496: checking for form_driver in -lform$cf_cv_libtype" >&5
15497 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
15498 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15499   echo $ECHO_N "(cached) $ECHO_C" >&6
15500 else
15501   ac_check_lib_save_LIBS=$LIBS
15502 LIBS="-lform$cf_cv_libtype  $LIBS"
15503 cat >conftest.$ac_ext <<_ACEOF
15504 #line 15504 "configure"
15505 #include "confdefs.h"
15506
15507 /* Override any gcc2 internal prototype to avoid an error.  */
15508 #ifdef __cplusplus
15509 extern "C"
15510 #endif
15511 /* We use char because int might match the return type of a gcc2
15512    builtin and then its argument prototype would still apply.  */
15513 char form_driver ();
15514 int
15515 main (void)
15516 {
15517 form_driver ();
15518   ;
15519   return 0;
15520 }
15521 _ACEOF
15522 rm -f conftest.$ac_objext conftest$ac_exeext
15523 if { (eval echo "$as_me:15523: \"$ac_link\"") >&5
15524   (eval $ac_link) 2>&5
15525   ac_status=$?
15526   echo "$as_me:15526: \$? = $ac_status" >&5
15527   (exit $ac_status); } &&
15528          { ac_try='test -s conftest$ac_exeext'
15529   { (eval echo "$as_me:15529: \"$ac_try\"") >&5
15530   (eval $ac_try) 2>&5
15531   ac_status=$?
15532   echo "$as_me:15532: \$? = $ac_status" >&5
15533   (exit $ac_status); }; }; then
15534   eval "$as_ac_Lib=yes"
15535 else
15536   echo "$as_me: failed program was:" >&5
15537 cat conftest.$ac_ext >&5
15538 eval "$as_ac_Lib=no"
15539 fi
15540 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15541 LIBS=$ac_check_lib_save_LIBS
15542 fi
15543 echo "$as_me:15543: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15544 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15545 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15546
15547 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15548
15549 cf_add_libs="-lform$cf_cv_libtype"
15550 # Filter out duplicates - this happens with badly-designed ".pc" files...
15551 for cf_add_1lib in $LIBS
15552 do
15553         for cf_add_2lib in $cf_add_libs
15554         do
15555                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15556                 then
15557                         cf_add_1lib=
15558                         break
15559                 fi
15560         done
15561         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15562 done
15563 LIBS="$cf_add_libs"
15564
15565                 cat >>confdefs.h <<EOF
15566 #define $cf_upper 1
15567 EOF
15568
15569 fi
15570
15571 fi
15572
15573         cf_curses_headers="$cf_curses_headers form.h"
15574 fi
15575
15576 # look for curses-related headers
15577
15578 for ac_header in $cf_curses_headers
15579 do
15580 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15581 echo "$as_me:15581: checking for $ac_header" >&5
15582 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15583 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15584   echo $ECHO_N "(cached) $ECHO_C" >&6
15585 else
15586   cat >conftest.$ac_ext <<_ACEOF
15587 #line 15587 "configure"
15588 #include "confdefs.h"
15589 #include <$ac_header>
15590 _ACEOF
15591 if { (eval echo "$as_me:15591: \"$ac_cpp conftest.$ac_ext\"") >&5
15592   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15593   ac_status=$?
15594   egrep -v '^ *\+' conftest.er1 >conftest.err
15595   rm -f conftest.er1
15596   cat conftest.err >&5
15597   echo "$as_me:15597: \$? = $ac_status" >&5
15598   (exit $ac_status); } >/dev/null; then
15599   if test -s conftest.err; then
15600     ac_cpp_err=$ac_c_preproc_warn_flag
15601   else
15602     ac_cpp_err=
15603   fi
15604 else
15605   ac_cpp_err=yes
15606 fi
15607 if test -z "$ac_cpp_err"; then
15608   eval "$as_ac_Header=yes"
15609 else
15610   echo "$as_me: failed program was:" >&5
15611   cat conftest.$ac_ext >&5
15612   eval "$as_ac_Header=no"
15613 fi
15614 rm -f conftest.err conftest.$ac_ext
15615 fi
15616 echo "$as_me:15616: result: `eval echo '${'$as_ac_Header'}'`" >&5
15617 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15618 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15619   cat >>confdefs.h <<EOF
15620 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15621 EOF
15622
15623 fi
15624 done
15625
15626 echo "$as_me:15626: checking for ANSI C header files" >&5
15627 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
15628 if test "${ac_cv_header_stdc+set}" = set; then
15629   echo $ECHO_N "(cached) $ECHO_C" >&6
15630 else
15631   cat >conftest.$ac_ext <<_ACEOF
15632 #line 15632 "configure"
15633 #include "confdefs.h"
15634 #include <stdlib.h>
15635 #include <stdarg.h>
15636 #include <string.h>
15637 #include <float.h>
15638
15639 _ACEOF
15640 if { (eval echo "$as_me:15640: \"$ac_cpp conftest.$ac_ext\"") >&5
15641   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15642   ac_status=$?
15643   egrep -v '^ *\+' conftest.er1 >conftest.err
15644   rm -f conftest.er1
15645   cat conftest.err >&5
15646   echo "$as_me:15646: \$? = $ac_status" >&5
15647   (exit $ac_status); } >/dev/null; then
15648   if test -s conftest.err; then
15649     ac_cpp_err=$ac_c_preproc_warn_flag
15650   else
15651     ac_cpp_err=
15652   fi
15653 else
15654   ac_cpp_err=yes
15655 fi
15656 if test -z "$ac_cpp_err"; then
15657   ac_cv_header_stdc=yes
15658 else
15659   echo "$as_me: failed program was:" >&5
15660   cat conftest.$ac_ext >&5
15661   ac_cv_header_stdc=no
15662 fi
15663 rm -f conftest.err conftest.$ac_ext
15664
15665 if test $ac_cv_header_stdc = yes; then
15666   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
15667   cat >conftest.$ac_ext <<_ACEOF
15668 #line 15668 "configure"
15669 #include "confdefs.h"
15670 #include <string.h>
15671
15672 _ACEOF
15673 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15674   egrep "memchr" >/dev/null 2>&1; then
15675   :
15676 else
15677   ac_cv_header_stdc=no
15678 fi
15679 rm -rf conftest*
15680
15681 fi
15682
15683 if test $ac_cv_header_stdc = yes; then
15684   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
15685   cat >conftest.$ac_ext <<_ACEOF
15686 #line 15686 "configure"
15687 #include "confdefs.h"
15688 #include <stdlib.h>
15689
15690 _ACEOF
15691 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
15692   egrep "free" >/dev/null 2>&1; then
15693   :
15694 else
15695   ac_cv_header_stdc=no
15696 fi
15697 rm -rf conftest*
15698
15699 fi
15700
15701 if test $ac_cv_header_stdc = yes; then
15702   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
15703   if test "$cross_compiling" = yes; then
15704   :
15705 else
15706   cat >conftest.$ac_ext <<_ACEOF
15707 #line 15707 "configure"
15708 #include "confdefs.h"
15709 #include <ctype.h>
15710 #if ((' ' & 0x0FF) == 0x020)
15711 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
15712 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
15713 #else
15714 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
15715                      || ('j' <= (c) && (c) <= 'r') \
15716                      || ('s' <= (c) && (c) <= 'z'))
15717 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
15718 #endif
15719
15720 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
15721 int
15722 main (void)
15723 {
15724   int i;
15725   for (i = 0; i < 256; i++)
15726     if (XOR (islower (i), ISLOWER (i))
15727         || toupper (i) != TOUPPER (i))
15728       $ac_main_return(2);
15729   $ac_main_return (0);
15730 }
15731 _ACEOF
15732 rm -f conftest$ac_exeext
15733 if { (eval echo "$as_me:15733: \"$ac_link\"") >&5
15734   (eval $ac_link) 2>&5
15735   ac_status=$?
15736   echo "$as_me:15736: \$? = $ac_status" >&5
15737   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15738   { (eval echo "$as_me:15738: \"$ac_try\"") >&5
15739   (eval $ac_try) 2>&5
15740   ac_status=$?
15741   echo "$as_me:15741: \$? = $ac_status" >&5
15742   (exit $ac_status); }; }; then
15743   :
15744 else
15745   echo "$as_me: program exited with status $ac_status" >&5
15746 echo "$as_me: failed program was:" >&5
15747 cat conftest.$ac_ext >&5
15748 ac_cv_header_stdc=no
15749 fi
15750 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15751 fi
15752 fi
15753 fi
15754 echo "$as_me:15754: result: $ac_cv_header_stdc" >&5
15755 echo "${ECHO_T}$ac_cv_header_stdc" >&6
15756 if test $ac_cv_header_stdc = yes; then
15757
15758 cat >>confdefs.h <<\EOF
15759 #define STDC_HEADERS 1
15760 EOF
15761
15762 fi
15763
15764 echo "$as_me:15764: checking whether time.h and sys/time.h may both be included" >&5
15765 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
15766 if test "${ac_cv_header_time+set}" = set; then
15767   echo $ECHO_N "(cached) $ECHO_C" >&6
15768 else
15769   cat >conftest.$ac_ext <<_ACEOF
15770 #line 15770 "configure"
15771 #include "confdefs.h"
15772 #include <sys/types.h>
15773 #include <sys/time.h>
15774 #include <time.h>
15775
15776 int
15777 main (void)
15778 {
15779 if ((struct tm *) 0)
15780 return 0;
15781   ;
15782   return 0;
15783 }
15784 _ACEOF
15785 rm -f conftest.$ac_objext
15786 if { (eval echo "$as_me:15786: \"$ac_compile\"") >&5
15787   (eval $ac_compile) 2>&5
15788   ac_status=$?
15789   echo "$as_me:15789: \$? = $ac_status" >&5
15790   (exit $ac_status); } &&
15791          { ac_try='test -s conftest.$ac_objext'
15792   { (eval echo "$as_me:15792: \"$ac_try\"") >&5
15793   (eval $ac_try) 2>&5
15794   ac_status=$?
15795   echo "$as_me:15795: \$? = $ac_status" >&5
15796   (exit $ac_status); }; }; then
15797   ac_cv_header_time=yes
15798 else
15799   echo "$as_me: failed program was:" >&5
15800 cat conftest.$ac_ext >&5
15801 ac_cv_header_time=no
15802 fi
15803 rm -f conftest.$ac_objext conftest.$ac_ext
15804 fi
15805 echo "$as_me:15805: result: $ac_cv_header_time" >&5
15806 echo "${ECHO_T}$ac_cv_header_time" >&6
15807 if test $ac_cv_header_time = yes; then
15808
15809 cat >>confdefs.h <<\EOF
15810 #define TIME_WITH_SYS_TIME 1
15811 EOF
15812
15813 fi
15814
15815 for ac_header in \
15816 getopt.h \
15817 locale.h \
15818 math.h \
15819 stdarg.h \
15820 stdint.h \
15821 sys/ioctl.h \
15822 sys/select.h \
15823 sys/time.h \
15824 termios.h \
15825 unistd.h \
15826
15827 do
15828 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15829 echo "$as_me:15829: checking for $ac_header" >&5
15830 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15831 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15832   echo $ECHO_N "(cached) $ECHO_C" >&6
15833 else
15834   cat >conftest.$ac_ext <<_ACEOF
15835 #line 15835 "configure"
15836 #include "confdefs.h"
15837 #include <$ac_header>
15838 _ACEOF
15839 if { (eval echo "$as_me:15839: \"$ac_cpp conftest.$ac_ext\"") >&5
15840   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15841   ac_status=$?
15842   egrep -v '^ *\+' conftest.er1 >conftest.err
15843   rm -f conftest.er1
15844   cat conftest.err >&5
15845   echo "$as_me:15845: \$? = $ac_status" >&5
15846   (exit $ac_status); } >/dev/null; then
15847   if test -s conftest.err; then
15848     ac_cpp_err=$ac_c_preproc_warn_flag
15849   else
15850     ac_cpp_err=
15851   fi
15852 else
15853   ac_cpp_err=yes
15854 fi
15855 if test -z "$ac_cpp_err"; then
15856   eval "$as_ac_Header=yes"
15857 else
15858   echo "$as_me: failed program was:" >&5
15859   cat conftest.$ac_ext >&5
15860   eval "$as_ac_Header=no"
15861 fi
15862 rm -f conftest.err conftest.$ac_ext
15863 fi
15864 echo "$as_me:15864: result: `eval echo '${'$as_ac_Header'}'`" >&5
15865 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15866 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15867   cat >>confdefs.h <<EOF
15868 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15869 EOF
15870
15871 fi
15872 done
15873
15874 for ac_header in unistd.h getopt.h
15875 do
15876 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
15877 echo "$as_me:15877: checking for $ac_header" >&5
15878 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
15879 if eval "test \"\${$as_ac_Header+set}\" = set"; then
15880   echo $ECHO_N "(cached) $ECHO_C" >&6
15881 else
15882   cat >conftest.$ac_ext <<_ACEOF
15883 #line 15883 "configure"
15884 #include "confdefs.h"
15885 #include <$ac_header>
15886 _ACEOF
15887 if { (eval echo "$as_me:15887: \"$ac_cpp conftest.$ac_ext\"") >&5
15888   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15889   ac_status=$?
15890   egrep -v '^ *\+' conftest.er1 >conftest.err
15891   rm -f conftest.er1
15892   cat conftest.err >&5
15893   echo "$as_me:15893: \$? = $ac_status" >&5
15894   (exit $ac_status); } >/dev/null; then
15895   if test -s conftest.err; then
15896     ac_cpp_err=$ac_c_preproc_warn_flag
15897   else
15898     ac_cpp_err=
15899   fi
15900 else
15901   ac_cpp_err=yes
15902 fi
15903 if test -z "$ac_cpp_err"; then
15904   eval "$as_ac_Header=yes"
15905 else
15906   echo "$as_me: failed program was:" >&5
15907   cat conftest.$ac_ext >&5
15908   eval "$as_ac_Header=no"
15909 fi
15910 rm -f conftest.err conftest.$ac_ext
15911 fi
15912 echo "$as_me:15912: result: `eval echo '${'$as_ac_Header'}'`" >&5
15913 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
15914 if test `eval echo '${'$as_ac_Header'}'` = yes; then
15915   cat >>confdefs.h <<EOF
15916 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
15917 EOF
15918
15919 fi
15920 done
15921
15922 echo "$as_me:15922: checking for header declaring getopt variables" >&5
15923 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
15924 if test "${cf_cv_getopt_header+set}" = set; then
15925   echo $ECHO_N "(cached) $ECHO_C" >&6
15926 else
15927
15928 cf_cv_getopt_header=none
15929 for cf_header in stdio.h stdlib.h unistd.h getopt.h
15930 do
15931 cat >conftest.$ac_ext <<_ACEOF
15932 #line 15932 "configure"
15933 #include "confdefs.h"
15934
15935 #include <$cf_header>
15936 int
15937 main (void)
15938 {
15939 int x = optind; char *y = optarg
15940   ;
15941   return 0;
15942 }
15943 _ACEOF
15944 rm -f conftest.$ac_objext
15945 if { (eval echo "$as_me:15945: \"$ac_compile\"") >&5
15946   (eval $ac_compile) 2>&5
15947   ac_status=$?
15948   echo "$as_me:15948: \$? = $ac_status" >&5
15949   (exit $ac_status); } &&
15950          { ac_try='test -s conftest.$ac_objext'
15951   { (eval echo "$as_me:15951: \"$ac_try\"") >&5
15952   (eval $ac_try) 2>&5
15953   ac_status=$?
15954   echo "$as_me:15954: \$? = $ac_status" >&5
15955   (exit $ac_status); }; }; then
15956   cf_cv_getopt_header=$cf_header
15957  break
15958 else
15959   echo "$as_me: failed program was:" >&5
15960 cat conftest.$ac_ext >&5
15961 fi
15962 rm -f conftest.$ac_objext conftest.$ac_ext
15963 done
15964
15965 fi
15966 echo "$as_me:15966: result: $cf_cv_getopt_header" >&5
15967 echo "${ECHO_T}$cf_cv_getopt_header" >&6
15968 if test $cf_cv_getopt_header != none ; then
15969
15970 cat >>confdefs.h <<\EOF
15971 #define HAVE_GETOPT_HEADER 1
15972 EOF
15973
15974 fi
15975 if test $cf_cv_getopt_header = getopt.h ; then
15976
15977 cat >>confdefs.h <<\EOF
15978 #define NEED_GETOPT_H 1
15979 EOF
15980
15981 fi
15982
15983 for ac_func in \
15984 getopt \
15985 gettimeofday \
15986 tdestroy \
15987 tsearch \
15988
15989 do
15990 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
15991 echo "$as_me:15991: checking for $ac_func" >&5
15992 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
15993 if eval "test \"\${$as_ac_var+set}\" = set"; then
15994   echo $ECHO_N "(cached) $ECHO_C" >&6
15995 else
15996   cat >conftest.$ac_ext <<_ACEOF
15997 #line 15997 "configure"
15998 #include "confdefs.h"
15999 /* System header to define __stub macros and hopefully few prototypes,
16000     which can conflict with char $ac_func (); below.  */
16001 #include <assert.h>
16002 /* Override any gcc2 internal prototype to avoid an error.  */
16003 #ifdef __cplusplus
16004 extern "C"
16005 #endif
16006 /* We use char because int might match the return type of a gcc2
16007    builtin and then its argument prototype would still apply.  */
16008 char $ac_func ();
16009 char (*f) ();
16010
16011 int
16012 main (void)
16013 {
16014 /* The GNU C library defines this for functions which it implements
16015     to always fail with ENOSYS.  Some functions are actually named
16016     something starting with __ and the normal name is an alias.  */
16017 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16018 choke me
16019 #else
16020 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16021 #endif
16022
16023   ;
16024   return 0;
16025 }
16026 _ACEOF
16027 rm -f conftest.$ac_objext conftest$ac_exeext
16028 if { (eval echo "$as_me:16028: \"$ac_link\"") >&5
16029   (eval $ac_link) 2>&5
16030   ac_status=$?
16031   echo "$as_me:16031: \$? = $ac_status" >&5
16032   (exit $ac_status); } &&
16033          { ac_try='test -s conftest$ac_exeext'
16034   { (eval echo "$as_me:16034: \"$ac_try\"") >&5
16035   (eval $ac_try) 2>&5
16036   ac_status=$?
16037   echo "$as_me:16037: \$? = $ac_status" >&5
16038   (exit $ac_status); }; }; then
16039   eval "$as_ac_var=yes"
16040 else
16041   echo "$as_me: failed program was:" >&5
16042 cat conftest.$ac_ext >&5
16043 eval "$as_ac_var=no"
16044 fi
16045 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16046 fi
16047 echo "$as_me:16047: result: `eval echo '${'$as_ac_var'}'`" >&5
16048 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16049 if test `eval echo '${'$as_ac_var'}'` = yes; then
16050   cat >>confdefs.h <<EOF
16051 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16052 EOF
16053
16054 fi
16055 done
16056
16057 # use a compile-check to work with ncurses*-config and subdirectory includes
16058 echo "$as_me:16058: checking if we can use termcap.h" >&5
16059 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
16060 if test "${cf_cv_have_termcap_h+set}" = set; then
16061   echo $ECHO_N "(cached) $ECHO_C" >&6
16062 else
16063
16064         cat >conftest.$ac_ext <<_ACEOF
16065 #line 16065 "configure"
16066 #include "confdefs.h"
16067
16068 #include <curses.h>
16069 #include <termcap.h>
16070
16071 int
16072 main (void)
16073 {
16074 return 0;
16075   ;
16076   return 0;
16077 }
16078 _ACEOF
16079 rm -f conftest.$ac_objext
16080 if { (eval echo "$as_me:16080: \"$ac_compile\"") >&5
16081   (eval $ac_compile) 2>&5
16082   ac_status=$?
16083   echo "$as_me:16083: \$? = $ac_status" >&5
16084   (exit $ac_status); } &&
16085          { ac_try='test -s conftest.$ac_objext'
16086   { (eval echo "$as_me:16086: \"$ac_try\"") >&5
16087   (eval $ac_try) 2>&5
16088   ac_status=$?
16089   echo "$as_me:16089: \$? = $ac_status" >&5
16090   (exit $ac_status); }; }; then
16091   cf_cv_have_termcap_h=yes
16092 else
16093   echo "$as_me: failed program was:" >&5
16094 cat conftest.$ac_ext >&5
16095 cf_cv_have_termcap_h=no
16096 fi
16097 rm -f conftest.$ac_objext conftest.$ac_ext
16098 fi
16099 echo "$as_me:16099: result: $cf_cv_have_termcap_h" >&5
16100 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
16101 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
16102 #define HAVE_TERMCAP_H 1
16103 EOF
16104
16105 if test "x$ac_cv_func_getopt" = xno; then
16106         { { echo "$as_me:16106: error: getopt is required for building programs" >&5
16107 echo "$as_me: error: getopt is required for building programs" >&2;}
16108    { (exit 1); exit 1; }; }
16109 fi
16110
16111 if test "$cf_enable_widec" = yes; then
16112
16113 for ac_func in \
16114 mblen \
16115 mbrlen \
16116 mbrtowc \
16117 mbsrtowcs \
16118 mbstowcs \
16119 mbtowc \
16120 wcsrtombs \
16121 wcstombs \
16122
16123 do
16124 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16125 echo "$as_me:16125: checking for $ac_func" >&5
16126 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16127 if eval "test \"\${$as_ac_var+set}\" = set"; then
16128   echo $ECHO_N "(cached) $ECHO_C" >&6
16129 else
16130   cat >conftest.$ac_ext <<_ACEOF
16131 #line 16131 "configure"
16132 #include "confdefs.h"
16133 /* System header to define __stub macros and hopefully few prototypes,
16134     which can conflict with char $ac_func (); below.  */
16135 #include <assert.h>
16136 /* Override any gcc2 internal prototype to avoid an error.  */
16137 #ifdef __cplusplus
16138 extern "C"
16139 #endif
16140 /* We use char because int might match the return type of a gcc2
16141    builtin and then its argument prototype would still apply.  */
16142 char $ac_func ();
16143 char (*f) ();
16144
16145 int
16146 main (void)
16147 {
16148 /* The GNU C library defines this for functions which it implements
16149     to always fail with ENOSYS.  Some functions are actually named
16150     something starting with __ and the normal name is an alias.  */
16151 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16152 choke me
16153 #else
16154 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16155 #endif
16156
16157   ;
16158   return 0;
16159 }
16160 _ACEOF
16161 rm -f conftest.$ac_objext conftest$ac_exeext
16162 if { (eval echo "$as_me:16162: \"$ac_link\"") >&5
16163   (eval $ac_link) 2>&5
16164   ac_status=$?
16165   echo "$as_me:16165: \$? = $ac_status" >&5
16166   (exit $ac_status); } &&
16167          { ac_try='test -s conftest$ac_exeext'
16168   { (eval echo "$as_me:16168: \"$ac_try\"") >&5
16169   (eval $ac_try) 2>&5
16170   ac_status=$?
16171   echo "$as_me:16171: \$? = $ac_status" >&5
16172   (exit $ac_status); }; }; then
16173   eval "$as_ac_var=yes"
16174 else
16175   echo "$as_me: failed program was:" >&5
16176 cat conftest.$ac_ext >&5
16177 eval "$as_ac_var=no"
16178 fi
16179 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16180 fi
16181 echo "$as_me:16181: result: `eval echo '${'$as_ac_var'}'`" >&5
16182 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16183 if test `eval echo '${'$as_ac_var'}'` = yes; then
16184   cat >>confdefs.h <<EOF
16185 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16186 EOF
16187
16188 fi
16189 done
16190
16191 fi
16192
16193 echo "$as_me:16193: checking definition to turn on extended curses functions" >&5
16194 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
16195 if test "${cf_cv_need_xopen_extension+set}" = set; then
16196   echo $ECHO_N "(cached) $ECHO_C" >&6
16197 else
16198
16199 cf_cv_need_xopen_extension=unknown
16200 cat >conftest.$ac_ext <<_ACEOF
16201 #line 16201 "configure"
16202 #include "confdefs.h"
16203
16204 #include <stdlib.h>
16205 #include <${cf_cv_ncurses_header:-curses.h}>
16206 int
16207 main (void)
16208 {
16209
16210 #if defined(NCURSES_VERSION_PATCH)
16211 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
16212         make an error
16213 #endif
16214 #endif
16215 #ifdef NCURSES_VERSION
16216         cchar_t check;
16217         int check2 = curs_set((int)sizeof(check));
16218 #endif
16219         long x = winnstr(stdscr, "", 0);
16220         int x1, y1;
16221         getbegyx(stdscr, y1, x1)
16222   ;
16223   return 0;
16224 }
16225 _ACEOF
16226 rm -f conftest.$ac_objext conftest$ac_exeext
16227 if { (eval echo "$as_me:16227: \"$ac_link\"") >&5
16228   (eval $ac_link) 2>&5
16229   ac_status=$?
16230   echo "$as_me:16230: \$? = $ac_status" >&5
16231   (exit $ac_status); } &&
16232          { ac_try='test -s conftest$ac_exeext'
16233   { (eval echo "$as_me:16233: \"$ac_try\"") >&5
16234   (eval $ac_try) 2>&5
16235   ac_status=$?
16236   echo "$as_me:16236: \$? = $ac_status" >&5
16237   (exit $ac_status); }; }; then
16238   cf_cv_need_xopen_extension=none
16239 else
16240   echo "$as_me: failed program was:" >&5
16241 cat conftest.$ac_ext >&5
16242
16243         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
16244         do
16245                 cat >conftest.$ac_ext <<_ACEOF
16246 #line 16246 "configure"
16247 #include "confdefs.h"
16248
16249 #define $cf_try_xopen_extension 1
16250 #include <stdlib.h>
16251 #include <${cf_cv_ncurses_header:-curses.h}>
16252 int
16253 main (void)
16254 {
16255
16256 #ifdef NCURSES_VERSION
16257                 cchar_t check;
16258                 int check2 = curs_set((int)sizeof(check));
16259 #endif
16260                 long x = winnstr(stdscr, "", 0);
16261                 int x1, y1;
16262                 getbegyx(stdscr, y1, x1)
16263   ;
16264   return 0;
16265 }
16266 _ACEOF
16267 rm -f conftest.$ac_objext conftest$ac_exeext
16268 if { (eval echo "$as_me:16268: \"$ac_link\"") >&5
16269   (eval $ac_link) 2>&5
16270   ac_status=$?
16271   echo "$as_me:16271: \$? = $ac_status" >&5
16272   (exit $ac_status); } &&
16273          { ac_try='test -s conftest$ac_exeext'
16274   { (eval echo "$as_me:16274: \"$ac_try\"") >&5
16275   (eval $ac_try) 2>&5
16276   ac_status=$?
16277   echo "$as_me:16277: \$? = $ac_status" >&5
16278   (exit $ac_status); }; }; then
16279   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
16280 else
16281   echo "$as_me: failed program was:" >&5
16282 cat conftest.$ac_ext >&5
16283 fi
16284 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16285         done
16286
16287 fi
16288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16289
16290 fi
16291 echo "$as_me:16291: result: $cf_cv_need_xopen_extension" >&5
16292 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
16293
16294 case $cf_cv_need_xopen_extension in
16295 (*_*)
16296         CPPFLAGS="$CPPFLAGS -D$cf_cv_need_xopen_extension"
16297         ;;
16298 esac
16299
16300 echo "$as_me:16300: checking for term.h" >&5
16301 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
16302 if test "${cf_cv_term_header+set}" = set; then
16303   echo $ECHO_N "(cached) $ECHO_C" >&6
16304 else
16305
16306 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
16307 # for <term.h> if we do not find the variant.
16308
16309 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
16310
16311 case ${cf_cv_ncurses_header:-curses.h} in
16312 (*/*)
16313         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
16314         cf_header_list="$cf_header_item $cf_header_list"
16315         ;;
16316 esac
16317
16318 for cf_header in $cf_header_list
16319 do
16320         cat >conftest.$ac_ext <<_ACEOF
16321 #line 16321 "configure"
16322 #include "confdefs.h"
16323
16324 #include <${cf_cv_ncurses_header:-curses.h}>
16325 #include <${cf_header}>
16326 int
16327 main (void)
16328 {
16329 WINDOW *x
16330   ;
16331   return 0;
16332 }
16333 _ACEOF
16334 rm -f conftest.$ac_objext
16335 if { (eval echo "$as_me:16335: \"$ac_compile\"") >&5
16336   (eval $ac_compile) 2>&5
16337   ac_status=$?
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit $ac_status); } &&
16340          { ac_try='test -s conftest.$ac_objext'
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   cf_cv_term_header=$cf_header
16347          break
16348 else
16349   echo "$as_me: failed program was:" >&5
16350 cat conftest.$ac_ext >&5
16351 cf_cv_term_header=no
16352 fi
16353 rm -f conftest.$ac_objext conftest.$ac_ext
16354 done
16355
16356 case $cf_cv_term_header in
16357 (no)
16358         # If curses is ncurses, some packagers still mess it up by trying to make
16359         # us use GNU termcap.  This handles the most common case.
16360         for cf_header in ncurses/term.h ncursesw/term.h
16361         do
16362                 cat >conftest.$ac_ext <<_ACEOF
16363 #line 16363 "configure"
16364 #include "confdefs.h"
16365
16366 #include <${cf_cv_ncurses_header:-curses.h}>
16367 #ifdef NCURSES_VERSION
16368 #include <${cf_header}>
16369 #else
16370 make an error
16371 #endif
16372 int
16373 main (void)
16374 {
16375 WINDOW *x
16376   ;
16377   return 0;
16378 }
16379 _ACEOF
16380 rm -f conftest.$ac_objext
16381 if { (eval echo "$as_me:16381: \"$ac_compile\"") >&5
16382   (eval $ac_compile) 2>&5
16383   ac_status=$?
16384   echo "$as_me:16384: \$? = $ac_status" >&5
16385   (exit $ac_status); } &&
16386          { ac_try='test -s conftest.$ac_objext'
16387   { (eval echo "$as_me:16387: \"$ac_try\"") >&5
16388   (eval $ac_try) 2>&5
16389   ac_status=$?
16390   echo "$as_me:16390: \$? = $ac_status" >&5
16391   (exit $ac_status); }; }; then
16392   cf_cv_term_header=$cf_header
16393                          break
16394 else
16395   echo "$as_me: failed program was:" >&5
16396 cat conftest.$ac_ext >&5
16397 cf_cv_term_header=no
16398 fi
16399 rm -f conftest.$ac_objext conftest.$ac_ext
16400         done
16401         ;;
16402 esac
16403
16404 fi
16405 echo "$as_me:16405: result: $cf_cv_term_header" >&5
16406 echo "${ECHO_T}$cf_cv_term_header" >&6
16407
16408 case $cf_cv_term_header in
16409 (term.h)
16410
16411 cat >>confdefs.h <<\EOF
16412 #define HAVE_TERM_H 1
16413 EOF
16414
16415         ;;
16416 (ncurses/term.h)
16417
16418 cat >>confdefs.h <<\EOF
16419 #define HAVE_NCURSES_TERM_H 1
16420 EOF
16421
16422         ;;
16423 (ncursesw/term.h)
16424
16425 cat >>confdefs.h <<\EOF
16426 #define HAVE_NCURSESW_TERM_H 1
16427 EOF
16428
16429         ;;
16430 esac
16431
16432 echo "$as_me:16432: checking for unctrl.h" >&5
16433 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
16434 if test "${cf_cv_unctrl_header+set}" = set; then
16435   echo $ECHO_N "(cached) $ECHO_C" >&6
16436 else
16437
16438 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
16439 # for <unctrl.h> if we do not find the variant.
16440
16441 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
16442
16443 case ${cf_cv_ncurses_header:-curses.h} in
16444 (*/*)
16445         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
16446         cf_header_list="$cf_header_item $cf_header_list"
16447         ;;
16448 esac
16449
16450 for cf_header in $cf_header_list
16451 do
16452         cat >conftest.$ac_ext <<_ACEOF
16453 #line 16453 "configure"
16454 #include "confdefs.h"
16455
16456 #include <${cf_cv_ncurses_header:-curses.h}>
16457 #include <${cf_header}>
16458 int
16459 main (void)
16460 {
16461 WINDOW *x
16462   ;
16463   return 0;
16464 }
16465 _ACEOF
16466 rm -f conftest.$ac_objext
16467 if { (eval echo "$as_me:16467: \"$ac_compile\"") >&5
16468   (eval $ac_compile) 2>&5
16469   ac_status=$?
16470   echo "$as_me:16470: \$? = $ac_status" >&5
16471   (exit $ac_status); } &&
16472          { ac_try='test -s conftest.$ac_objext'
16473   { (eval echo "$as_me:16473: \"$ac_try\"") >&5
16474   (eval $ac_try) 2>&5
16475   ac_status=$?
16476   echo "$as_me:16476: \$? = $ac_status" >&5
16477   (exit $ac_status); }; }; then
16478   cf_cv_unctrl_header=$cf_header
16479          break
16480 else
16481   echo "$as_me: failed program was:" >&5
16482 cat conftest.$ac_ext >&5
16483 cf_cv_unctrl_header=no
16484 fi
16485 rm -f conftest.$ac_objext conftest.$ac_ext
16486 done
16487
16488 fi
16489 echo "$as_me:16489: result: $cf_cv_unctrl_header" >&5
16490 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
16491
16492 case $cf_cv_unctrl_header in
16493 (no)
16494         { echo "$as_me:16494: WARNING: unctrl.h header not found" >&5
16495 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
16496         ;;
16497 esac
16498
16499 case $cf_cv_unctrl_header in
16500 (unctrl.h)
16501
16502 cat >>confdefs.h <<\EOF
16503 #define HAVE_UNCTRL_H 1
16504 EOF
16505
16506         ;;
16507 (ncurses/unctrl.h)
16508
16509 cat >>confdefs.h <<\EOF
16510 #define HAVE_NCURSES_UNCTRL_H 1
16511 EOF
16512
16513         ;;
16514 (ncursesw/unctrl.h)
16515
16516 cat >>confdefs.h <<\EOF
16517 #define HAVE_NCURSESW_UNCTRL_H 1
16518 EOF
16519
16520         ;;
16521 esac
16522
16523 for cf_func in \
16524 alloc_pair \
16525 assume_default_colors \
16526 chgat \
16527 color_content \
16528 color_set \
16529 copywin \
16530 delscreen \
16531 dupwin \
16532 filter \
16533 getbegx \
16534 getcurx \
16535 getmaxx \
16536 getnstr \
16537 getparx \
16538 getwin \
16539 halfdelay \
16540 init_extended_color \
16541 mvderwin \
16542 mvvline \
16543 mvwin \
16544 mvwvline \
16545 napms \
16546 newpad \
16547 putwin \
16548 reset_color_pairs \
16549 resize_term \
16550 resizeterm \
16551 restartterm \
16552 ripoffline \
16553 scr_dump \
16554 setupterm \
16555 slk_color \
16556 slk_init \
16557 termattrs \
16558 tgetent \
16559 tigetnum \
16560 tigetstr \
16561 tputs_sp \
16562 typeahead \
16563 use_default_colors \
16564 use_env \
16565 use_extended_names \
16566 use_screen \
16567 use_window \
16568 vid_puts \
16569 vidputs \
16570 vsscanf \
16571 vw_printw \
16572 wchgat \
16573 winsdelln \
16574 winsstr \
16575 wresize \
16576 wsyncdown \
16577 _tracef \
16578
16579 do
16580
16581 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16582
16583         echo "$as_me:16583: checking for ${cf_func}" >&5
16584 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16585
16586 echo "${as_me:-configure}:16586: testing ${cf_func} ..." 1>&5
16587
16588         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16589   echo $ECHO_N "(cached) $ECHO_C" >&6
16590 else
16591
16592                 eval cf_result='$ac_cv_func_'$cf_func
16593                 if test ".$cf_result" != ".no"; then
16594                         cat >conftest.$ac_ext <<_ACEOF
16595 #line 16595 "configure"
16596 #include "confdefs.h"
16597
16598 #ifdef HAVE_XCURSES
16599 #include <xcurses.h>
16600 char * XCursesProgramName = "test";
16601 #else
16602 #include <${cf_cv_ncurses_header:-curses.h}>
16603 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16604 #include <ncursesw/term.h>
16605 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16606 #include <ncurses/term.h>
16607 #elif defined(HAVE_TERM_H)
16608 #include <term.h>
16609 #endif
16610 #endif
16611
16612 int
16613 main (void)
16614 {
16615
16616 #ifndef ${cf_func}
16617 long foo = (long)(&${cf_func});
16618 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16619 if (foo + 1234L > 5678L)
16620         ${cf_cv_main_return:-return}(foo != 0);
16621 #endif
16622
16623   ;
16624   return 0;
16625 }
16626 _ACEOF
16627 rm -f conftest.$ac_objext conftest$ac_exeext
16628 if { (eval echo "$as_me:16628: \"$ac_link\"") >&5
16629   (eval $ac_link) 2>&5
16630   ac_status=$?
16631   echo "$as_me:16631: \$? = $ac_status" >&5
16632   (exit $ac_status); } &&
16633          { ac_try='test -s conftest$ac_exeext'
16634   { (eval echo "$as_me:16634: \"$ac_try\"") >&5
16635   (eval $ac_try) 2>&5
16636   ac_status=$?
16637   echo "$as_me:16637: \$? = $ac_status" >&5
16638   (exit $ac_status); }; }; then
16639   cf_result=yes
16640 else
16641   echo "$as_me: failed program was:" >&5
16642 cat conftest.$ac_ext >&5
16643 cf_result=no
16644 fi
16645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16646                 fi
16647                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16648
16649 fi
16650
16651         # use the computed/retrieved cache-value:
16652         eval 'cf_result=$cf_cv_func_'$cf_func
16653         echo "$as_me:16653: result: $cf_result" >&5
16654 echo "${ECHO_T}$cf_result" >&6
16655         if test $cf_result != no; then
16656                 cat >>confdefs.h <<EOF
16657 #define HAVE_${cf_tr_func} 1
16658 EOF
16659
16660         fi
16661 done
16662
16663 for cf_func in tputs
16664 do
16665
16666 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16667
16668         echo "$as_me:16668: checking for ${cf_func}" >&5
16669 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
16670
16671 echo "${as_me:-configure}:16671: testing ${cf_func} ..." 1>&5
16672
16673         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
16674   echo $ECHO_N "(cached) $ECHO_C" >&6
16675 else
16676
16677                 eval cf_result='$ac_cv_func_'$cf_func
16678                 if test ".$cf_result" != ".no"; then
16679                         cat >conftest.$ac_ext <<_ACEOF
16680 #line 16680 "configure"
16681 #include "confdefs.h"
16682
16683 #ifdef HAVE_XCURSES
16684 #include <xcurses.h>
16685 char * XCursesProgramName = "test";
16686 #else
16687 #include <${cf_cv_ncurses_header:-curses.h}>
16688 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
16689 #include <ncursesw/term.h>
16690 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
16691 #include <ncurses/term.h>
16692 #elif defined(HAVE_TERM_H)
16693 #include <term.h>
16694 #endif
16695 #endif
16696
16697 int
16698 main (void)
16699 {
16700
16701 #ifndef ${cf_func}
16702 long foo = (long)(&${cf_func});
16703 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
16704 if (foo + 1234L > 5678L)
16705         ${cf_cv_main_return:-return}(foo != 0);
16706 #endif
16707
16708   ;
16709   return 0;
16710 }
16711 _ACEOF
16712 rm -f conftest.$ac_objext conftest$ac_exeext
16713 if { (eval echo "$as_me:16713: \"$ac_link\"") >&5
16714   (eval $ac_link) 2>&5
16715   ac_status=$?
16716   echo "$as_me:16716: \$? = $ac_status" >&5
16717   (exit $ac_status); } &&
16718          { ac_try='test -s conftest$ac_exeext'
16719   { (eval echo "$as_me:16719: \"$ac_try\"") >&5
16720   (eval $ac_try) 2>&5
16721   ac_status=$?
16722   echo "$as_me:16722: \$? = $ac_status" >&5
16723   (exit $ac_status); }; }; then
16724   cf_result=yes
16725 else
16726   echo "$as_me: failed program was:" >&5
16727 cat conftest.$ac_ext >&5
16728 cf_result=no
16729 fi
16730 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16731                 fi
16732                 eval 'cf_cv_func_'$cf_func'=$cf_result'
16733
16734 fi
16735
16736         # use the computed/retrieved cache-value:
16737         eval 'cf_result=$cf_cv_func_'$cf_func
16738         echo "$as_me:16738: result: $cf_result" >&5
16739 echo "${ECHO_T}$cf_result" >&6
16740         if test $cf_result != no; then
16741                 cat >>confdefs.h <<EOF
16742 #define HAVE_${cf_tr_func} 1
16743 EOF
16744
16745         fi
16746 done
16747
16748 if test x$cf_cv_func_tputs = xyes
16749 then
16750         cf_done=no
16751         for cf_arg in int char
16752         do
16753                 for cf_ret in int void
16754                 do
16755                         if test $cf_ret = void
16756                         then
16757                                 cf_return="/* nothing */"
16758                         else
16759                                 cf_return="return value"
16760                         fi
16761                         cat >conftest.$ac_ext <<_ACEOF
16762 #line 16762 "configure"
16763 #include "confdefs.h"
16764
16765 #include <${cf_cv_ncurses_header:-curses.h}>
16766 #include <$cf_cv_term_header>
16767
16768 static $cf_ret outc($cf_arg value) { $cf_return; }
16769
16770 int
16771 main (void)
16772 {
16773
16774         tputs("hello", 0, outc);
16775         ${cf_cv_main_return:-return}(0);
16776
16777   ;
16778   return 0;
16779 }
16780 _ACEOF
16781 rm -f conftest.$ac_objext
16782 if { (eval echo "$as_me:16782: \"$ac_compile\"") >&5
16783   (eval $ac_compile) 2>&5
16784   ac_status=$?
16785   echo "$as_me:16785: \$? = $ac_status" >&5
16786   (exit $ac_status); } &&
16787          { ac_try='test -s conftest.$ac_objext'
16788   { (eval echo "$as_me:16788: \"$ac_try\"") >&5
16789   (eval $ac_try) 2>&5
16790   ac_status=$?
16791   echo "$as_me:16791: \$? = $ac_status" >&5
16792   (exit $ac_status); }; }; then
16793
16794                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
16795
16796 echo "${as_me:-configure}:16796: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
16797
16798                 cat >>confdefs.h <<EOF
16799 #define TPUTS_ARG               $cf_arg
16800 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
16801 #define TPUTS_RETURN(value)     $cf_return
16802 EOF
16803                 cf_done=yes
16804                 break
16805
16806 else
16807   echo "$as_me: failed program was:" >&5
16808 cat conftest.$ac_ext >&5
16809 fi
16810 rm -f conftest.$ac_objext conftest.$ac_ext
16811                 done
16812                 test $cf_done = yes && break
16813         done
16814 fi
16815
16816 echo "$as_me:16816: checking for ncurses extended functions" >&5
16817 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
16818 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
16819   echo $ECHO_N "(cached) $ECHO_C" >&6
16820 else
16821
16822 cat >conftest.$ac_ext <<_ACEOF
16823 #line 16823 "configure"
16824 #include "confdefs.h"
16825
16826 #include <${cf_cv_ncurses_header:-curses.h}>
16827 int
16828 main (void)
16829 {
16830
16831 int x = NCURSES_EXT_FUNCS
16832
16833   ;
16834   return 0;
16835 }
16836 _ACEOF
16837 rm -f conftest.$ac_objext
16838 if { (eval echo "$as_me:16838: \"$ac_compile\"") >&5
16839   (eval $ac_compile) 2>&5
16840   ac_status=$?
16841   echo "$as_me:16841: \$? = $ac_status" >&5
16842   (exit $ac_status); } &&
16843          { ac_try='test -s conftest.$ac_objext'
16844   { (eval echo "$as_me:16844: \"$ac_try\"") >&5
16845   (eval $ac_try) 2>&5
16846   ac_status=$?
16847   echo "$as_me:16847: \$? = $ac_status" >&5
16848   (exit $ac_status); }; }; then
16849   cf_cv_ncurses_ext_funcs=defined
16850 else
16851   echo "$as_me: failed program was:" >&5
16852 cat conftest.$ac_ext >&5
16853
16854 cat >conftest.$ac_ext <<_ACEOF
16855 #line 16855 "configure"
16856 #include "confdefs.h"
16857
16858 #include <${cf_cv_ncurses_header:-curses.h}>
16859 int
16860 main (void)
16861 {
16862
16863         (void) assume_default_colors (0, 0);
16864         (void) curses_version ();
16865         (void) define_key (0, 0);
16866         (void) is_term_resized (0, 0);
16867         (void) key_defined (0);
16868         (void) keybound (0, 0);
16869         (void) keyok (0, 0);
16870         (void) resize_term (0, 0);
16871         (void) resizeterm (0, 0);
16872         (void) use_default_colors ();
16873         (void) use_extended_names (0);
16874         (void) wresize (0, 0, 0);
16875   ;
16876   return 0;
16877 }
16878 _ACEOF
16879 rm -f conftest.$ac_objext conftest$ac_exeext
16880 if { (eval echo "$as_me:16880: \"$ac_link\"") >&5
16881   (eval $ac_link) 2>&5
16882   ac_status=$?
16883   echo "$as_me:16883: \$? = $ac_status" >&5
16884   (exit $ac_status); } &&
16885          { ac_try='test -s conftest$ac_exeext'
16886   { (eval echo "$as_me:16886: \"$ac_try\"") >&5
16887   (eval $ac_try) 2>&5
16888   ac_status=$?
16889   echo "$as_me:16889: \$? = $ac_status" >&5
16890   (exit $ac_status); }; }; then
16891   cf_cv_ncurses_ext_funcs=yes
16892 else
16893   echo "$as_me: failed program was:" >&5
16894 cat conftest.$ac_ext >&5
16895 cf_cv_ncurses_ext_funcs=no
16896 fi
16897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16898
16899 fi
16900 rm -f conftest.$ac_objext conftest.$ac_ext
16901
16902 fi
16903 echo "$as_me:16903: result: $cf_cv_ncurses_ext_funcs" >&5
16904 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
16905 test "$cf_cv_ncurses_ext_funcs" = yes &&
16906 cat >>confdefs.h <<\EOF
16907 #define NCURSES_EXT_FUNCS 1
16908 EOF
16909
16910 if test "$cf_enable_widec" = yes
16911 then
16912         # workaround for systems with ncurses before 20111029, due to change of
16913         # feature test macro from _XPG5 to _XOPEN_SOURCE
16914         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
16915         then
16916                 cf_define_xpg5=no
16917                 echo "$as_me:16917: checking if _XPG5 should be defined to enable wide-characters" >&5
16918 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
16919
16920                 cat >conftest.$ac_ext <<_ACEOF
16921 #line 16921 "configure"
16922 #include "confdefs.h"
16923
16924 #include <${cf_cv_ncurses_header:-curses.h}>
16925 int
16926 main (void)
16927 {
16928 int x = _XPG5
16929   ;
16930   return 0;
16931 }
16932 _ACEOF
16933 rm -f conftest.$ac_objext
16934 if { (eval echo "$as_me:16934: \"$ac_compile\"") >&5
16935   (eval $ac_compile) 2>&5
16936   ac_status=$?
16937   echo "$as_me:16937: \$? = $ac_status" >&5
16938   (exit $ac_status); } &&
16939          { ac_try='test -s conftest.$ac_objext'
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   :
16946 else
16947   echo "$as_me: failed program was:" >&5
16948 cat conftest.$ac_ext >&5
16949 cf_save_cppflags="$CPPFLAGS"
16950                          CPPFLAGS="$CPPFLAGS -D_XPG5"
16951                          cat >conftest.$ac_ext <<_ACEOF
16952 #line 16952 "configure"
16953 #include "confdefs.h"
16954
16955 #include <${cf_cv_ncurses_header:-curses.h}>
16956 int
16957 main (void)
16958 {
16959 int x = _XPG5
16960   ;
16961   return 0;
16962 }
16963 _ACEOF
16964 rm -f conftest.$ac_objext
16965 if { (eval echo "$as_me:16965: \"$ac_compile\"") >&5
16966   (eval $ac_compile) 2>&5
16967   ac_status=$?
16968   echo "$as_me:16968: \$? = $ac_status" >&5
16969   (exit $ac_status); } &&
16970          { ac_try='test -s conftest.$ac_objext'
16971   { (eval echo "$as_me:16971: \"$ac_try\"") >&5
16972   (eval $ac_try) 2>&5
16973   ac_status=$?
16974   echo "$as_me:16974: \$? = $ac_status" >&5
16975   (exit $ac_status); }; }; then
16976   cf_define_xpg5=yes
16977 else
16978   echo "$as_me: failed program was:" >&5
16979 cat conftest.$ac_ext >&5
16980 fi
16981 rm -f conftest.$ac_objext conftest.$ac_ext
16982                          CPPFLAGS="$cf_save_cppflags"
16983 fi
16984 rm -f conftest.$ac_objext conftest.$ac_ext
16985                 echo "$as_me:16985: result: $cf_define_xpg5" >&5
16986 echo "${ECHO_T}$cf_define_xpg5" >&6
16987
16988                 if test "$cf_define_xpg5" = yes
16989                 then
16990                         CPPFLAGS="$CPPFLAGS -D_XPG5"
16991                 fi
16992         fi
16993
16994         echo "$as_me:16994: checking for wide-character functions" >&5
16995 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
16996 if test "${cf_cv_widechar_funcs+set}" = set; then
16997   echo $ECHO_N "(cached) $ECHO_C" >&6
16998 else
16999
17000         cat >conftest.$ac_ext <<_ACEOF
17001 #line 17001 "configure"
17002 #include "confdefs.h"
17003
17004 #include <${cf_cv_ncurses_header:-curses.h}>
17005 int
17006 main (void)
17007 {
17008
17009                 static wchar_t src_wchar[2];
17010                 static cchar_t dst_cchar;
17011                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
17012
17013   ;
17014   return 0;
17015 }
17016 _ACEOF
17017 rm -f conftest.$ac_objext conftest$ac_exeext
17018 if { (eval echo "$as_me:17018: \"$ac_link\"") >&5
17019   (eval $ac_link) 2>&5
17020   ac_status=$?
17021   echo "$as_me:17021: \$? = $ac_status" >&5
17022   (exit $ac_status); } &&
17023          { ac_try='test -s conftest$ac_exeext'
17024   { (eval echo "$as_me:17024: \"$ac_try\"") >&5
17025   (eval $ac_try) 2>&5
17026   ac_status=$?
17027   echo "$as_me:17027: \$? = $ac_status" >&5
17028   (exit $ac_status); }; }; then
17029   cf_cv_widechar_funcs=yes
17030 else
17031   echo "$as_me: failed program was:" >&5
17032 cat conftest.$ac_ext >&5
17033 cf_cv_widechar_funcs=no
17034 fi
17035 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17036
17037 fi
17038 echo "$as_me:17038: result: $cf_cv_widechar_funcs" >&5
17039 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
17040         if test "$cf_cv_widechar_funcs" != no ; then
17041
17042 cat >>confdefs.h <<\EOF
17043 #define USE_WIDEC_SUPPORT 1
17044 EOF
17045
17046         else
17047                 cat >>confdefs.h <<\EOF
17048 #define USE_WIDEC_SUPPORT 0
17049 EOF
17050
17051         fi
17052 else
17053         cat >>confdefs.h <<\EOF
17054 #define USE_WIDEC_SUPPORT 0
17055 EOF
17056
17057 fi
17058
17059 echo "$as_me:17059: checking if $cf_cv_screen library uses pthreads" >&5
17060 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
17061 if test "${cf_cv_use_pthreads+set}" = set; then
17062   echo $ECHO_N "(cached) $ECHO_C" >&6
17063 else
17064
17065 cat >conftest.$ac_ext <<_ACEOF
17066 #line 17066 "configure"
17067 #include "confdefs.h"
17068
17069 #include <${cf_cv_ncurses_header:-curses.h}>
17070 extern void _nc_init_pthreads(void);
17071
17072 int
17073 main (void)
17074 {
17075
17076         initscr();
17077         _nc_init_pthreads();
17078
17079   ;
17080   return 0;
17081 }
17082 _ACEOF
17083 rm -f conftest.$ac_objext conftest$ac_exeext
17084 if { (eval echo "$as_me:17084: \"$ac_link\"") >&5
17085   (eval $ac_link) 2>&5
17086   ac_status=$?
17087   echo "$as_me:17087: \$? = $ac_status" >&5
17088   (exit $ac_status); } &&
17089          { ac_try='test -s conftest$ac_exeext'
17090   { (eval echo "$as_me:17090: \"$ac_try\"") >&5
17091   (eval $ac_try) 2>&5
17092   ac_status=$?
17093   echo "$as_me:17093: \$? = $ac_status" >&5
17094   (exit $ac_status); }; }; then
17095   cf_cv_use_pthreads=yes
17096 else
17097   echo "$as_me: failed program was:" >&5
17098 cat conftest.$ac_ext >&5
17099 cf_cv_use_pthreads=no
17100 fi
17101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17102
17103 fi
17104 echo "$as_me:17104: result: $cf_cv_use_pthreads" >&5
17105 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
17106 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
17107 #define USE_PTHREADS 1
17108 EOF
17109
17110 echo "$as_me:17110: checking if sys/time.h works with sys/select.h" >&5
17111 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
17112 if test "${cf_cv_sys_time_select+set}" = set; then
17113   echo $ECHO_N "(cached) $ECHO_C" >&6
17114 else
17115
17116 cat >conftest.$ac_ext <<_ACEOF
17117 #line 17117 "configure"
17118 #include "confdefs.h"
17119
17120 #include <sys/types.h>
17121 #ifdef HAVE_SYS_TIME_H
17122 #include <sys/time.h>
17123 #endif
17124 #ifdef HAVE_SYS_SELECT_H
17125 #include <sys/select.h>
17126 #endif
17127
17128 int
17129 main (void)
17130 {
17131
17132   ;
17133   return 0;
17134 }
17135 _ACEOF
17136 rm -f conftest.$ac_objext
17137 if { (eval echo "$as_me:17137: \"$ac_compile\"") >&5
17138   (eval $ac_compile) 2>&5
17139   ac_status=$?
17140   echo "$as_me:17140: \$? = $ac_status" >&5
17141   (exit $ac_status); } &&
17142          { ac_try='test -s conftest.$ac_objext'
17143   { (eval echo "$as_me:17143: \"$ac_try\"") >&5
17144   (eval $ac_try) 2>&5
17145   ac_status=$?
17146   echo "$as_me:17146: \$? = $ac_status" >&5
17147   (exit $ac_status); }; }; then
17148   cf_cv_sys_time_select=yes
17149 else
17150   echo "$as_me: failed program was:" >&5
17151 cat conftest.$ac_ext >&5
17152 cf_cv_sys_time_select=no
17153 fi
17154 rm -f conftest.$ac_objext conftest.$ac_ext
17155
17156 fi
17157
17158 echo "$as_me:17158: result: $cf_cv_sys_time_select" >&5
17159 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
17160 test "$cf_cv_sys_time_select" = yes &&
17161 cat >>confdefs.h <<\EOF
17162 #define HAVE_SYS_TIME_SELECT 1
17163 EOF
17164
17165 # special check for test/ditto.c
17166
17167 echo "$as_me:17167: checking for openpty in -lutil" >&5
17168 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
17169 if test "${ac_cv_lib_util_openpty+set}" = set; then
17170   echo $ECHO_N "(cached) $ECHO_C" >&6
17171 else
17172   ac_check_lib_save_LIBS=$LIBS
17173 LIBS="-lutil  $LIBS"
17174 cat >conftest.$ac_ext <<_ACEOF
17175 #line 17175 "configure"
17176 #include "confdefs.h"
17177
17178 /* Override any gcc2 internal prototype to avoid an error.  */
17179 #ifdef __cplusplus
17180 extern "C"
17181 #endif
17182 /* We use char because int might match the return type of a gcc2
17183    builtin and then its argument prototype would still apply.  */
17184 char openpty ();
17185 int
17186 main (void)
17187 {
17188 openpty ();
17189   ;
17190   return 0;
17191 }
17192 _ACEOF
17193 rm -f conftest.$ac_objext conftest$ac_exeext
17194 if { (eval echo "$as_me:17194: \"$ac_link\"") >&5
17195   (eval $ac_link) 2>&5
17196   ac_status=$?
17197   echo "$as_me:17197: \$? = $ac_status" >&5
17198   (exit $ac_status); } &&
17199          { ac_try='test -s conftest$ac_exeext'
17200   { (eval echo "$as_me:17200: \"$ac_try\"") >&5
17201   (eval $ac_try) 2>&5
17202   ac_status=$?
17203   echo "$as_me:17203: \$? = $ac_status" >&5
17204   (exit $ac_status); }; }; then
17205   ac_cv_lib_util_openpty=yes
17206 else
17207   echo "$as_me: failed program was:" >&5
17208 cat conftest.$ac_ext >&5
17209 ac_cv_lib_util_openpty=no
17210 fi
17211 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17212 LIBS=$ac_check_lib_save_LIBS
17213 fi
17214 echo "$as_me:17214: result: $ac_cv_lib_util_openpty" >&5
17215 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
17216 if test $ac_cv_lib_util_openpty = yes; then
17217   cf_cv_lib_util=yes
17218 else
17219   cf_cv_lib_util=no
17220 fi
17221
17222 echo "$as_me:17222: checking for openpty header" >&5
17223 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
17224 if test "${cf_cv_func_openpty+set}" = set; then
17225   echo $ECHO_N "(cached) $ECHO_C" >&6
17226 else
17227
17228         cf_save_LIBS="$LIBS"
17229         test $cf_cv_lib_util = yes && {
17230 cf_add_libs="-lutil"
17231 # Filter out duplicates - this happens with badly-designed ".pc" files...
17232 for cf_add_1lib in $LIBS
17233 do
17234         for cf_add_2lib in $cf_add_libs
17235         do
17236                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17237                 then
17238                         cf_add_1lib=
17239                         break
17240                 fi
17241         done
17242         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17243 done
17244 LIBS="$cf_add_libs"
17245  }
17246         for cf_header in pty.h libutil.h util.h
17247         do
17248         cat >conftest.$ac_ext <<_ACEOF
17249 #line 17249 "configure"
17250 #include "confdefs.h"
17251
17252 #include <$cf_header>
17253
17254 int
17255 main (void)
17256 {
17257
17258         int x = openpty((int *)0, (int *)0, (char *)0,
17259                                    (struct termios *)0, (struct winsize *)0);
17260
17261   ;
17262   return 0;
17263 }
17264 _ACEOF
17265 rm -f conftest.$ac_objext conftest$ac_exeext
17266 if { (eval echo "$as_me:17266: \"$ac_link\"") >&5
17267   (eval $ac_link) 2>&5
17268   ac_status=$?
17269   echo "$as_me:17269: \$? = $ac_status" >&5
17270   (exit $ac_status); } &&
17271          { ac_try='test -s conftest$ac_exeext'
17272   { (eval echo "$as_me:17272: \"$ac_try\"") >&5
17273   (eval $ac_try) 2>&5
17274   ac_status=$?
17275   echo "$as_me:17275: \$? = $ac_status" >&5
17276   (exit $ac_status); }; }; then
17277
17278                 cf_cv_func_openpty=$cf_header
17279                 break
17280
17281 else
17282   echo "$as_me: failed program was:" >&5
17283 cat conftest.$ac_ext >&5
17284
17285                 cf_cv_func_openpty=no
17286
17287 fi
17288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17289         done
17290         LIBS="$cf_save_LIBS"
17291
17292 fi
17293 echo "$as_me:17293: result: $cf_cv_func_openpty" >&5
17294 echo "${ECHO_T}$cf_cv_func_openpty" >&6
17295
17296 if test "$cf_cv_func_openpty" != no ; then
17297
17298 cat >>confdefs.h <<EOF
17299 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
17300 EOF
17301
17302 cat >>confdefs.h <<\EOF
17303 #define USE_XTERM_PTY 1
17304 EOF
17305
17306         if test "x$cf_cv_lib_util" = xyes ; then
17307
17308 cf_add_libs="-lutil"
17309 # Filter out duplicates - this happens with badly-designed ".pc" files...
17310 for cf_add_1lib in $TEST_LIBS
17311 do
17312         for cf_add_2lib in $cf_add_libs
17313         do
17314                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17315                 then
17316                         cf_add_1lib=
17317                         break
17318                 fi
17319         done
17320         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17321 done
17322 TEST_LIBS="$cf_add_libs"
17323
17324         fi
17325 fi
17326
17327 echo "$as_me:17327: checking for function curses_version" >&5
17328 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
17329 if test "${cf_cv_func_curses_version+set}" = set; then
17330   echo $ECHO_N "(cached) $ECHO_C" >&6
17331 else
17332
17333 if test "$cross_compiling" = yes; then
17334   cf_cv_func_curses_version=unknown
17335 else
17336   cat >conftest.$ac_ext <<_ACEOF
17337 #line 17337 "configure"
17338 #include "confdefs.h"
17339
17340 #include <${cf_cv_ncurses_header:-curses.h}>
17341 int main(void)
17342 {
17343         char temp[1024];
17344         sprintf(temp, "%s\n", curses_version());
17345         ${cf_cv_main_return:-return}(0);
17346 }
17347
17348 _ACEOF
17349 rm -f conftest$ac_exeext
17350 if { (eval echo "$as_me:17350: \"$ac_link\"") >&5
17351   (eval $ac_link) 2>&5
17352   ac_status=$?
17353   echo "$as_me:17353: \$? = $ac_status" >&5
17354   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
17355   { (eval echo "$as_me:17355: \"$ac_try\"") >&5
17356   (eval $ac_try) 2>&5
17357   ac_status=$?
17358   echo "$as_me:17358: \$? = $ac_status" >&5
17359   (exit $ac_status); }; }; then
17360   cf_cv_func_curses_version=yes
17361
17362 else
17363   echo "$as_me: program exited with status $ac_status" >&5
17364 echo "$as_me: failed program was:" >&5
17365 cat conftest.$ac_ext >&5
17366 cf_cv_func_curses_version=no
17367
17368 fi
17369 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
17370 fi
17371 rm -f core
17372 fi
17373 echo "$as_me:17373: result: $cf_cv_func_curses_version" >&5
17374 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
17375 test "$cf_cv_func_curses_version" = yes &&
17376 cat >>confdefs.h <<\EOF
17377 #define HAVE_CURSES_VERSION 1
17378 EOF
17379
17380 echo "$as_me:17380: checking for alternate character set array" >&5
17381 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
17382 if test "${cf_cv_curses_acs_map+set}" = set; then
17383   echo $ECHO_N "(cached) $ECHO_C" >&6
17384 else
17385
17386 cf_cv_curses_acs_map=unknown
17387 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
17388 do
17389 cat >conftest.$ac_ext <<_ACEOF
17390 #line 17390 "configure"
17391 #include "confdefs.h"
17392
17393 #include <${cf_cv_ncurses_header:-curses.h}>
17394
17395 int
17396 main (void)
17397 {
17398
17399 $name['k'] = ACS_PLUS
17400
17401   ;
17402   return 0;
17403 }
17404 _ACEOF
17405 rm -f conftest.$ac_objext conftest$ac_exeext
17406 if { (eval echo "$as_me:17406: \"$ac_link\"") >&5
17407   (eval $ac_link) 2>&5
17408   ac_status=$?
17409   echo "$as_me:17409: \$? = $ac_status" >&5
17410   (exit $ac_status); } &&
17411          { ac_try='test -s conftest$ac_exeext'
17412   { (eval echo "$as_me:17412: \"$ac_try\"") >&5
17413   (eval $ac_try) 2>&5
17414   ac_status=$?
17415   echo "$as_me:17415: \$? = $ac_status" >&5
17416   (exit $ac_status); }; }; then
17417   cf_cv_curses_acs_map=$name; break
17418 else
17419   echo "$as_me: failed program was:" >&5
17420 cat conftest.$ac_ext >&5
17421 fi
17422 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17423 done
17424
17425 fi
17426 echo "$as_me:17426: result: $cf_cv_curses_acs_map" >&5
17427 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
17428
17429 test "$cf_cv_curses_acs_map" != unknown &&
17430 cat >>confdefs.h <<EOF
17431 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
17432 EOF
17433
17434 if test "$cf_enable_widec" = yes; then
17435
17436 echo "$as_me:17436: checking for wide alternate character set array" >&5
17437 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
17438 if test "${cf_cv_curses_wacs_map+set}" = set; then
17439   echo $ECHO_N "(cached) $ECHO_C" >&6
17440 else
17441
17442         cf_cv_curses_wacs_map=unknown
17443         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
17444         do
17445         cat >conftest.$ac_ext <<_ACEOF
17446 #line 17446 "configure"
17447 #include "confdefs.h"
17448
17449 #ifndef _XOPEN_SOURCE_EXTENDED
17450 #define _XOPEN_SOURCE_EXTENDED
17451 #endif
17452 #include <${cf_cv_ncurses_header:-curses.h}>
17453 int
17454 main (void)
17455 {
17456 void *foo = &($name['k'])
17457   ;
17458   return 0;
17459 }
17460 _ACEOF
17461 rm -f conftest.$ac_objext conftest$ac_exeext
17462 if { (eval echo "$as_me:17462: \"$ac_link\"") >&5
17463   (eval $ac_link) 2>&5
17464   ac_status=$?
17465   echo "$as_me:17465: \$? = $ac_status" >&5
17466   (exit $ac_status); } &&
17467          { ac_try='test -s conftest$ac_exeext'
17468   { (eval echo "$as_me:17468: \"$ac_try\"") >&5
17469   (eval $ac_try) 2>&5
17470   ac_status=$?
17471   echo "$as_me:17471: \$? = $ac_status" >&5
17472   (exit $ac_status); }; }; then
17473   cf_cv_curses_wacs_map=$name
17474          break
17475 else
17476   echo "$as_me: failed program was:" >&5
17477 cat conftest.$ac_ext >&5
17478 fi
17479 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17480         done
17481 fi
17482 echo "$as_me:17482: result: $cf_cv_curses_wacs_map" >&5
17483 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
17484
17485 test "$cf_cv_curses_wacs_map" != unknown &&
17486 cat >>confdefs.h <<EOF
17487 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
17488 EOF
17489
17490 echo "$as_me:17490: checking for wide alternate character constants" >&5
17491 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
17492 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
17493   echo $ECHO_N "(cached) $ECHO_C" >&6
17494 else
17495
17496 cf_cv_curses_wacs_symbols=no
17497 if test "$cf_cv_curses_wacs_map" != unknown
17498 then
17499         cat >conftest.$ac_ext <<_ACEOF
17500 #line 17500 "configure"
17501 #include "confdefs.h"
17502
17503 #ifndef _XOPEN_SOURCE_EXTENDED
17504 #define _XOPEN_SOURCE_EXTENDED
17505 #endif
17506 #include <${cf_cv_ncurses_header:-curses.h}>
17507 int
17508 main (void)
17509 {
17510 cchar_t *foo = WACS_PLUS;
17511          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
17512   ;
17513   return 0;
17514 }
17515 _ACEOF
17516 rm -f conftest.$ac_objext conftest$ac_exeext
17517 if { (eval echo "$as_me:17517: \"$ac_link\"") >&5
17518   (eval $ac_link) 2>&5
17519   ac_status=$?
17520   echo "$as_me:17520: \$? = $ac_status" >&5
17521   (exit $ac_status); } &&
17522          { ac_try='test -s conftest$ac_exeext'
17523   { (eval echo "$as_me:17523: \"$ac_try\"") >&5
17524   (eval $ac_try) 2>&5
17525   ac_status=$?
17526   echo "$as_me:17526: \$? = $ac_status" >&5
17527   (exit $ac_status); }; }; then
17528   cf_cv_curses_wacs_symbols=yes
17529 else
17530   echo "$as_me: failed program was:" >&5
17531 cat conftest.$ac_ext >&5
17532 fi
17533 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17534 else
17535         cat >conftest.$ac_ext <<_ACEOF
17536 #line 17536 "configure"
17537 #include "confdefs.h"
17538
17539 #ifndef _XOPEN_SOURCE_EXTENDED
17540 #define _XOPEN_SOURCE_EXTENDED
17541 #endif
17542 #include <${cf_cv_ncurses_header:-curses.h}>
17543 int
17544 main (void)
17545 {
17546 cchar_t *foo = WACS_PLUS
17547   ;
17548   return 0;
17549 }
17550 _ACEOF
17551 rm -f conftest.$ac_objext conftest$ac_exeext
17552 if { (eval echo "$as_me:17552: \"$ac_link\"") >&5
17553   (eval $ac_link) 2>&5
17554   ac_status=$?
17555   echo "$as_me:17555: \$? = $ac_status" >&5
17556   (exit $ac_status); } &&
17557          { ac_try='test -s conftest$ac_exeext'
17558   { (eval echo "$as_me:17558: \"$ac_try\"") >&5
17559   (eval $ac_try) 2>&5
17560   ac_status=$?
17561   echo "$as_me:17561: \$? = $ac_status" >&5
17562   (exit $ac_status); }; }; then
17563   cf_cv_curses_wacs_symbols=yes
17564 else
17565   echo "$as_me: failed program was:" >&5
17566 cat conftest.$ac_ext >&5
17567 fi
17568 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17569 fi
17570
17571 fi
17572 echo "$as_me:17572: result: $cf_cv_curses_wacs_symbols" >&5
17573 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
17574
17575 test "$cf_cv_curses_wacs_symbols" != no &&
17576 cat >>confdefs.h <<\EOF
17577 #define CURSES_WACS_SYMBOLS 1
17578 EOF
17579
17580 fi
17581
17582 echo "$as_me:17582: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17583 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17584 cat >conftest.$ac_ext <<_ACEOF
17585 #line 17585 "configure"
17586 #include "confdefs.h"
17587
17588 #ifndef _XOPEN_SOURCE_EXTENDED
17589 #define _XOPEN_SOURCE_EXTENDED
17590 #endif
17591 #include <${cf_cv_ncurses_header:-curses.h}>
17592 int
17593 main (void)
17594 {
17595
17596 attr_t foo
17597
17598   ;
17599   return 0;
17600 }
17601 _ACEOF
17602 rm -f conftest.$ac_objext
17603 if { (eval echo "$as_me:17603: \"$ac_compile\"") >&5
17604   (eval $ac_compile) 2>&5
17605   ac_status=$?
17606   echo "$as_me:17606: \$? = $ac_status" >&5
17607   (exit $ac_status); } &&
17608          { ac_try='test -s conftest.$ac_objext'
17609   { (eval echo "$as_me:17609: \"$ac_try\"") >&5
17610   (eval $ac_try) 2>&5
17611   ac_status=$?
17612   echo "$as_me:17612: \$? = $ac_status" >&5
17613   (exit $ac_status); }; }; then
17614   cf_result=yes
17615 else
17616   echo "$as_me: failed program was:" >&5
17617 cat conftest.$ac_ext >&5
17618 cf_result=no
17619 fi
17620 rm -f conftest.$ac_objext conftest.$ac_ext
17621 echo "$as_me:17621: result: $cf_result" >&5
17622 echo "${ECHO_T}$cf_result" >&6
17623 if test $cf_result = yes ; then
17624
17625 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17626
17627 cat >>confdefs.h <<EOF
17628 #define $cf_result 1
17629 EOF
17630
17631 else
17632
17633 cat >>confdefs.h <<EOF
17634 #define attr_t long
17635 EOF
17636
17637 fi
17638
17639 if test "$cf_enable_widec" = yes; then
17640
17641 # This is needed on Tru64 5.0 to declare mbstate_t
17642 echo "$as_me:17642: checking if we must include wchar.h to declare mbstate_t" >&5
17643 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
17644 if test "${cf_cv_mbstate_t+set}" = set; then
17645   echo $ECHO_N "(cached) $ECHO_C" >&6
17646 else
17647
17648 cat >conftest.$ac_ext <<_ACEOF
17649 #line 17649 "configure"
17650 #include "confdefs.h"
17651
17652 #include <stdlib.h>
17653 #include <stdarg.h>
17654 #include <stdio.h>
17655 #ifdef HAVE_LIBUTF8_H
17656 #include <libutf8.h>
17657 #endif
17658 int
17659 main (void)
17660 {
17661 mbstate_t state
17662   ;
17663   return 0;
17664 }
17665 _ACEOF
17666 rm -f conftest.$ac_objext
17667 if { (eval echo "$as_me:17667: \"$ac_compile\"") >&5
17668   (eval $ac_compile) 2>&5
17669   ac_status=$?
17670   echo "$as_me:17670: \$? = $ac_status" >&5
17671   (exit $ac_status); } &&
17672          { ac_try='test -s conftest.$ac_objext'
17673   { (eval echo "$as_me:17673: \"$ac_try\"") >&5
17674   (eval $ac_try) 2>&5
17675   ac_status=$?
17676   echo "$as_me:17676: \$? = $ac_status" >&5
17677   (exit $ac_status); }; }; then
17678   cf_cv_mbstate_t=no
17679 else
17680   echo "$as_me: failed program was:" >&5
17681 cat conftest.$ac_ext >&5
17682 cat >conftest.$ac_ext <<_ACEOF
17683 #line 17683 "configure"
17684 #include "confdefs.h"
17685
17686 #include <stdlib.h>
17687 #include <stdarg.h>
17688 #include <stdio.h>
17689 #include <wchar.h>
17690 #ifdef HAVE_LIBUTF8_H
17691 #include <libutf8.h>
17692 #endif
17693 int
17694 main (void)
17695 {
17696 mbstate_t value
17697   ;
17698   return 0;
17699 }
17700 _ACEOF
17701 rm -f conftest.$ac_objext
17702 if { (eval echo "$as_me:17702: \"$ac_compile\"") >&5
17703   (eval $ac_compile) 2>&5
17704   ac_status=$?
17705   echo "$as_me:17705: \$? = $ac_status" >&5
17706   (exit $ac_status); } &&
17707          { ac_try='test -s conftest.$ac_objext'
17708   { (eval echo "$as_me:17708: \"$ac_try\"") >&5
17709   (eval $ac_try) 2>&5
17710   ac_status=$?
17711   echo "$as_me:17711: \$? = $ac_status" >&5
17712   (exit $ac_status); }; }; then
17713   cf_cv_mbstate_t=yes
17714 else
17715   echo "$as_me: failed program was:" >&5
17716 cat conftest.$ac_ext >&5
17717 cf_cv_mbstate_t=unknown
17718 fi
17719 rm -f conftest.$ac_objext conftest.$ac_ext
17720 fi
17721 rm -f conftest.$ac_objext conftest.$ac_ext
17722 fi
17723 echo "$as_me:17723: result: $cf_cv_mbstate_t" >&5
17724 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
17725
17726 if test "$cf_cv_mbstate_t" = yes ; then
17727
17728 cat >>confdefs.h <<\EOF
17729 #define NEED_WCHAR_H 1
17730 EOF
17731
17732         NEED_WCHAR_H=1
17733 fi
17734
17735 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
17736 if test "$cf_cv_mbstate_t" = unknown ; then
17737         NCURSES_MBSTATE_T=1
17738 fi
17739
17740 # if we find mbstate_t in either place, use substitution to provide a fallback.
17741 if test "$cf_cv_mbstate_t" != unknown ; then
17742         NCURSES_OK_MBSTATE_T=1
17743 fi
17744
17745 # This is needed on Tru64 5.0 to declare wchar_t
17746 echo "$as_me:17746: checking if we must include wchar.h to declare wchar_t" >&5
17747 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
17748 if test "${cf_cv_wchar_t+set}" = set; then
17749   echo $ECHO_N "(cached) $ECHO_C" >&6
17750 else
17751
17752 cat >conftest.$ac_ext <<_ACEOF
17753 #line 17753 "configure"
17754 #include "confdefs.h"
17755
17756 #include <stdlib.h>
17757 #include <stdarg.h>
17758 #include <stdio.h>
17759 #ifdef HAVE_LIBUTF8_H
17760 #include <libutf8.h>
17761 #endif
17762 int
17763 main (void)
17764 {
17765 wchar_t state
17766   ;
17767   return 0;
17768 }
17769 _ACEOF
17770 rm -f conftest.$ac_objext
17771 if { (eval echo "$as_me:17771: \"$ac_compile\"") >&5
17772   (eval $ac_compile) 2>&5
17773   ac_status=$?
17774   echo "$as_me:17774: \$? = $ac_status" >&5
17775   (exit $ac_status); } &&
17776          { ac_try='test -s conftest.$ac_objext'
17777   { (eval echo "$as_me:17777: \"$ac_try\"") >&5
17778   (eval $ac_try) 2>&5
17779   ac_status=$?
17780   echo "$as_me:17780: \$? = $ac_status" >&5
17781   (exit $ac_status); }; }; then
17782   cf_cv_wchar_t=no
17783 else
17784   echo "$as_me: failed program was:" >&5
17785 cat conftest.$ac_ext >&5
17786 cat >conftest.$ac_ext <<_ACEOF
17787 #line 17787 "configure"
17788 #include "confdefs.h"
17789
17790 #include <stdlib.h>
17791 #include <stdarg.h>
17792 #include <stdio.h>
17793 #include <wchar.h>
17794 #ifdef HAVE_LIBUTF8_H
17795 #include <libutf8.h>
17796 #endif
17797 int
17798 main (void)
17799 {
17800 wchar_t value
17801   ;
17802   return 0;
17803 }
17804 _ACEOF
17805 rm -f conftest.$ac_objext
17806 if { (eval echo "$as_me:17806: \"$ac_compile\"") >&5
17807   (eval $ac_compile) 2>&5
17808   ac_status=$?
17809   echo "$as_me:17809: \$? = $ac_status" >&5
17810   (exit $ac_status); } &&
17811          { ac_try='test -s conftest.$ac_objext'
17812   { (eval echo "$as_me:17812: \"$ac_try\"") >&5
17813   (eval $ac_try) 2>&5
17814   ac_status=$?
17815   echo "$as_me:17815: \$? = $ac_status" >&5
17816   (exit $ac_status); }; }; then
17817   cf_cv_wchar_t=yes
17818 else
17819   echo "$as_me: failed program was:" >&5
17820 cat conftest.$ac_ext >&5
17821 cf_cv_wchar_t=unknown
17822 fi
17823 rm -f conftest.$ac_objext conftest.$ac_ext
17824 fi
17825 rm -f conftest.$ac_objext conftest.$ac_ext
17826 fi
17827 echo "$as_me:17827: result: $cf_cv_wchar_t" >&5
17828 echo "${ECHO_T}$cf_cv_wchar_t" >&6
17829
17830 if test "$cf_cv_wchar_t" = yes ; then
17831
17832 cat >>confdefs.h <<\EOF
17833 #define NEED_WCHAR_H 1
17834 EOF
17835
17836         NEED_WCHAR_H=1
17837 fi
17838
17839 # if we do not find wchar_t in either place, use substitution to provide a fallback.
17840 if test "$cf_cv_wchar_t" = unknown ; then
17841         NCURSES_WCHAR_T=1
17842 fi
17843
17844 # if we find wchar_t in either place, use substitution to provide a fallback.
17845 if test "$cf_cv_wchar_t" != unknown ; then
17846         NCURSES_OK_WCHAR_T=1
17847 fi
17848
17849 # This is needed on Tru64 5.0 to declare wint_t
17850 echo "$as_me:17850: checking if we must include wchar.h to declare wint_t" >&5
17851 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
17852 if test "${cf_cv_wint_t+set}" = set; then
17853   echo $ECHO_N "(cached) $ECHO_C" >&6
17854 else
17855
17856 cat >conftest.$ac_ext <<_ACEOF
17857 #line 17857 "configure"
17858 #include "confdefs.h"
17859
17860 #include <stdlib.h>
17861 #include <stdarg.h>
17862 #include <stdio.h>
17863 #ifdef HAVE_LIBUTF8_H
17864 #include <libutf8.h>
17865 #endif
17866 int
17867 main (void)
17868 {
17869 wint_t state
17870   ;
17871   return 0;
17872 }
17873 _ACEOF
17874 rm -f conftest.$ac_objext
17875 if { (eval echo "$as_me:17875: \"$ac_compile\"") >&5
17876   (eval $ac_compile) 2>&5
17877   ac_status=$?
17878   echo "$as_me:17878: \$? = $ac_status" >&5
17879   (exit $ac_status); } &&
17880          { ac_try='test -s conftest.$ac_objext'
17881   { (eval echo "$as_me:17881: \"$ac_try\"") >&5
17882   (eval $ac_try) 2>&5
17883   ac_status=$?
17884   echo "$as_me:17884: \$? = $ac_status" >&5
17885   (exit $ac_status); }; }; then
17886   cf_cv_wint_t=no
17887 else
17888   echo "$as_me: failed program was:" >&5
17889 cat conftest.$ac_ext >&5
17890 cat >conftest.$ac_ext <<_ACEOF
17891 #line 17891 "configure"
17892 #include "confdefs.h"
17893
17894 #include <stdlib.h>
17895 #include <stdarg.h>
17896 #include <stdio.h>
17897 #include <wchar.h>
17898 #ifdef HAVE_LIBUTF8_H
17899 #include <libutf8.h>
17900 #endif
17901 int
17902 main (void)
17903 {
17904 wint_t value
17905   ;
17906   return 0;
17907 }
17908 _ACEOF
17909 rm -f conftest.$ac_objext
17910 if { (eval echo "$as_me:17910: \"$ac_compile\"") >&5
17911   (eval $ac_compile) 2>&5
17912   ac_status=$?
17913   echo "$as_me:17913: \$? = $ac_status" >&5
17914   (exit $ac_status); } &&
17915          { ac_try='test -s conftest.$ac_objext'
17916   { (eval echo "$as_me:17916: \"$ac_try\"") >&5
17917   (eval $ac_try) 2>&5
17918   ac_status=$?
17919   echo "$as_me:17919: \$? = $ac_status" >&5
17920   (exit $ac_status); }; }; then
17921   cf_cv_wint_t=yes
17922 else
17923   echo "$as_me: failed program was:" >&5
17924 cat conftest.$ac_ext >&5
17925 cf_cv_wint_t=unknown
17926 fi
17927 rm -f conftest.$ac_objext conftest.$ac_ext
17928 fi
17929 rm -f conftest.$ac_objext conftest.$ac_ext
17930 fi
17931 echo "$as_me:17931: result: $cf_cv_wint_t" >&5
17932 echo "${ECHO_T}$cf_cv_wint_t" >&6
17933
17934 if test "$cf_cv_wint_t" = yes ; then
17935
17936 cat >>confdefs.h <<\EOF
17937 #define NEED_WCHAR_H 1
17938 EOF
17939
17940         NEED_WCHAR_H=1
17941 fi
17942
17943 # if we do not find wint_t in either place, use substitution to provide a fallback.
17944 if test "$cf_cv_wint_t" = unknown ; then
17945         NCURSES_WINT_T=1
17946 fi
17947
17948 # if we find wint_t in either place, use substitution to provide a fallback.
17949 if test "$cf_cv_wint_t" != unknown ; then
17950         NCURSES_OK_WINT_T=1
17951 fi
17952
17953         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
17954
17955 echo "$as_me:17955: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
17956 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
17957 cat >conftest.$ac_ext <<_ACEOF
17958 #line 17958 "configure"
17959 #include "confdefs.h"
17960
17961 #ifndef _XOPEN_SOURCE_EXTENDED
17962 #define _XOPEN_SOURCE_EXTENDED
17963 #endif
17964 #include <${cf_cv_ncurses_header:-curses.h}>
17965 int
17966 main (void)
17967 {
17968
17969 mbstate_t foo
17970
17971   ;
17972   return 0;
17973 }
17974 _ACEOF
17975 rm -f conftest.$ac_objext
17976 if { (eval echo "$as_me:17976: \"$ac_compile\"") >&5
17977   (eval $ac_compile) 2>&5
17978   ac_status=$?
17979   echo "$as_me:17979: \$? = $ac_status" >&5
17980   (exit $ac_status); } &&
17981          { ac_try='test -s conftest.$ac_objext'
17982   { (eval echo "$as_me:17982: \"$ac_try\"") >&5
17983   (eval $ac_try) 2>&5
17984   ac_status=$?
17985   echo "$as_me:17985: \$? = $ac_status" >&5
17986   (exit $ac_status); }; }; then
17987   cf_result=yes
17988 else
17989   echo "$as_me: failed program was:" >&5
17990 cat conftest.$ac_ext >&5
17991 cf_result=no
17992 fi
17993 rm -f conftest.$ac_objext conftest.$ac_ext
17994 echo "$as_me:17994: result: $cf_result" >&5
17995 echo "${ECHO_T}$cf_result" >&6
17996 if test $cf_result = yes ; then
17997
17998 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17999
18000 cat >>confdefs.h <<EOF
18001 #define $cf_result 1
18002 EOF
18003
18004 else
18005
18006 cat >>confdefs.h <<EOF
18007 #define mbstate_t long
18008 EOF
18009
18010 fi
18011
18012         fi
18013
18014         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
18015
18016 echo "$as_me:18016: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18017 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18018 cat >conftest.$ac_ext <<_ACEOF
18019 #line 18019 "configure"
18020 #include "confdefs.h"
18021
18022 #ifndef _XOPEN_SOURCE_EXTENDED
18023 #define _XOPEN_SOURCE_EXTENDED
18024 #endif
18025 #include <${cf_cv_ncurses_header:-curses.h}>
18026 int
18027 main (void)
18028 {
18029
18030 wchar_t foo
18031
18032   ;
18033   return 0;
18034 }
18035 _ACEOF
18036 rm -f conftest.$ac_objext
18037 if { (eval echo "$as_me:18037: \"$ac_compile\"") >&5
18038   (eval $ac_compile) 2>&5
18039   ac_status=$?
18040   echo "$as_me:18040: \$? = $ac_status" >&5
18041   (exit $ac_status); } &&
18042          { ac_try='test -s conftest.$ac_objext'
18043   { (eval echo "$as_me:18043: \"$ac_try\"") >&5
18044   (eval $ac_try) 2>&5
18045   ac_status=$?
18046   echo "$as_me:18046: \$? = $ac_status" >&5
18047   (exit $ac_status); }; }; then
18048   cf_result=yes
18049 else
18050   echo "$as_me: failed program was:" >&5
18051 cat conftest.$ac_ext >&5
18052 cf_result=no
18053 fi
18054 rm -f conftest.$ac_objext conftest.$ac_ext
18055 echo "$as_me:18055: result: $cf_result" >&5
18056 echo "${ECHO_T}$cf_result" >&6
18057 if test $cf_result = yes ; then
18058
18059 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18060
18061 cat >>confdefs.h <<EOF
18062 #define $cf_result 1
18063 EOF
18064
18065 else
18066
18067 cat >>confdefs.h <<EOF
18068 #define wchar_t long
18069 EOF
18070
18071 fi
18072
18073         fi
18074
18075         if test "$NCURSES_OK_WINT_T" = 0 ; then
18076
18077 echo "$as_me:18077: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18078 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18079 cat >conftest.$ac_ext <<_ACEOF
18080 #line 18080 "configure"
18081 #include "confdefs.h"
18082
18083 #ifndef _XOPEN_SOURCE_EXTENDED
18084 #define _XOPEN_SOURCE_EXTENDED
18085 #endif
18086 #include <${cf_cv_ncurses_header:-curses.h}>
18087 int
18088 main (void)
18089 {
18090
18091 wint_t foo
18092
18093   ;
18094   return 0;
18095 }
18096 _ACEOF
18097 rm -f conftest.$ac_objext
18098 if { (eval echo "$as_me:18098: \"$ac_compile\"") >&5
18099   (eval $ac_compile) 2>&5
18100   ac_status=$?
18101   echo "$as_me:18101: \$? = $ac_status" >&5
18102   (exit $ac_status); } &&
18103          { ac_try='test -s conftest.$ac_objext'
18104   { (eval echo "$as_me:18104: \"$ac_try\"") >&5
18105   (eval $ac_try) 2>&5
18106   ac_status=$?
18107   echo "$as_me:18107: \$? = $ac_status" >&5
18108   (exit $ac_status); }; }; then
18109   cf_result=yes
18110 else
18111   echo "$as_me: failed program was:" >&5
18112 cat conftest.$ac_ext >&5
18113 cf_result=no
18114 fi
18115 rm -f conftest.$ac_objext conftest.$ac_ext
18116 echo "$as_me:18116: result: $cf_result" >&5
18117 echo "${ECHO_T}$cf_result" >&6
18118 if test $cf_result = yes ; then
18119
18120 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18121
18122 cat >>confdefs.h <<EOF
18123 #define $cf_result 1
18124 EOF
18125
18126 else
18127
18128 cat >>confdefs.h <<EOF
18129 #define wint_t long
18130 EOF
18131
18132 fi
18133
18134         fi
18135 fi
18136
18137 for cf_data in \
18138 curscr \
18139 ospeed \
18140 boolnames \
18141 boolfnames \
18142 ttytype
18143 do
18144 echo "$as_me:18144: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
18145 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18146
18147 cat >conftest.$ac_ext <<_ACEOF
18148 #line 18148 "configure"
18149 #include "confdefs.h"
18150
18151 #ifdef HAVE_XCURSES
18152 #include <xcurses.h>
18153 char * XCursesProgramName = "test";
18154 #else
18155 #include <${cf_cv_ncurses_header:-curses.h}>
18156 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18157 #include <ncursesw/term.h>
18158 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18159 #include <ncurses/term.h>
18160 #elif defined(HAVE_TERM_H)
18161 #include <term.h>
18162 #endif
18163 #endif
18164
18165 int
18166 main (void)
18167 {
18168
18169 void *foo = &($cf_data)
18170
18171   ;
18172   return 0;
18173 }
18174 _ACEOF
18175 rm -f conftest.$ac_objext
18176 if { (eval echo "$as_me:18176: \"$ac_compile\"") >&5
18177   (eval $ac_compile) 2>&5
18178   ac_status=$?
18179   echo "$as_me:18179: \$? = $ac_status" >&5
18180   (exit $ac_status); } &&
18181          { ac_try='test -s conftest.$ac_objext'
18182   { (eval echo "$as_me:18182: \"$ac_try\"") >&5
18183   (eval $ac_try) 2>&5
18184   ac_status=$?
18185   echo "$as_me:18185: \$? = $ac_status" >&5
18186   (exit $ac_status); }; }; then
18187   cf_result=yes
18188
18189 else
18190   echo "$as_me: failed program was:" >&5
18191 cat conftest.$ac_ext >&5
18192 cf_result=no
18193 fi
18194 rm -f conftest.$ac_objext conftest.$ac_ext
18195 echo "$as_me:18195: result: $cf_result" >&5
18196 echo "${ECHO_T}$cf_result" >&6
18197
18198 if test $cf_result = yes ; then
18199
18200 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18201
18202         cat >>confdefs.h <<EOF
18203 #define $cf_result 1
18204 EOF
18205
18206 else
18207         echo "$as_me:18207: checking for data $cf_data in library" >&5
18208 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
18209         # BSD linkers insist on making weak linkage, but resolve at runtime.
18210         if test "$cross_compiling" = yes; then
18211
18212         # cross-compiling
18213         cat >conftest.$ac_ext <<_ACEOF
18214 #line 18214 "configure"
18215 #include "confdefs.h"
18216
18217 #ifdef HAVE_XCURSES
18218 #include <xcurses.h>
18219 char * XCursesProgramName = "test";
18220 #else
18221 #include <${cf_cv_ncurses_header:-curses.h}>
18222 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18223 #include <ncursesw/term.h>
18224 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18225 #include <ncurses/term.h>
18226 #elif defined(HAVE_TERM_H)
18227 #include <term.h>
18228 #endif
18229 #endif
18230
18231 extern char $cf_data;
18232 int
18233 main (void)
18234 {
18235
18236         do {
18237                 void *foo = &($cf_data);
18238                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18239                 ${cf_cv_main_return:-return}(foo == 0);
18240         } while (0)
18241
18242   ;
18243   return 0;
18244 }
18245 _ACEOF
18246 rm -f conftest.$ac_objext conftest$ac_exeext
18247 if { (eval echo "$as_me:18247: \"$ac_link\"") >&5
18248   (eval $ac_link) 2>&5
18249   ac_status=$?
18250   echo "$as_me:18250: \$? = $ac_status" >&5
18251   (exit $ac_status); } &&
18252          { ac_try='test -s conftest$ac_exeext'
18253   { (eval echo "$as_me:18253: \"$ac_try\"") >&5
18254   (eval $ac_try) 2>&5
18255   ac_status=$?
18256   echo "$as_me:18256: \$? = $ac_status" >&5
18257   (exit $ac_status); }; }; then
18258   cf_result=yes
18259 else
18260   echo "$as_me: failed program was:" >&5
18261 cat conftest.$ac_ext >&5
18262 cf_result=no
18263 fi
18264 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18265
18266 else
18267   cat >conftest.$ac_ext <<_ACEOF
18268 #line 18268 "configure"
18269 #include "confdefs.h"
18270
18271 #ifdef HAVE_XCURSES
18272 #include <xcurses.h>
18273 char * XCursesProgramName = "test";
18274 #else
18275 #include <${cf_cv_ncurses_header:-curses.h}>
18276 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18277 #include <ncursesw/term.h>
18278 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18279 #include <ncurses/term.h>
18280 #elif defined(HAVE_TERM_H)
18281 #include <term.h>
18282 #endif
18283 #endif
18284
18285 extern char $cf_data;
18286 int main(void)
18287 {
18288         void *foo = &($cf_data);
18289         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18290         ${cf_cv_main_return:-return}(foo == 0);
18291 }
18292 _ACEOF
18293 rm -f conftest$ac_exeext
18294 if { (eval echo "$as_me:18294: \"$ac_link\"") >&5
18295   (eval $ac_link) 2>&5
18296   ac_status=$?
18297   echo "$as_me:18297: \$? = $ac_status" >&5
18298   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18299   { (eval echo "$as_me:18299: \"$ac_try\"") >&5
18300   (eval $ac_try) 2>&5
18301   ac_status=$?
18302   echo "$as_me:18302: \$? = $ac_status" >&5
18303   (exit $ac_status); }; }; then
18304   cf_result=yes
18305
18306 else
18307   echo "$as_me: program exited with status $ac_status" >&5
18308 echo "$as_me: failed program was:" >&5
18309 cat conftest.$ac_ext >&5
18310 cf_result=no
18311 fi
18312 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18313 fi
18314         echo "$as_me:18314: result: $cf_result" >&5
18315 echo "${ECHO_T}$cf_result" >&6
18316         if test $cf_result = yes ; then
18317
18318 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18319
18320                 cat >>confdefs.h <<EOF
18321 #define $cf_result 1
18322 EOF
18323
18324                 # do not exit loop here, since we prefer system's declarations
18325         fi
18326 fi
18327 done
18328
18329 if ( test "$GCC" = yes || test "$GXX" = yes )
18330 then
18331 echo "$as_me:18331: checking if you want to turn on gcc warnings" >&5
18332 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
18333
18334 # Check whether --enable-warnings or --disable-warnings was given.
18335 if test "${enable_warnings+set}" = set; then
18336   enableval="$enable_warnings"
18337   test "$enableval" != yes && enableval=no
18338         if test "$enableval" != "no" ; then
18339     with_warnings=yes
18340         else
18341                 with_warnings=no
18342         fi
18343 else
18344   enableval=no
18345         with_warnings=no
18346
18347 fi;
18348 echo "$as_me:18348: result: $with_warnings" >&5
18349 echo "${ECHO_T}$with_warnings" >&6
18350 if test "$with_warnings" = "yes"
18351 then
18352
18353 if test "$GCC" = yes
18354 then
18355 cat > conftest.i <<EOF
18356 #ifndef GCC_PRINTF
18357 #define GCC_PRINTF 0
18358 #endif
18359 #ifndef GCC_SCANF
18360 #define GCC_SCANF 0
18361 #endif
18362 #ifndef GCC_NORETURN
18363 #define GCC_NORETURN /* nothing */
18364 #endif
18365 #ifndef GCC_UNUSED
18366 #define GCC_UNUSED /* nothing */
18367 #endif
18368 EOF
18369 if test "$GCC" = yes
18370 then
18371         { echo "$as_me:18371: checking for $CC __attribute__ directives..." >&5
18372 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
18373 cat > conftest.$ac_ext <<EOF
18374 #line 18374 "${as_me:-configure}"
18375 #include "confdefs.h"
18376 #include "conftest.h"
18377 #include "conftest.i"
18378 #if     GCC_PRINTF
18379 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
18380 #else
18381 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
18382 #endif
18383 #if     GCC_SCANF
18384 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
18385 #else
18386 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
18387 #endif
18388 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
18389 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
18390 extern void foo(void) GCC_NORETURN;
18391 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
18392 EOF
18393         cf_printf_attribute=no
18394         cf_scanf_attribute=no
18395         for cf_attribute in scanf printf unused noreturn
18396         do
18397
18398 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18399
18400                 cf_directive="__attribute__(($cf_attribute))"
18401                 echo "checking for $CC $cf_directive" 1>&5
18402
18403                 case $cf_attribute in
18404                 (printf)
18405                         cf_printf_attribute=yes
18406                         cat >conftest.h <<EOF
18407 #define GCC_$cf_ATTRIBUTE 1
18408 EOF
18409                         ;;
18410                 (scanf)
18411                         cf_scanf_attribute=yes
18412                         cat >conftest.h <<EOF
18413 #define GCC_$cf_ATTRIBUTE 1
18414 EOF
18415                         ;;
18416                 (*)
18417                         cat >conftest.h <<EOF
18418 #define GCC_$cf_ATTRIBUTE $cf_directive
18419 EOF
18420                         ;;
18421                 esac
18422
18423                 if { (eval echo "$as_me:18423: \"$ac_compile\"") >&5
18424   (eval $ac_compile) 2>&5
18425   ac_status=$?
18426   echo "$as_me:18426: \$? = $ac_status" >&5
18427   (exit $ac_status); }; then
18428                         test -n "$verbose" && echo "$as_me:18428: result: ... $cf_attribute" >&5
18429 echo "${ECHO_T}... $cf_attribute" >&6
18430                         cat conftest.h >>confdefs.h
18431                         case $cf_attribute in
18432                         (noreturn)
18433
18434 cat >>confdefs.h <<EOF
18435 #define GCC_NORETURN $cf_directive
18436 EOF
18437
18438                                 ;;
18439                         (printf)
18440                                 cf_value='/* nothing */'
18441                                 if test "$cf_printf_attribute" != no ; then
18442                                         cf_value='__attribute__((format(printf,fmt,var)))'
18443
18444 cat >>confdefs.h <<\EOF
18445 #define GCC_PRINTF 1
18446 EOF
18447
18448                                 fi
18449
18450 cat >>confdefs.h <<EOF
18451 #define GCC_PRINTFLIKE(fmt,var) $cf_value
18452 EOF
18453
18454                                 ;;
18455                         (scanf)
18456                                 cf_value='/* nothing */'
18457                                 if test "$cf_scanf_attribute" != no ; then
18458                                         cf_value='__attribute__((format(scanf,fmt,var)))'
18459
18460 cat >>confdefs.h <<\EOF
18461 #define GCC_SCANF 1
18462 EOF
18463
18464                                 fi
18465
18466 cat >>confdefs.h <<EOF
18467 #define GCC_SCANFLIKE(fmt,var) $cf_value
18468 EOF
18469
18470                                 ;;
18471                         (unused)
18472
18473 cat >>confdefs.h <<EOF
18474 #define GCC_UNUSED $cf_directive
18475 EOF
18476
18477                                 ;;
18478                         esac
18479                 fi
18480         done
18481 else
18482         fgrep define conftest.i >>confdefs.h
18483 fi
18484 rm -rf conftest*
18485 fi
18486
18487 INTEL_COMPILER=no
18488
18489 if test "$GCC" = yes ; then
18490         case $host_os in
18491         (linux*|gnu*)
18492                 echo "$as_me:18492: checking if this is really Intel C compiler" >&5
18493 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
18494                 cf_save_CFLAGS="$CFLAGS"
18495                 CFLAGS="$CFLAGS -no-gcc"
18496                 cat >conftest.$ac_ext <<_ACEOF
18497 #line 18497 "configure"
18498 #include "confdefs.h"
18499
18500 int
18501 main (void)
18502 {
18503
18504 #ifdef __INTEL_COMPILER
18505 #else
18506 make an error
18507 #endif
18508
18509   ;
18510   return 0;
18511 }
18512 _ACEOF
18513 rm -f conftest.$ac_objext
18514 if { (eval echo "$as_me:18514: \"$ac_compile\"") >&5
18515   (eval $ac_compile) 2>&5
18516   ac_status=$?
18517   echo "$as_me:18517: \$? = $ac_status" >&5
18518   (exit $ac_status); } &&
18519          { ac_try='test -s conftest.$ac_objext'
18520   { (eval echo "$as_me:18520: \"$ac_try\"") >&5
18521   (eval $ac_try) 2>&5
18522   ac_status=$?
18523   echo "$as_me:18523: \$? = $ac_status" >&5
18524   (exit $ac_status); }; }; then
18525   INTEL_COMPILER=yes
18526 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
18527
18528 else
18529   echo "$as_me: failed program was:" >&5
18530 cat conftest.$ac_ext >&5
18531 fi
18532 rm -f conftest.$ac_objext conftest.$ac_ext
18533                 CFLAGS="$cf_save_CFLAGS"
18534                 echo "$as_me:18534: result: $INTEL_COMPILER" >&5
18535 echo "${ECHO_T}$INTEL_COMPILER" >&6
18536                 ;;
18537         esac
18538 fi
18539
18540 CLANG_COMPILER=no
18541
18542 if test "$GCC" = yes ; then
18543         echo "$as_me:18543: checking if this is really Clang C compiler" >&5
18544 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
18545         cf_save_CFLAGS="$CFLAGS"
18546         CFLAGS="$CFLAGS -Qunused-arguments"
18547         cat >conftest.$ac_ext <<_ACEOF
18548 #line 18548 "configure"
18549 #include "confdefs.h"
18550
18551 int
18552 main (void)
18553 {
18554
18555 #ifdef __clang__
18556 #else
18557 make an error
18558 #endif
18559
18560   ;
18561   return 0;
18562 }
18563 _ACEOF
18564 rm -f conftest.$ac_objext
18565 if { (eval echo "$as_me:18565: \"$ac_compile\"") >&5
18566   (eval $ac_compile) 2>&5
18567   ac_status=$?
18568   echo "$as_me:18568: \$? = $ac_status" >&5
18569   (exit $ac_status); } &&
18570          { ac_try='test -s conftest.$ac_objext'
18571   { (eval echo "$as_me:18571: \"$ac_try\"") >&5
18572   (eval $ac_try) 2>&5
18573   ac_status=$?
18574   echo "$as_me:18574: \$? = $ac_status" >&5
18575   (exit $ac_status); }; }; then
18576   CLANG_COMPILER=yes
18577 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
18578
18579 else
18580   echo "$as_me: failed program was:" >&5
18581 cat conftest.$ac_ext >&5
18582 fi
18583 rm -f conftest.$ac_objext conftest.$ac_ext
18584         CFLAGS="$cf_save_CFLAGS"
18585         echo "$as_me:18585: result: $CLANG_COMPILER" >&5
18586 echo "${ECHO_T}$CLANG_COMPILER" >&6
18587 fi
18588
18589 cat > conftest.$ac_ext <<EOF
18590 #line 18590 "${as_me:-configure}"
18591 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
18592 EOF
18593
18594 if test "$INTEL_COMPILER" = yes
18595 then
18596 # The "-wdXXX" options suppress warnings:
18597 # remark #1419: external declaration in primary source file
18598 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
18599 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
18600 # remark #193: zero used for undefined preprocessing identifier
18601 # remark #593: variable "curs_sb_left_arrow" was set but never used
18602 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
18603 # remark #869: parameter "tw" was never referenced
18604 # remark #981: operands are evaluated in unspecified order
18605 # warning #279: controlling expression is constant
18606
18607         { echo "$as_me:18607: checking for $CC warning options..." >&5
18608 echo "$as_me: checking for $CC warning options..." >&6;}
18609         cf_save_CFLAGS="$CFLAGS"
18610         EXTRA_CFLAGS="-Wall"
18611         for cf_opt in \
18612                 wd1419 \
18613                 wd1683 \
18614                 wd1684 \
18615                 wd193 \
18616                 wd593 \
18617                 wd279 \
18618                 wd810 \
18619                 wd869 \
18620                 wd981
18621         do
18622                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18623                 if { (eval echo "$as_me:18623: \"$ac_compile\"") >&5
18624   (eval $ac_compile) 2>&5
18625   ac_status=$?
18626   echo "$as_me:18626: \$? = $ac_status" >&5
18627   (exit $ac_status); }; then
18628                         test -n "$verbose" && echo "$as_me:18628: result: ... -$cf_opt" >&5
18629 echo "${ECHO_T}... -$cf_opt" >&6
18630                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18631                 fi
18632         done
18633         CFLAGS="$cf_save_CFLAGS"
18634
18635 elif test "$GCC" = yes
18636 then
18637         { echo "$as_me:18637: checking for $CC warning options..." >&5
18638 echo "$as_me: checking for $CC warning options..." >&6;}
18639         cf_save_CFLAGS="$CFLAGS"
18640         EXTRA_CFLAGS=
18641         cf_warn_CONST=""
18642         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
18643         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
18644         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
18645         for cf_opt in W Wall \
18646                 Wbad-function-cast \
18647                 Wcast-align \
18648                 Wcast-qual \
18649                 Wdeclaration-after-statement \
18650                 Wextra \
18651                 Winline \
18652                 Wmissing-declarations \
18653                 Wmissing-prototypes \
18654                 Wnested-externs \
18655                 Wpointer-arith \
18656                 Wshadow \
18657                 Wstrict-prototypes \
18658                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
18659         do
18660                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
18661                 if { (eval echo "$as_me:18661: \"$ac_compile\"") >&5
18662   (eval $ac_compile) 2>&5
18663   ac_status=$?
18664   echo "$as_me:18664: \$? = $ac_status" >&5
18665   (exit $ac_status); }; then
18666                         test -n "$verbose" && echo "$as_me:18666: result: ... -$cf_opt" >&5
18667 echo "${ECHO_T}... -$cf_opt" >&6
18668                         case $cf_opt in
18669                         (Wcast-qual)
18670                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
18671                                 ;;
18672                         (Winline)
18673                                 case $GCC_VERSION in
18674                                 ([34].*)
18675                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18676
18677 echo "${as_me:-configure}:18677: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18678
18679                                         continue;;
18680                                 esac
18681                                 ;;
18682                         (Wpointer-arith)
18683                                 case $GCC_VERSION in
18684                                 ([12].*)
18685                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
18686
18687 echo "${as_me:-configure}:18687: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
18688
18689                                         continue;;
18690                                 esac
18691                                 ;;
18692                         esac
18693                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
18694                 fi
18695         done
18696         CFLAGS="$cf_save_CFLAGS"
18697 fi
18698 rm -rf conftest*
18699
18700 fi
18701 fi
18702
18703 echo "$as_me:18703: checking if you want to use dmalloc for testing" >&5
18704 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
18705
18706 # Check whether --with-dmalloc or --without-dmalloc was given.
18707 if test "${with_dmalloc+set}" = set; then
18708   withval="$with_dmalloc"
18709
18710 cat >>confdefs.h <<EOF
18711 #define USE_DMALLOC 1
18712 EOF
18713
18714         : ${with_cflags:=-g}
18715         : ${with_no_leaks:=yes}
18716          with_dmalloc=yes
18717 else
18718   with_dmalloc=
18719 fi;
18720 echo "$as_me:18720: result: ${with_dmalloc:-no}" >&5
18721 echo "${ECHO_T}${with_dmalloc:-no}" >&6
18722
18723 case .$with_cflags in
18724 (.*-g*)
18725         case .$CFLAGS in
18726         (.*-g*)
18727                 ;;
18728         (*)
18729
18730 cf_fix_cppflags=no
18731 cf_new_cflags=
18732 cf_new_cppflags=
18733 cf_new_extra_cppflags=
18734
18735 for cf_add_cflags in -g
18736 do
18737 case $cf_fix_cppflags in
18738 (no)
18739         case $cf_add_cflags in
18740         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18741                 case $cf_add_cflags in
18742                 (-D*)
18743                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18744
18745                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18746                                 && test -z "${cf_tst_cflags}" \
18747                                 && cf_fix_cppflags=yes
18748
18749                         if test $cf_fix_cppflags = yes ; then
18750
18751         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18752         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18753
18754                                 continue
18755                         elif test "${cf_tst_cflags}" = "\"'" ; then
18756
18757         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18758         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18759
18760                                 continue
18761                         fi
18762                         ;;
18763                 esac
18764                 case "$CPPFLAGS" in
18765                 (*$cf_add_cflags)
18766                         ;;
18767                 (*)
18768                         case $cf_add_cflags in
18769                         (-D*)
18770                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
18771
18772 CPPFLAGS=`echo "$CPPFLAGS" | \
18773         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
18774                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
18775
18776                                 ;;
18777                         esac
18778
18779         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
18780         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
18781
18782                         ;;
18783                 esac
18784                 ;;
18785         (*)
18786
18787         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
18788         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
18789
18790                 ;;
18791         esac
18792         ;;
18793 (yes)
18794
18795         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18796         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18797
18798         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
18799
18800         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18801                 && test -z "${cf_tst_cflags}" \
18802                 && cf_fix_cppflags=no
18803         ;;
18804 esac
18805 done
18806
18807 if test -n "$cf_new_cflags" ; then
18808
18809         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
18810         CFLAGS="${CFLAGS}$cf_new_cflags"
18811
18812 fi
18813
18814 if test -n "$cf_new_cppflags" ; then
18815
18816         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
18817         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
18818
18819 fi
18820
18821 if test -n "$cf_new_extra_cppflags" ; then
18822
18823         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
18824         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
18825
18826 fi
18827
18828                 ;;
18829         esac
18830         ;;
18831 esac
18832
18833 if test "$with_dmalloc" = yes ; then
18834         echo "$as_me:18834: checking for dmalloc.h" >&5
18835 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
18836 if test "${ac_cv_header_dmalloc_h+set}" = set; then
18837   echo $ECHO_N "(cached) $ECHO_C" >&6
18838 else
18839   cat >conftest.$ac_ext <<_ACEOF
18840 #line 18840 "configure"
18841 #include "confdefs.h"
18842 #include <dmalloc.h>
18843 _ACEOF
18844 if { (eval echo "$as_me:18844: \"$ac_cpp conftest.$ac_ext\"") >&5
18845   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
18846   ac_status=$?
18847   egrep -v '^ *\+' conftest.er1 >conftest.err
18848   rm -f conftest.er1
18849   cat conftest.err >&5
18850   echo "$as_me:18850: \$? = $ac_status" >&5
18851   (exit $ac_status); } >/dev/null; then
18852   if test -s conftest.err; then
18853     ac_cpp_err=$ac_c_preproc_warn_flag
18854   else
18855     ac_cpp_err=
18856   fi
18857 else
18858   ac_cpp_err=yes
18859 fi
18860 if test -z "$ac_cpp_err"; then
18861   ac_cv_header_dmalloc_h=yes
18862 else
18863   echo "$as_me: failed program was:" >&5
18864   cat conftest.$ac_ext >&5
18865   ac_cv_header_dmalloc_h=no
18866 fi
18867 rm -f conftest.err conftest.$ac_ext
18868 fi
18869 echo "$as_me:18869: result: $ac_cv_header_dmalloc_h" >&5
18870 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
18871 if test $ac_cv_header_dmalloc_h = yes; then
18872
18873 echo "$as_me:18873: checking for dmalloc_debug in -ldmalloc" >&5
18874 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
18875 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
18876   echo $ECHO_N "(cached) $ECHO_C" >&6
18877 else
18878   ac_check_lib_save_LIBS=$LIBS
18879 LIBS="-ldmalloc  $LIBS"
18880 cat >conftest.$ac_ext <<_ACEOF
18881 #line 18881 "configure"
18882 #include "confdefs.h"
18883
18884 /* Override any gcc2 internal prototype to avoid an error.  */
18885 #ifdef __cplusplus
18886 extern "C"
18887 #endif
18888 /* We use char because int might match the return type of a gcc2
18889    builtin and then its argument prototype would still apply.  */
18890 char dmalloc_debug ();
18891 int
18892 main (void)
18893 {
18894 dmalloc_debug ();
18895   ;
18896   return 0;
18897 }
18898 _ACEOF
18899 rm -f conftest.$ac_objext conftest$ac_exeext
18900 if { (eval echo "$as_me:18900: \"$ac_link\"") >&5
18901   (eval $ac_link) 2>&5
18902   ac_status=$?
18903   echo "$as_me:18903: \$? = $ac_status" >&5
18904   (exit $ac_status); } &&
18905          { ac_try='test -s conftest$ac_exeext'
18906   { (eval echo "$as_me:18906: \"$ac_try\"") >&5
18907   (eval $ac_try) 2>&5
18908   ac_status=$?
18909   echo "$as_me:18909: \$? = $ac_status" >&5
18910   (exit $ac_status); }; }; then
18911   ac_cv_lib_dmalloc_dmalloc_debug=yes
18912 else
18913   echo "$as_me: failed program was:" >&5
18914 cat conftest.$ac_ext >&5
18915 ac_cv_lib_dmalloc_dmalloc_debug=no
18916 fi
18917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18918 LIBS=$ac_check_lib_save_LIBS
18919 fi
18920 echo "$as_me:18920: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
18921 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
18922 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
18923   cat >>confdefs.h <<EOF
18924 #define HAVE_LIBDMALLOC 1
18925 EOF
18926
18927   LIBS="-ldmalloc $LIBS"
18928
18929 fi
18930
18931 fi
18932
18933 fi
18934
18935 echo "$as_me:18935: checking if you want to use dbmalloc for testing" >&5
18936 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
18937
18938 # Check whether --with-dbmalloc or --without-dbmalloc was given.
18939 if test "${with_dbmalloc+set}" = set; then
18940   withval="$with_dbmalloc"
18941
18942 cat >>confdefs.h <<EOF
18943 #define USE_DBMALLOC 1
18944 EOF
18945
18946         : ${with_cflags:=-g}
18947         : ${with_no_leaks:=yes}
18948          with_dbmalloc=yes
18949 else
18950   with_dbmalloc=
18951 fi;
18952 echo "$as_me:18952: result: ${with_dbmalloc:-no}" >&5
18953 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
18954
18955 case .$with_cflags in
18956 (.*-g*)
18957         case .$CFLAGS in
18958         (.*-g*)
18959                 ;;
18960         (*)
18961
18962 cf_fix_cppflags=no
18963 cf_new_cflags=
18964 cf_new_cppflags=
18965 cf_new_extra_cppflags=
18966
18967 for cf_add_cflags in -g
18968 do
18969 case $cf_fix_cppflags in
18970 (no)
18971         case $cf_add_cflags in
18972         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
18973                 case $cf_add_cflags in
18974                 (-D*)
18975                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
18976
18977                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
18978                                 && test -z "${cf_tst_cflags}" \
18979                                 && cf_fix_cppflags=yes
18980
18981                         if test $cf_fix_cppflags = yes ; then
18982
18983         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18984         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18985
18986                                 continue
18987                         elif test "${cf_tst_cflags}" = "\"'" ; then
18988
18989         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
18990         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
18991
18992                                 continue
18993                         fi
18994                         ;;
18995                 esac
18996                 case "$CPPFLAGS" in
18997                 (*$cf_add_cflags)
18998                         ;;
18999                 (*)
19000                         case $cf_add_cflags in
19001                         (-D*)
19002                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19003
19004 CPPFLAGS=`echo "$CPPFLAGS" | \
19005         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19006                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19007
19008                                 ;;
19009                         esac
19010
19011         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19012         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19013
19014                         ;;
19015                 esac
19016                 ;;
19017         (*)
19018
19019         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19020         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19021
19022                 ;;
19023         esac
19024         ;;
19025 (yes)
19026
19027         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19028         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19029
19030         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19031
19032         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19033                 && test -z "${cf_tst_cflags}" \
19034                 && cf_fix_cppflags=no
19035         ;;
19036 esac
19037 done
19038
19039 if test -n "$cf_new_cflags" ; then
19040
19041         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19042         CFLAGS="${CFLAGS}$cf_new_cflags"
19043
19044 fi
19045
19046 if test -n "$cf_new_cppflags" ; then
19047
19048         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19049         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19050
19051 fi
19052
19053 if test -n "$cf_new_extra_cppflags" ; then
19054
19055         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19056         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19057
19058 fi
19059
19060                 ;;
19061         esac
19062         ;;
19063 esac
19064
19065 if test "$with_dbmalloc" = yes ; then
19066         echo "$as_me:19066: checking for dbmalloc.h" >&5
19067 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
19068 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
19069   echo $ECHO_N "(cached) $ECHO_C" >&6
19070 else
19071   cat >conftest.$ac_ext <<_ACEOF
19072 #line 19072 "configure"
19073 #include "confdefs.h"
19074 #include <dbmalloc.h>
19075 _ACEOF
19076 if { (eval echo "$as_me:19076: \"$ac_cpp conftest.$ac_ext\"") >&5
19077   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19078   ac_status=$?
19079   egrep -v '^ *\+' conftest.er1 >conftest.err
19080   rm -f conftest.er1
19081   cat conftest.err >&5
19082   echo "$as_me:19082: \$? = $ac_status" >&5
19083   (exit $ac_status); } >/dev/null; then
19084   if test -s conftest.err; then
19085     ac_cpp_err=$ac_c_preproc_warn_flag
19086   else
19087     ac_cpp_err=
19088   fi
19089 else
19090   ac_cpp_err=yes
19091 fi
19092 if test -z "$ac_cpp_err"; then
19093   ac_cv_header_dbmalloc_h=yes
19094 else
19095   echo "$as_me: failed program was:" >&5
19096   cat conftest.$ac_ext >&5
19097   ac_cv_header_dbmalloc_h=no
19098 fi
19099 rm -f conftest.err conftest.$ac_ext
19100 fi
19101 echo "$as_me:19101: result: $ac_cv_header_dbmalloc_h" >&5
19102 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
19103 if test $ac_cv_header_dbmalloc_h = yes; then
19104
19105 echo "$as_me:19105: checking for debug_malloc in -ldbmalloc" >&5
19106 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
19107 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
19108   echo $ECHO_N "(cached) $ECHO_C" >&6
19109 else
19110   ac_check_lib_save_LIBS=$LIBS
19111 LIBS="-ldbmalloc  $LIBS"
19112 cat >conftest.$ac_ext <<_ACEOF
19113 #line 19113 "configure"
19114 #include "confdefs.h"
19115
19116 /* Override any gcc2 internal prototype to avoid an error.  */
19117 #ifdef __cplusplus
19118 extern "C"
19119 #endif
19120 /* We use char because int might match the return type of a gcc2
19121    builtin and then its argument prototype would still apply.  */
19122 char debug_malloc ();
19123 int
19124 main (void)
19125 {
19126 debug_malloc ();
19127   ;
19128   return 0;
19129 }
19130 _ACEOF
19131 rm -f conftest.$ac_objext conftest$ac_exeext
19132 if { (eval echo "$as_me:19132: \"$ac_link\"") >&5
19133   (eval $ac_link) 2>&5
19134   ac_status=$?
19135   echo "$as_me:19135: \$? = $ac_status" >&5
19136   (exit $ac_status); } &&
19137          { ac_try='test -s conftest$ac_exeext'
19138   { (eval echo "$as_me:19138: \"$ac_try\"") >&5
19139   (eval $ac_try) 2>&5
19140   ac_status=$?
19141   echo "$as_me:19141: \$? = $ac_status" >&5
19142   (exit $ac_status); }; }; then
19143   ac_cv_lib_dbmalloc_debug_malloc=yes
19144 else
19145   echo "$as_me: failed program was:" >&5
19146 cat conftest.$ac_ext >&5
19147 ac_cv_lib_dbmalloc_debug_malloc=no
19148 fi
19149 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19150 LIBS=$ac_check_lib_save_LIBS
19151 fi
19152 echo "$as_me:19152: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
19153 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
19154 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
19155   cat >>confdefs.h <<EOF
19156 #define HAVE_LIBDBMALLOC 1
19157 EOF
19158
19159   LIBS="-ldbmalloc $LIBS"
19160
19161 fi
19162
19163 fi
19164
19165 fi
19166
19167 echo "$as_me:19167: checking if you want to use valgrind for testing" >&5
19168 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
19169
19170 # Check whether --with-valgrind or --without-valgrind was given.
19171 if test "${with_valgrind+set}" = set; then
19172   withval="$with_valgrind"
19173
19174 cat >>confdefs.h <<EOF
19175 #define USE_VALGRIND 1
19176 EOF
19177
19178         : ${with_cflags:=-g}
19179         : ${with_no_leaks:=yes}
19180          with_valgrind=yes
19181 else
19182   with_valgrind=
19183 fi;
19184 echo "$as_me:19184: result: ${with_valgrind:-no}" >&5
19185 echo "${ECHO_T}${with_valgrind:-no}" >&6
19186
19187 case .$with_cflags in
19188 (.*-g*)
19189         case .$CFLAGS in
19190         (.*-g*)
19191                 ;;
19192         (*)
19193
19194 cf_fix_cppflags=no
19195 cf_new_cflags=
19196 cf_new_cppflags=
19197 cf_new_extra_cppflags=
19198
19199 for cf_add_cflags in -g
19200 do
19201 case $cf_fix_cppflags in
19202 (no)
19203         case $cf_add_cflags in
19204         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19205                 case $cf_add_cflags in
19206                 (-D*)
19207                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19208
19209                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19210                                 && test -z "${cf_tst_cflags}" \
19211                                 && cf_fix_cppflags=yes
19212
19213                         if test $cf_fix_cppflags = yes ; then
19214
19215         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19216         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19217
19218                                 continue
19219                         elif test "${cf_tst_cflags}" = "\"'" ; then
19220
19221         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19222         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19223
19224                                 continue
19225                         fi
19226                         ;;
19227                 esac
19228                 case "$CPPFLAGS" in
19229                 (*$cf_add_cflags)
19230                         ;;
19231                 (*)
19232                         case $cf_add_cflags in
19233                         (-D*)
19234                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19235
19236 CPPFLAGS=`echo "$CPPFLAGS" | \
19237         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19238                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19239
19240                                 ;;
19241                         esac
19242
19243         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19244         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19245
19246                         ;;
19247                 esac
19248                 ;;
19249         (*)
19250
19251         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19252         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19253
19254                 ;;
19255         esac
19256         ;;
19257 (yes)
19258
19259         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19260         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19261
19262         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19263
19264         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19265                 && test -z "${cf_tst_cflags}" \
19266                 && cf_fix_cppflags=no
19267         ;;
19268 esac
19269 done
19270
19271 if test -n "$cf_new_cflags" ; then
19272
19273         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19274         CFLAGS="${CFLAGS}$cf_new_cflags"
19275
19276 fi
19277
19278 if test -n "$cf_new_cppflags" ; then
19279
19280         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19281         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19282
19283 fi
19284
19285 if test -n "$cf_new_extra_cppflags" ; then
19286
19287         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19288         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19289
19290 fi
19291
19292                 ;;
19293         esac
19294         ;;
19295 esac
19296
19297 echo "$as_me:19297: checking if you want to perform memory-leak testing" >&5
19298 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
19299
19300 # Check whether --enable-leaks or --disable-leaks was given.
19301 if test "${enable_leaks+set}" = set; then
19302   enableval="$enable_leaks"
19303   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
19304 else
19305   : ${with_no_leaks:=no}
19306 fi;
19307 echo "$as_me:19307: result: $with_no_leaks" >&5
19308 echo "${ECHO_T}$with_no_leaks" >&6
19309
19310 if test "$with_no_leaks" = yes ; then
19311
19312 cat >>confdefs.h <<\EOF
19313 #define NO_LEAKS 1
19314 EOF
19315
19316 cat >>confdefs.h <<\EOF
19317 #define YY_NO_LEAKS 1
19318 EOF
19319
19320 fi
19321
19322 LD_RPATH_OPT=
19323 echo "$as_me:19323: checking for an rpath option" >&5
19324 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
19325 case $cf_cv_system_name in
19326 (irix*)
19327         if test "$GCC" = yes; then
19328                 LD_RPATH_OPT="-Wl,-rpath,"
19329         else
19330                 LD_RPATH_OPT="-rpath "
19331         fi
19332         ;;
19333 (linux*|gnu*|k*bsd*-gnu|freebsd*)
19334         LD_RPATH_OPT="-Wl,-rpath,"
19335         ;;
19336 (openbsd[2-9].*|mirbsd*)
19337         LD_RPATH_OPT="-Wl,-rpath,"
19338         ;;
19339 (dragonfly*)
19340         LD_RPATH_OPT="-rpath "
19341         ;;
19342 (netbsd*)
19343         LD_RPATH_OPT="-Wl,-rpath,"
19344         ;;
19345 (osf*|mls+*)
19346         LD_RPATH_OPT="-rpath "
19347         ;;
19348 (solaris2*)
19349         LD_RPATH_OPT="-R"
19350         ;;
19351 (*)
19352         ;;
19353 esac
19354 echo "$as_me:19354: result: $LD_RPATH_OPT" >&5
19355 echo "${ECHO_T}$LD_RPATH_OPT" >&6
19356
19357 case "x$LD_RPATH_OPT" in
19358 (x-R*)
19359         echo "$as_me:19359: checking if we need a space after rpath option" >&5
19360 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
19361         cf_save_LIBS="$LIBS"
19362
19363 cf_add_libs="${LD_RPATH_OPT}$libdir"
19364 # Filter out duplicates - this happens with badly-designed ".pc" files...
19365 for cf_add_1lib in $LIBS
19366 do
19367         for cf_add_2lib in $cf_add_libs
19368         do
19369                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
19370                 then
19371                         cf_add_1lib=
19372                         break
19373                 fi
19374         done
19375         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
19376 done
19377 LIBS="$cf_add_libs"
19378
19379         cat >conftest.$ac_ext <<_ACEOF
19380 #line 19380 "configure"
19381 #include "confdefs.h"
19382
19383 int
19384 main (void)
19385 {
19386
19387   ;
19388   return 0;
19389 }
19390 _ACEOF
19391 rm -f conftest.$ac_objext conftest$ac_exeext
19392 if { (eval echo "$as_me:19392: \"$ac_link\"") >&5
19393   (eval $ac_link) 2>&5
19394   ac_status=$?
19395   echo "$as_me:19395: \$? = $ac_status" >&5
19396   (exit $ac_status); } &&
19397          { ac_try='test -s conftest$ac_exeext'
19398   { (eval echo "$as_me:19398: \"$ac_try\"") >&5
19399   (eval $ac_try) 2>&5
19400   ac_status=$?
19401   echo "$as_me:19401: \$? = $ac_status" >&5
19402   (exit $ac_status); }; }; then
19403   cf_rpath_space=no
19404 else
19405   echo "$as_me: failed program was:" >&5
19406 cat conftest.$ac_ext >&5
19407 cf_rpath_space=yes
19408 fi
19409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19410         LIBS="$cf_save_LIBS"
19411         echo "$as_me:19411: result: $cf_rpath_space" >&5
19412 echo "${ECHO_T}$cf_rpath_space" >&6
19413         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
19414         ;;
19415 esac
19416
19417 echo "$as_me:19417: checking if rpath-hack should be disabled" >&5
19418 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
19419
19420 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
19421 if test "${enable_rpath_hack+set}" = set; then
19422   enableval="$enable_rpath_hack"
19423   test "$enableval" != no && enableval=yes
19424         if test "$enableval" != "yes" ; then
19425     cf_disable_rpath_hack=yes
19426         else
19427                 cf_disable_rpath_hack=no
19428         fi
19429 else
19430   enableval=yes
19431         cf_disable_rpath_hack=no
19432
19433 fi;
19434 echo "$as_me:19434: result: $cf_disable_rpath_hack" >&5
19435 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
19436 if test "$cf_disable_rpath_hack" = no ; then
19437
19438 echo "$as_me:19438: checking for updated LDFLAGS" >&5
19439 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
19440 if test -n "$LD_RPATH_OPT" ; then
19441         echo "$as_me:19441: result: maybe" >&5
19442 echo "${ECHO_T}maybe" >&6
19443
19444         for ac_prog in ldd
19445 do
19446   # Extract the first word of "$ac_prog", so it can be a program name with args.
19447 set dummy $ac_prog; ac_word=$2
19448 echo "$as_me:19448: checking for $ac_word" >&5
19449 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19450 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
19451   echo $ECHO_N "(cached) $ECHO_C" >&6
19452 else
19453   if test -n "$cf_ldd_prog"; then
19454   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
19455 else
19456   ac_save_IFS=$IFS; IFS=$ac_path_separator
19457 ac_dummy="$PATH"
19458 for ac_dir in $ac_dummy; do
19459   IFS=$ac_save_IFS
19460   test -z "$ac_dir" && ac_dir=.
19461   $as_executable_p "$ac_dir/$ac_word" || continue
19462 ac_cv_prog_cf_ldd_prog="$ac_prog"
19463 echo "$as_me:19463: found $ac_dir/$ac_word" >&5
19464 break
19465 done
19466
19467 fi
19468 fi
19469 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
19470 if test -n "$cf_ldd_prog"; then
19471   echo "$as_me:19471: result: $cf_ldd_prog" >&5
19472 echo "${ECHO_T}$cf_ldd_prog" >&6
19473 else
19474   echo "$as_me:19474: result: no" >&5
19475 echo "${ECHO_T}no" >&6
19476 fi
19477
19478   test -n "$cf_ldd_prog" && break
19479 done
19480 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
19481
19482         cf_rpath_list="/usr/lib /lib"
19483         if test "$cf_ldd_prog" != no
19484         then
19485                 cf_rpath_oops=
19486
19487 cat >conftest.$ac_ext <<_ACEOF
19488 #line 19488 "configure"
19489 #include "confdefs.h"
19490 #include <stdio.h>
19491 int
19492 main (void)
19493 {
19494 printf("Hello");
19495   ;
19496   return 0;
19497 }
19498 _ACEOF
19499 rm -f conftest.$ac_objext conftest$ac_exeext
19500 if { (eval echo "$as_me:19500: \"$ac_link\"") >&5
19501   (eval $ac_link) 2>&5
19502   ac_status=$?
19503   echo "$as_me:19503: \$? = $ac_status" >&5
19504   (exit $ac_status); } &&
19505          { ac_try='test -s conftest$ac_exeext'
19506   { (eval echo "$as_me:19506: \"$ac_try\"") >&5
19507   (eval $ac_try) 2>&5
19508   ac_status=$?
19509   echo "$as_me:19509: \$? = $ac_status" >&5
19510   (exit $ac_status); }; }; then
19511   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
19512                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
19513 else
19514   echo "$as_me: failed program was:" >&5
19515 cat conftest.$ac_ext >&5
19516 fi
19517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19518
19519                 # If we passed the link-test, but get a "not found" on a given library,
19520                 # this could be due to inept reconfiguration of gcc to make it only
19521                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
19522                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
19523                 # /usr/local libraries.
19524                 if test -n "$cf_rpath_oops"
19525                 then
19526                         for cf_rpath_src in $cf_rpath_oops
19527                         do
19528                                 for cf_rpath_dir in \
19529                                         /usr/local \
19530                                         /usr/pkg \
19531                                         /opt/sfw
19532                                 do
19533                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
19534                                         then
19535                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
19536
19537 echo "${as_me:-configure}:19537: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
19538
19539                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
19540                                                 break
19541                                         fi
19542                                 done
19543                         done
19544                 fi
19545         fi
19546
19547         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19548
19549 echo "${as_me:-configure}:19549: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19550
19551 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
19552
19553 echo "${as_me:-configure}:19553: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
19554
19555 cf_rpath_dst=
19556 for cf_rpath_src in $LDFLAGS
19557 do
19558         case $cf_rpath_src in
19559         (-L*)
19560
19561                 # check if this refers to a directory which we will ignore
19562                 cf_rpath_skip=no
19563                 if test -n "$cf_rpath_list"
19564                 then
19565                         for cf_rpath_item in $cf_rpath_list
19566                         do
19567                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19568                                 then
19569                                         cf_rpath_skip=yes
19570                                         break
19571                                 fi
19572                         done
19573                 fi
19574
19575                 if test "$cf_rpath_skip" = no
19576                 then
19577                         # transform the option
19578                         if test "$LD_RPATH_OPT" = "-R " ; then
19579                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19580                         else
19581                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19582                         fi
19583
19584                         # if we have not already added this, add it now
19585                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19586                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19587                         then
19588                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19589
19590 echo "${as_me:-configure}:19590: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19591
19592                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19593                         fi
19594                 fi
19595                 ;;
19596         esac
19597         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19598 done
19599 LDFLAGS=$cf_rpath_dst
19600
19601 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
19602
19603 echo "${as_me:-configure}:19603: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
19604
19605 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
19606
19607 echo "${as_me:-configure}:19607: testing ...checking LIBS $LIBS ..." 1>&5
19608
19609 cf_rpath_dst=
19610 for cf_rpath_src in $LIBS
19611 do
19612         case $cf_rpath_src in
19613         (-L*)
19614
19615                 # check if this refers to a directory which we will ignore
19616                 cf_rpath_skip=no
19617                 if test -n "$cf_rpath_list"
19618                 then
19619                         for cf_rpath_item in $cf_rpath_list
19620                         do
19621                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
19622                                 then
19623                                         cf_rpath_skip=yes
19624                                         break
19625                                 fi
19626                         done
19627                 fi
19628
19629                 if test "$cf_rpath_skip" = no
19630                 then
19631                         # transform the option
19632                         if test "$LD_RPATH_OPT" = "-R " ; then
19633                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
19634                         else
19635                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
19636                         fi
19637
19638                         # if we have not already added this, add it now
19639                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
19640                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
19641                         then
19642                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
19643
19644 echo "${as_me:-configure}:19644: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
19645
19646                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
19647                         fi
19648                 fi
19649                 ;;
19650         esac
19651         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
19652 done
19653 LIBS=$cf_rpath_dst
19654
19655 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
19656
19657 echo "${as_me:-configure}:19657: testing ...checked LIBS $LIBS ..." 1>&5
19658
19659         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
19660
19661 echo "${as_me:-configure}:19661: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
19662
19663 else
19664         echo "$as_me:19664: result: no" >&5
19665 echo "${ECHO_T}no" >&6
19666 fi
19667
19668 fi
19669
19670 TEST_ARGS="$LIBS"
19671 LIBS=
19672
19673 ac_config_files="$ac_config_files Makefile"
19674 ac_config_commands="$ac_config_commands default"
19675 cat >confcache <<\_ACEOF
19676 # This file is a shell script that caches the results of configure
19677 # tests run on this system so they can be shared between configure
19678 # scripts and configure runs, see configure's option --config-cache.
19679 # It is not useful on other systems.  If it contains results you don't
19680 # want to keep, you may remove or edit it.
19681 #
19682 # config.status only pays attention to the cache file if you give it
19683 # the --recheck option to rerun configure.
19684 #
19685 # `ac_cv_env_foo' variables (set or unset) will be overriden when
19686 # loading this file, other *unset* `ac_cv_foo' will be assigned the
19687 # following values.
19688
19689 _ACEOF
19690
19691 # The following way of writing the cache mishandles newlines in values,
19692 # but we know of no workaround that is simple, portable, and efficient.
19693 # So, don't put newlines in cache variables' values.
19694 # Ultrix sh set writes to stderr and can't be redirected directly,
19695 # and sets the high bit in the cache file unless we assign to the vars.
19696 {
19697   (set) 2>&1 |
19698     case `(ac_space=' '; set | grep ac_space) 2>&1` in
19699     *ac_space=\ *)
19700       # `set' does not quote correctly, so add quotes (double-quote
19701       # substitution turns \\\\ into \\, and sed turns \\ into \).
19702       sed -n \
19703         "s/'/'\\\\''/g;
19704           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
19705       ;;
19706     *)
19707       # `set' quotes correctly as required by POSIX, so do not add quotes.
19708       sed -n \
19709         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
19710       ;;
19711     esac;
19712 } |
19713   sed '
19714      t clear
19715      : clear
19716      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
19717      t end
19718      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
19719      : end' >>confcache
19720 if cmp -s $cache_file confcache; then :; else
19721   if test -w $cache_file; then
19722     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
19723     cat confcache >$cache_file
19724   else
19725     echo "not updating unwritable cache $cache_file"
19726   fi
19727 fi
19728 rm -f confcache
19729
19730 test "x$prefix" = xNONE && prefix=$ac_default_prefix
19731 # Let make expand exec_prefix.
19732 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
19733
19734 # VPATH may cause trouble with some makes, so we remove $(srcdir),
19735 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
19736 # trailing colons and then remove the whole line if VPATH becomes empty
19737 # (actually we leave an empty line to preserve line numbers).
19738 if test "x$srcdir" = x.; then
19739   ac_vpsub='/^[         ]*VPATH[        ]*=/{
19740 s/:*\$(srcdir):*/:/;
19741 s/:*\${srcdir}:*/:/;
19742 s/:*@srcdir@:*/:/;
19743 s/^\([^=]*=[    ]*\):*/\1/;
19744 s/:*$//;
19745 s/^[^=]*=[      ]*$//;
19746 }'
19747 fi
19748
19749 DEFS=-DHAVE_CONFIG_H
19750
19751 : ${CONFIG_STATUS=./config.status}
19752 ac_clean_files_save=$ac_clean_files
19753 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
19754 { echo "$as_me:19754: creating $CONFIG_STATUS" >&5
19755 echo "$as_me: creating $CONFIG_STATUS" >&6;}
19756 cat >$CONFIG_STATUS <<_ACEOF
19757 #! $SHELL
19758 # Generated automatically by configure.
19759 # Run this file to recreate the current configuration.
19760 # Compiler output produced by configure, useful for debugging
19761 # configure, is in config.log if it exists.
19762
19763 debug=false
19764 SHELL=\${CONFIG_SHELL-$SHELL}
19765 ac_cs_invocation="\$0 \$@"
19766
19767 _ACEOF
19768
19769 cat >>$CONFIG_STATUS <<\_ACEOF
19770 # Be Bourne compatible
19771 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19772   emulate sh
19773   NULLCMD=:
19774 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
19775   set -o posix
19776 fi
19777
19778 # Name of the executable.
19779 as_me=`echo "$0" |sed 's,.*[\\/],,'`
19780
19781 if expr a : '\(a\)' >/dev/null 2>&1; then
19782   as_expr=expr
19783 else
19784   as_expr=false
19785 fi
19786
19787 rm -f conf$$ conf$$.exe conf$$.file
19788 echo >conf$$.file
19789 if ln -s conf$$.file conf$$ 2>/dev/null; then
19790   # We could just check for DJGPP; but this test a) works b) is more generic
19791   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
19792   if test -f conf$$.exe; then
19793     # Don't use ln at all; we don't have any links
19794     as_ln_s='cp -p'
19795   else
19796     as_ln_s='ln -s'
19797   fi
19798 elif ln conf$$.file conf$$ 2>/dev/null; then
19799   as_ln_s=ln
19800 else
19801   as_ln_s='cp -p'
19802 fi
19803 rm -f conf$$ conf$$.exe conf$$.file
19804
19805 as_executable_p="test -f"
19806
19807 # Support unset when possible.
19808 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
19809   as_unset=unset
19810 else
19811   as_unset=false
19812 fi
19813
19814 # NLS nuisances.
19815 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
19816 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
19817 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
19818 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
19819 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
19820 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
19821 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
19822 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
19823
19824 # IFS
19825 # We need space, tab and new line, in precisely that order.
19826 as_nl='
19827 '
19828 IFS="   $as_nl"
19829
19830 # CDPATH.
19831 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
19832
19833 exec 6>&1
19834
19835 _ACEOF
19836
19837 # Files that config.status was made for.
19838 if test -n "$ac_config_files"; then
19839   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
19840 fi
19841
19842 if test -n "$ac_config_headers"; then
19843   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
19844 fi
19845
19846 if test -n "$ac_config_links"; then
19847   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
19848 fi
19849
19850 if test -n "$ac_config_commands"; then
19851   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
19852 fi
19853
19854 cat >>$CONFIG_STATUS <<\EOF
19855
19856 ac_cs_usage="\
19857 \`$as_me' instantiates files from templates according to the
19858 current configuration.
19859
19860 Usage: $0 [OPTIONS] [FILE]...
19861
19862   -h, --help       print this help, then exit
19863   -V, --version    print version number, then exit
19864   -d, --debug      don't remove temporary files
19865       --recheck    update $as_me by reconfiguring in the same conditions
19866   --file=FILE[:TEMPLATE]
19867                    instantiate the configuration file FILE
19868   --header=FILE[:TEMPLATE]
19869                    instantiate the configuration header FILE
19870
19871 Configuration files:
19872 $config_files
19873
19874 Configuration headers:
19875 $config_headers
19876
19877 Configuration commands:
19878 $config_commands
19879
19880 Report bugs to <dickey@invisible-island.net>."
19881 EOF
19882
19883 cat >>$CONFIG_STATUS <<EOF
19884 ac_cs_version="\\
19885 config.status
19886 configured by $0, generated by GNU Autoconf 2.52.20170501,
19887   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
19888
19889 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
19890 Free Software Foundation, Inc.
19891 This config.status script is free software; the Free Software Foundation
19892 gives unlimited permission to copy, distribute and modify it."
19893 srcdir=$srcdir
19894 INSTALL="$INSTALL"
19895 EOF
19896
19897 cat >>$CONFIG_STATUS <<\EOF
19898 # If no file are specified by the user, then we need to provide default
19899 # value.  By we need to know if files were specified by the user.
19900 ac_need_defaults=:
19901 while test $# != 0
19902 do
19903   case $1 in
19904   --*=*)
19905     ac_option=`expr "x$1" : 'x\([^=]*\)='`
19906     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
19907     shift
19908     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
19909     shift
19910     ;;
19911   -*);;
19912   *) # This is not an option, so the user has probably given explicit
19913      # arguments.
19914      ac_need_defaults=false;;
19915   esac
19916
19917   case $1 in
19918   # Handling of the options.
19919 EOF
19920 cat >>$CONFIG_STATUS <<EOF
19921   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
19922     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
19923     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
19924 EOF
19925 cat >>$CONFIG_STATUS <<\EOF
19926   --version | --vers* | -V )
19927     echo "$ac_cs_version"; exit 0 ;;
19928   --he | --h)
19929     # Conflict between --help and --header
19930     { { echo "$as_me:19930: error: ambiguous option: $1
19931 Try \`$0 --help' for more information." >&5
19932 echo "$as_me: error: ambiguous option: $1
19933 Try \`$0 --help' for more information." >&2;}
19934    { (exit 1); exit 1; }; };;
19935   --help | --hel | -h )
19936     echo "$ac_cs_usage"; exit 0 ;;
19937   --debug | --d* | -d )
19938     debug=: ;;
19939   --file | --fil | --fi | --f )
19940     shift
19941     CONFIG_FILES="$CONFIG_FILES $1"
19942     ac_need_defaults=false;;
19943   --header | --heade | --head | --hea )
19944     shift
19945     CONFIG_HEADERS="$CONFIG_HEADERS $1"
19946     ac_need_defaults=false;;
19947
19948   # This is an error.
19949   -*) { { echo "$as_me:19949: error: unrecognized option: $1
19950 Try \`$0 --help' for more information." >&5
19951 echo "$as_me: error: unrecognized option: $1
19952 Try \`$0 --help' for more information." >&2;}
19953    { (exit 1); exit 1; }; } ;;
19954
19955   *) ac_config_targets="$ac_config_targets $1" ;;
19956
19957   esac
19958   shift
19959 done
19960
19961 exec 5>>config.log
19962 cat >&5 << _ACEOF
19963
19964 ## ----------------------- ##
19965 ## Running config.status.  ##
19966 ## ----------------------- ##
19967
19968 This file was extended by $as_me 2.52.20170501, executed with
19969   CONFIG_FILES    = $CONFIG_FILES
19970   CONFIG_HEADERS  = $CONFIG_HEADERS
19971   CONFIG_LINKS    = $CONFIG_LINKS
19972   CONFIG_COMMANDS = $CONFIG_COMMANDS
19973   > $ac_cs_invocation
19974 on `(hostname || uname -n) 2>/dev/null | sed 1q`
19975
19976 _ACEOF
19977 EOF
19978
19979 cat >>$CONFIG_STATUS <<EOF
19980 #
19981 # INIT-COMMANDS section.
19982 #
19983
19984 AWK="$AWK"
19985 ECHO_CC="$ECHO_CC"
19986 ECHO_LD="$ECHO_LD"
19987 SHOW_CC="$SHOW_LD"
19988
19989 EOF
19990
19991 cat >>$CONFIG_STATUS <<\EOF
19992 for ac_config_target in $ac_config_targets
19993 do
19994   case "$ac_config_target" in
19995   # Handling of arguments.
19996   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
19997   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
19998   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
19999   *) { { echo "$as_me:19999: error: invalid argument: $ac_config_target" >&5
20000 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
20001    { (exit 1); exit 1; }; };;
20002   esac
20003 done
20004
20005 # If the user did not use the arguments to specify the items to instantiate,
20006 # then the envvar interface is used.  Set only those that are not.
20007 # We use the long form for the default assignment because of an extremely
20008 # bizarre bug on SunOS 4.1.3.
20009 if $ac_need_defaults; then
20010   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20011   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20012   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20013 fi
20014
20015 # Create a temporary directory, and hook for its removal unless debugging.
20016 $debug ||
20017 {
20018   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
20019   trap '{ (exit 1); exit 1; }' 1 2 13 15
20020 }
20021
20022 # Create a (secure) tmp directory for tmp files.
20023 : ${TMPDIR=/tmp}
20024 {
20025   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
20026   test -n "$tmp" && test -d "$tmp"
20027 }  ||
20028 {
20029   tmp=$TMPDIR/cs$$-$RANDOM
20030   (umask 077 && mkdir $tmp)
20031 } ||
20032 {
20033    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
20034    { (exit 1); exit 1; }
20035 }
20036
20037 EOF
20038
20039 cat >>$CONFIG_STATUS <<EOF
20040
20041 #
20042 # CONFIG_FILES section.
20043 #
20044
20045 # No need to generate the scripts if there are no CONFIG_FILES.
20046 # This happens for instance when ./config.status config.h
20047 if test -n "\$CONFIG_FILES"; then
20048   # Protect against being on the right side of a sed subst in config.status.
20049   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20050    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20051 s,@SHELL@,$SHELL,;t t
20052 s,@exec_prefix@,$exec_prefix,;t t
20053 s,@prefix@,$prefix,;t t
20054 s,@program_transform_name@,$program_transform_name,;t t
20055 s,@bindir@,$bindir,;t t
20056 s,@sbindir@,$sbindir,;t t
20057 s,@libexecdir@,$libexecdir,;t t
20058 s,@datarootdir@,$datarootdir,;t t
20059 s,@datadir@,$datadir,;t t
20060 s,@sysconfdir@,$sysconfdir,;t t
20061 s,@sharedstatedir@,$sharedstatedir,;t t
20062 s,@localstatedir@,$localstatedir,;t t
20063 s,@libdir@,$libdir,;t t
20064 s,@includedir@,$includedir,;t t
20065 s,@oldincludedir@,$oldincludedir,;t t
20066 s,@infodir@,$infodir,;t t
20067 s,@mandir@,$mandir,;t t
20068 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20069 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20070 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20071 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20072 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20073 s,@build_alias@,$build_alias,;t t
20074 s,@host_alias@,$host_alias,;t t
20075 s,@target_alias@,$target_alias,;t t
20076 s,@ECHO_C@,$ECHO_C,;t t
20077 s,@ECHO_N@,$ECHO_N,;t t
20078 s,@ECHO_T@,$ECHO_T,;t t
20079 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
20080 s,@DEFS@,$DEFS,;t t
20081 s,@LIBS@,$LIBS,;t t
20082 s,@build@,$build,;t t
20083 s,@build_cpu@,$build_cpu,;t t
20084 s,@build_vendor@,$build_vendor,;t t
20085 s,@build_os@,$build_os,;t t
20086 s,@host@,$host,;t t
20087 s,@host_cpu@,$host_cpu,;t t
20088 s,@host_vendor@,$host_vendor,;t t
20089 s,@host_os@,$host_os,;t t
20090 s,@SET_MAKE@,$SET_MAKE,;t t
20091 s,@CC@,$CC,;t t
20092 s,@CFLAGS@,$CFLAGS,;t t
20093 s,@LDFLAGS@,$LDFLAGS,;t t
20094 s,@CPPFLAGS@,$CPPFLAGS,;t t
20095 s,@ac_ct_CC@,$ac_ct_CC,;t t
20096 s,@EXEEXT@,$EXEEXT,;t t
20097 s,@OBJEXT@,$OBJEXT,;t t
20098 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
20099 s,@CPP@,$CPP,;t t
20100 s,@AWK@,$AWK,;t t
20101 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
20102 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
20103 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
20104 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
20105 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
20106 s,@LINT@,$LINT,;t t
20107 s,@LINT_OPTS@,$LINT_OPTS,;t t
20108 s,@CTAGS@,$CTAGS,;t t
20109 s,@ETAGS@,$ETAGS,;t t
20110 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
20111 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
20112 s,@MATH_LIB@,$MATH_LIB,;t t
20113 s,@top_builddir@,$top_builddir,;t t
20114 s,@CC_G_OPT@,$CC_G_OPT,;t t
20115 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
20116 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
20117 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
20118 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
20119 s,@LD@,$LD,;t t
20120 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
20121 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
20122 s,@LD_MODEL@,$LD_MODEL,;t t
20123 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
20124 s,@LIBTOOL@,$LIBTOOL,;t t
20125 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
20126 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
20127 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
20128 s,@LIB_LINK@,$LIB_LINK,;t t
20129 s,@LINK_TESTS@,$LINK_TESTS,;t t
20130 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
20131 s,@PACKAGE@,$PACKAGE,;t t
20132 s,@PTHREAD@,$PTHREAD,;t t
20133 s,@TEST_ARGS@,$TEST_ARGS,;t t
20134 s,@TEST_DEPS@,$TEST_DEPS,;t t
20135 s,@TEST_LIBS@,$TEST_LIBS,;t t
20136 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
20137 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
20138 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
20139 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
20140 s,@includesubdir@,$includesubdir,;t t
20141 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
20142 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
20143 s,@ECHO_LT@,$ECHO_LT,;t t
20144 s,@ECHO_LD@,$ECHO_LD,;t t
20145 s,@RULE_CC@,$RULE_CC,;t t
20146 s,@SHOW_CC@,$SHOW_CC,;t t
20147 s,@ECHO_CC@,$ECHO_CC,;t t
20148 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
20149 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
20150 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
20151 s,@X_CFLAGS@,$X_CFLAGS,;t t
20152 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
20153 s,@X_LIBS@,$X_LIBS,;t t
20154 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
20155 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
20156 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
20157 s,@RGB_PATH@,$RGB_PATH,;t t
20158 s,@no_x11_rgb@,$no_x11_rgb,;t t
20159 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
20160 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
20161 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
20162 CEOF
20163
20164 EOF
20165
20166   cat >>$CONFIG_STATUS <<\EOF
20167   # Split the substitutions into bite-sized pieces for seds with
20168   # small command number limits, like on Digital OSF/1 and HP-UX.
20169   ac_max_sed_lines=48
20170   ac_sed_frag=1 # Number of current file.
20171   ac_beg=1 # First line for current file.
20172   ac_end=$ac_max_sed_lines # Line after last line for current file.
20173   ac_more_lines=:
20174   ac_sed_cmds=
20175   while $ac_more_lines; do
20176     if test $ac_beg -gt 1; then
20177       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20178     else
20179       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20180     fi
20181     if test ! -s $tmp/subs.frag; then
20182       ac_more_lines=false
20183     else
20184       # The purpose of the label and of the branching condition is to
20185       # speed up the sed processing (if there are no `@' at all, there
20186       # is no need to browse any of the substitutions).
20187       # These are the two extra sed commands mentioned above.
20188       (echo ':t
20189   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
20190       # It is possible to make a multiline substitution using escaped newlines.
20191       # Ensure that we do not split the substitution between script fragments.
20192       ac_BEG=$ac_end
20193       ac_END=`expr $ac_end + $ac_max_sed_lines`
20194       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
20195       if test -s $tmp/subs.next; then
20196         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
20197         if test ! -s $tmp/subs.edit; then
20198           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
20199           if test ! -s $tmp/subs.edit; then
20200             if test $ac_beg -gt 1; then
20201               ac_end=`expr $ac_end - 1`
20202               continue
20203             fi
20204           fi
20205         fi
20206       fi
20207
20208       if test -z "$ac_sed_cmds"; then
20209         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
20210       else
20211         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
20212       fi
20213       ac_sed_frag=`expr $ac_sed_frag + 1`
20214       ac_beg=$ac_end
20215       ac_end=`expr $ac_end + $ac_max_sed_lines`
20216     fi
20217   done
20218   if test -z "$ac_sed_cmds"; then
20219     ac_sed_cmds=cat
20220   fi
20221 fi # test -n "$CONFIG_FILES"
20222
20223 EOF
20224 cat >>$CONFIG_STATUS <<\EOF
20225 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
20226   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20227   case $ac_file in
20228   - | *:- | *:-:* ) # input from stdin
20229         cat >$tmp/stdin
20230         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20231         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20232   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20233         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20234   * )   ac_file_in=$ac_file.in ;;
20235   esac
20236
20237   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
20238   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20239          X"$ac_file" : 'X\(//\)[^/]' \| \
20240          X"$ac_file" : 'X\(//\)$' \| \
20241          X"$ac_file" : 'X\(/\)' \| \
20242          .     : '\(.\)' 2>/dev/null ||
20243 echo X"$ac_file" |
20244     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20245           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20246           /^X\(\/\/\)$/{ s//\1/; q; }
20247           /^X\(\/\).*/{ s//\1/; q; }
20248           s/.*/./; q'`
20249   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20250     { case "$ac_dir" in
20251   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20252   *)                      as_incr_dir=.;;
20253 esac
20254 as_dummy="$ac_dir"
20255 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20256   case $as_mkdir_dir in
20257     # Skip DOS drivespec
20258     ?:) as_incr_dir=$as_mkdir_dir ;;
20259     *)
20260       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20261       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20262     ;;
20263   esac
20264 done; }
20265
20266     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
20267     # A "../" for each directory in $ac_dir_suffix.
20268     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
20269   else
20270     ac_dir_suffix= ac_dots=
20271   fi
20272
20273   case $srcdir in
20274   .)  ac_srcdir=.
20275       if test -z "$ac_dots"; then
20276          ac_top_srcdir=.
20277       else
20278          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
20279       fi ;;
20280   [\\/]* | ?:[\\/]* )
20281       ac_srcdir=$srcdir$ac_dir_suffix;
20282       ac_top_srcdir=$srcdir ;;
20283   *) # Relative path.
20284     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
20285     ac_top_srcdir=$ac_dots$srcdir ;;
20286   esac
20287
20288   case $INSTALL in
20289   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
20290   *) ac_INSTALL=$ac_dots$INSTALL ;;
20291   esac
20292
20293   if test x"$ac_file" != x-; then
20294     { echo "$as_me:20294: creating $ac_file" >&5
20295 echo "$as_me: creating $ac_file" >&6;}
20296     rm -f "$ac_file"
20297   fi
20298   # Let's still pretend it is `configure' which instantiates (i.e., don't
20299   # use $as_me), people would be surprised to read:
20300   #    /* config.h.  Generated automatically by config.status.  */
20301   configure_input="Generated automatically from `echo $ac_file_in |
20302                                                  sed 's,.*/,,'` by configure."
20303
20304   # First look for the input files in the build tree, otherwise in the
20305   # src tree.
20306   ac_file_inputs=`IFS=:
20307     for f in $ac_file_in; do
20308       case $f in
20309       -) echo $tmp/stdin ;;
20310       [\\/$]*)
20311          # Absolute (can't be DOS-style, as IFS=:)
20312          test -f "$f" || { { echo "$as_me:20312: error: cannot find input file: $f" >&5
20313 echo "$as_me: error: cannot find input file: $f" >&2;}
20314    { (exit 1); exit 1; }; }
20315          echo $f;;
20316       *) # Relative
20317          if test -f "$f"; then
20318            # Build tree
20319            echo $f
20320          elif test -f "$srcdir/$f"; then
20321            # Source tree
20322            echo $srcdir/$f
20323          else
20324            # /dev/null tree
20325            { { echo "$as_me:20325: error: cannot find input file: $f" >&5
20326 echo "$as_me: error: cannot find input file: $f" >&2;}
20327    { (exit 1); exit 1; }; }
20328          fi;;
20329       esac
20330     done` || { (exit 1); exit 1; }
20331 EOF
20332 cat >>$CONFIG_STATUS <<\EOF
20333   ac_warn_datarootdir=no
20334   if test x"$ac_file" != x-; then
20335     for ac_item in $ac_file_inputs
20336     do
20337       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
20338       if test -n "$ac_seen"; then
20339         ac_used=`grep '@datarootdir@' $ac_item`
20340         if test -z "$ac_used"; then
20341           { echo "$as_me:20341: WARNING: datarootdir was used implicitly but not set:
20342 $ac_seen" >&5
20343 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
20344 $ac_seen" >&2;}
20345           ac_warn_datarootdir=yes
20346         fi
20347       fi
20348       ac_seen=`grep '${datarootdir}' $ac_item`
20349       if test -n "$ac_seen"; then
20350         { echo "$as_me:20350: WARNING: datarootdir was used explicitly but not set:
20351 $ac_seen" >&5
20352 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
20353 $ac_seen" >&2;}
20354         ac_warn_datarootdir=yes
20355       fi
20356     done
20357   fi
20358
20359 if test "x$ac_warn_datarootdir" = xyes; then
20360   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
20361 fi
20362
20363 EOF
20364 cat >>$CONFIG_STATUS <<EOF
20365   sed "$ac_vpsub
20366 $extrasub
20367 EOF
20368 cat >>$CONFIG_STATUS <<\EOF
20369 :t
20370 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
20371 s,@configure_input@,$configure_input,;t t
20372 s,@srcdir@,$ac_srcdir,;t t
20373 s,@top_srcdir@,$ac_top_srcdir,;t t
20374 s,@INSTALL@,$ac_INSTALL,;t t
20375 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
20376   rm -f $tmp/stdin
20377   if test x"$ac_file" != x-; then
20378     cp $tmp/out $ac_file
20379
20380     for ac_name in prefix exec_prefix datarootdir
20381     do
20382         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
20383         if test -n "$ac_seen"; then
20384             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
20385             if test -z "$ac_init"; then
20386               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
20387               { echo "$as_me:20387: WARNING: Variable $ac_name is used but was not set:
20388 $ac_seen" >&5
20389 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
20390 $ac_seen" >&2;}
20391             fi
20392         fi
20393     done
20394     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
20395     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
20396     if test -s $tmp/out; then
20397       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
20398       { echo "$as_me:20398: WARNING: Some variables may not be substituted:
20399 $ac_seen" >&5
20400 echo "$as_me: WARNING: Some variables may not be substituted:
20401 $ac_seen" >&2;}
20402     fi
20403   else
20404     cat $tmp/out
20405   fi
20406   rm -f $tmp/out
20407
20408 done
20409 EOF
20410 cat >>$CONFIG_STATUS <<\EOF
20411
20412 #
20413 # CONFIG_HEADER section.
20414 #
20415
20416 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
20417 # NAME is the cpp macro being defined and VALUE is the value it is being given.
20418 #
20419 # ac_d sets the value in "#define NAME VALUE" lines.
20420 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
20421 ac_dB='[        ].*$,\1#\2'
20422 ac_dC=' '
20423 ac_dD=',;t'
20424 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
20425 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20426 ac_iB='\([      ]\),\1#\2define\3'
20427 ac_iC=' '
20428 ac_iD='\4,;t'
20429 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
20430 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
20431 ac_uB='$,\1#\2define\3'
20432 ac_uC=' '
20433 ac_uD=',;t'
20434
20435 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
20436   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20437   case $ac_file in
20438   - | *:- | *:-:* ) # input from stdin
20439         cat >$tmp/stdin
20440         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20441         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20442   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20443         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20444   * )   ac_file_in=$ac_file.in ;;
20445   esac
20446
20447   test x"$ac_file" != x- && { echo "$as_me:20447: creating $ac_file" >&5
20448 echo "$as_me: creating $ac_file" >&6;}
20449
20450   # First look for the input files in the build tree, otherwise in the
20451   # src tree.
20452   ac_file_inputs=`IFS=:
20453     for f in $ac_file_in; do
20454       case $f in
20455       -) echo $tmp/stdin ;;
20456       [\\/$]*)
20457          # Absolute (can't be DOS-style, as IFS=:)
20458          test -f "$f" || { { echo "$as_me:20458: error: cannot find input file: $f" >&5
20459 echo "$as_me: error: cannot find input file: $f" >&2;}
20460    { (exit 1); exit 1; }; }
20461          echo $f;;
20462       *) # Relative
20463          if test -f "$f"; then
20464            # Build tree
20465            echo $f
20466          elif test -f "$srcdir/$f"; then
20467            # Source tree
20468            echo $srcdir/$f
20469          else
20470            # /dev/null tree
20471            { { echo "$as_me:20471: error: cannot find input file: $f" >&5
20472 echo "$as_me: error: cannot find input file: $f" >&2;}
20473    { (exit 1); exit 1; }; }
20474          fi;;
20475       esac
20476     done` || { (exit 1); exit 1; }
20477   # Remove the trailing spaces.
20478   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
20479
20480 EOF
20481
20482 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
20483 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
20484 # be either 'cat' or 'sort'.
20485 cat confdefs.h | uniq >conftest.vals
20486
20487 # Break up conftest.vals because some shells have a limit on
20488 # the size of here documents, and old seds have small limits too.
20489
20490 rm -f conftest.tail
20491 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
20492 while grep . conftest.vals >/dev/null
20493 do
20494   # Write chunks of a limited-size here document to conftest.frag.
20495   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
20496   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
20497   echo 'CEOF' >> $CONFIG_STATUS
20498   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
20499   rm -f conftest.vals
20500   mv conftest.tail conftest.vals
20501 done
20502 rm -f conftest.vals
20503
20504 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
20505 # marker @DEFS@.
20506 echo '  cat >> conftest.edit <<CEOF
20507 /@DEFS@/r conftest.frag
20508 /@DEFS@/d
20509 CEOF
20510 sed -f conftest.edit $tmp/in > $tmp/out
20511 rm -f $tmp/in
20512 mv $tmp/out $tmp/in
20513 rm -f conftest.edit conftest.frag
20514 ' >> $CONFIG_STATUS
20515
20516 cat >>$CONFIG_STATUS <<\EOF
20517   # Let's still pretend it is `configure' which instantiates (i.e., don't
20518   # use $as_me), people would be surprised to read:
20519   #    /* config.h.  Generated automatically by config.status.  */
20520   if test x"$ac_file" = x-; then
20521     echo "/* Generated automatically by configure.  */" >$tmp/config.h
20522   else
20523     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
20524   fi
20525   cat $tmp/in >>$tmp/config.h
20526   rm -f $tmp/in
20527   if test x"$ac_file" != x-; then
20528     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
20529       { echo "$as_me:20529: $ac_file is unchanged" >&5
20530 echo "$as_me: $ac_file is unchanged" >&6;}
20531     else
20532       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20533          X"$ac_file" : 'X\(//\)[^/]' \| \
20534          X"$ac_file" : 'X\(//\)$' \| \
20535          X"$ac_file" : 'X\(/\)' \| \
20536          .     : '\(.\)' 2>/dev/null ||
20537 echo X"$ac_file" |
20538     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20539           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20540           /^X\(\/\/\)$/{ s//\1/; q; }
20541           /^X\(\/\).*/{ s//\1/; q; }
20542           s/.*/./; q'`
20543       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20544         { case "$ac_dir" in
20545   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20546   *)                      as_incr_dir=.;;
20547 esac
20548 as_dummy="$ac_dir"
20549 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
20550   case $as_mkdir_dir in
20551     # Skip DOS drivespec
20552     ?:) as_incr_dir=$as_mkdir_dir ;;
20553     *)
20554       as_incr_dir=$as_incr_dir/$as_mkdir_dir
20555       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
20556     ;;
20557   esac
20558 done; }
20559
20560       fi
20561       rm -f $ac_file
20562       mv $tmp/config.h $ac_file
20563     fi
20564   else
20565     cat $tmp/config.h
20566     rm -f $tmp/config.h
20567   fi
20568 done
20569 EOF
20570 cat >>$CONFIG_STATUS <<\EOF
20571 #
20572 # CONFIG_COMMANDS section.
20573 #
20574 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
20575   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
20576   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
20577
20578   case $ac_dest in
20579     default )
20580
20581 for cf_dir in .
20582 do
20583         if test ! -d $srcdir/$cf_dir; then
20584                 continue
20585         elif test -f $srcdir/$cf_dir/programs; then
20586                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
20587         fi
20588 done
20589
20590         cat >>Makefile <<TEST_EOF
20591
20592 # These rules are generated so we do not rely on suffix rules, which do not
20593 # work consistently for different make-programs (the '\$(MODEL)/' confuses
20594 # some, and the '\$x' confuses others).
20595 TEST_EOF
20596
20597 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
20598 for N in $LIST
20599 do
20600         cat >>Makefile <<TEST_EOF
20601
20602 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
20603         \$(srcdir)/test.priv.h \\
20604         ncurses_cfg.h
20605         $SHOW_CC
20606         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
20607 TEST_EOF
20608 done
20609
20610 if test -f ../config.guess && test -f ../config.sub
20611 then
20612         cat >>Makefile <<TEST_EOF
20613
20614 # if we used CF_INHERIT for getting these files, we can remove them
20615 distclean::
20616         rm -f config.guess config.sub
20617 TEST_EOF
20618 fi
20619  ;;
20620   esac
20621 done
20622 EOF
20623
20624 cat >>$CONFIG_STATUS <<\EOF
20625
20626 { (exit 0); exit 0; }
20627 EOF
20628 chmod +x $CONFIG_STATUS
20629 ac_clean_files=$ac_clean_files_save
20630
20631 # configure is writing to config.log, and then calls config.status.
20632 # config.status does its own redirection, appending to config.log.
20633 # Unfortunately, on DOS this fails, as config.log is still kept open
20634 # by configure, so config.status won't be able to write to it; its
20635 # output is simply discarded.  So we exec the FD to /dev/null,
20636 # effectively closing config.log, so it can be properly (re)opened and
20637 # appended to by config.status.  When coming back to configure, we
20638 # need to make the FD available again.
20639 if test "$no_create" != yes; then
20640   ac_cs_success=:
20641   exec 5>/dev/null
20642   $SHELL $CONFIG_STATUS || ac_cs_success=false
20643   exec 5>>config.log
20644   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
20645   # would make configure fail if this is the last instruction.
20646   $ac_cs_success || { (exit 1); exit 1; }
20647 fi
20648