]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 6.1 - patch 20180623
[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
3327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3328         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3329
3330                 cat >conftest.$ac_ext <<_ACEOF
3331 #line 3331 "configure"
3332 #include "confdefs.h"
3333 #include <sys/types.h>
3334 int
3335 main (void)
3336 {
3337
3338                         #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
3339                                 return 0;
3340                         #else
3341                         #       error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
3342                         #endif
3343   ;
3344   return 0;
3345 }
3346 _ACEOF
3347 rm -f conftest.$ac_objext
3348 if { (eval echo "$as_me:3348: \"$ac_compile\"") >&5
3349   (eval $ac_compile) 2>&5
3350   ac_status=$?
3351   echo "$as_me:3351: \$? = $ac_status" >&5
3352   (exit $ac_status); } &&
3353          { ac_try='test -s conftest.$ac_objext'
3354   { (eval echo "$as_me:3354: \"$ac_try\"") >&5
3355   (eval $ac_try) 2>&5
3356   ac_status=$?
3357   echo "$as_me:3357: \$? = $ac_status" >&5
3358   (exit $ac_status); }; }; then
3359   cf_cv_gnu_library_219=yes
3360 else
3361   echo "$as_me: failed program was:" >&5
3362 cat conftest.$ac_ext >&5
3363 cf_cv_gnu_library_219=no
3364 fi
3365 rm -f conftest.$ac_objext conftest.$ac_ext
3366                 CPPFLAGS="$cf_save"
3367
3368 fi
3369 echo "$as_me:3369: result: $cf_cv_gnu_library_219" >&5
3370 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6
3371
3372         if test "x$cf_cv_gnu_library_219" = xyes; then
3373                 cf_save="$CPPFLAGS"
3374                 echo "$as_me:3374: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5
3375 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6
3376 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then
3377   echo $ECHO_N "(cached) $ECHO_C" >&6
3378 else
3379
3380 cf_fix_cppflags=no
3381 cf_new_cflags=
3382 cf_new_cppflags=
3383 cf_new_extra_cppflags=
3384
3385 for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source
3386 do
3387 case $cf_fix_cppflags in
3388 (no)
3389         case $cf_add_cflags in
3390         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3391                 case $cf_add_cflags in
3392                 (-D*)
3393                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3394
3395                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3396                                 && test -z "${cf_tst_cflags}" \
3397                                 && cf_fix_cppflags=yes
3398
3399                         if test $cf_fix_cppflags = yes ; then
3400
3401         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3402         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3403
3404                                 continue
3405                         elif test "${cf_tst_cflags}" = "\"'" ; then
3406
3407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3409
3410                                 continue
3411                         fi
3412                         ;;
3413                 esac
3414                 case "$CPPFLAGS" in
3415                 (*$cf_add_cflags)
3416                         ;;
3417                 (*)
3418                         case $cf_add_cflags in
3419                         (-D*)
3420                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3421
3422 CPPFLAGS=`echo "$CPPFLAGS" | \
3423         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3424                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3425
3426                                 ;;
3427                         esac
3428
3429         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3430         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3431
3432                         ;;
3433                 esac
3434                 ;;
3435         (*)
3436
3437         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3438         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3439
3440                 ;;
3441         esac
3442         ;;
3443 (yes)
3444
3445         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3446         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3447
3448         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3449
3450         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3451                 && test -z "${cf_tst_cflags}" \
3452                 && cf_fix_cppflags=no
3453         ;;
3454 esac
3455 done
3456
3457 if test -n "$cf_new_cflags" ; then
3458
3459         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3460         CFLAGS="${CFLAGS}$cf_new_cflags"
3461
3462 fi
3463
3464 if test -n "$cf_new_cppflags" ; then
3465
3466         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3467         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3468
3469 fi
3470
3471 if test -n "$cf_new_extra_cppflags" ; then
3472
3473         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3474         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3475
3476 fi
3477
3478                         cat >conftest.$ac_ext <<_ACEOF
3479 #line 3479 "configure"
3480 #include "confdefs.h"
3481
3482                                 #include <limits.h>
3483                                 #include <sys/types.h>
3484
3485 int
3486 main (void)
3487 {
3488
3489                                 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
3490                                         return 0;
3491                                 #else
3492                                 #       error GNU C library is too old
3493                                 #endif
3494   ;
3495   return 0;
3496 }
3497 _ACEOF
3498 rm -f conftest.$ac_objext
3499 if { (eval echo "$as_me:3499: \"$ac_compile\"") >&5
3500   (eval $ac_compile) 2>&5
3501   ac_status=$?
3502   echo "$as_me:3502: \$? = $ac_status" >&5
3503   (exit $ac_status); } &&
3504          { ac_try='test -s conftest.$ac_objext'
3505   { (eval echo "$as_me:3505: \"$ac_try\"") >&5
3506   (eval $ac_try) 2>&5
3507   ac_status=$?
3508   echo "$as_me:3508: \$? = $ac_status" >&5
3509   (exit $ac_status); }; }; then
3510   cf_cv_gnu_dftsrc_219=yes
3511 else
3512   echo "$as_me: failed program was:" >&5
3513 cat conftest.$ac_ext >&5
3514 cf_cv_gnu_dftsrc_219=no
3515 fi
3516 rm -f conftest.$ac_objext conftest.$ac_ext
3517
3518 fi
3519 echo "$as_me:3519: result: $cf_cv_gnu_dftsrc_219" >&5
3520 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6
3521                 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
3522         else
3523                 cf_cv_gnu_dftsrc_219=maybe
3524         fi
3525
3526         if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
3527
3528                 echo "$as_me:3528: checking if we must define _GNU_SOURCE" >&5
3529 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
3530 if test "${cf_cv_gnu_source+set}" = set; then
3531   echo $ECHO_N "(cached) $ECHO_C" >&6
3532 else
3533
3534                 cat >conftest.$ac_ext <<_ACEOF
3535 #line 3535 "configure"
3536 #include "confdefs.h"
3537 #include <sys/types.h>
3538 int
3539 main (void)
3540 {
3541
3542                         #ifndef _XOPEN_SOURCE
3543                         #error  expected _XOPEN_SOURCE to be defined
3544                         #endif
3545   ;
3546   return 0;
3547 }
3548 _ACEOF
3549 rm -f conftest.$ac_objext
3550 if { (eval echo "$as_me:3550: \"$ac_compile\"") >&5
3551   (eval $ac_compile) 2>&5
3552   ac_status=$?
3553   echo "$as_me:3553: \$? = $ac_status" >&5
3554   (exit $ac_status); } &&
3555          { ac_try='test -s conftest.$ac_objext'
3556   { (eval echo "$as_me:3556: \"$ac_try\"") >&5
3557   (eval $ac_try) 2>&5
3558   ac_status=$?
3559   echo "$as_me:3559: \$? = $ac_status" >&5
3560   (exit $ac_status); }; }; then
3561   cf_cv_gnu_source=no
3562 else
3563   echo "$as_me: failed program was:" >&5
3564 cat conftest.$ac_ext >&5
3565 cf_save="$CPPFLAGS"
3566
3567 cf_fix_cppflags=no
3568 cf_new_cflags=
3569 cf_new_cppflags=
3570 cf_new_extra_cppflags=
3571
3572 for cf_add_cflags in -D_GNU_SOURCE
3573 do
3574 case $cf_fix_cppflags in
3575 (no)
3576         case $cf_add_cflags in
3577         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3578                 case $cf_add_cflags in
3579                 (-D*)
3580                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3581
3582                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3583                                 && test -z "${cf_tst_cflags}" \
3584                                 && cf_fix_cppflags=yes
3585
3586                         if test $cf_fix_cppflags = yes ; then
3587
3588         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3589         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3590
3591                                 continue
3592                         elif test "${cf_tst_cflags}" = "\"'" ; then
3593
3594         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3595         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3596
3597                                 continue
3598                         fi
3599                         ;;
3600                 esac
3601                 case "$CPPFLAGS" in
3602                 (*$cf_add_cflags)
3603                         ;;
3604                 (*)
3605                         case $cf_add_cflags in
3606                         (-D*)
3607                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3608
3609 CPPFLAGS=`echo "$CPPFLAGS" | \
3610         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3611                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3612
3613                                 ;;
3614                         esac
3615
3616         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3617         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3618
3619                         ;;
3620                 esac
3621                 ;;
3622         (*)
3623
3624         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3625         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3626
3627                 ;;
3628         esac
3629         ;;
3630 (yes)
3631
3632         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3633         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3634
3635         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3636
3637         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3638                 && test -z "${cf_tst_cflags}" \
3639                 && cf_fix_cppflags=no
3640         ;;
3641 esac
3642 done
3643
3644 if test -n "$cf_new_cflags" ; then
3645
3646         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
3647         CFLAGS="${CFLAGS}$cf_new_cflags"
3648
3649 fi
3650
3651 if test -n "$cf_new_cppflags" ; then
3652
3653         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3654         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
3655
3656 fi
3657
3658 if test -n "$cf_new_extra_cppflags" ; then
3659
3660         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
3661         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
3662
3663 fi
3664
3665                          cat >conftest.$ac_ext <<_ACEOF
3666 #line 3666 "configure"
3667 #include "confdefs.h"
3668 #include <sys/types.h>
3669 int
3670 main (void)
3671 {
3672
3673                                 #ifdef _XOPEN_SOURCE
3674                                 #error  expected _XOPEN_SOURCE to be undefined
3675                                 #endif
3676   ;
3677   return 0;
3678 }
3679 _ACEOF
3680 rm -f conftest.$ac_objext
3681 if { (eval echo "$as_me:3681: \"$ac_compile\"") >&5
3682   (eval $ac_compile) 2>&5
3683   ac_status=$?
3684   echo "$as_me:3684: \$? = $ac_status" >&5
3685   (exit $ac_status); } &&
3686          { ac_try='test -s conftest.$ac_objext'
3687   { (eval echo "$as_me:3687: \"$ac_try\"") >&5
3688   (eval $ac_try) 2>&5
3689   ac_status=$?
3690   echo "$as_me:3690: \$? = $ac_status" >&5
3691   (exit $ac_status); }; }; then
3692   cf_cv_gnu_source=no
3693 else
3694   echo "$as_me: failed program was:" >&5
3695 cat conftest.$ac_ext >&5
3696 cf_cv_gnu_source=yes
3697 fi
3698 rm -f conftest.$ac_objext conftest.$ac_ext
3699                         CPPFLAGS="$cf_save"
3700
3701 fi
3702 rm -f conftest.$ac_objext conftest.$ac_ext
3703
3704 fi
3705 echo "$as_me:3705: result: $cf_cv_gnu_source" >&5
3706 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3707
3708                 if test "$cf_cv_gnu_source" = yes
3709                 then
3710                 echo "$as_me:3710: checking if we should also define _DEFAULT_SOURCE" >&5
3711 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6
3712 if test "${cf_cv_default_source+set}" = set; then
3713   echo $ECHO_N "(cached) $ECHO_C" >&6
3714 else
3715
3716         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3717         CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE"
3718
3719                         cat >conftest.$ac_ext <<_ACEOF
3720 #line 3720 "configure"
3721 #include "confdefs.h"
3722 #include <sys/types.h>
3723 int
3724 main (void)
3725 {
3726
3727                                 #ifdef _DEFAULT_SOURCE
3728                                 #error  expected _DEFAULT_SOURCE to be undefined
3729                                 #endif
3730   ;
3731   return 0;
3732 }
3733 _ACEOF
3734 rm -f conftest.$ac_objext
3735 if { (eval echo "$as_me:3735: \"$ac_compile\"") >&5
3736   (eval $ac_compile) 2>&5
3737   ac_status=$?
3738   echo "$as_me:3738: \$? = $ac_status" >&5
3739   (exit $ac_status); } &&
3740          { ac_try='test -s conftest.$ac_objext'
3741   { (eval echo "$as_me:3741: \"$ac_try\"") >&5
3742   (eval $ac_try) 2>&5
3743   ac_status=$?
3744   echo "$as_me:3744: \$? = $ac_status" >&5
3745   (exit $ac_status); }; }; then
3746   cf_cv_default_source=no
3747 else
3748   echo "$as_me: failed program was:" >&5
3749 cat conftest.$ac_ext >&5
3750 cf_cv_default_source=yes
3751 fi
3752 rm -f conftest.$ac_objext conftest.$ac_ext
3753
3754 fi
3755 echo "$as_me:3755: result: $cf_cv_default_source" >&5
3756 echo "${ECHO_T}$cf_cv_default_source" >&6
3757                         if test "$cf_cv_default_source" = yes
3758                         then
3759
3760         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3761         CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE"
3762
3763                         fi
3764                 fi
3765         fi
3766
3767 fi
3768
3769         ;;
3770 (minix*)
3771         cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
3772         ;;
3773 (mirbsd*)
3774         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3775         cf_XOPEN_SOURCE=
3776
3777 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3778
3779 cf_save_CFLAGS="$CFLAGS"
3780 cf_save_CPPFLAGS="$CPPFLAGS"
3781
3782 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3783         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3784                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3785
3786 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3787         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3788                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3789
3790 echo "$as_me:3790: checking if we should define _POSIX_C_SOURCE" >&5
3791 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3792 if test "${cf_cv_posix_c_source+set}" = set; then
3793   echo $ECHO_N "(cached) $ECHO_C" >&6
3794 else
3795
3796 echo "${as_me:-configure}:3796: testing if the symbol is already defined go no further ..." 1>&5
3797
3798         cat >conftest.$ac_ext <<_ACEOF
3799 #line 3799 "configure"
3800 #include "confdefs.h"
3801 #include <sys/types.h>
3802 int
3803 main (void)
3804 {
3805
3806 #ifndef _POSIX_C_SOURCE
3807 make an error
3808 #endif
3809   ;
3810   return 0;
3811 }
3812 _ACEOF
3813 rm -f conftest.$ac_objext
3814 if { (eval echo "$as_me:3814: \"$ac_compile\"") >&5
3815   (eval $ac_compile) 2>&5
3816   ac_status=$?
3817   echo "$as_me:3817: \$? = $ac_status" >&5
3818   (exit $ac_status); } &&
3819          { ac_try='test -s conftest.$ac_objext'
3820   { (eval echo "$as_me:3820: \"$ac_try\"") >&5
3821   (eval $ac_try) 2>&5
3822   ac_status=$?
3823   echo "$as_me:3823: \$? = $ac_status" >&5
3824   (exit $ac_status); }; }; then
3825   cf_cv_posix_c_source=no
3826 else
3827   echo "$as_me: failed program was:" >&5
3828 cat conftest.$ac_ext >&5
3829 cf_want_posix_source=no
3830          case .$cf_POSIX_C_SOURCE in
3831          (.[12]??*)
3832                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3833                 ;;
3834          (.2)
3835                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3836                 cf_want_posix_source=yes
3837                 ;;
3838          (.*)
3839                 cf_want_posix_source=yes
3840                 ;;
3841          esac
3842          if test "$cf_want_posix_source" = yes ; then
3843                 cat >conftest.$ac_ext <<_ACEOF
3844 #line 3844 "configure"
3845 #include "confdefs.h"
3846 #include <sys/types.h>
3847 int
3848 main (void)
3849 {
3850
3851 #ifdef _POSIX_SOURCE
3852 make an error
3853 #endif
3854   ;
3855   return 0;
3856 }
3857 _ACEOF
3858 rm -f conftest.$ac_objext
3859 if { (eval echo "$as_me:3859: \"$ac_compile\"") >&5
3860   (eval $ac_compile) 2>&5
3861   ac_status=$?
3862   echo "$as_me:3862: \$? = $ac_status" >&5
3863   (exit $ac_status); } &&
3864          { ac_try='test -s conftest.$ac_objext'
3865   { (eval echo "$as_me:3865: \"$ac_try\"") >&5
3866   (eval $ac_try) 2>&5
3867   ac_status=$?
3868   echo "$as_me:3868: \$? = $ac_status" >&5
3869   (exit $ac_status); }; }; then
3870   :
3871 else
3872   echo "$as_me: failed program was:" >&5
3873 cat conftest.$ac_ext >&5
3874 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3875 fi
3876 rm -f conftest.$ac_objext conftest.$ac_ext
3877          fi
3878
3879 echo "${as_me:-configure}:3879: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3880
3881          CFLAGS="$cf_trim_CFLAGS"
3882          CPPFLAGS="$cf_trim_CPPFLAGS"
3883
3884         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
3885         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
3886
3887 echo "${as_me:-configure}:3887: testing if the second compile does not leave our definition intact error ..." 1>&5
3888
3889          cat >conftest.$ac_ext <<_ACEOF
3890 #line 3890 "configure"
3891 #include "confdefs.h"
3892 #include <sys/types.h>
3893 int
3894 main (void)
3895 {
3896
3897 #ifndef _POSIX_C_SOURCE
3898 make an error
3899 #endif
3900   ;
3901   return 0;
3902 }
3903 _ACEOF
3904 rm -f conftest.$ac_objext
3905 if { (eval echo "$as_me:3905: \"$ac_compile\"") >&5
3906   (eval $ac_compile) 2>&5
3907   ac_status=$?
3908   echo "$as_me:3908: \$? = $ac_status" >&5
3909   (exit $ac_status); } &&
3910          { ac_try='test -s conftest.$ac_objext'
3911   { (eval echo "$as_me:3911: \"$ac_try\"") >&5
3912   (eval $ac_try) 2>&5
3913   ac_status=$?
3914   echo "$as_me:3914: \$? = $ac_status" >&5
3915   (exit $ac_status); }; }; then
3916   :
3917 else
3918   echo "$as_me: failed program was:" >&5
3919 cat conftest.$ac_ext >&5
3920 cf_cv_posix_c_source=no
3921 fi
3922 rm -f conftest.$ac_objext conftest.$ac_ext
3923          CFLAGS="$cf_save_CFLAGS"
3924          CPPFLAGS="$cf_save_CPPFLAGS"
3925
3926 fi
3927 rm -f conftest.$ac_objext conftest.$ac_ext
3928
3929 fi
3930 echo "$as_me:3930: result: $cf_cv_posix_c_source" >&5
3931 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3932
3933 if test "$cf_cv_posix_c_source" != no ; then
3934         CFLAGS="$cf_trim_CFLAGS"
3935         CPPFLAGS="$cf_trim_CPPFLAGS"
3936
3937 cf_fix_cppflags=no
3938 cf_new_cflags=
3939 cf_new_cppflags=
3940 cf_new_extra_cppflags=
3941
3942 for cf_add_cflags in $cf_cv_posix_c_source
3943 do
3944 case $cf_fix_cppflags in
3945 (no)
3946         case $cf_add_cflags in
3947         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
3948                 case $cf_add_cflags in
3949                 (-D*)
3950                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3951
3952                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
3953                                 && test -z "${cf_tst_cflags}" \
3954                                 && cf_fix_cppflags=yes
3955
3956                         if test $cf_fix_cppflags = yes ; then
3957
3958         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3959         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3960
3961                                 continue
3962                         elif test "${cf_tst_cflags}" = "\"'" ; then
3963
3964         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
3965         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
3966
3967                                 continue
3968                         fi
3969                         ;;
3970                 esac
3971                 case "$CPPFLAGS" in
3972                 (*$cf_add_cflags)
3973                         ;;
3974                 (*)
3975                         case $cf_add_cflags in
3976                         (-D*)
3977                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3978
3979 CPPFLAGS=`echo "$CPPFLAGS" | \
3980         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3981                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3982
3983                                 ;;
3984                         esac
3985
3986         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
3987         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
3988
3989                         ;;
3990                 esac
3991                 ;;
3992         (*)
3993
3994         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
3995         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
3996
3997                 ;;
3998         esac
3999         ;;
4000 (yes)
4001
4002         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4003         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4004
4005         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4006
4007         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4008                 && test -z "${cf_tst_cflags}" \
4009                 && cf_fix_cppflags=no
4010         ;;
4011 esac
4012 done
4013
4014 if test -n "$cf_new_cflags" ; then
4015
4016         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4017         CFLAGS="${CFLAGS}$cf_new_cflags"
4018
4019 fi
4020
4021 if test -n "$cf_new_cppflags" ; then
4022
4023         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4024         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4025
4026 fi
4027
4028 if test -n "$cf_new_extra_cppflags" ; then
4029
4030         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4031         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4032
4033 fi
4034
4035 fi
4036
4037         ;;
4038 (netbsd*)
4039         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
4040         ;;
4041 (openbsd[4-9]*)
4042         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
4043         cf_xopen_source="-D_BSD_SOURCE"
4044         cf_XOPEN_SOURCE=600
4045         ;;
4046 (openbsd*)
4047         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
4048         ;;
4049 (osf[45]*)
4050         cf_xopen_source="-D_OSF_SOURCE"
4051         ;;
4052 (nto-qnx*)
4053         cf_xopen_source="-D_QNX_SOURCE"
4054         ;;
4055 (sco*)
4056         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
4057         ;;
4058 (solaris2.*)
4059         cf_xopen_source="-D__EXTENSIONS__"
4060         cf_cv_xopen_source=broken
4061         ;;
4062 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
4063         cf_XOPEN_SOURCE=
4064         cf_POSIX_C_SOURCE=
4065         ;;
4066 (*)
4067
4068 echo "$as_me:4068: checking if we should define _XOPEN_SOURCE" >&5
4069 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4070 if test "${cf_cv_xopen_source+set}" = set; then
4071   echo $ECHO_N "(cached) $ECHO_C" >&6
4072 else
4073
4074         cat >conftest.$ac_ext <<_ACEOF
4075 #line 4075 "configure"
4076 #include "confdefs.h"
4077
4078 #include <stdlib.h>
4079 #include <string.h>
4080 #include <sys/types.h>
4081
4082 int
4083 main (void)
4084 {
4085
4086 #ifndef _XOPEN_SOURCE
4087 make an error
4088 #endif
4089   ;
4090   return 0;
4091 }
4092 _ACEOF
4093 rm -f conftest.$ac_objext
4094 if { (eval echo "$as_me:4094: \"$ac_compile\"") >&5
4095   (eval $ac_compile) 2>&5
4096   ac_status=$?
4097   echo "$as_me:4097: \$? = $ac_status" >&5
4098   (exit $ac_status); } &&
4099          { ac_try='test -s conftest.$ac_objext'
4100   { (eval echo "$as_me:4100: \"$ac_try\"") >&5
4101   (eval $ac_try) 2>&5
4102   ac_status=$?
4103   echo "$as_me:4103: \$? = $ac_status" >&5
4104   (exit $ac_status); }; }; then
4105   cf_cv_xopen_source=no
4106 else
4107   echo "$as_me: failed program was:" >&5
4108 cat conftest.$ac_ext >&5
4109 cf_save="$CPPFLAGS"
4110
4111         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4112         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4113
4114          cat >conftest.$ac_ext <<_ACEOF
4115 #line 4115 "configure"
4116 #include "confdefs.h"
4117
4118 #include <stdlib.h>
4119 #include <string.h>
4120 #include <sys/types.h>
4121
4122 int
4123 main (void)
4124 {
4125
4126 #ifdef _XOPEN_SOURCE
4127 make an error
4128 #endif
4129   ;
4130   return 0;
4131 }
4132 _ACEOF
4133 rm -f conftest.$ac_objext
4134 if { (eval echo "$as_me:4134: \"$ac_compile\"") >&5
4135   (eval $ac_compile) 2>&5
4136   ac_status=$?
4137   echo "$as_me:4137: \$? = $ac_status" >&5
4138   (exit $ac_status); } &&
4139          { ac_try='test -s conftest.$ac_objext'
4140   { (eval echo "$as_me:4140: \"$ac_try\"") >&5
4141   (eval $ac_try) 2>&5
4142   ac_status=$?
4143   echo "$as_me:4143: \$? = $ac_status" >&5
4144   (exit $ac_status); }; }; then
4145   cf_cv_xopen_source=no
4146 else
4147   echo "$as_me: failed program was:" >&5
4148 cat conftest.$ac_ext >&5
4149 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4150 fi
4151 rm -f conftest.$ac_objext conftest.$ac_ext
4152         CPPFLAGS="$cf_save"
4153
4154 fi
4155 rm -f conftest.$ac_objext conftest.$ac_ext
4156
4157 fi
4158 echo "$as_me:4158: result: $cf_cv_xopen_source" >&5
4159 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4160
4161 if test "$cf_cv_xopen_source" != no ; then
4162
4163 CFLAGS=`echo "$CFLAGS" | \
4164         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4165                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4166
4167 CPPFLAGS=`echo "$CPPFLAGS" | \
4168         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4169                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4170
4171         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4172
4173 cf_fix_cppflags=no
4174 cf_new_cflags=
4175 cf_new_cppflags=
4176 cf_new_extra_cppflags=
4177
4178 for cf_add_cflags in $cf_temp_xopen_source
4179 do
4180 case $cf_fix_cppflags in
4181 (no)
4182         case $cf_add_cflags in
4183         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4184                 case $cf_add_cflags in
4185                 (-D*)
4186                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4187
4188                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4189                                 && test -z "${cf_tst_cflags}" \
4190                                 && cf_fix_cppflags=yes
4191
4192                         if test $cf_fix_cppflags = yes ; then
4193
4194         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4195         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4196
4197                                 continue
4198                         elif test "${cf_tst_cflags}" = "\"'" ; then
4199
4200         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4201         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4202
4203                                 continue
4204                         fi
4205                         ;;
4206                 esac
4207                 case "$CPPFLAGS" in
4208                 (*$cf_add_cflags)
4209                         ;;
4210                 (*)
4211                         case $cf_add_cflags in
4212                         (-D*)
4213                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4214
4215 CPPFLAGS=`echo "$CPPFLAGS" | \
4216         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4217                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4218
4219                                 ;;
4220                         esac
4221
4222         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4223         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4224
4225                         ;;
4226                 esac
4227                 ;;
4228         (*)
4229
4230         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4231         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4232
4233                 ;;
4234         esac
4235         ;;
4236 (yes)
4237
4238         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4239         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4240
4241         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4242
4243         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4244                 && test -z "${cf_tst_cflags}" \
4245                 && cf_fix_cppflags=no
4246         ;;
4247 esac
4248 done
4249
4250 if test -n "$cf_new_cflags" ; then
4251
4252         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4253         CFLAGS="${CFLAGS}$cf_new_cflags"
4254
4255 fi
4256
4257 if test -n "$cf_new_cppflags" ; then
4258
4259         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4260         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4261
4262 fi
4263
4264 if test -n "$cf_new_extra_cppflags" ; then
4265
4266         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4267         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4268
4269 fi
4270
4271 fi
4272
4273 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
4274
4275 cf_save_CFLAGS="$CFLAGS"
4276 cf_save_CPPFLAGS="$CPPFLAGS"
4277
4278 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
4279         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4280                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4281
4282 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
4283         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
4284                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
4285
4286 echo "$as_me:4286: checking if we should define _POSIX_C_SOURCE" >&5
4287 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
4288 if test "${cf_cv_posix_c_source+set}" = set; then
4289   echo $ECHO_N "(cached) $ECHO_C" >&6
4290 else
4291
4292 echo "${as_me:-configure}:4292: testing if the symbol is already defined go no further ..." 1>&5
4293
4294         cat >conftest.$ac_ext <<_ACEOF
4295 #line 4295 "configure"
4296 #include "confdefs.h"
4297 #include <sys/types.h>
4298 int
4299 main (void)
4300 {
4301
4302 #ifndef _POSIX_C_SOURCE
4303 make an error
4304 #endif
4305   ;
4306   return 0;
4307 }
4308 _ACEOF
4309 rm -f conftest.$ac_objext
4310 if { (eval echo "$as_me:4310: \"$ac_compile\"") >&5
4311   (eval $ac_compile) 2>&5
4312   ac_status=$?
4313   echo "$as_me:4313: \$? = $ac_status" >&5
4314   (exit $ac_status); } &&
4315          { ac_try='test -s conftest.$ac_objext'
4316   { (eval echo "$as_me:4316: \"$ac_try\"") >&5
4317   (eval $ac_try) 2>&5
4318   ac_status=$?
4319   echo "$as_me:4319: \$? = $ac_status" >&5
4320   (exit $ac_status); }; }; then
4321   cf_cv_posix_c_source=no
4322 else
4323   echo "$as_me: failed program was:" >&5
4324 cat conftest.$ac_ext >&5
4325 cf_want_posix_source=no
4326          case .$cf_POSIX_C_SOURCE in
4327          (.[12]??*)
4328                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4329                 ;;
4330          (.2)
4331                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
4332                 cf_want_posix_source=yes
4333                 ;;
4334          (.*)
4335                 cf_want_posix_source=yes
4336                 ;;
4337          esac
4338          if test "$cf_want_posix_source" = yes ; then
4339                 cat >conftest.$ac_ext <<_ACEOF
4340 #line 4340 "configure"
4341 #include "confdefs.h"
4342 #include <sys/types.h>
4343 int
4344 main (void)
4345 {
4346
4347 #ifdef _POSIX_SOURCE
4348 make an error
4349 #endif
4350   ;
4351   return 0;
4352 }
4353 _ACEOF
4354 rm -f conftest.$ac_objext
4355 if { (eval echo "$as_me:4355: \"$ac_compile\"") >&5
4356   (eval $ac_compile) 2>&5
4357   ac_status=$?
4358   echo "$as_me:4358: \$? = $ac_status" >&5
4359   (exit $ac_status); } &&
4360          { ac_try='test -s conftest.$ac_objext'
4361   { (eval echo "$as_me:4361: \"$ac_try\"") >&5
4362   (eval $ac_try) 2>&5
4363   ac_status=$?
4364   echo "$as_me:4364: \$? = $ac_status" >&5
4365   (exit $ac_status); }; }; then
4366   :
4367 else
4368   echo "$as_me: failed program was:" >&5
4369 cat conftest.$ac_ext >&5
4370 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
4371 fi
4372 rm -f conftest.$ac_objext conftest.$ac_ext
4373          fi
4374
4375 echo "${as_me:-configure}:4375: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
4376
4377          CFLAGS="$cf_trim_CFLAGS"
4378          CPPFLAGS="$cf_trim_CPPFLAGS"
4379
4380         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4381         CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source"
4382
4383 echo "${as_me:-configure}:4383: testing if the second compile does not leave our definition intact error ..." 1>&5
4384
4385          cat >conftest.$ac_ext <<_ACEOF
4386 #line 4386 "configure"
4387 #include "confdefs.h"
4388 #include <sys/types.h>
4389 int
4390 main (void)
4391 {
4392
4393 #ifndef _POSIX_C_SOURCE
4394 make an error
4395 #endif
4396   ;
4397   return 0;
4398 }
4399 _ACEOF
4400 rm -f conftest.$ac_objext
4401 if { (eval echo "$as_me:4401: \"$ac_compile\"") >&5
4402   (eval $ac_compile) 2>&5
4403   ac_status=$?
4404   echo "$as_me:4404: \$? = $ac_status" >&5
4405   (exit $ac_status); } &&
4406          { ac_try='test -s conftest.$ac_objext'
4407   { (eval echo "$as_me:4407: \"$ac_try\"") >&5
4408   (eval $ac_try) 2>&5
4409   ac_status=$?
4410   echo "$as_me:4410: \$? = $ac_status" >&5
4411   (exit $ac_status); }; }; then
4412   :
4413 else
4414   echo "$as_me: failed program was:" >&5
4415 cat conftest.$ac_ext >&5
4416 cf_cv_posix_c_source=no
4417 fi
4418 rm -f conftest.$ac_objext conftest.$ac_ext
4419          CFLAGS="$cf_save_CFLAGS"
4420          CPPFLAGS="$cf_save_CPPFLAGS"
4421
4422 fi
4423 rm -f conftest.$ac_objext conftest.$ac_ext
4424
4425 fi
4426 echo "$as_me:4426: result: $cf_cv_posix_c_source" >&5
4427 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
4428
4429 if test "$cf_cv_posix_c_source" != no ; then
4430         CFLAGS="$cf_trim_CFLAGS"
4431         CPPFLAGS="$cf_trim_CPPFLAGS"
4432
4433 cf_fix_cppflags=no
4434 cf_new_cflags=
4435 cf_new_cppflags=
4436 cf_new_extra_cppflags=
4437
4438 for cf_add_cflags in $cf_cv_posix_c_source
4439 do
4440 case $cf_fix_cppflags in
4441 (no)
4442         case $cf_add_cflags in
4443         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4444                 case $cf_add_cflags in
4445                 (-D*)
4446                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4447
4448                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4449                                 && test -z "${cf_tst_cflags}" \
4450                                 && cf_fix_cppflags=yes
4451
4452                         if test $cf_fix_cppflags = yes ; then
4453
4454         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4455         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4456
4457                                 continue
4458                         elif test "${cf_tst_cflags}" = "\"'" ; then
4459
4460         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4461         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4462
4463                                 continue
4464                         fi
4465                         ;;
4466                 esac
4467                 case "$CPPFLAGS" in
4468                 (*$cf_add_cflags)
4469                         ;;
4470                 (*)
4471                         case $cf_add_cflags in
4472                         (-D*)
4473                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4474
4475 CPPFLAGS=`echo "$CPPFLAGS" | \
4476         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4477                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4478
4479                                 ;;
4480                         esac
4481
4482         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4483         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4484
4485                         ;;
4486                 esac
4487                 ;;
4488         (*)
4489
4490         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4491         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4492
4493                 ;;
4494         esac
4495         ;;
4496 (yes)
4497
4498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4500
4501         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4502
4503         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4504                 && test -z "${cf_tst_cflags}" \
4505                 && cf_fix_cppflags=no
4506         ;;
4507 esac
4508 done
4509
4510 if test -n "$cf_new_cflags" ; then
4511
4512         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4513         CFLAGS="${CFLAGS}$cf_new_cflags"
4514
4515 fi
4516
4517 if test -n "$cf_new_cppflags" ; then
4518
4519         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4520         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4521
4522 fi
4523
4524 if test -n "$cf_new_extra_cppflags" ; then
4525
4526         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4527         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4528
4529 fi
4530
4531 fi
4532
4533         ;;
4534 esac
4535
4536 if test -n "$cf_xopen_source" ; then
4537
4538 cf_fix_cppflags=no
4539 cf_new_cflags=
4540 cf_new_cppflags=
4541 cf_new_extra_cppflags=
4542
4543 for cf_add_cflags in $cf_xopen_source
4544 do
4545 case $cf_fix_cppflags in
4546 (no)
4547         case $cf_add_cflags in
4548         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4549                 case $cf_add_cflags in
4550                 (-D*)
4551                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4552
4553                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4554                                 && test -z "${cf_tst_cflags}" \
4555                                 && cf_fix_cppflags=yes
4556
4557                         if test $cf_fix_cppflags = yes ; then
4558
4559         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4560         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4561
4562                                 continue
4563                         elif test "${cf_tst_cflags}" = "\"'" ; then
4564
4565         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4566         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4567
4568                                 continue
4569                         fi
4570                         ;;
4571                 esac
4572                 case "$CPPFLAGS" in
4573                 (*$cf_add_cflags)
4574                         ;;
4575                 (*)
4576                         case $cf_add_cflags in
4577                         (-D*)
4578                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4579
4580 CPPFLAGS=`echo "$CPPFLAGS" | \
4581         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4582                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4583
4584                                 ;;
4585                         esac
4586
4587         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4588         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4589
4590                         ;;
4591                 esac
4592                 ;;
4593         (*)
4594
4595         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4596         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4597
4598                 ;;
4599         esac
4600         ;;
4601 (yes)
4602
4603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4605
4606         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4607
4608         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4609                 && test -z "${cf_tst_cflags}" \
4610                 && cf_fix_cppflags=no
4611         ;;
4612 esac
4613 done
4614
4615 if test -n "$cf_new_cflags" ; then
4616         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
4617
4618 echo "${as_me:-configure}:4618: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
4619
4620         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4621         CFLAGS="${CFLAGS}$cf_new_cflags"
4622
4623 fi
4624
4625 if test -n "$cf_new_cppflags" ; then
4626         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
4627
4628 echo "${as_me:-configure}:4628: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
4629
4630         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4631         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4632
4633 fi
4634
4635 if test -n "$cf_new_extra_cppflags" ; then
4636         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
4637
4638 echo "${as_me:-configure}:4638: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
4639
4640         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4641         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4642
4643 fi
4644
4645 fi
4646
4647 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
4648         echo "$as_me:4648: checking if _XOPEN_SOURCE really is set" >&5
4649 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
4650         cat >conftest.$ac_ext <<_ACEOF
4651 #line 4651 "configure"
4652 #include "confdefs.h"
4653 #include <stdlib.h>
4654 int
4655 main (void)
4656 {
4657
4658 #ifndef _XOPEN_SOURCE
4659 make an error
4660 #endif
4661   ;
4662   return 0;
4663 }
4664 _ACEOF
4665 rm -f conftest.$ac_objext
4666 if { (eval echo "$as_me:4666: \"$ac_compile\"") >&5
4667   (eval $ac_compile) 2>&5
4668   ac_status=$?
4669   echo "$as_me:4669: \$? = $ac_status" >&5
4670   (exit $ac_status); } &&
4671          { ac_try='test -s conftest.$ac_objext'
4672   { (eval echo "$as_me:4672: \"$ac_try\"") >&5
4673   (eval $ac_try) 2>&5
4674   ac_status=$?
4675   echo "$as_me:4675: \$? = $ac_status" >&5
4676   (exit $ac_status); }; }; then
4677   cf_XOPEN_SOURCE_set=yes
4678 else
4679   echo "$as_me: failed program was:" >&5
4680 cat conftest.$ac_ext >&5
4681 cf_XOPEN_SOURCE_set=no
4682 fi
4683 rm -f conftest.$ac_objext conftest.$ac_ext
4684         echo "$as_me:4684: result: $cf_XOPEN_SOURCE_set" >&5
4685 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
4686         if test $cf_XOPEN_SOURCE_set = yes
4687         then
4688                 cat >conftest.$ac_ext <<_ACEOF
4689 #line 4689 "configure"
4690 #include "confdefs.h"
4691 #include <stdlib.h>
4692 int
4693 main (void)
4694 {
4695
4696 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
4697 make an error
4698 #endif
4699   ;
4700   return 0;
4701 }
4702 _ACEOF
4703 rm -f conftest.$ac_objext
4704 if { (eval echo "$as_me:4704: \"$ac_compile\"") >&5
4705   (eval $ac_compile) 2>&5
4706   ac_status=$?
4707   echo "$as_me:4707: \$? = $ac_status" >&5
4708   (exit $ac_status); } &&
4709          { ac_try='test -s conftest.$ac_objext'
4710   { (eval echo "$as_me:4710: \"$ac_try\"") >&5
4711   (eval $ac_try) 2>&5
4712   ac_status=$?
4713   echo "$as_me:4713: \$? = $ac_status" >&5
4714   (exit $ac_status); }; }; then
4715   cf_XOPEN_SOURCE_set_ok=yes
4716 else
4717   echo "$as_me: failed program was:" >&5
4718 cat conftest.$ac_ext >&5
4719 cf_XOPEN_SOURCE_set_ok=no
4720 fi
4721 rm -f conftest.$ac_objext conftest.$ac_ext
4722                 if test $cf_XOPEN_SOURCE_set_ok = no
4723                 then
4724                         { echo "$as_me:4724: WARNING: _XOPEN_SOURCE is lower than requested" >&5
4725 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
4726                 fi
4727         else
4728
4729 echo "$as_me:4729: checking if we should define _XOPEN_SOURCE" >&5
4730 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
4731 if test "${cf_cv_xopen_source+set}" = set; then
4732   echo $ECHO_N "(cached) $ECHO_C" >&6
4733 else
4734
4735         cat >conftest.$ac_ext <<_ACEOF
4736 #line 4736 "configure"
4737 #include "confdefs.h"
4738
4739 #include <stdlib.h>
4740 #include <string.h>
4741 #include <sys/types.h>
4742
4743 int
4744 main (void)
4745 {
4746
4747 #ifndef _XOPEN_SOURCE
4748 make an error
4749 #endif
4750   ;
4751   return 0;
4752 }
4753 _ACEOF
4754 rm -f conftest.$ac_objext
4755 if { (eval echo "$as_me:4755: \"$ac_compile\"") >&5
4756   (eval $ac_compile) 2>&5
4757   ac_status=$?
4758   echo "$as_me:4758: \$? = $ac_status" >&5
4759   (exit $ac_status); } &&
4760          { ac_try='test -s conftest.$ac_objext'
4761   { (eval echo "$as_me:4761: \"$ac_try\"") >&5
4762   (eval $ac_try) 2>&5
4763   ac_status=$?
4764   echo "$as_me:4764: \$? = $ac_status" >&5
4765   (exit $ac_status); }; }; then
4766   cf_cv_xopen_source=no
4767 else
4768   echo "$as_me: failed program was:" >&5
4769 cat conftest.$ac_ext >&5
4770 cf_save="$CPPFLAGS"
4771
4772         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4773         CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
4774
4775          cat >conftest.$ac_ext <<_ACEOF
4776 #line 4776 "configure"
4777 #include "confdefs.h"
4778
4779 #include <stdlib.h>
4780 #include <string.h>
4781 #include <sys/types.h>
4782
4783 int
4784 main (void)
4785 {
4786
4787 #ifdef _XOPEN_SOURCE
4788 make an error
4789 #endif
4790   ;
4791   return 0;
4792 }
4793 _ACEOF
4794 rm -f conftest.$ac_objext
4795 if { (eval echo "$as_me:4795: \"$ac_compile\"") >&5
4796   (eval $ac_compile) 2>&5
4797   ac_status=$?
4798   echo "$as_me:4798: \$? = $ac_status" >&5
4799   (exit $ac_status); } &&
4800          { ac_try='test -s conftest.$ac_objext'
4801   { (eval echo "$as_me:4801: \"$ac_try\"") >&5
4802   (eval $ac_try) 2>&5
4803   ac_status=$?
4804   echo "$as_me:4804: \$? = $ac_status" >&5
4805   (exit $ac_status); }; }; then
4806   cf_cv_xopen_source=no
4807 else
4808   echo "$as_me: failed program was:" >&5
4809 cat conftest.$ac_ext >&5
4810 cf_cv_xopen_source=$cf_XOPEN_SOURCE
4811 fi
4812 rm -f conftest.$ac_objext conftest.$ac_ext
4813         CPPFLAGS="$cf_save"
4814
4815 fi
4816 rm -f conftest.$ac_objext conftest.$ac_ext
4817
4818 fi
4819 echo "$as_me:4819: result: $cf_cv_xopen_source" >&5
4820 echo "${ECHO_T}$cf_cv_xopen_source" >&6
4821
4822 if test "$cf_cv_xopen_source" != no ; then
4823
4824 CFLAGS=`echo "$CFLAGS" | \
4825         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4826                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4827
4828 CPPFLAGS=`echo "$CPPFLAGS" | \
4829         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
4830                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
4831
4832         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4833
4834 cf_fix_cppflags=no
4835 cf_new_cflags=
4836 cf_new_cppflags=
4837 cf_new_extra_cppflags=
4838
4839 for cf_add_cflags in $cf_temp_xopen_source
4840 do
4841 case $cf_fix_cppflags in
4842 (no)
4843         case $cf_add_cflags in
4844         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
4845                 case $cf_add_cflags in
4846                 (-D*)
4847                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4848
4849                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4850                                 && test -z "${cf_tst_cflags}" \
4851                                 && cf_fix_cppflags=yes
4852
4853                         if test $cf_fix_cppflags = yes ; then
4854
4855         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4856         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4857
4858                                 continue
4859                         elif test "${cf_tst_cflags}" = "\"'" ; then
4860
4861         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4862         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4863
4864                                 continue
4865                         fi
4866                         ;;
4867                 esac
4868                 case "$CPPFLAGS" in
4869                 (*$cf_add_cflags)
4870                         ;;
4871                 (*)
4872                         case $cf_add_cflags in
4873                         (-D*)
4874                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4875
4876 CPPFLAGS=`echo "$CPPFLAGS" | \
4877         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4878                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4879
4880                                 ;;
4881                         esac
4882
4883         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
4884         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
4885
4886                         ;;
4887                 esac
4888                 ;;
4889         (*)
4890
4891         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
4892         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
4893
4894                 ;;
4895         esac
4896         ;;
4897 (yes)
4898
4899         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
4900         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
4901
4902         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4903
4904         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
4905                 && test -z "${cf_tst_cflags}" \
4906                 && cf_fix_cppflags=no
4907         ;;
4908 esac
4909 done
4910
4911 if test -n "$cf_new_cflags" ; then
4912
4913         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
4914         CFLAGS="${CFLAGS}$cf_new_cflags"
4915
4916 fi
4917
4918 if test -n "$cf_new_cppflags" ; then
4919
4920         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
4921         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
4922
4923 fi
4924
4925 if test -n "$cf_new_extra_cppflags" ; then
4926
4927         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
4928         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
4929
4930 fi
4931
4932 fi
4933
4934         fi
4935 fi
4936
4937 echo "$as_me:4937: checking for signal global datatype" >&5
4938 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4939 if test "${cf_cv_sig_atomic_t+set}" = set; then
4940   echo $ECHO_N "(cached) $ECHO_C" >&6
4941 else
4942
4943         for cf_type in \
4944                 "volatile sig_atomic_t" \
4945                 "sig_atomic_t" \
4946                 "int"
4947         do
4948         cat >conftest.$ac_ext <<_ACEOF
4949 #line 4949 "configure"
4950 #include "confdefs.h"
4951
4952 #include <sys/types.h>
4953 #include <signal.h>
4954 #include <stdio.h>
4955
4956 extern $cf_type x;
4957 $cf_type x;
4958 static void handler(int sig)
4959 {
4960         x = 5;
4961 }
4962 int
4963 main (void)
4964 {
4965 signal(SIGINT, handler);
4966                  x = 1
4967   ;
4968   return 0;
4969 }
4970 _ACEOF
4971 rm -f conftest.$ac_objext
4972 if { (eval echo "$as_me:4972: \"$ac_compile\"") >&5
4973   (eval $ac_compile) 2>&5
4974   ac_status=$?
4975   echo "$as_me:4975: \$? = $ac_status" >&5
4976   (exit $ac_status); } &&
4977          { ac_try='test -s conftest.$ac_objext'
4978   { (eval echo "$as_me:4978: \"$ac_try\"") >&5
4979   (eval $ac_try) 2>&5
4980   ac_status=$?
4981   echo "$as_me:4981: \$? = $ac_status" >&5
4982   (exit $ac_status); }; }; then
4983   cf_cv_sig_atomic_t=$cf_type
4984 else
4985   echo "$as_me: failed program was:" >&5
4986 cat conftest.$ac_ext >&5
4987 cf_cv_sig_atomic_t=no
4988 fi
4989 rm -f conftest.$ac_objext conftest.$ac_ext
4990                 test "$cf_cv_sig_atomic_t" != no && break
4991         done
4992
4993 fi
4994
4995 echo "$as_me:4995: result: $cf_cv_sig_atomic_t" >&5
4996 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4997 test "$cf_cv_sig_atomic_t" != no &&
4998 cat >>confdefs.h <<EOF
4999 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
5000 EOF
5001
5002 # Work around breakage on OS X
5003
5004 echo "$as_me:5004: checking if SIGWINCH is defined" >&5
5005 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6
5006 if test "${cf_cv_define_sigwinch+set}" = set; then
5007   echo $ECHO_N "(cached) $ECHO_C" >&6
5008 else
5009
5010         cat >conftest.$ac_ext <<_ACEOF
5011 #line 5011 "configure"
5012 #include "confdefs.h"
5013
5014 #include <sys/types.h>
5015 #include <sys/signal.h>
5016
5017 int
5018 main (void)
5019 {
5020 int x = SIGWINCH
5021   ;
5022   return 0;
5023 }
5024 _ACEOF
5025 rm -f conftest.$ac_objext
5026 if { (eval echo "$as_me:5026: \"$ac_compile\"") >&5
5027   (eval $ac_compile) 2>&5
5028   ac_status=$?
5029   echo "$as_me:5029: \$? = $ac_status" >&5
5030   (exit $ac_status); } &&
5031          { ac_try='test -s conftest.$ac_objext'
5032   { (eval echo "$as_me:5032: \"$ac_try\"") >&5
5033   (eval $ac_try) 2>&5
5034   ac_status=$?
5035   echo "$as_me:5035: \$? = $ac_status" >&5
5036   (exit $ac_status); }; }; then
5037   cf_cv_define_sigwinch=yes
5038 else
5039   echo "$as_me: failed program was:" >&5
5040 cat conftest.$ac_ext >&5
5041 cat >conftest.$ac_ext <<_ACEOF
5042 #line 5042 "configure"
5043 #include "confdefs.h"
5044
5045 #undef _XOPEN_SOURCE
5046 #undef _POSIX_SOURCE
5047 #undef _POSIX_C_SOURCE
5048 #include <sys/types.h>
5049 #include <sys/signal.h>
5050
5051 int
5052 main (void)
5053 {
5054 int x = SIGWINCH
5055   ;
5056   return 0;
5057 }
5058 _ACEOF
5059 rm -f conftest.$ac_objext
5060 if { (eval echo "$as_me:5060: \"$ac_compile\"") >&5
5061   (eval $ac_compile) 2>&5
5062   ac_status=$?
5063   echo "$as_me:5063: \$? = $ac_status" >&5
5064   (exit $ac_status); } &&
5065          { ac_try='test -s conftest.$ac_objext'
5066   { (eval echo "$as_me:5066: \"$ac_try\"") >&5
5067   (eval $ac_try) 2>&5
5068   ac_status=$?
5069   echo "$as_me:5069: \$? = $ac_status" >&5
5070   (exit $ac_status); }; }; then
5071   cf_cv_define_sigwinch=maybe
5072 else
5073   echo "$as_me: failed program was:" >&5
5074 cat conftest.$ac_ext >&5
5075 cf_cv_define_sigwinch=no
5076 fi
5077 rm -f conftest.$ac_objext conftest.$ac_ext
5078
5079 fi
5080 rm -f conftest.$ac_objext conftest.$ac_ext
5081
5082 fi
5083 echo "$as_me:5083: result: $cf_cv_define_sigwinch" >&5
5084 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6
5085
5086 if test "$cf_cv_define_sigwinch" = maybe ; then
5087 echo "$as_me:5087: checking for actual SIGWINCH definition" >&5
5088 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6
5089 if test "${cf_cv_fixup_sigwinch+set}" = set; then
5090   echo $ECHO_N "(cached) $ECHO_C" >&6
5091 else
5092
5093 cf_cv_fixup_sigwinch=unknown
5094 cf_sigwinch=32
5095 while test $cf_sigwinch != 1
5096 do
5097         cat >conftest.$ac_ext <<_ACEOF
5098 #line 5098 "configure"
5099 #include "confdefs.h"
5100
5101 #undef _XOPEN_SOURCE
5102 #undef _POSIX_SOURCE
5103 #undef _POSIX_C_SOURCE
5104 #include <sys/types.h>
5105 #include <sys/signal.h>
5106
5107 int
5108 main (void)
5109 {
5110
5111 #if SIGWINCH != $cf_sigwinch
5112 make an error
5113 #endif
5114 int x = SIGWINCH
5115   ;
5116   return 0;
5117 }
5118 _ACEOF
5119 rm -f conftest.$ac_objext
5120 if { (eval echo "$as_me:5120: \"$ac_compile\"") >&5
5121   (eval $ac_compile) 2>&5
5122   ac_status=$?
5123   echo "$as_me:5123: \$? = $ac_status" >&5
5124   (exit $ac_status); } &&
5125          { ac_try='test -s conftest.$ac_objext'
5126   { (eval echo "$as_me:5126: \"$ac_try\"") >&5
5127   (eval $ac_try) 2>&5
5128   ac_status=$?
5129   echo "$as_me:5129: \$? = $ac_status" >&5
5130   (exit $ac_status); }; }; then
5131   cf_cv_fixup_sigwinch=$cf_sigwinch
5132          break
5133 else
5134   echo "$as_me: failed program was:" >&5
5135 cat conftest.$ac_ext >&5
5136 fi
5137 rm -f conftest.$ac_objext conftest.$ac_ext
5138
5139 cf_sigwinch=`expr $cf_sigwinch - 1`
5140 done
5141
5142 fi
5143 echo "$as_me:5143: result: $cf_cv_fixup_sigwinch" >&5
5144 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6
5145
5146         if test "$cf_cv_fixup_sigwinch" != unknown ; then
5147                 CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch"
5148         fi
5149 fi
5150
5151 # Checks for CODESET support.
5152
5153 echo "$as_me:5153: checking for nl_langinfo and CODESET" >&5
5154 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6
5155 if test "${am_cv_langinfo_codeset+set}" = set; then
5156   echo $ECHO_N "(cached) $ECHO_C" >&6
5157 else
5158   cat >conftest.$ac_ext <<_ACEOF
5159 #line 5159 "configure"
5160 #include "confdefs.h"
5161 #include <langinfo.h>
5162 int
5163 main (void)
5164 {
5165 char* cs = nl_langinfo(CODESET);
5166   ;
5167   return 0;
5168 }
5169 _ACEOF
5170 rm -f conftest.$ac_objext conftest$ac_exeext
5171 if { (eval echo "$as_me:5171: \"$ac_link\"") >&5
5172   (eval $ac_link) 2>&5
5173   ac_status=$?
5174   echo "$as_me:5174: \$? = $ac_status" >&5
5175   (exit $ac_status); } &&
5176          { ac_try='test -s conftest$ac_exeext'
5177   { (eval echo "$as_me:5177: \"$ac_try\"") >&5
5178   (eval $ac_try) 2>&5
5179   ac_status=$?
5180   echo "$as_me:5180: \$? = $ac_status" >&5
5181   (exit $ac_status); }; }; then
5182   am_cv_langinfo_codeset=yes
5183 else
5184   echo "$as_me: failed program was:" >&5
5185 cat conftest.$ac_ext >&5
5186 am_cv_langinfo_codeset=no
5187 fi
5188 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5189
5190 fi
5191 echo "$as_me:5191: result: $am_cv_langinfo_codeset" >&5
5192 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6
5193         if test $am_cv_langinfo_codeset = yes; then
5194
5195 cat >>confdefs.h <<\EOF
5196 #define HAVE_LANGINFO_CODESET 1
5197 EOF
5198
5199         fi
5200
5201 echo "$as_me:5201: checking if you want to use pkg-config" >&5
5202 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
5203
5204 # Check whether --with-pkg-config or --without-pkg-config was given.
5205 if test "${with_pkg_config+set}" = set; then
5206   withval="$with_pkg_config"
5207   cf_pkg_config=$withval
5208 else
5209   cf_pkg_config=yes
5210 fi;
5211 echo "$as_me:5211: result: $cf_pkg_config" >&5
5212 echo "${ECHO_T}$cf_pkg_config" >&6
5213
5214 case $cf_pkg_config in
5215 (no)
5216         PKG_CONFIG=none
5217         ;;
5218 (yes)
5219
5220 if test -n "$ac_tool_prefix"; then
5221   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
5222 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
5223 echo "$as_me:5223: checking for $ac_word" >&5
5224 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5225 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
5226   echo $ECHO_N "(cached) $ECHO_C" >&6
5227 else
5228   case $PKG_CONFIG in
5229   [\\/]* | ?:[\\/]*)
5230   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
5231   ;;
5232   *)
5233   ac_save_IFS=$IFS; IFS=$ac_path_separator
5234 ac_dummy="$PATH"
5235 for ac_dir in $ac_dummy; do
5236   IFS=$ac_save_IFS
5237   test -z "$ac_dir" && ac_dir=.
5238   if $as_executable_p "$ac_dir/$ac_word"; then
5239    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
5240    echo "$as_me:5240: found $ac_dir/$ac_word" >&5
5241    break
5242 fi
5243 done
5244
5245   ;;
5246 esac
5247 fi
5248 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
5249
5250 if test -n "$PKG_CONFIG"; then
5251   echo "$as_me:5251: result: $PKG_CONFIG" >&5
5252 echo "${ECHO_T}$PKG_CONFIG" >&6
5253 else
5254   echo "$as_me:5254: result: no" >&5
5255 echo "${ECHO_T}no" >&6
5256 fi
5257
5258 fi
5259 if test -z "$ac_cv_path_PKG_CONFIG"; then
5260   ac_pt_PKG_CONFIG=$PKG_CONFIG
5261   # Extract the first word of "pkg-config", so it can be a program name with args.
5262 set dummy pkg-config; ac_word=$2
5263 echo "$as_me:5263: checking for $ac_word" >&5
5264 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
5265 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
5266   echo $ECHO_N "(cached) $ECHO_C" >&6
5267 else
5268   case $ac_pt_PKG_CONFIG in
5269   [\\/]* | ?:[\\/]*)
5270   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
5271   ;;
5272   *)
5273   ac_save_IFS=$IFS; IFS=$ac_path_separator
5274 ac_dummy="$PATH"
5275 for ac_dir in $ac_dummy; do
5276   IFS=$ac_save_IFS
5277   test -z "$ac_dir" && ac_dir=.
5278   if $as_executable_p "$ac_dir/$ac_word"; then
5279    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
5280    echo "$as_me:5280: found $ac_dir/$ac_word" >&5
5281    break
5282 fi
5283 done
5284
5285   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
5286   ;;
5287 esac
5288 fi
5289 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
5290
5291 if test -n "$ac_pt_PKG_CONFIG"; then
5292   echo "$as_me:5292: result: $ac_pt_PKG_CONFIG" >&5
5293 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
5294 else
5295   echo "$as_me:5295: result: no" >&5
5296 echo "${ECHO_T}no" >&6
5297 fi
5298
5299   PKG_CONFIG=$ac_pt_PKG_CONFIG
5300 else
5301   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
5302 fi
5303
5304         ;;
5305 (*)
5306         PKG_CONFIG=$withval
5307         ;;
5308 esac
5309
5310 test -z "$PKG_CONFIG" && PKG_CONFIG=none
5311 if test "$PKG_CONFIG" != none ; then
5312
5313 if test "x$prefix" != xNONE; then
5314         cf_path_syntax="$prefix"
5315 else
5316         cf_path_syntax="$ac_default_prefix"
5317 fi
5318
5319 case ".$PKG_CONFIG" in
5320 (.\$\(*\)*|.\'*\'*)
5321         ;;
5322 (..|./*|.\\*)
5323         ;;
5324 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5325         ;;
5326 (.\${*prefix}*|.\${*dir}*)
5327         eval PKG_CONFIG="$PKG_CONFIG"
5328         case ".$PKG_CONFIG" in
5329         (.NONE/*)
5330                 PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5331                 ;;
5332         esac
5333         ;;
5334 (.no|.NONE/*)
5335         PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
5336         ;;
5337 (*)
5338         { { echo "$as_me:5338: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
5339 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
5340    { (exit 1); exit 1; }; }
5341         ;;
5342 esac
5343
5344 elif test "x$cf_pkg_config" != xno ; then
5345         { echo "$as_me:5345: WARNING: pkg-config is not installed" >&5
5346 echo "$as_me: WARNING: pkg-config is not installed" >&2;}
5347 fi
5348
5349 echo "$as_me:5349: checking if you want to see long compiling messages" >&5
5350 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
5351
5352 # Check whether --enable-echo or --disable-echo was given.
5353 if test "${enable_echo+set}" = set; then
5354   enableval="$enable_echo"
5355   test "$enableval" != no && enableval=yes
5356         if test "$enableval" != "yes" ; then
5357
5358         ECHO_LT='--silent'
5359         ECHO_LD='@echo linking $@;'
5360         RULE_CC='@echo compiling $<'
5361         SHOW_CC='@echo compiling $@'
5362         ECHO_CC='@'
5363
5364         else
5365
5366         ECHO_LT=''
5367         ECHO_LD=''
5368         RULE_CC=''
5369         SHOW_CC=''
5370         ECHO_CC=''
5371
5372         fi
5373 else
5374   enableval=yes
5375
5376         ECHO_LT=''
5377         ECHO_LD=''
5378         RULE_CC=''
5379         SHOW_CC=''
5380         ECHO_CC=''
5381
5382 fi;
5383 echo "$as_me:5383: result: $enableval" >&5
5384 echo "${ECHO_T}$enableval" >&6
5385
5386 echo "$as_me:5386: checking for ncurses wrap-prefix" >&5
5387 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
5388
5389 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
5390 if test "${with_ncurses_wrap_prefix+set}" = set; then
5391   withval="$with_ncurses_wrap_prefix"
5392   NCURSES_WRAP_PREFIX=$withval
5393 else
5394   NCURSES_WRAP_PREFIX=_nc_
5395 fi;
5396 echo "$as_me:5396: result: $NCURSES_WRAP_PREFIX" >&5
5397 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
5398
5399 echo "$as_me:5399: checking if you want to check for wide-character functions" >&5
5400 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5401
5402 # Check whether --enable-widec or --disable-widec was given.
5403 if test "${enable_widec+set}" = set; then
5404   enableval="$enable_widec"
5405   test "$enableval" != no && enableval=yes
5406         if test "$enableval" != "yes" ; then
5407     cf_enable_widec=no
5408         else
5409                 cf_enable_widec=yes
5410         fi
5411 else
5412   enableval=yes
5413         cf_enable_widec=yes
5414
5415 fi;
5416 echo "$as_me:5416: result: $cf_enable_widec" >&5
5417 echo "${ECHO_T}$cf_enable_widec" >&6
5418
5419 echo "$as_me:5419: checking for specific curses-directory" >&5
5420 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5421
5422 # Check whether --with-curses-dir or --without-curses-dir was given.
5423 if test "${with_curses_dir+set}" = set; then
5424   withval="$with_curses_dir"
5425   cf_cv_curses_dir=$withval
5426 else
5427   cf_cv_curses_dir=no
5428 fi;
5429 echo "$as_me:5429: result: $cf_cv_curses_dir" >&5
5430 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5431
5432 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5433 then
5434
5435 if test "x$prefix" != xNONE; then
5436         cf_path_syntax="$prefix"
5437 else
5438         cf_path_syntax="$ac_default_prefix"
5439 fi
5440
5441 case ".$withval" in
5442 (.\$\(*\)*|.\'*\'*)
5443         ;;
5444 (..|./*|.\\*)
5445         ;;
5446 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
5447         ;;
5448 (.\${*prefix}*|.\${*dir}*)
5449         eval withval="$withval"
5450         case ".$withval" in
5451         (.NONE/*)
5452                 withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5453                 ;;
5454         esac
5455         ;;
5456 (.no|.NONE/*)
5457         withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5458         ;;
5459 (*)
5460         { { echo "$as_me:5460: error: expected a pathname, not \"$withval\"" >&5
5461 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5462    { (exit 1); exit 1; }; }
5463         ;;
5464 esac
5465
5466         if test -d "$cf_cv_curses_dir"
5467         then
5468
5469 if test -n "$cf_cv_curses_dir/include" ; then
5470   for cf_add_incdir in $cf_cv_curses_dir/include
5471   do
5472         while test $cf_add_incdir != /usr/include
5473         do
5474           if test -d $cf_add_incdir
5475           then
5476                 cf_have_incdir=no
5477                 if test -n "$CFLAGS$CPPFLAGS" ; then
5478                   # a loop is needed to ensure we can add subdirs of existing dirs
5479                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5480                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5481                           cf_have_incdir=yes; break
5482                         fi
5483                   done
5484                 fi
5485
5486                 if test "$cf_have_incdir" = no ; then
5487                   if test "$cf_add_incdir" = /usr/local/include ; then
5488                         if test "$GCC" = yes
5489                         then
5490                           cf_save_CPPFLAGS=$CPPFLAGS
5491
5492         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5493         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
5494
5495                           cat >conftest.$ac_ext <<_ACEOF
5496 #line 5496 "configure"
5497 #include "confdefs.h"
5498 #include <stdio.h>
5499 int
5500 main (void)
5501 {
5502 printf("Hello")
5503   ;
5504   return 0;
5505 }
5506 _ACEOF
5507 rm -f conftest.$ac_objext
5508 if { (eval echo "$as_me:5508: \"$ac_compile\"") >&5
5509   (eval $ac_compile) 2>&5
5510   ac_status=$?
5511   echo "$as_me:5511: \$? = $ac_status" >&5
5512   (exit $ac_status); } &&
5513          { ac_try='test -s conftest.$ac_objext'
5514   { (eval echo "$as_me:5514: \"$ac_try\"") >&5
5515   (eval $ac_try) 2>&5
5516   ac_status=$?
5517   echo "$as_me:5517: \$? = $ac_status" >&5
5518   (exit $ac_status); }; }; then
5519   :
5520 else
5521   echo "$as_me: failed program was:" >&5
5522 cat conftest.$ac_ext >&5
5523 cf_have_incdir=yes
5524 fi
5525 rm -f conftest.$ac_objext conftest.$ac_ext
5526                           CPPFLAGS=$cf_save_CPPFLAGS
5527                         fi
5528                   fi
5529                 fi
5530
5531                 if test "$cf_have_incdir" = no ; then
5532                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5533
5534 echo "${as_me:-configure}:5534: testing adding $cf_add_incdir to include-path ..." 1>&5
5535
5536                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5537
5538                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5539                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5540                   cf_add_incdir="$cf_top_incdir"
5541                 else
5542                   break
5543                 fi
5544           else
5545                 break
5546           fi
5547         done
5548   done
5549 fi
5550
5551 if test -n "$cf_cv_curses_dir/lib" ; then
5552         for cf_add_libdir in $cf_cv_curses_dir/lib
5553         do
5554                 if test $cf_add_libdir = /usr/lib ; then
5555                         :
5556                 elif test -d $cf_add_libdir
5557                 then
5558                         cf_have_libdir=no
5559                         if test -n "$LDFLAGS$LIBS" ; then
5560                                 # a loop is needed to ensure we can add subdirs of existing dirs
5561                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
5562                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5563                                                 cf_have_libdir=yes; break
5564                                         fi
5565                                 done
5566                         fi
5567                         if test "$cf_have_libdir" = no ; then
5568                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5569
5570 echo "${as_me:-configure}:5570: testing adding $cf_add_libdir to library-path ..." 1>&5
5571
5572                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5573                         fi
5574                 fi
5575         done
5576 fi
5577
5578         fi
5579 fi
5580
5581 cf_cv_screen=curses
5582
5583 echo "$as_me:5583: checking for specified curses library type" >&5
5584 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5585
5586 # Check whether --with-screen or --without-screen was given.
5587 if test "${with_screen+set}" = set; then
5588   withval="$with_screen"
5589   cf_cv_screen=$withval
5590 else
5591
5592 # Check whether --with-ncursesw or --without-ncursesw was given.
5593 if test "${with_ncursesw+set}" = set; then
5594   withval="$with_ncursesw"
5595   cf_cv_screen=ncursesw
5596 else
5597
5598 # Check whether --with-ncurses or --without-ncurses was given.
5599 if test "${with_ncurses+set}" = set; then
5600   withval="$with_ncurses"
5601   cf_cv_screen=ncurses
5602 else
5603
5604 # Check whether --with-pdcurses or --without-pdcurses was given.
5605 if test "${with_pdcurses+set}" = set; then
5606   withval="$with_pdcurses"
5607   cf_cv_screen=pdcurses
5608 else
5609
5610 # Check whether --with-curses-colr or --without-curses-colr was given.
5611 if test "${with_curses_colr+set}" = set; then
5612   withval="$with_curses_colr"
5613   cf_cv_screen=curses_colr
5614 else
5615
5616 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5617 if test "${with_curses_5lib+set}" = set; then
5618   withval="$with_curses_5lib"
5619   cf_cv_screen=curses_5lib
5620 fi;
5621 fi;
5622 fi;
5623 fi;
5624 fi;
5625 fi;
5626
5627 echo "$as_me:5627: result: $cf_cv_screen" >&5
5628 echo "${ECHO_T}$cf_cv_screen" >&6
5629
5630 case $cf_cv_screen in
5631 (curses|curses_*)
5632
5633 echo "$as_me:5633: checking for extra include directories" >&5
5634 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5635 if test "${cf_cv_curses_incdir+set}" = set; then
5636   echo $ECHO_N "(cached) $ECHO_C" >&6
5637 else
5638
5639 cf_cv_curses_incdir=no
5640 case $host_os in
5641 (hpux10.*)
5642         if test "x$cf_cv_screen" = "xcurses_colr"
5643         then
5644                 test -d /usr/include/curses_colr && \
5645                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5646         fi
5647         ;;
5648 (sunos3*|sunos4*)
5649         if test "x$cf_cv_screen" = "xcurses_5lib"
5650         then
5651                 test -d /usr/5lib && \
5652                 test -d /usr/5include && \
5653                 cf_cv_curses_incdir="-I/usr/5include"
5654         fi
5655         ;;
5656 esac
5657
5658 fi
5659 echo "$as_me:5659: result: $cf_cv_curses_incdir" >&5
5660 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5661 if test "$cf_cv_curses_incdir" != no
5662 then
5663
5664         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
5665         CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir"
5666
5667 fi
5668
5669 echo "$as_me:5669: checking if we have identified curses headers" >&5
5670 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5671 if test "${cf_cv_ncurses_header+set}" = set; then
5672   echo $ECHO_N "(cached) $ECHO_C" >&6
5673 else
5674
5675 cf_cv_ncurses_header=none
5676 for cf_header in \
5677         ncurses.h  \
5678         curses.h  ncurses/ncurses.h ncurses/curses.h
5679 do
5680 cat >conftest.$ac_ext <<_ACEOF
5681 #line 5681 "configure"
5682 #include "confdefs.h"
5683 #include <${cf_header}>
5684 int
5685 main (void)
5686 {
5687 initscr(); tgoto("?", 0,0)
5688   ;
5689   return 0;
5690 }
5691 _ACEOF
5692 rm -f conftest.$ac_objext
5693 if { (eval echo "$as_me:5693: \"$ac_compile\"") >&5
5694   (eval $ac_compile) 2>&5
5695   ac_status=$?
5696   echo "$as_me:5696: \$? = $ac_status" >&5
5697   (exit $ac_status); } &&
5698          { ac_try='test -s conftest.$ac_objext'
5699   { (eval echo "$as_me:5699: \"$ac_try\"") >&5
5700   (eval $ac_try) 2>&5
5701   ac_status=$?
5702   echo "$as_me:5702: \$? = $ac_status" >&5
5703   (exit $ac_status); }; }; then
5704   cf_cv_ncurses_header=$cf_header; break
5705 else
5706   echo "$as_me: failed program was:" >&5
5707 cat conftest.$ac_ext >&5
5708 fi
5709 rm -f conftest.$ac_objext conftest.$ac_ext
5710 done
5711
5712 fi
5713 echo "$as_me:5713: result: $cf_cv_ncurses_header" >&5
5714 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5715
5716 if test "$cf_cv_ncurses_header" = none ; then
5717         { { echo "$as_me:5717: error: No curses header-files found" >&5
5718 echo "$as_me: error: No curses header-files found" >&2;}
5719    { (exit 1); exit 1; }; }
5720 fi
5721
5722 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5723
5724 for ac_header in $cf_cv_ncurses_header
5725 do
5726 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5727 echo "$as_me:5727: checking for $ac_header" >&5
5728 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5729 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5730   echo $ECHO_N "(cached) $ECHO_C" >&6
5731 else
5732   cat >conftest.$ac_ext <<_ACEOF
5733 #line 5733 "configure"
5734 #include "confdefs.h"
5735 #include <$ac_header>
5736 _ACEOF
5737 if { (eval echo "$as_me:5737: \"$ac_cpp conftest.$ac_ext\"") >&5
5738   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5739   ac_status=$?
5740   egrep -v '^ *\+' conftest.er1 >conftest.err
5741   rm -f conftest.er1
5742   cat conftest.err >&5
5743   echo "$as_me:5743: \$? = $ac_status" >&5
5744   (exit $ac_status); } >/dev/null; then
5745   if test -s conftest.err; then
5746     ac_cpp_err=$ac_c_preproc_warn_flag
5747   else
5748     ac_cpp_err=
5749   fi
5750 else
5751   ac_cpp_err=yes
5752 fi
5753 if test -z "$ac_cpp_err"; then
5754   eval "$as_ac_Header=yes"
5755 else
5756   echo "$as_me: failed program was:" >&5
5757   cat conftest.$ac_ext >&5
5758   eval "$as_ac_Header=no"
5759 fi
5760 rm -f conftest.err conftest.$ac_ext
5761 fi
5762 echo "$as_me:5762: result: `eval echo '${'$as_ac_Header'}'`" >&5
5763 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5764 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5765   cat >>confdefs.h <<EOF
5766 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5767 EOF
5768
5769 fi
5770 done
5771
5772 echo "$as_me:5772: checking for terminfo header" >&5
5773 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5774 if test "${cf_cv_term_header+set}" = set; then
5775   echo $ECHO_N "(cached) $ECHO_C" >&6
5776 else
5777
5778 case ${cf_cv_ncurses_header} in
5779 (*/ncurses.h|*/ncursesw.h)
5780         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5781         ;;
5782 (*)
5783         cf_term_header=term.h
5784         ;;
5785 esac
5786
5787 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5788 do
5789 cat >conftest.$ac_ext <<_ACEOF
5790 #line 5790 "configure"
5791 #include "confdefs.h"
5792 #include <stdio.h>
5793 #include <${cf_cv_ncurses_header:-curses.h}>
5794 #include <$cf_test>
5795
5796 int
5797 main (void)
5798 {
5799 int x = auto_left_margin
5800   ;
5801   return 0;
5802 }
5803 _ACEOF
5804 rm -f conftest.$ac_objext
5805 if { (eval echo "$as_me:5805: \"$ac_compile\"") >&5
5806   (eval $ac_compile) 2>&5
5807   ac_status=$?
5808   echo "$as_me:5808: \$? = $ac_status" >&5
5809   (exit $ac_status); } &&
5810          { ac_try='test -s conftest.$ac_objext'
5811   { (eval echo "$as_me:5811: \"$ac_try\"") >&5
5812   (eval $ac_try) 2>&5
5813   ac_status=$?
5814   echo "$as_me:5814: \$? = $ac_status" >&5
5815   (exit $ac_status); }; }; then
5816
5817         cf_cv_term_header="$cf_test"
5818 else
5819   echo "$as_me: failed program was:" >&5
5820 cat conftest.$ac_ext >&5
5821
5822         cf_cv_term_header=unknown
5823
5824 fi
5825 rm -f conftest.$ac_objext conftest.$ac_ext
5826         test "$cf_cv_term_header" != unknown && break
5827 done
5828
5829 fi
5830 echo "$as_me:5830: result: $cf_cv_term_header" >&5
5831 echo "${ECHO_T}$cf_cv_term_header" >&6
5832
5833 # Set definitions to allow ifdef'ing to accommodate subdirectories
5834
5835 case $cf_cv_term_header in
5836 (*term.h)
5837
5838 cat >>confdefs.h <<\EOF
5839 #define HAVE_TERM_H 1
5840 EOF
5841
5842         ;;
5843 esac
5844
5845 case $cf_cv_term_header in
5846 (ncurses/term.h)
5847
5848 cat >>confdefs.h <<\EOF
5849 #define HAVE_NCURSES_TERM_H 1
5850 EOF
5851
5852         ;;
5853 (ncursesw/term.h)
5854
5855 cat >>confdefs.h <<\EOF
5856 #define HAVE_NCURSESW_TERM_H 1
5857 EOF
5858
5859         ;;
5860 esac
5861
5862 echo "$as_me:5862: checking for ncurses version" >&5
5863 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5864 if test "${cf_cv_ncurses_version+set}" = set; then
5865   echo $ECHO_N "(cached) $ECHO_C" >&6
5866 else
5867
5868         cf_cv_ncurses_version=no
5869         cf_tempfile=out$$
5870         rm -f $cf_tempfile
5871         if test "$cross_compiling" = yes; then
5872
5873         # This will not work if the preprocessor splits the line after the
5874         # Autoconf token.  The 'unproto' program does that.
5875         cat > conftest.$ac_ext <<EOF
5876 #include <${cf_cv_ncurses_header:-curses.h}>
5877 #undef Autoconf
5878 #ifdef NCURSES_VERSION
5879 Autoconf NCURSES_VERSION
5880 #else
5881 #ifdef __NCURSES_H
5882 Autoconf "old"
5883 #endif
5884 ;
5885 #endif
5886 EOF
5887         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5888         { (eval echo "$as_me:5888: \"$cf_try\"") >&5
5889   (eval $cf_try) 2>&5
5890   ac_status=$?
5891   echo "$as_me:5891: \$? = $ac_status" >&5
5892   (exit $ac_status); }
5893         if test -f conftest.out ; then
5894                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5895                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5896                 rm -f conftest.out
5897         fi
5898
5899 else
5900   cat >conftest.$ac_ext <<_ACEOF
5901 #line 5901 "configure"
5902 #include "confdefs.h"
5903
5904 #include <${cf_cv_ncurses_header:-curses.h}>
5905 #include <stdio.h>
5906 int main(void)
5907 {
5908         FILE *fp = fopen("$cf_tempfile", "w");
5909 #ifdef NCURSES_VERSION
5910 # ifdef NCURSES_VERSION_PATCH
5911         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5912 # else
5913         fprintf(fp, "%s\n", NCURSES_VERSION);
5914 # endif
5915 #else
5916 # ifdef __NCURSES_H
5917         fprintf(fp, "old\n");
5918 # else
5919         make an error
5920 # endif
5921 #endif
5922         ${cf_cv_main_return:-return}(0);
5923 }
5924 _ACEOF
5925 rm -f conftest$ac_exeext
5926 if { (eval echo "$as_me:5926: \"$ac_link\"") >&5
5927   (eval $ac_link) 2>&5
5928   ac_status=$?
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5931   { (eval echo "$as_me:5931: \"$ac_try\"") >&5
5932   (eval $ac_try) 2>&5
5933   ac_status=$?
5934   echo "$as_me:5934: \$? = $ac_status" >&5
5935   (exit $ac_status); }; }; then
5936
5937         cf_cv_ncurses_version=`cat $cf_tempfile`
5938 else
5939   echo "$as_me: program exited with status $ac_status" >&5
5940 echo "$as_me: failed program was:" >&5
5941 cat conftest.$ac_ext >&5
5942 fi
5943 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5944 fi
5945         rm -f $cf_tempfile
5946
5947 fi
5948 echo "$as_me:5948: result: $cf_cv_ncurses_version" >&5
5949 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5950 test "$cf_cv_ncurses_version" = no ||
5951 cat >>confdefs.h <<\EOF
5952 #define NCURSES 1
5953 EOF
5954
5955 echo "$as_me:5955: checking if we have identified curses libraries" >&5
5956 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5957 cat >conftest.$ac_ext <<_ACEOF
5958 #line 5958 "configure"
5959 #include "confdefs.h"
5960 #include <${cf_cv_ncurses_header:-curses.h}>
5961 int
5962 main (void)
5963 {
5964 initscr(); tgoto("?", 0,0)
5965   ;
5966   return 0;
5967 }
5968 _ACEOF
5969 rm -f conftest.$ac_objext conftest$ac_exeext
5970 if { (eval echo "$as_me:5970: \"$ac_link\"") >&5
5971   (eval $ac_link) 2>&5
5972   ac_status=$?
5973   echo "$as_me:5973: \$? = $ac_status" >&5
5974   (exit $ac_status); } &&
5975          { ac_try='test -s conftest$ac_exeext'
5976   { (eval echo "$as_me:5976: \"$ac_try\"") >&5
5977   (eval $ac_try) 2>&5
5978   ac_status=$?
5979   echo "$as_me:5979: \$? = $ac_status" >&5
5980   (exit $ac_status); }; }; then
5981   cf_result=yes
5982 else
5983   echo "$as_me: failed program was:" >&5
5984 cat conftest.$ac_ext >&5
5985 cf_result=no
5986 fi
5987 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5988 echo "$as_me:5988: result: $cf_result" >&5
5989 echo "${ECHO_T}$cf_result" >&6
5990
5991 if test "$cf_result" = no ; then
5992 case $host_os in
5993 (freebsd*)
5994         echo "$as_me:5994: checking for tgoto in -lmytinfo" >&5
5995 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5996 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5997   echo $ECHO_N "(cached) $ECHO_C" >&6
5998 else
5999   ac_check_lib_save_LIBS=$LIBS
6000 LIBS="-lmytinfo  $LIBS"
6001 cat >conftest.$ac_ext <<_ACEOF
6002 #line 6002 "configure"
6003 #include "confdefs.h"
6004
6005 /* Override any gcc2 internal prototype to avoid an error.  */
6006 #ifdef __cplusplus
6007 extern "C"
6008 #endif
6009 /* We use char because int might match the return type of a gcc2
6010    builtin and then its argument prototype would still apply.  */
6011 char tgoto ();
6012 int
6013 main (void)
6014 {
6015 tgoto ();
6016   ;
6017   return 0;
6018 }
6019 _ACEOF
6020 rm -f conftest.$ac_objext conftest$ac_exeext
6021 if { (eval echo "$as_me:6021: \"$ac_link\"") >&5
6022   (eval $ac_link) 2>&5
6023   ac_status=$?
6024   echo "$as_me:6024: \$? = $ac_status" >&5
6025   (exit $ac_status); } &&
6026          { ac_try='test -s conftest$ac_exeext'
6027   { (eval echo "$as_me:6027: \"$ac_try\"") >&5
6028   (eval $ac_try) 2>&5
6029   ac_status=$?
6030   echo "$as_me:6030: \$? = $ac_status" >&5
6031   (exit $ac_status); }; }; then
6032   ac_cv_lib_mytinfo_tgoto=yes
6033 else
6034   echo "$as_me: failed program was:" >&5
6035 cat conftest.$ac_ext >&5
6036 ac_cv_lib_mytinfo_tgoto=no
6037 fi
6038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6039 LIBS=$ac_check_lib_save_LIBS
6040 fi
6041 echo "$as_me:6041: result: $ac_cv_lib_mytinfo_tgoto" >&5
6042 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
6043 if test $ac_cv_lib_mytinfo_tgoto = yes; then
6044
6045 cf_add_libs="-lmytinfo"
6046 # Filter out duplicates - this happens with badly-designed ".pc" files...
6047 for cf_add_1lib in $LIBS
6048 do
6049         for cf_add_2lib in $cf_add_libs
6050         do
6051                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6052                 then
6053                         cf_add_1lib=
6054                         break
6055                 fi
6056         done
6057         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6058 done
6059 LIBS="$cf_add_libs"
6060
6061 fi
6062
6063         ;;
6064 (hpux10.*)
6065         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
6066         # next (1998), and xcurses "newer" (2000).  There is no header file for
6067         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
6068         # term.h) for cur_colr
6069         if test "x$cf_cv_screen" = "xcurses_colr"
6070         then
6071                 echo "$as_me:6071: checking for initscr in -lcur_colr" >&5
6072 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
6073 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
6074   echo $ECHO_N "(cached) $ECHO_C" >&6
6075 else
6076   ac_check_lib_save_LIBS=$LIBS
6077 LIBS="-lcur_colr  $LIBS"
6078 cat >conftest.$ac_ext <<_ACEOF
6079 #line 6079 "configure"
6080 #include "confdefs.h"
6081
6082 /* Override any gcc2 internal prototype to avoid an error.  */
6083 #ifdef __cplusplus
6084 extern "C"
6085 #endif
6086 /* We use char because int might match the return type of a gcc2
6087    builtin and then its argument prototype would still apply.  */
6088 char initscr ();
6089 int
6090 main (void)
6091 {
6092 initscr ();
6093   ;
6094   return 0;
6095 }
6096 _ACEOF
6097 rm -f conftest.$ac_objext conftest$ac_exeext
6098 if { (eval echo "$as_me:6098: \"$ac_link\"") >&5
6099   (eval $ac_link) 2>&5
6100   ac_status=$?
6101   echo "$as_me:6101: \$? = $ac_status" >&5
6102   (exit $ac_status); } &&
6103          { ac_try='test -s conftest$ac_exeext'
6104   { (eval echo "$as_me:6104: \"$ac_try\"") >&5
6105   (eval $ac_try) 2>&5
6106   ac_status=$?
6107   echo "$as_me:6107: \$? = $ac_status" >&5
6108   (exit $ac_status); }; }; then
6109   ac_cv_lib_cur_colr_initscr=yes
6110 else
6111   echo "$as_me: failed program was:" >&5
6112 cat conftest.$ac_ext >&5
6113 ac_cv_lib_cur_colr_initscr=no
6114 fi
6115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6116 LIBS=$ac_check_lib_save_LIBS
6117 fi
6118 echo "$as_me:6118: result: $ac_cv_lib_cur_colr_initscr" >&5
6119 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
6120 if test $ac_cv_lib_cur_colr_initscr = yes; then
6121
6122 cf_add_libs="-lcur_colr"
6123 # Filter out duplicates - this happens with badly-designed ".pc" files...
6124 for cf_add_1lib in $LIBS
6125 do
6126         for cf_add_2lib in $cf_add_libs
6127         do
6128                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6129                 then
6130                         cf_add_1lib=
6131                         break
6132                 fi
6133         done
6134         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6135 done
6136 LIBS="$cf_add_libs"
6137
6138                         ac_cv_func_initscr=yes
6139
6140 else
6141
6142                 echo "$as_me:6142: checking for initscr in -lHcurses" >&5
6143 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
6144 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
6145   echo $ECHO_N "(cached) $ECHO_C" >&6
6146 else
6147   ac_check_lib_save_LIBS=$LIBS
6148 LIBS="-lHcurses  $LIBS"
6149 cat >conftest.$ac_ext <<_ACEOF
6150 #line 6150 "configure"
6151 #include "confdefs.h"
6152
6153 /* Override any gcc2 internal prototype to avoid an error.  */
6154 #ifdef __cplusplus
6155 extern "C"
6156 #endif
6157 /* We use char because int might match the return type of a gcc2
6158    builtin and then its argument prototype would still apply.  */
6159 char initscr ();
6160 int
6161 main (void)
6162 {
6163 initscr ();
6164   ;
6165   return 0;
6166 }
6167 _ACEOF
6168 rm -f conftest.$ac_objext conftest$ac_exeext
6169 if { (eval echo "$as_me:6169: \"$ac_link\"") >&5
6170   (eval $ac_link) 2>&5
6171   ac_status=$?
6172   echo "$as_me:6172: \$? = $ac_status" >&5
6173   (exit $ac_status); } &&
6174          { ac_try='test -s conftest$ac_exeext'
6175   { (eval echo "$as_me:6175: \"$ac_try\"") >&5
6176   (eval $ac_try) 2>&5
6177   ac_status=$?
6178   echo "$as_me:6178: \$? = $ac_status" >&5
6179   (exit $ac_status); }; }; then
6180   ac_cv_lib_Hcurses_initscr=yes
6181 else
6182   echo "$as_me: failed program was:" >&5
6183 cat conftest.$ac_ext >&5
6184 ac_cv_lib_Hcurses_initscr=no
6185 fi
6186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6187 LIBS=$ac_check_lib_save_LIBS
6188 fi
6189 echo "$as_me:6189: result: $ac_cv_lib_Hcurses_initscr" >&5
6190 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6191 if test $ac_cv_lib_Hcurses_initscr = yes; then
6192
6193                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6194
6195 cf_add_libs="-lHcurses"
6196 # Filter out duplicates - this happens with badly-designed ".pc" files...
6197 for cf_add_1lib in $LIBS
6198 do
6199         for cf_add_2lib in $cf_add_libs
6200         do
6201                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6202                 then
6203                         cf_add_1lib=
6204                         break
6205                 fi
6206         done
6207         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6208 done
6209 LIBS="$cf_add_libs"
6210
6211         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6212         CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES"
6213
6214                         ac_cv_func_initscr=yes
6215
6216 fi
6217
6218 fi
6219
6220         fi
6221         ;;
6222 (linux*)
6223         case `arch 2>/dev/null` in
6224         (x86_64)
6225                 if test -d /lib64
6226                 then
6227
6228 if test -n "/lib64" ; then
6229         for cf_add_libdir in /lib64
6230         do
6231                 if test $cf_add_libdir = /usr/lib ; then
6232                         :
6233                 elif test -d $cf_add_libdir
6234                 then
6235                         cf_have_libdir=no
6236                         if test -n "$LDFLAGS$LIBS" ; then
6237                                 # a loop is needed to ensure we can add subdirs of existing dirs
6238                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6239                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6240                                                 cf_have_libdir=yes; break
6241                                         fi
6242                                 done
6243                         fi
6244                         if test "$cf_have_libdir" = no ; then
6245                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6246
6247 echo "${as_me:-configure}:6247: testing adding $cf_add_libdir to library-path ..." 1>&5
6248
6249                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6250                         fi
6251                 fi
6252         done
6253 fi
6254
6255                 else
6256
6257 if test -n "/lib" ; then
6258         for cf_add_libdir in /lib
6259         do
6260                 if test $cf_add_libdir = /usr/lib ; then
6261                         :
6262                 elif test -d $cf_add_libdir
6263                 then
6264                         cf_have_libdir=no
6265                         if test -n "$LDFLAGS$LIBS" ; then
6266                                 # a loop is needed to ensure we can add subdirs of existing dirs
6267                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6268                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6269                                                 cf_have_libdir=yes; break
6270                                         fi
6271                                 done
6272                         fi
6273                         if test "$cf_have_libdir" = no ; then
6274                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6275
6276 echo "${as_me:-configure}:6276: testing adding $cf_add_libdir to library-path ..." 1>&5
6277
6278                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6279                         fi
6280                 fi
6281         done
6282 fi
6283
6284                 fi
6285                 ;;
6286         (*)
6287
6288 if test -n "/lib" ; then
6289         for cf_add_libdir in /lib
6290         do
6291                 if test $cf_add_libdir = /usr/lib ; then
6292                         :
6293                 elif test -d $cf_add_libdir
6294                 then
6295                         cf_have_libdir=no
6296                         if test -n "$LDFLAGS$LIBS" ; then
6297                                 # a loop is needed to ensure we can add subdirs of existing dirs
6298                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6299                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6300                                                 cf_have_libdir=yes; break
6301                                         fi
6302                                 done
6303                         fi
6304                         if test "$cf_have_libdir" = no ; then
6305                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6306
6307 echo "${as_me:-configure}:6307: testing adding $cf_add_libdir to library-path ..." 1>&5
6308
6309                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6310                         fi
6311                 fi
6312         done
6313 fi
6314
6315                 ;;
6316         esac
6317         ;;
6318 (sunos3*|sunos4*)
6319         if test "x$cf_cv_screen" = "xcurses_5lib"
6320         then
6321                 if test -d /usr/5lib ; then
6322
6323 if test -n "/usr/5lib" ; then
6324         for cf_add_libdir in /usr/5lib
6325         do
6326                 if test $cf_add_libdir = /usr/lib ; then
6327                         :
6328                 elif test -d $cf_add_libdir
6329                 then
6330                         cf_have_libdir=no
6331                         if test -n "$LDFLAGS$LIBS" ; then
6332                                 # a loop is needed to ensure we can add subdirs of existing dirs
6333                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
6334                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6335                                                 cf_have_libdir=yes; break
6336                                         fi
6337                                 done
6338                         fi
6339                         if test "$cf_have_libdir" = no ; then
6340                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6341
6342 echo "${as_me:-configure}:6342: testing adding $cf_add_libdir to library-path ..." 1>&5
6343
6344                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6345                         fi
6346                 fi
6347         done
6348 fi
6349
6350 cf_add_libs="-lcurses -ltermcap"
6351 # Filter out duplicates - this happens with badly-designed ".pc" files...
6352 for cf_add_1lib in $LIBS
6353 do
6354         for cf_add_2lib in $cf_add_libs
6355         do
6356                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
6357                 then
6358                         cf_add_1lib=
6359                         break
6360                 fi
6361         done
6362         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
6363 done
6364 LIBS="$cf_add_libs"
6365
6366                 fi
6367         fi
6368         ac_cv_func_initscr=yes
6369         ;;
6370 esac
6371
6372 if test ".$ac_cv_func_initscr" != .yes ; then
6373         cf_save_LIBS="$LIBS"
6374
6375         if test ".${cf_cv_ncurses_version:-no}" != .no
6376         then
6377                 cf_check_list="ncurses curses cursesX"
6378         else
6379                 cf_check_list="cursesX curses ncurses"
6380         fi
6381
6382         # Check for library containing tgoto.  Do this before curses library
6383         # because it may be needed to link the test-case for initscr.
6384         if test "x$cf_term_lib" = x
6385         then
6386                 echo "$as_me:6386: checking for tgoto" >&5
6387 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6388 if test "${ac_cv_func_tgoto+set}" = set; then
6389   echo $ECHO_N "(cached) $ECHO_C" >&6
6390 else
6391   cat >conftest.$ac_ext <<_ACEOF
6392 #line 6392 "configure"
6393 #include "confdefs.h"
6394 /* System header to define __stub macros and hopefully few prototypes,
6395     which can conflict with char tgoto (); below.  */
6396 #include <assert.h>
6397 /* Override any gcc2 internal prototype to avoid an error.  */
6398 #ifdef __cplusplus
6399 extern "C"
6400 #endif
6401 /* We use char because int might match the return type of a gcc2
6402    builtin and then its argument prototype would still apply.  */
6403 char tgoto ();
6404 char (*f) ();
6405
6406 int
6407 main (void)
6408 {
6409 /* The GNU C library defines this for functions which it implements
6410     to always fail with ENOSYS.  Some functions are actually named
6411     something starting with __ and the normal name is an alias.  */
6412 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6413 choke me
6414 #else
6415 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6416 #endif
6417
6418   ;
6419   return 0;
6420 }
6421 _ACEOF
6422 rm -f conftest.$ac_objext conftest$ac_exeext
6423 if { (eval echo "$as_me:6423: \"$ac_link\"") >&5
6424   (eval $ac_link) 2>&5
6425   ac_status=$?
6426   echo "$as_me:6426: \$? = $ac_status" >&5
6427   (exit $ac_status); } &&
6428          { ac_try='test -s conftest$ac_exeext'
6429   { (eval echo "$as_me:6429: \"$ac_try\"") >&5
6430   (eval $ac_try) 2>&5
6431   ac_status=$?
6432   echo "$as_me:6432: \$? = $ac_status" >&5
6433   (exit $ac_status); }; }; then
6434   ac_cv_func_tgoto=yes
6435 else
6436   echo "$as_me: failed program was:" >&5
6437 cat conftest.$ac_ext >&5
6438 ac_cv_func_tgoto=no
6439 fi
6440 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6441 fi
6442 echo "$as_me:6442: result: $ac_cv_func_tgoto" >&5
6443 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6444 if test $ac_cv_func_tgoto = yes; then
6445   cf_term_lib=predefined
6446 else
6447
6448                         for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
6449                         do
6450                                 as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6451 echo "$as_me:6451: checking for tgoto in -l$cf_term_lib" >&5
6452 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6453 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6454   echo $ECHO_N "(cached) $ECHO_C" >&6
6455 else
6456   ac_check_lib_save_LIBS=$LIBS
6457 LIBS="-l$cf_term_lib  $LIBS"
6458 cat >conftest.$ac_ext <<_ACEOF
6459 #line 6459 "configure"
6460 #include "confdefs.h"
6461
6462 /* Override any gcc2 internal prototype to avoid an error.  */
6463 #ifdef __cplusplus
6464 extern "C"
6465 #endif
6466 /* We use char because int might match the return type of a gcc2
6467    builtin and then its argument prototype would still apply.  */
6468 char tgoto ();
6469 int
6470 main (void)
6471 {
6472 tgoto ();
6473   ;
6474   return 0;
6475 }
6476 _ACEOF
6477 rm -f conftest.$ac_objext conftest$ac_exeext
6478 if { (eval echo "$as_me:6478: \"$ac_link\"") >&5
6479   (eval $ac_link) 2>&5
6480   ac_status=$?
6481   echo "$as_me:6481: \$? = $ac_status" >&5
6482   (exit $ac_status); } &&
6483          { ac_try='test -s conftest$ac_exeext'
6484   { (eval echo "$as_me:6484: \"$ac_try\"") >&5
6485   (eval $ac_try) 2>&5
6486   ac_status=$?
6487   echo "$as_me:6487: \$? = $ac_status" >&5
6488   (exit $ac_status); }; }; then
6489   eval "$as_ac_Lib=yes"
6490 else
6491   echo "$as_me: failed program was:" >&5
6492 cat conftest.$ac_ext >&5
6493 eval "$as_ac_Lib=no"
6494 fi
6495 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6496 LIBS=$ac_check_lib_save_LIBS
6497 fi
6498 echo "$as_me:6498: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6499 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6500 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6501
6502                                         : ${cf_nculib_root:=$cf_term_lib}
6503                                         break
6504
6505 fi
6506
6507                         done
6508
6509 fi
6510
6511         fi
6512
6513         # Check for library containing initscr
6514         test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6515         if test "x$cf_curs_lib" = x
6516         then
6517                 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6518                 do
6519                         LIBS="-l$cf_curs_lib $cf_save_LIBS"
6520                         if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
6521                                 echo "$as_me:6521: checking if we can link with $cf_curs_lib library" >&5
6522 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6523                                 cat >conftest.$ac_ext <<_ACEOF
6524 #line 6524 "configure"
6525 #include "confdefs.h"
6526 #include <${cf_cv_ncurses_header:-curses.h}>
6527 int
6528 main (void)
6529 {
6530 initscr()
6531   ;
6532   return 0;
6533 }
6534 _ACEOF
6535 rm -f conftest.$ac_objext conftest$ac_exeext
6536 if { (eval echo "$as_me:6536: \"$ac_link\"") >&5
6537   (eval $ac_link) 2>&5
6538   ac_status=$?
6539   echo "$as_me:6539: \$? = $ac_status" >&5
6540   (exit $ac_status); } &&
6541          { ac_try='test -s conftest$ac_exeext'
6542   { (eval echo "$as_me:6542: \"$ac_try\"") >&5
6543   (eval $ac_try) 2>&5
6544   ac_status=$?
6545   echo "$as_me:6545: \$? = $ac_status" >&5
6546   (exit $ac_status); }; }; then
6547   cf_result=yes
6548 else
6549   echo "$as_me: failed program was:" >&5
6550 cat conftest.$ac_ext >&5
6551 cf_result=no
6552 fi
6553 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6554                                 echo "$as_me:6554: result: $cf_result" >&5
6555 echo "${ECHO_T}$cf_result" >&6
6556                                 test $cf_result = yes && break
6557                         elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6558                                 cf_result=no
6559                         elif test "$cf_term_lib" != predefined ; then
6560                                 echo "$as_me:6560: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6561 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6562                                 cat >conftest.$ac_ext <<_ACEOF
6563 #line 6563 "configure"
6564 #include "confdefs.h"
6565 #include <${cf_cv_ncurses_header:-curses.h}>
6566 int
6567 main (void)
6568 {
6569 initscr(); tgoto((char *)0, 0, 0);
6570   ;
6571   return 0;
6572 }
6573 _ACEOF
6574 rm -f conftest.$ac_objext conftest$ac_exeext
6575 if { (eval echo "$as_me:6575: \"$ac_link\"") >&5
6576   (eval $ac_link) 2>&5
6577   ac_status=$?
6578   echo "$as_me:6578: \$? = $ac_status" >&5
6579   (exit $ac_status); } &&
6580          { ac_try='test -s conftest$ac_exeext'
6581   { (eval echo "$as_me:6581: \"$ac_try\"") >&5
6582   (eval $ac_try) 2>&5
6583   ac_status=$?
6584   echo "$as_me:6584: \$? = $ac_status" >&5
6585   (exit $ac_status); }; }; then
6586   cf_result=no
6587 else
6588   echo "$as_me: failed program was:" >&5
6589 cat conftest.$ac_ext >&5
6590
6591                                         LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6592                                         cat >conftest.$ac_ext <<_ACEOF
6593 #line 6593 "configure"
6594 #include "confdefs.h"
6595 #include <${cf_cv_ncurses_header:-curses.h}>
6596 int
6597 main (void)
6598 {
6599 initscr()
6600   ;
6601   return 0;
6602 }
6603 _ACEOF
6604 rm -f conftest.$ac_objext conftest$ac_exeext
6605 if { (eval echo "$as_me:6605: \"$ac_link\"") >&5
6606   (eval $ac_link) 2>&5
6607   ac_status=$?
6608   echo "$as_me:6608: \$? = $ac_status" >&5
6609   (exit $ac_status); } &&
6610          { ac_try='test -s conftest$ac_exeext'
6611   { (eval echo "$as_me:6611: \"$ac_try\"") >&5
6612   (eval $ac_try) 2>&5
6613   ac_status=$?
6614   echo "$as_me:6614: \$? = $ac_status" >&5
6615   (exit $ac_status); }; }; then
6616   cf_result=yes
6617 else
6618   echo "$as_me: failed program was:" >&5
6619 cat conftest.$ac_ext >&5
6620 cf_result=error
6621 fi
6622 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6623
6624 fi
6625 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6626                                 echo "$as_me:6626: result: $cf_result" >&5
6627 echo "${ECHO_T}$cf_result" >&6
6628                                 test $cf_result != error && break
6629                         fi
6630                 done
6631         fi
6632         test $cf_curs_lib = unknown && { { echo "$as_me:6632: error: no curses library found" >&5
6633 echo "$as_me: error: no curses library found" >&2;}
6634    { (exit 1); exit 1; }; }
6635 fi
6636 fi
6637
6638         ;;
6639 (ncursesw*)
6640
6641 echo "$as_me:6641: checking for multibyte character support" >&5
6642 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
6643 if test "${cf_cv_utf8_lib+set}" = set; then
6644   echo $ECHO_N "(cached) $ECHO_C" >&6
6645 else
6646
6647         cf_save_LIBS="$LIBS"
6648         cat >conftest.$ac_ext <<_ACEOF
6649 #line 6649 "configure"
6650 #include "confdefs.h"
6651
6652 #include <stdlib.h>
6653 int
6654 main (void)
6655 {
6656 putwc(0,0);
6657   ;
6658   return 0;
6659 }
6660 _ACEOF
6661 rm -f conftest.$ac_objext conftest$ac_exeext
6662 if { (eval echo "$as_me:6662: \"$ac_link\"") >&5
6663   (eval $ac_link) 2>&5
6664   ac_status=$?
6665   echo "$as_me:6665: \$? = $ac_status" >&5
6666   (exit $ac_status); } &&
6667          { ac_try='test -s conftest$ac_exeext'
6668   { (eval echo "$as_me:6668: \"$ac_try\"") >&5
6669   (eval $ac_try) 2>&5
6670   ac_status=$?
6671   echo "$as_me:6671: \$? = $ac_status" >&5
6672   (exit $ac_status); }; }; then
6673   cf_cv_utf8_lib=yes
6674 else
6675   echo "$as_me: failed program was:" >&5
6676 cat conftest.$ac_ext >&5
6677
6678 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
6679 # will be set on completion of the AC_TRY_LINK below.
6680 cf_cv_header_path_utf8=
6681 cf_cv_library_path_utf8=
6682
6683 echo "${as_me:-configure}:6683: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
6684
6685 cf_save_LIBS="$LIBS"
6686
6687 cat >conftest.$ac_ext <<_ACEOF
6688 #line 6688 "configure"
6689 #include "confdefs.h"
6690
6691 #include <libutf8.h>
6692 int
6693 main (void)
6694 {
6695 putwc(0,0);
6696   ;
6697   return 0;
6698 }
6699 _ACEOF
6700 rm -f conftest.$ac_objext conftest$ac_exeext
6701 if { (eval echo "$as_me:6701: \"$ac_link\"") >&5
6702   (eval $ac_link) 2>&5
6703   ac_status=$?
6704   echo "$as_me:6704: \$? = $ac_status" >&5
6705   (exit $ac_status); } &&
6706          { ac_try='test -s conftest$ac_exeext'
6707   { (eval echo "$as_me:6707: \"$ac_try\"") >&5
6708   (eval $ac_try) 2>&5
6709   ac_status=$?
6710   echo "$as_me:6710: \$? = $ac_status" >&5
6711   (exit $ac_status); }; }; then
6712
6713         cf_cv_find_linkage_utf8=yes
6714         cf_cv_header_path_utf8=/usr/include
6715         cf_cv_library_path_utf8=/usr/lib
6716
6717 else
6718   echo "$as_me: failed program was:" >&5
6719 cat conftest.$ac_ext >&5
6720
6721 LIBS="-lutf8  $cf_save_LIBS"
6722
6723 cat >conftest.$ac_ext <<_ACEOF
6724 #line 6724 "configure"
6725 #include "confdefs.h"
6726
6727 #include <libutf8.h>
6728 int
6729 main (void)
6730 {
6731 putwc(0,0);
6732   ;
6733   return 0;
6734 }
6735 _ACEOF
6736 rm -f conftest.$ac_objext conftest$ac_exeext
6737 if { (eval echo "$as_me:6737: \"$ac_link\"") >&5
6738   (eval $ac_link) 2>&5
6739   ac_status=$?
6740   echo "$as_me:6740: \$? = $ac_status" >&5
6741   (exit $ac_status); } &&
6742          { ac_try='test -s conftest$ac_exeext'
6743   { (eval echo "$as_me:6743: \"$ac_try\"") >&5
6744   (eval $ac_try) 2>&5
6745   ac_status=$?
6746   echo "$as_me:6746: \$? = $ac_status" >&5
6747   (exit $ac_status); }; }; then
6748
6749         cf_cv_find_linkage_utf8=yes
6750         cf_cv_header_path_utf8=/usr/include
6751         cf_cv_library_path_utf8=/usr/lib
6752         cf_cv_library_file_utf8="-lutf8"
6753
6754 else
6755   echo "$as_me: failed program was:" >&5
6756 cat conftest.$ac_ext >&5
6757
6758         cf_cv_find_linkage_utf8=no
6759         LIBS="$cf_save_LIBS"
6760
6761         test -n "$verbose" && echo "    find linkage for utf8 library" 1>&6
6762
6763 echo "${as_me:-configure}:6763: testing find linkage for utf8 library ..." 1>&5
6764
6765 echo "${as_me:-configure}:6765: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
6766
6767         cf_save_CPPFLAGS="$CPPFLAGS"
6768         cf_test_CPPFLAGS="$CPPFLAGS"
6769
6770 cf_search=
6771
6772 # collect the current set of include-directories from compiler flags
6773 cf_header_path_list=""
6774 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6775         for cf_header_path in $CPPFLAGS $CFLAGS
6776         do
6777                 case $cf_header_path in
6778                 (-I*)
6779                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6780
6781 test "x$cf_header_path" != "xNONE" && \
6782 test -d "$cf_header_path" && \
6783  {
6784         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6785         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6786         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
6787         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
6788         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
6789         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
6790 }
6791
6792                         cf_header_path_list="$cf_header_path_list $cf_search"
6793                         ;;
6794                 esac
6795         done
6796 fi
6797
6798 # add the variations for the package we are looking for
6799
6800 cf_search=
6801
6802 test "x$prefix" != "xNONE" && \
6803 test -d "$prefix" && \
6804  {
6805         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6806         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6807         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
6808         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
6809         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
6810         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
6811 }
6812
6813 for cf_subdir_prefix in \
6814         /usr \
6815         /usr/local \
6816         /usr/pkg \
6817         /opt \
6818         /opt/local \
6819         $HOME
6820 do
6821
6822 test "x$cf_subdir_prefix" != "x$prefix" && \
6823 test -d "$cf_subdir_prefix" && \
6824 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6825         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
6826         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
6827         test -d $cf_subdir_prefix/include/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/include/utf8"
6828         test -d $cf_subdir_prefix/include/utf8/include &&    cf_search="$cf_search $cf_subdir_prefix/include/utf8/include"
6829         test -d $cf_subdir_prefix/utf8/include &&       cf_search="$cf_search $cf_subdir_prefix/utf8/include"
6830         test -d $cf_subdir_prefix/utf8/include/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8"
6831 }
6832
6833 done
6834
6835 test "$includedir" != NONE && \
6836 test "$includedir" != "/usr/include" && \
6837 test -d "$includedir" && {
6838         test -d $includedir &&    cf_search="$cf_search $includedir"
6839         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
6840 }
6841
6842 test "$oldincludedir" != NONE && \
6843 test "$oldincludedir" != "/usr/include" && \
6844 test -d "$oldincludedir" && {
6845         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6846         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
6847 }
6848
6849 cf_search="$cf_search $cf_header_path_list"
6850
6851         for cf_cv_header_path_utf8 in $cf_search
6852         do
6853                 if test -d $cf_cv_header_path_utf8 ; then
6854                         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
6855
6856 echo "${as_me:-configure}:6856: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
6857
6858                         CPPFLAGS="$cf_save_CPPFLAGS"
6859
6860         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
6861         CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8"
6862
6863                         cat >conftest.$ac_ext <<_ACEOF
6864 #line 6864 "configure"
6865 #include "confdefs.h"
6866
6867 #include <libutf8.h>
6868 int
6869 main (void)
6870 {
6871 putwc(0,0);
6872   ;
6873   return 0;
6874 }
6875 _ACEOF
6876 rm -f conftest.$ac_objext
6877 if { (eval echo "$as_me:6877: \"$ac_compile\"") >&5
6878   (eval $ac_compile) 2>&5
6879   ac_status=$?
6880   echo "$as_me:6880: \$? = $ac_status" >&5
6881   (exit $ac_status); } &&
6882          { ac_try='test -s conftest.$ac_objext'
6883   { (eval echo "$as_me:6883: \"$ac_try\"") >&5
6884   (eval $ac_try) 2>&5
6885   ac_status=$?
6886   echo "$as_me:6886: \$? = $ac_status" >&5
6887   (exit $ac_status); }; }; then
6888
6889                                 test -n "$verbose" && echo "    ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
6890
6891 echo "${as_me:-configure}:6891: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
6892
6893                                 cf_cv_find_linkage_utf8=maybe
6894                                 cf_test_CPPFLAGS="$CPPFLAGS"
6895                                 break
6896 else
6897   echo "$as_me: failed program was:" >&5
6898 cat conftest.$ac_ext >&5
6899
6900                                 CPPFLAGS="$cf_save_CPPFLAGS"
6901
6902 fi
6903 rm -f conftest.$ac_objext conftest.$ac_ext
6904                 fi
6905         done
6906
6907         if test "$cf_cv_find_linkage_utf8" = maybe ; then
6908
6909 echo "${as_me:-configure}:6909: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
6910
6911                 cf_save_LIBS="$LIBS"
6912                 cf_save_LDFLAGS="$LDFLAGS"
6913
6914                 if test "$cf_cv_find_linkage_utf8" != yes ; then
6915
6916 cf_search=
6917 cf_library_path_list=""
6918 if test -n "${LDFLAGS}${LIBS}" ; then
6919         for cf_library_path in $LDFLAGS $LIBS
6920         do
6921                 case $cf_library_path in
6922                 (-L*)
6923                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
6924
6925 test "x$cf_library_path" != "xNONE" && \
6926 test -d "$cf_library_path" && \
6927  {
6928         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
6929         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
6930         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
6931         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
6932         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
6933         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
6934 }
6935
6936                         cf_library_path_list="$cf_library_path_list $cf_search"
6937                         ;;
6938                 esac
6939         done
6940 fi
6941
6942 cf_search=
6943
6944 test "x$prefix" != "xNONE" && \
6945 test -d "$prefix" && \
6946  {
6947         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
6948         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
6949         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
6950         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
6951         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
6952         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
6953 }
6954
6955 for cf_subdir_prefix in \
6956         /usr \
6957         /usr/local \
6958         /usr/pkg \
6959         /opt \
6960         /opt/local \
6961         $HOME
6962 do
6963
6964 test "x$cf_subdir_prefix" != "x$prefix" && \
6965 test -d "$cf_subdir_prefix" && \
6966 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
6967         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
6968         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
6969         test -d $cf_subdir_prefix/lib/utf8 &&       cf_search="$cf_search $cf_subdir_prefix/lib/utf8"
6970         test -d $cf_subdir_prefix/lib/utf8/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib"
6971         test -d $cf_subdir_prefix/utf8/lib &&       cf_search="$cf_search $cf_subdir_prefix/utf8/lib"
6972         test -d $cf_subdir_prefix/utf8/lib/utf8 &&    cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8"
6973 }
6974
6975 done
6976
6977 cf_search="$cf_library_path_list $cf_search"
6978
6979                         for cf_cv_library_path_utf8 in $cf_search
6980                         do
6981                                 if test -d $cf_cv_library_path_utf8 ; then
6982                                         test -n "$verbose" && echo "    ... testing $cf_cv_library_path_utf8" 1>&6
6983
6984 echo "${as_me:-configure}:6984: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
6985
6986                                         CPPFLAGS="$cf_test_CPPFLAGS"
6987                                         LIBS="-lutf8  $cf_save_LIBS"
6988                                         LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
6989                                         cat >conftest.$ac_ext <<_ACEOF
6990 #line 6990 "configure"
6991 #include "confdefs.h"
6992
6993 #include <libutf8.h>
6994 int
6995 main (void)
6996 {
6997 putwc(0,0);
6998   ;
6999   return 0;
7000 }
7001 _ACEOF
7002 rm -f conftest.$ac_objext conftest$ac_exeext
7003 if { (eval echo "$as_me:7003: \"$ac_link\"") >&5
7004   (eval $ac_link) 2>&5
7005   ac_status=$?
7006   echo "$as_me:7006: \$? = $ac_status" >&5
7007   (exit $ac_status); } &&
7008          { ac_try='test -s conftest$ac_exeext'
7009   { (eval echo "$as_me:7009: \"$ac_try\"") >&5
7010   (eval $ac_try) 2>&5
7011   ac_status=$?
7012   echo "$as_me:7012: \$? = $ac_status" >&5
7013   (exit $ac_status); }; }; then
7014
7015                                         test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
7016
7017 echo "${as_me:-configure}:7017: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
7018
7019                                         cf_cv_find_linkage_utf8=yes
7020                                         cf_cv_library_file_utf8="-lutf8"
7021                                         break
7022 else
7023   echo "$as_me: failed program was:" >&5
7024 cat conftest.$ac_ext >&5
7025
7026                                         CPPFLAGS="$cf_save_CPPFLAGS"
7027                                         LIBS="$cf_save_LIBS"
7028                                         LDFLAGS="$cf_save_LDFLAGS"
7029
7030 fi
7031 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7032                                 fi
7033                         done
7034                         CPPFLAGS="$cf_save_CPPFLAGS"
7035                         LDFLAGS="$cf_save_LDFLAGS"
7036                 fi
7037
7038         else
7039                 cf_cv_find_linkage_utf8=no
7040         fi
7041
7042 fi
7043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7044
7045 fi
7046 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7047
7048 LIBS="$cf_save_LIBS"
7049
7050 if test "$cf_cv_find_linkage_utf8" = yes ; then
7051 cf_cv_utf8_lib=add-on
7052 else
7053 cf_cv_utf8_lib=no
7054 fi
7055
7056 fi
7057 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7058 fi
7059 echo "$as_me:7059: result: $cf_cv_utf8_lib" >&5
7060 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
7061
7062 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
7063 # ncurses/ncursesw:
7064 if test "$cf_cv_utf8_lib" = "add-on" ; then
7065
7066 cat >>confdefs.h <<\EOF
7067 #define HAVE_LIBUTF8_H 1
7068 EOF
7069
7070 if test -n "$cf_cv_header_path_utf8" ; then
7071   for cf_add_incdir in $cf_cv_header_path_utf8
7072   do
7073         while test $cf_add_incdir != /usr/include
7074         do
7075           if test -d $cf_add_incdir
7076           then
7077                 cf_have_incdir=no
7078                 if test -n "$CFLAGS$CPPFLAGS" ; then
7079                   # a loop is needed to ensure we can add subdirs of existing dirs
7080                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7081                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7082                           cf_have_incdir=yes; break
7083                         fi
7084                   done
7085                 fi
7086
7087                 if test "$cf_have_incdir" = no ; then
7088                   if test "$cf_add_incdir" = /usr/local/include ; then
7089                         if test "$GCC" = yes
7090                         then
7091                           cf_save_CPPFLAGS=$CPPFLAGS
7092
7093         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7094         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7095
7096                           cat >conftest.$ac_ext <<_ACEOF
7097 #line 7097 "configure"
7098 #include "confdefs.h"
7099 #include <stdio.h>
7100 int
7101 main (void)
7102 {
7103 printf("Hello")
7104   ;
7105   return 0;
7106 }
7107 _ACEOF
7108 rm -f conftest.$ac_objext
7109 if { (eval echo "$as_me:7109: \"$ac_compile\"") >&5
7110   (eval $ac_compile) 2>&5
7111   ac_status=$?
7112   echo "$as_me:7112: \$? = $ac_status" >&5
7113   (exit $ac_status); } &&
7114          { ac_try='test -s conftest.$ac_objext'
7115   { (eval echo "$as_me:7115: \"$ac_try\"") >&5
7116   (eval $ac_try) 2>&5
7117   ac_status=$?
7118   echo "$as_me:7118: \$? = $ac_status" >&5
7119   (exit $ac_status); }; }; then
7120   :
7121 else
7122   echo "$as_me: failed program was:" >&5
7123 cat conftest.$ac_ext >&5
7124 cf_have_incdir=yes
7125 fi
7126 rm -f conftest.$ac_objext conftest.$ac_ext
7127                           CPPFLAGS=$cf_save_CPPFLAGS
7128                         fi
7129                   fi
7130                 fi
7131
7132                 if test "$cf_have_incdir" = no ; then
7133                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7134
7135 echo "${as_me:-configure}:7135: testing adding $cf_add_incdir to include-path ..." 1>&5
7136
7137                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7138
7139                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7140                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7141                   cf_add_incdir="$cf_top_incdir"
7142                 else
7143                   break
7144                 fi
7145           else
7146                 break
7147           fi
7148         done
7149   done
7150 fi
7151
7152 if test -n "$cf_cv_library_path_utf8" ; then
7153         for cf_add_libdir in $cf_cv_library_path_utf8
7154         do
7155                 if test $cf_add_libdir = /usr/lib ; then
7156                         :
7157                 elif test -d $cf_add_libdir
7158                 then
7159                         cf_have_libdir=no
7160                         if test -n "$LDFLAGS$LIBS" ; then
7161                                 # a loop is needed to ensure we can add subdirs of existing dirs
7162                                 for cf_test_libdir in $LDFLAGS $LIBS ; do
7163                                         if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
7164                                                 cf_have_libdir=yes; break
7165                                         fi
7166                                 done
7167                         fi
7168                         if test "$cf_have_libdir" = no ; then
7169                                 test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
7170
7171 echo "${as_me:-configure}:7171: testing adding $cf_add_libdir to library-path ..." 1>&5
7172
7173                                 LDFLAGS="-L$cf_add_libdir $LDFLAGS"
7174                         fi
7175                 fi
7176         done
7177 fi
7178
7179 cf_add_libs="$cf_cv_library_file_utf8"
7180 # Filter out duplicates - this happens with badly-designed ".pc" files...
7181 for cf_add_1lib in $LIBS
7182 do
7183         for cf_add_2lib in $cf_add_libs
7184         do
7185                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7186                 then
7187                         cf_add_1lib=
7188                         break
7189                 fi
7190         done
7191         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7192 done
7193 LIBS="$cf_add_libs"
7194
7195 fi
7196
7197 cf_ncuconfig_root=$cf_cv_screen
7198 cf_have_ncuconfig=no
7199
7200 if test "x${PKG_CONFIG:=none}" != xnone; then
7201         echo "$as_me:7201: checking pkg-config for $cf_ncuconfig_root" >&5
7202 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
7203         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
7204                 echo "$as_me:7204: result: yes" >&5
7205 echo "${ECHO_T}yes" >&6
7206
7207                 echo "$as_me:7207: checking if the $cf_ncuconfig_root package files work" >&5
7208 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
7209                 cf_have_ncuconfig=unknown
7210
7211                 cf_save_CPPFLAGS="$CPPFLAGS"
7212                 cf_save_LIBS="$LIBS"
7213
7214 cf_fix_cppflags=no
7215 cf_new_cflags=
7216 cf_new_cppflags=
7217 cf_new_extra_cppflags=
7218
7219 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
7220 do
7221 case $cf_fix_cppflags in
7222 (no)
7223         case $cf_add_cflags in
7224         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7225                 case $cf_add_cflags in
7226                 (-D*)
7227                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7228
7229                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7230                                 && test -z "${cf_tst_cflags}" \
7231                                 && cf_fix_cppflags=yes
7232
7233                         if test $cf_fix_cppflags = yes ; then
7234
7235         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7236         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7237
7238                                 continue
7239                         elif test "${cf_tst_cflags}" = "\"'" ; then
7240
7241         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7242         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7243
7244                                 continue
7245                         fi
7246                         ;;
7247                 esac
7248                 case "$CPPFLAGS" in
7249                 (*$cf_add_cflags)
7250                         ;;
7251                 (*)
7252                         case $cf_add_cflags in
7253                         (-D*)
7254                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7255
7256 CPPFLAGS=`echo "$CPPFLAGS" | \
7257         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7258                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7259
7260                                 ;;
7261                         esac
7262
7263         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7264         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7265
7266                         ;;
7267                 esac
7268                 ;;
7269         (*)
7270
7271         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7272         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7273
7274                 ;;
7275         esac
7276         ;;
7277 (yes)
7278
7279         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7280         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7281
7282         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7283
7284         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7285                 && test -z "${cf_tst_cflags}" \
7286                 && cf_fix_cppflags=no
7287         ;;
7288 esac
7289 done
7290
7291 if test -n "$cf_new_cflags" ; then
7292
7293         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7294         CFLAGS="${CFLAGS}$cf_new_cflags"
7295
7296 fi
7297
7298 if test -n "$cf_new_cppflags" ; then
7299
7300         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7301         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7302
7303 fi
7304
7305 if test -n "$cf_new_extra_cppflags" ; then
7306
7307         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7308         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7309
7310 fi
7311
7312 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
7313 # Filter out duplicates - this happens with badly-designed ".pc" files...
7314 for cf_add_1lib in $LIBS
7315 do
7316         for cf_add_2lib in $cf_add_libs
7317         do
7318                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7319                 then
7320                         cf_add_1lib=
7321                         break
7322                 fi
7323         done
7324         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7325 done
7326 LIBS="$cf_add_libs"
7327
7328                 cat >conftest.$ac_ext <<_ACEOF
7329 #line 7329 "configure"
7330 #include "confdefs.h"
7331 #include <${cf_cv_ncurses_header:-curses.h}>
7332 int
7333 main (void)
7334 {
7335 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7336   ;
7337   return 0;
7338 }
7339 _ACEOF
7340 rm -f conftest.$ac_objext conftest$ac_exeext
7341 if { (eval echo "$as_me:7341: \"$ac_link\"") >&5
7342   (eval $ac_link) 2>&5
7343   ac_status=$?
7344   echo "$as_me:7344: \$? = $ac_status" >&5
7345   (exit $ac_status); } &&
7346          { ac_try='test -s conftest$ac_exeext'
7347   { (eval echo "$as_me:7347: \"$ac_try\"") >&5
7348   (eval $ac_try) 2>&5
7349   ac_status=$?
7350   echo "$as_me:7350: \$? = $ac_status" >&5
7351   (exit $ac_status); }; }; then
7352   if test "$cross_compiling" = yes; then
7353   cf_have_ncuconfig=maybe
7354 else
7355   cat >conftest.$ac_ext <<_ACEOF
7356 #line 7356 "configure"
7357 #include "confdefs.h"
7358 #include <${cf_cv_ncurses_header:-curses.h}>
7359                                 int main(void)
7360                                 { char *xx = curses_version(); return (xx == 0); }
7361 _ACEOF
7362 rm -f conftest$ac_exeext
7363 if { (eval echo "$as_me:7363: \"$ac_link\"") >&5
7364   (eval $ac_link) 2>&5
7365   ac_status=$?
7366   echo "$as_me:7366: \$? = $ac_status" >&5
7367   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7368   { (eval echo "$as_me:7368: \"$ac_try\"") >&5
7369   (eval $ac_try) 2>&5
7370   ac_status=$?
7371   echo "$as_me:7371: \$? = $ac_status" >&5
7372   (exit $ac_status); }; }; then
7373   cf_have_ncuconfig=yes
7374 else
7375   echo "$as_me: program exited with status $ac_status" >&5
7376 echo "$as_me: failed program was:" >&5
7377 cat conftest.$ac_ext >&5
7378 cf_have_ncuconfig=no
7379 fi
7380 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7381 fi
7382 else
7383   echo "$as_me: failed program was:" >&5
7384 cat conftest.$ac_ext >&5
7385 cf_have_ncuconfig=no
7386 fi
7387 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7388                 echo "$as_me:7388: result: $cf_have_ncuconfig" >&5
7389 echo "${ECHO_T}$cf_have_ncuconfig" >&6
7390                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
7391                 if test "$cf_have_ncuconfig" != "yes"
7392                 then
7393                         CPPFLAGS="$cf_save_CPPFLAGS"
7394                         LIBS="$cf_save_LIBS"
7395                         NCURSES_CONFIG_PKG=none
7396                 else
7397
7398 cat >>confdefs.h <<\EOF
7399 #define NCURSES 1
7400 EOF
7401
7402                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
7403
7404 echo "$as_me:7404: checking for terminfo header" >&5
7405 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7406 if test "${cf_cv_term_header+set}" = set; then
7407   echo $ECHO_N "(cached) $ECHO_C" >&6
7408 else
7409
7410 case ${cf_cv_ncurses_header} in
7411 (*/ncurses.h|*/ncursesw.h)
7412         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7413         ;;
7414 (*)
7415         cf_term_header=term.h
7416         ;;
7417 esac
7418
7419 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7420 do
7421 cat >conftest.$ac_ext <<_ACEOF
7422 #line 7422 "configure"
7423 #include "confdefs.h"
7424 #include <stdio.h>
7425 #include <${cf_cv_ncurses_header:-curses.h}>
7426 #include <$cf_test>
7427
7428 int
7429 main (void)
7430 {
7431 int x = auto_left_margin
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         cf_cv_term_header="$cf_test"
7450 else
7451   echo "$as_me: failed program was:" >&5
7452 cat conftest.$ac_ext >&5
7453
7454         cf_cv_term_header=unknown
7455
7456 fi
7457 rm -f conftest.$ac_objext conftest.$ac_ext
7458         test "$cf_cv_term_header" != unknown && break
7459 done
7460
7461 fi
7462 echo "$as_me:7462: result: $cf_cv_term_header" >&5
7463 echo "${ECHO_T}$cf_cv_term_header" >&6
7464
7465 # Set definitions to allow ifdef'ing to accommodate subdirectories
7466
7467 case $cf_cv_term_header in
7468 (*term.h)
7469
7470 cat >>confdefs.h <<\EOF
7471 #define HAVE_TERM_H 1
7472 EOF
7473
7474         ;;
7475 esac
7476
7477 case $cf_cv_term_header in
7478 (ncurses/term.h)
7479
7480 cat >>confdefs.h <<\EOF
7481 #define HAVE_NCURSES_TERM_H 1
7482 EOF
7483
7484         ;;
7485 (ncursesw/term.h)
7486
7487 cat >>confdefs.h <<\EOF
7488 #define HAVE_NCURSESW_TERM_H 1
7489 EOF
7490
7491         ;;
7492 esac
7493
7494                 fi
7495
7496         else
7497                 echo "$as_me:7497: result: no" >&5
7498 echo "${ECHO_T}no" >&6
7499                 NCURSES_CONFIG_PKG=none
7500         fi
7501 else
7502         NCURSES_CONFIG_PKG=none
7503 fi
7504
7505 if test "x$cf_have_ncuconfig" = "xno"; then
7506         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
7507
7508 if test -n "$ac_tool_prefix"; then
7509   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7510   do
7511     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
7512 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
7513 echo "$as_me:7513: checking for $ac_word" >&5
7514 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7515 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
7516   echo $ECHO_N "(cached) $ECHO_C" >&6
7517 else
7518   if test -n "$NCURSES_CONFIG"; then
7519   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
7520 else
7521   ac_save_IFS=$IFS; IFS=$ac_path_separator
7522 ac_dummy="$PATH"
7523 for ac_dir in $ac_dummy; do
7524   IFS=$ac_save_IFS
7525   test -z "$ac_dir" && ac_dir=.
7526   $as_executable_p "$ac_dir/$ac_word" || continue
7527 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
7528 echo "$as_me:7528: found $ac_dir/$ac_word" >&5
7529 break
7530 done
7531
7532 fi
7533 fi
7534 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
7535 if test -n "$NCURSES_CONFIG"; then
7536   echo "$as_me:7536: result: $NCURSES_CONFIG" >&5
7537 echo "${ECHO_T}$NCURSES_CONFIG" >&6
7538 else
7539   echo "$as_me:7539: result: no" >&5
7540 echo "${ECHO_T}no" >&6
7541 fi
7542
7543     test -n "$NCURSES_CONFIG" && break
7544   done
7545 fi
7546 if test -z "$NCURSES_CONFIG"; then
7547   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
7548   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
7549 do
7550   # Extract the first word of "$ac_prog", so it can be a program name with args.
7551 set dummy $ac_prog; ac_word=$2
7552 echo "$as_me:7552: checking for $ac_word" >&5
7553 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
7554 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
7555   echo $ECHO_N "(cached) $ECHO_C" >&6
7556 else
7557   if test -n "$ac_ct_NCURSES_CONFIG"; then
7558   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
7559 else
7560   ac_save_IFS=$IFS; IFS=$ac_path_separator
7561 ac_dummy="$PATH"
7562 for ac_dir in $ac_dummy; do
7563   IFS=$ac_save_IFS
7564   test -z "$ac_dir" && ac_dir=.
7565   $as_executable_p "$ac_dir/$ac_word" || continue
7566 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
7567 echo "$as_me:7567: found $ac_dir/$ac_word" >&5
7568 break
7569 done
7570
7571 fi
7572 fi
7573 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
7574 if test -n "$ac_ct_NCURSES_CONFIG"; then
7575   echo "$as_me:7575: result: $ac_ct_NCURSES_CONFIG" >&5
7576 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
7577 else
7578   echo "$as_me:7578: result: no" >&5
7579 echo "${ECHO_T}no" >&6
7580 fi
7581
7582   test -n "$ac_ct_NCURSES_CONFIG" && break
7583 done
7584 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
7585
7586   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
7587 fi
7588
7589         if test "$NCURSES_CONFIG" != none ; then
7590
7591 cf_fix_cppflags=no
7592 cf_new_cflags=
7593 cf_new_cppflags=
7594 cf_new_extra_cppflags=
7595
7596 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
7597 do
7598 case $cf_fix_cppflags in
7599 (no)
7600         case $cf_add_cflags in
7601         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
7602                 case $cf_add_cflags in
7603                 (-D*)
7604                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
7605
7606                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7607                                 && test -z "${cf_tst_cflags}" \
7608                                 && cf_fix_cppflags=yes
7609
7610                         if test $cf_fix_cppflags = yes ; then
7611
7612         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7613         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7614
7615                                 continue
7616                         elif test "${cf_tst_cflags}" = "\"'" ; then
7617
7618         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7619         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7620
7621                                 continue
7622                         fi
7623                         ;;
7624                 esac
7625                 case "$CPPFLAGS" in
7626                 (*$cf_add_cflags)
7627                         ;;
7628                 (*)
7629                         case $cf_add_cflags in
7630                         (-D*)
7631                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
7632
7633 CPPFLAGS=`echo "$CPPFLAGS" | \
7634         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
7635                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
7636
7637                                 ;;
7638                         esac
7639
7640         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
7641         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
7642
7643                         ;;
7644                 esac
7645                 ;;
7646         (*)
7647
7648         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
7649         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
7650
7651                 ;;
7652         esac
7653         ;;
7654 (yes)
7655
7656         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
7657         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
7658
7659         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
7660
7661         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
7662                 && test -z "${cf_tst_cflags}" \
7663                 && cf_fix_cppflags=no
7664         ;;
7665 esac
7666 done
7667
7668 if test -n "$cf_new_cflags" ; then
7669
7670         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
7671         CFLAGS="${CFLAGS}$cf_new_cflags"
7672
7673 fi
7674
7675 if test -n "$cf_new_cppflags" ; then
7676
7677         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7678         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
7679
7680 fi
7681
7682 if test -n "$cf_new_extra_cppflags" ; then
7683
7684         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
7685         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
7686
7687 fi
7688
7689 cf_add_libs="`$NCURSES_CONFIG --libs`"
7690 # Filter out duplicates - this happens with badly-designed ".pc" files...
7691 for cf_add_1lib in $LIBS
7692 do
7693         for cf_add_2lib in $cf_add_libs
7694         do
7695                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
7696                 then
7697                         cf_add_1lib=
7698                         break
7699                 fi
7700         done
7701         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
7702 done
7703 LIBS="$cf_add_libs"
7704
7705                 # even with config script, some packages use no-override for curses.h
7706
7707 echo "$as_me:7707: checking if we have identified curses headers" >&5
7708 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
7709 if test "${cf_cv_ncurses_header+set}" = set; then
7710   echo $ECHO_N "(cached) $ECHO_C" >&6
7711 else
7712
7713 cf_cv_ncurses_header=none
7714 for cf_header in \
7715         ncurses.h $cf_cv_screen/ncurses.h \
7716         curses.h $cf_cv_screen/curses.h
7717 do
7718 cat >conftest.$ac_ext <<_ACEOF
7719 #line 7719 "configure"
7720 #include "confdefs.h"
7721 #include <${cf_header}>
7722 int
7723 main (void)
7724 {
7725 initscr(); tgoto("?", 0,0)
7726   ;
7727   return 0;
7728 }
7729 _ACEOF
7730 rm -f conftest.$ac_objext
7731 if { (eval echo "$as_me:7731: \"$ac_compile\"") >&5
7732   (eval $ac_compile) 2>&5
7733   ac_status=$?
7734   echo "$as_me:7734: \$? = $ac_status" >&5
7735   (exit $ac_status); } &&
7736          { ac_try='test -s conftest.$ac_objext'
7737   { (eval echo "$as_me:7737: \"$ac_try\"") >&5
7738   (eval $ac_try) 2>&5
7739   ac_status=$?
7740   echo "$as_me:7740: \$? = $ac_status" >&5
7741   (exit $ac_status); }; }; then
7742   cf_cv_ncurses_header=$cf_header; break
7743 else
7744   echo "$as_me: failed program was:" >&5
7745 cat conftest.$ac_ext >&5
7746 fi
7747 rm -f conftest.$ac_objext conftest.$ac_ext
7748 done
7749
7750 fi
7751 echo "$as_me:7751: result: $cf_cv_ncurses_header" >&5
7752 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
7753
7754 if test "$cf_cv_ncurses_header" = none ; then
7755         { { echo "$as_me:7755: error: No curses header-files found" >&5
7756 echo "$as_me: error: No curses header-files found" >&2;}
7757    { (exit 1); exit 1; }; }
7758 fi
7759
7760 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
7761
7762 for ac_header in $cf_cv_ncurses_header
7763 do
7764 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
7765 echo "$as_me:7765: checking for $ac_header" >&5
7766 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
7767 if eval "test \"\${$as_ac_Header+set}\" = set"; then
7768   echo $ECHO_N "(cached) $ECHO_C" >&6
7769 else
7770   cat >conftest.$ac_ext <<_ACEOF
7771 #line 7771 "configure"
7772 #include "confdefs.h"
7773 #include <$ac_header>
7774 _ACEOF
7775 if { (eval echo "$as_me:7775: \"$ac_cpp conftest.$ac_ext\"") >&5
7776   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
7777   ac_status=$?
7778   egrep -v '^ *\+' conftest.er1 >conftest.err
7779   rm -f conftest.er1
7780   cat conftest.err >&5
7781   echo "$as_me:7781: \$? = $ac_status" >&5
7782   (exit $ac_status); } >/dev/null; then
7783   if test -s conftest.err; then
7784     ac_cpp_err=$ac_c_preproc_warn_flag
7785   else
7786     ac_cpp_err=
7787   fi
7788 else
7789   ac_cpp_err=yes
7790 fi
7791 if test -z "$ac_cpp_err"; then
7792   eval "$as_ac_Header=yes"
7793 else
7794   echo "$as_me: failed program was:" >&5
7795   cat conftest.$ac_ext >&5
7796   eval "$as_ac_Header=no"
7797 fi
7798 rm -f conftest.err conftest.$ac_ext
7799 fi
7800 echo "$as_me:7800: result: `eval echo '${'$as_ac_Header'}'`" >&5
7801 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
7802 if test `eval echo '${'$as_ac_Header'}'` = yes; then
7803   cat >>confdefs.h <<EOF
7804 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
7805 EOF
7806
7807 fi
7808 done
7809
7810 cat >>confdefs.h <<\EOF
7811 #define NCURSES 1
7812 EOF
7813
7814 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7815
7816                 cat >>confdefs.h <<EOF
7817 #define $cf_nculib_ROOT 1
7818 EOF
7819
7820                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
7821
7822         else
7823
7824 cf_ncuhdr_root=$cf_cv_screen
7825
7826 test -n "$cf_cv_curses_dir" && \
7827 test "$cf_cv_curses_dir" != "no" && { \
7828
7829 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
7830   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
7831   do
7832         while test $cf_add_incdir != /usr/include
7833         do
7834           if test -d $cf_add_incdir
7835           then
7836                 cf_have_incdir=no
7837                 if test -n "$CFLAGS$CPPFLAGS" ; then
7838                   # a loop is needed to ensure we can add subdirs of existing dirs
7839                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7840                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7841                           cf_have_incdir=yes; break
7842                         fi
7843                   done
7844                 fi
7845
7846                 if test "$cf_have_incdir" = no ; then
7847                   if test "$cf_add_incdir" = /usr/local/include ; then
7848                         if test "$GCC" = yes
7849                         then
7850                           cf_save_CPPFLAGS=$CPPFLAGS
7851
7852         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
7853         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
7854
7855                           cat >conftest.$ac_ext <<_ACEOF
7856 #line 7856 "configure"
7857 #include "confdefs.h"
7858 #include <stdio.h>
7859 int
7860 main (void)
7861 {
7862 printf("Hello")
7863   ;
7864   return 0;
7865 }
7866 _ACEOF
7867 rm -f conftest.$ac_objext
7868 if { (eval echo "$as_me:7868: \"$ac_compile\"") >&5
7869   (eval $ac_compile) 2>&5
7870   ac_status=$?
7871   echo "$as_me:7871: \$? = $ac_status" >&5
7872   (exit $ac_status); } &&
7873          { ac_try='test -s conftest.$ac_objext'
7874   { (eval echo "$as_me:7874: \"$ac_try\"") >&5
7875   (eval $ac_try) 2>&5
7876   ac_status=$?
7877   echo "$as_me:7877: \$? = $ac_status" >&5
7878   (exit $ac_status); }; }; then
7879   :
7880 else
7881   echo "$as_me: failed program was:" >&5
7882 cat conftest.$ac_ext >&5
7883 cf_have_incdir=yes
7884 fi
7885 rm -f conftest.$ac_objext conftest.$ac_ext
7886                           CPPFLAGS=$cf_save_CPPFLAGS
7887                         fi
7888                   fi
7889                 fi
7890
7891                 if test "$cf_have_incdir" = no ; then
7892                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7893
7894 echo "${as_me:-configure}:7894: testing adding $cf_add_incdir to include-path ..." 1>&5
7895
7896                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7897
7898                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7899                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7900                   cf_add_incdir="$cf_top_incdir"
7901                 else
7902                   break
7903                 fi
7904           else
7905                 break
7906           fi
7907         done
7908   done
7909 fi
7910
7911 }
7912
7913 echo "$as_me:7913: checking for $cf_ncuhdr_root header in include-path" >&5
7914 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
7915 if test "${cf_cv_ncurses_h+set}" = set; then
7916   echo $ECHO_N "(cached) $ECHO_C" >&6
7917 else
7918
7919         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
7920         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
7921         for cf_header in $cf_header_list
7922         do
7923
7924         cat >conftest.$ac_ext <<_ACEOF
7925 #line 7925 "configure"
7926 #include "confdefs.h"
7927
7928 #include <$cf_header>
7929 int
7930 main (void)
7931 {
7932
7933 #ifdef NCURSES_VERSION
7934
7935 printf("%s\n", NCURSES_VERSION);
7936 #else
7937 #ifdef __NCURSES_H
7938 printf("old\n");
7939 #else
7940         make an error
7941 #endif
7942 #endif
7943
7944   ;
7945   return 0;
7946 }
7947 _ACEOF
7948 rm -f conftest.$ac_objext
7949 if { (eval echo "$as_me:7949: \"$ac_compile\"") >&5
7950   (eval $ac_compile) 2>&5
7951   ac_status=$?
7952   echo "$as_me:7952: \$? = $ac_status" >&5
7953   (exit $ac_status); } &&
7954          { ac_try='test -s conftest.$ac_objext'
7955   { (eval echo "$as_me:7955: \"$ac_try\"") >&5
7956   (eval $ac_try) 2>&5
7957   ac_status=$?
7958   echo "$as_me:7958: \$? = $ac_status" >&5
7959   (exit $ac_status); }; }; then
7960   cf_cv_ncurses_h=$cf_header
7961
7962 else
7963   echo "$as_me: failed program was:" >&5
7964 cat conftest.$ac_ext >&5
7965 cf_cv_ncurses_h=no
7966 fi
7967 rm -f conftest.$ac_objext conftest.$ac_ext
7968
7969                 test "$cf_cv_ncurses_h" != no && break
7970         done
7971
7972 fi
7973 echo "$as_me:7973: result: $cf_cv_ncurses_h" >&5
7974 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
7975
7976 if test "$cf_cv_ncurses_h" != no ; then
7977         cf_cv_ncurses_header=$cf_cv_ncurses_h
7978 else
7979
7980 echo "$as_me:7980: checking for $cf_ncuhdr_root include-path" >&5
7981 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
7982 if test "${cf_cv_ncurses_h2+set}" = set; then
7983   echo $ECHO_N "(cached) $ECHO_C" >&6
7984 else
7985
7986         test -n "$verbose" && echo
7987
7988 cf_search=
7989
7990 # collect the current set of include-directories from compiler flags
7991 cf_header_path_list=""
7992 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7993         for cf_header_path in $CPPFLAGS $CFLAGS
7994         do
7995                 case $cf_header_path in
7996                 (-I*)
7997                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7998
7999 test "x$cf_header_path" != "xNONE" && \
8000 test -d "$cf_header_path" && \
8001  {
8002         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8003         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8004         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8005         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8006         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8007         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"
8008 }
8009
8010                         cf_header_path_list="$cf_header_path_list $cf_search"
8011                         ;;
8012                 esac
8013         done
8014 fi
8015
8016 # add the variations for the package we are looking for
8017
8018 cf_search=
8019
8020 test "x$prefix" != "xNONE" && \
8021 test -d "$prefix" && \
8022  {
8023         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8024         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8025         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8026         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8027         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8028         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8029 }
8030
8031 for cf_subdir_prefix in \
8032         /usr \
8033         /usr/local \
8034         /usr/pkg \
8035         /opt \
8036         /opt/local \
8037         $HOME
8038 do
8039
8040 test "x$cf_subdir_prefix" != "x$prefix" && \
8041 test -d "$cf_subdir_prefix" && \
8042 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8043         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
8044         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
8045         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
8046         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
8047         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
8048         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"
8049 }
8050
8051 done
8052
8053 test "$includedir" != NONE && \
8054 test "$includedir" != "/usr/include" && \
8055 test -d "$includedir" && {
8056         test -d $includedir &&    cf_search="$cf_search $includedir"
8057         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8058 }
8059
8060 test "$oldincludedir" != NONE && \
8061 test "$oldincludedir" != "/usr/include" && \
8062 test -d "$oldincludedir" && {
8063         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8064         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8065 }
8066
8067 cf_search="$cf_search $cf_header_path_list"
8068
8069         test -n "$verbose" && echo search path $cf_search
8070         cf_save2_CPPFLAGS="$CPPFLAGS"
8071         for cf_incdir in $cf_search
8072         do
8073
8074 if test -n "$cf_incdir" ; then
8075   for cf_add_incdir in $cf_incdir
8076   do
8077         while test $cf_add_incdir != /usr/include
8078         do
8079           if test -d $cf_add_incdir
8080           then
8081                 cf_have_incdir=no
8082                 if test -n "$CFLAGS$CPPFLAGS" ; then
8083                   # a loop is needed to ensure we can add subdirs of existing dirs
8084                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8085                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8086                           cf_have_incdir=yes; break
8087                         fi
8088                   done
8089                 fi
8090
8091                 if test "$cf_have_incdir" = no ; then
8092                   if test "$cf_add_incdir" = /usr/local/include ; then
8093                         if test "$GCC" = yes
8094                         then
8095                           cf_save_CPPFLAGS=$CPPFLAGS
8096
8097         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8098         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8099
8100                           cat >conftest.$ac_ext <<_ACEOF
8101 #line 8101 "configure"
8102 #include "confdefs.h"
8103 #include <stdio.h>
8104 int
8105 main (void)
8106 {
8107 printf("Hello")
8108   ;
8109   return 0;
8110 }
8111 _ACEOF
8112 rm -f conftest.$ac_objext
8113 if { (eval echo "$as_me:8113: \"$ac_compile\"") >&5
8114   (eval $ac_compile) 2>&5
8115   ac_status=$?
8116   echo "$as_me:8116: \$? = $ac_status" >&5
8117   (exit $ac_status); } &&
8118          { ac_try='test -s conftest.$ac_objext'
8119   { (eval echo "$as_me:8119: \"$ac_try\"") >&5
8120   (eval $ac_try) 2>&5
8121   ac_status=$?
8122   echo "$as_me:8122: \$? = $ac_status" >&5
8123   (exit $ac_status); }; }; then
8124   :
8125 else
8126   echo "$as_me: failed program was:" >&5
8127 cat conftest.$ac_ext >&5
8128 cf_have_incdir=yes
8129 fi
8130 rm -f conftest.$ac_objext conftest.$ac_ext
8131                           CPPFLAGS=$cf_save_CPPFLAGS
8132                         fi
8133                   fi
8134                 fi
8135
8136                 if test "$cf_have_incdir" = no ; then
8137                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8138
8139 echo "${as_me:-configure}:8139: testing adding $cf_add_incdir to include-path ..." 1>&5
8140
8141                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8142
8143                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8144                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8145                   cf_add_incdir="$cf_top_incdir"
8146                 else
8147                   break
8148                 fi
8149           else
8150                 break
8151           fi
8152         done
8153   done
8154 fi
8155
8156                 for cf_header in \
8157                         ncurses.h \
8158                         curses.h
8159                 do
8160
8161         cat >conftest.$ac_ext <<_ACEOF
8162 #line 8162 "configure"
8163 #include "confdefs.h"
8164
8165 #include <$cf_header>
8166 int
8167 main (void)
8168 {
8169
8170 #ifdef NCURSES_VERSION
8171
8172 printf("%s\n", NCURSES_VERSION);
8173 #else
8174 #ifdef __NCURSES_H
8175 printf("old\n");
8176 #else
8177         make an error
8178 #endif
8179 #endif
8180
8181   ;
8182   return 0;
8183 }
8184 _ACEOF
8185 rm -f conftest.$ac_objext
8186 if { (eval echo "$as_me:8186: \"$ac_compile\"") >&5
8187   (eval $ac_compile) 2>&5
8188   ac_status=$?
8189   echo "$as_me:8189: \$? = $ac_status" >&5
8190   (exit $ac_status); } &&
8191          { ac_try='test -s conftest.$ac_objext'
8192   { (eval echo "$as_me:8192: \"$ac_try\"") >&5
8193   (eval $ac_try) 2>&5
8194   ac_status=$?
8195   echo "$as_me:8195: \$? = $ac_status" >&5
8196   (exit $ac_status); }; }; then
8197   cf_cv_ncurses_h2=$cf_header
8198
8199 else
8200   echo "$as_me: failed program was:" >&5
8201 cat conftest.$ac_ext >&5
8202 cf_cv_ncurses_h2=no
8203 fi
8204 rm -f conftest.$ac_objext conftest.$ac_ext
8205
8206                         if test "$cf_cv_ncurses_h2" != no ; then
8207                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
8208                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
8209                                 break
8210                         fi
8211                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
8212                 done
8213                 CPPFLAGS="$cf_save2_CPPFLAGS"
8214                 test "$cf_cv_ncurses_h2" != no && break
8215         done
8216         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:8216: error: not found" >&5
8217 echo "$as_me: error: not found" >&2;}
8218    { (exit 1); exit 1; }; }
8219
8220 fi
8221 echo "$as_me:8221: result: $cf_cv_ncurses_h2" >&5
8222 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
8223
8224         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
8225         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
8226         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
8227                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
8228         fi
8229
8230 if test -n "$cf_1st_incdir" ; then
8231   for cf_add_incdir in $cf_1st_incdir
8232   do
8233         while test $cf_add_incdir != /usr/include
8234         do
8235           if test -d $cf_add_incdir
8236           then
8237                 cf_have_incdir=no
8238                 if test -n "$CFLAGS$CPPFLAGS" ; then
8239                   # a loop is needed to ensure we can add subdirs of existing dirs
8240                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8241                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8242                           cf_have_incdir=yes; break
8243                         fi
8244                   done
8245                 fi
8246
8247                 if test "$cf_have_incdir" = no ; then
8248                   if test "$cf_add_incdir" = /usr/local/include ; then
8249                         if test "$GCC" = yes
8250                         then
8251                           cf_save_CPPFLAGS=$CPPFLAGS
8252
8253         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
8254         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
8255
8256                           cat >conftest.$ac_ext <<_ACEOF
8257 #line 8257 "configure"
8258 #include "confdefs.h"
8259 #include <stdio.h>
8260 int
8261 main (void)
8262 {
8263 printf("Hello")
8264   ;
8265   return 0;
8266 }
8267 _ACEOF
8268 rm -f conftest.$ac_objext
8269 if { (eval echo "$as_me:8269: \"$ac_compile\"") >&5
8270   (eval $ac_compile) 2>&5
8271   ac_status=$?
8272   echo "$as_me:8272: \$? = $ac_status" >&5
8273   (exit $ac_status); } &&
8274          { ac_try='test -s conftest.$ac_objext'
8275   { (eval echo "$as_me:8275: \"$ac_try\"") >&5
8276   (eval $ac_try) 2>&5
8277   ac_status=$?
8278   echo "$as_me:8278: \$? = $ac_status" >&5
8279   (exit $ac_status); }; }; then
8280   :
8281 else
8282   echo "$as_me: failed program was:" >&5
8283 cat conftest.$ac_ext >&5
8284 cf_have_incdir=yes
8285 fi
8286 rm -f conftest.$ac_objext conftest.$ac_ext
8287                           CPPFLAGS=$cf_save_CPPFLAGS
8288                         fi
8289                   fi
8290                 fi
8291
8292                 if test "$cf_have_incdir" = no ; then
8293                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8294
8295 echo "${as_me:-configure}:8295: testing adding $cf_add_incdir to include-path ..." 1>&5
8296
8297                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8298
8299                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8300                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8301                   cf_add_incdir="$cf_top_incdir"
8302                 else
8303                   break
8304                 fi
8305           else
8306                 break
8307           fi
8308         done
8309   done
8310 fi
8311
8312 fi
8313
8314 # Set definitions to allow ifdef'ing for ncurses.h
8315
8316 case $cf_cv_ncurses_header in
8317 (*ncurses.h)
8318
8319 cat >>confdefs.h <<\EOF
8320 #define HAVE_NCURSES_H 1
8321 EOF
8322
8323         ;;
8324 esac
8325
8326 case $cf_cv_ncurses_header in
8327 (ncurses/curses.h|ncurses/ncurses.h)
8328
8329 cat >>confdefs.h <<\EOF
8330 #define HAVE_NCURSES_NCURSES_H 1
8331 EOF
8332
8333         ;;
8334 (ncursesw/curses.h|ncursesw/ncurses.h)
8335
8336 cat >>confdefs.h <<\EOF
8337 #define HAVE_NCURSESW_NCURSES_H 1
8338 EOF
8339
8340         ;;
8341 esac
8342
8343 echo "$as_me:8343: checking for terminfo header" >&5
8344 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
8345 if test "${cf_cv_term_header+set}" = set; then
8346   echo $ECHO_N "(cached) $ECHO_C" >&6
8347 else
8348
8349 case ${cf_cv_ncurses_header} in
8350 (*/ncurses.h|*/ncursesw.h)
8351         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
8352         ;;
8353 (*)
8354         cf_term_header=term.h
8355         ;;
8356 esac
8357
8358 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
8359 do
8360 cat >conftest.$ac_ext <<_ACEOF
8361 #line 8361 "configure"
8362 #include "confdefs.h"
8363 #include <stdio.h>
8364 #include <${cf_cv_ncurses_header:-curses.h}>
8365 #include <$cf_test>
8366
8367 int
8368 main (void)
8369 {
8370 int x = auto_left_margin
8371   ;
8372   return 0;
8373 }
8374 _ACEOF
8375 rm -f conftest.$ac_objext
8376 if { (eval echo "$as_me:8376: \"$ac_compile\"") >&5
8377   (eval $ac_compile) 2>&5
8378   ac_status=$?
8379   echo "$as_me:8379: \$? = $ac_status" >&5
8380   (exit $ac_status); } &&
8381          { ac_try='test -s conftest.$ac_objext'
8382   { (eval echo "$as_me:8382: \"$ac_try\"") >&5
8383   (eval $ac_try) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit $ac_status); }; }; then
8387
8388         cf_cv_term_header="$cf_test"
8389 else
8390   echo "$as_me: failed program was:" >&5
8391 cat conftest.$ac_ext >&5
8392
8393         cf_cv_term_header=unknown
8394
8395 fi
8396 rm -f conftest.$ac_objext conftest.$ac_ext
8397         test "$cf_cv_term_header" != unknown && break
8398 done
8399
8400 fi
8401 echo "$as_me:8401: result: $cf_cv_term_header" >&5
8402 echo "${ECHO_T}$cf_cv_term_header" >&6
8403
8404 # Set definitions to allow ifdef'ing to accommodate subdirectories
8405
8406 case $cf_cv_term_header in
8407 (*term.h)
8408
8409 cat >>confdefs.h <<\EOF
8410 #define HAVE_TERM_H 1
8411 EOF
8412
8413         ;;
8414 esac
8415
8416 case $cf_cv_term_header in
8417 (ncurses/term.h)
8418
8419 cat >>confdefs.h <<\EOF
8420 #define HAVE_NCURSES_TERM_H 1
8421 EOF
8422
8423         ;;
8424 (ncursesw/term.h)
8425
8426 cat >>confdefs.h <<\EOF
8427 #define HAVE_NCURSESW_TERM_H 1
8428 EOF
8429
8430         ;;
8431 esac
8432
8433 # some applications need this, but should check for NCURSES_VERSION
8434
8435 cat >>confdefs.h <<\EOF
8436 #define NCURSES 1
8437 EOF
8438
8439 echo "$as_me:8439: checking for ncurses version" >&5
8440 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
8441 if test "${cf_cv_ncurses_version+set}" = set; then
8442   echo $ECHO_N "(cached) $ECHO_C" >&6
8443 else
8444
8445         cf_cv_ncurses_version=no
8446         cf_tempfile=out$$
8447         rm -f $cf_tempfile
8448         if test "$cross_compiling" = yes; then
8449
8450         # This will not work if the preprocessor splits the line after the
8451         # Autoconf token.  The 'unproto' program does that.
8452         cat > conftest.$ac_ext <<EOF
8453 #include <${cf_cv_ncurses_header:-curses.h}>
8454 #undef Autoconf
8455 #ifdef NCURSES_VERSION
8456 Autoconf NCURSES_VERSION
8457 #else
8458 #ifdef __NCURSES_H
8459 Autoconf "old"
8460 #endif
8461 ;
8462 #endif
8463 EOF
8464         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
8465         { (eval echo "$as_me:8465: \"$cf_try\"") >&5
8466   (eval $cf_try) 2>&5
8467   ac_status=$?
8468   echo "$as_me:8468: \$? = $ac_status" >&5
8469   (exit $ac_status); }
8470         if test -f conftest.out ; then
8471                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
8472                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
8473                 rm -f conftest.out
8474         fi
8475
8476 else
8477   cat >conftest.$ac_ext <<_ACEOF
8478 #line 8478 "configure"
8479 #include "confdefs.h"
8480
8481 #include <${cf_cv_ncurses_header:-curses.h}>
8482 #include <stdio.h>
8483 int main(void)
8484 {
8485         FILE *fp = fopen("$cf_tempfile", "w");
8486 #ifdef NCURSES_VERSION
8487 # ifdef NCURSES_VERSION_PATCH
8488         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
8489 # else
8490         fprintf(fp, "%s\n", NCURSES_VERSION);
8491 # endif
8492 #else
8493 # ifdef __NCURSES_H
8494         fprintf(fp, "old\n");
8495 # else
8496         make an error
8497 # endif
8498 #endif
8499         ${cf_cv_main_return:-return}(0);
8500 }
8501 _ACEOF
8502 rm -f conftest$ac_exeext
8503 if { (eval echo "$as_me:8503: \"$ac_link\"") >&5
8504   (eval $ac_link) 2>&5
8505   ac_status=$?
8506   echo "$as_me:8506: \$? = $ac_status" >&5
8507   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
8508   { (eval echo "$as_me:8508: \"$ac_try\"") >&5
8509   (eval $ac_try) 2>&5
8510   ac_status=$?
8511   echo "$as_me:8511: \$? = $ac_status" >&5
8512   (exit $ac_status); }; }; then
8513
8514         cf_cv_ncurses_version=`cat $cf_tempfile`
8515 else
8516   echo "$as_me: program exited with status $ac_status" >&5
8517 echo "$as_me: failed program was:" >&5
8518 cat conftest.$ac_ext >&5
8519 fi
8520 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
8521 fi
8522         rm -f $cf_tempfile
8523
8524 fi
8525 echo "$as_me:8525: result: $cf_cv_ncurses_version" >&5
8526 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
8527 test "$cf_cv_ncurses_version" = no ||
8528 cat >>confdefs.h <<\EOF
8529 #define NCURSES 1
8530 EOF
8531
8532 cf_nculib_root=$cf_cv_screen
8533         # This works, except for the special case where we find gpm, but
8534         # ncurses is in a nonstandard location via $LIBS, and we really want
8535         # to link gpm.
8536 cf_ncurses_LIBS=""
8537 cf_ncurses_SAVE="$LIBS"
8538 echo "$as_me:8538: checking for Gpm_Open in -lgpm" >&5
8539 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
8540 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
8541   echo $ECHO_N "(cached) $ECHO_C" >&6
8542 else
8543   ac_check_lib_save_LIBS=$LIBS
8544 LIBS="-lgpm  $LIBS"
8545 cat >conftest.$ac_ext <<_ACEOF
8546 #line 8546 "configure"
8547 #include "confdefs.h"
8548
8549 /* Override any gcc2 internal prototype to avoid an error.  */
8550 #ifdef __cplusplus
8551 extern "C"
8552 #endif
8553 /* We use char because int might match the return type of a gcc2
8554    builtin and then its argument prototype would still apply.  */
8555 char Gpm_Open ();
8556 int
8557 main (void)
8558 {
8559 Gpm_Open ();
8560   ;
8561   return 0;
8562 }
8563 _ACEOF
8564 rm -f conftest.$ac_objext conftest$ac_exeext
8565 if { (eval echo "$as_me:8565: \"$ac_link\"") >&5
8566   (eval $ac_link) 2>&5
8567   ac_status=$?
8568   echo "$as_me:8568: \$? = $ac_status" >&5
8569   (exit $ac_status); } &&
8570          { ac_try='test -s conftest$ac_exeext'
8571   { (eval echo "$as_me:8571: \"$ac_try\"") >&5
8572   (eval $ac_try) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit $ac_status); }; }; then
8576   ac_cv_lib_gpm_Gpm_Open=yes
8577 else
8578   echo "$as_me: failed program was:" >&5
8579 cat conftest.$ac_ext >&5
8580 ac_cv_lib_gpm_Gpm_Open=no
8581 fi
8582 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8583 LIBS=$ac_check_lib_save_LIBS
8584 fi
8585 echo "$as_me:8585: result: $ac_cv_lib_gpm_Gpm_Open" >&5
8586 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
8587 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
8588   echo "$as_me:8588: checking for initscr in -lgpm" >&5
8589 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
8590 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
8591   echo $ECHO_N "(cached) $ECHO_C" >&6
8592 else
8593   ac_check_lib_save_LIBS=$LIBS
8594 LIBS="-lgpm  $LIBS"
8595 cat >conftest.$ac_ext <<_ACEOF
8596 #line 8596 "configure"
8597 #include "confdefs.h"
8598
8599 /* Override any gcc2 internal prototype to avoid an error.  */
8600 #ifdef __cplusplus
8601 extern "C"
8602 #endif
8603 /* We use char because int might match the return type of a gcc2
8604    builtin and then its argument prototype would still apply.  */
8605 char initscr ();
8606 int
8607 main (void)
8608 {
8609 initscr ();
8610   ;
8611   return 0;
8612 }
8613 _ACEOF
8614 rm -f conftest.$ac_objext conftest$ac_exeext
8615 if { (eval echo "$as_me:8615: \"$ac_link\"") >&5
8616   (eval $ac_link) 2>&5
8617   ac_status=$?
8618   echo "$as_me:8618: \$? = $ac_status" >&5
8619   (exit $ac_status); } &&
8620          { ac_try='test -s conftest$ac_exeext'
8621   { (eval echo "$as_me:8621: \"$ac_try\"") >&5
8622   (eval $ac_try) 2>&5
8623   ac_status=$?
8624   echo "$as_me:8624: \$? = $ac_status" >&5
8625   (exit $ac_status); }; }; then
8626   ac_cv_lib_gpm_initscr=yes
8627 else
8628   echo "$as_me: failed program was:" >&5
8629 cat conftest.$ac_ext >&5
8630 ac_cv_lib_gpm_initscr=no
8631 fi
8632 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8633 LIBS=$ac_check_lib_save_LIBS
8634 fi
8635 echo "$as_me:8635: result: $ac_cv_lib_gpm_initscr" >&5
8636 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
8637 if test $ac_cv_lib_gpm_initscr = yes; then
8638   LIBS="$cf_ncurses_SAVE"
8639 else
8640   cf_ncurses_LIBS="-lgpm"
8641 fi
8642
8643 fi
8644
8645 case $host_os in
8646 (freebsd*)
8647         # This is only necessary if you are linking against an obsolete
8648         # version of ncurses (but it should do no harm, since it's static).
8649         if test "$cf_nculib_root" = ncurses ; then
8650                 echo "$as_me:8650: checking for tgoto in -lmytinfo" >&5
8651 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
8652 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
8653   echo $ECHO_N "(cached) $ECHO_C" >&6
8654 else
8655   ac_check_lib_save_LIBS=$LIBS
8656 LIBS="-lmytinfo  $LIBS"
8657 cat >conftest.$ac_ext <<_ACEOF
8658 #line 8658 "configure"
8659 #include "confdefs.h"
8660
8661 /* Override any gcc2 internal prototype to avoid an error.  */
8662 #ifdef __cplusplus
8663 extern "C"
8664 #endif
8665 /* We use char because int might match the return type of a gcc2
8666    builtin and then its argument prototype would still apply.  */
8667 char tgoto ();
8668 int
8669 main (void)
8670 {
8671 tgoto ();
8672   ;
8673   return 0;
8674 }
8675 _ACEOF
8676 rm -f conftest.$ac_objext conftest$ac_exeext
8677 if { (eval echo "$as_me:8677: \"$ac_link\"") >&5
8678   (eval $ac_link) 2>&5
8679   ac_status=$?
8680   echo "$as_me:8680: \$? = $ac_status" >&5
8681   (exit $ac_status); } &&
8682          { ac_try='test -s conftest$ac_exeext'
8683   { (eval echo "$as_me:8683: \"$ac_try\"") >&5
8684   (eval $ac_try) 2>&5
8685   ac_status=$?
8686   echo "$as_me:8686: \$? = $ac_status" >&5
8687   (exit $ac_status); }; }; then
8688   ac_cv_lib_mytinfo_tgoto=yes
8689 else
8690   echo "$as_me: failed program was:" >&5
8691 cat conftest.$ac_ext >&5
8692 ac_cv_lib_mytinfo_tgoto=no
8693 fi
8694 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8695 LIBS=$ac_check_lib_save_LIBS
8696 fi
8697 echo "$as_me:8697: result: $ac_cv_lib_mytinfo_tgoto" >&5
8698 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
8699 if test $ac_cv_lib_mytinfo_tgoto = yes; then
8700   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
8701 fi
8702
8703         fi
8704         ;;
8705 esac
8706
8707 cf_add_libs="$cf_ncurses_LIBS"
8708 # Filter out duplicates - this happens with badly-designed ".pc" files...
8709 for cf_add_1lib in $LIBS
8710 do
8711         for cf_add_2lib in $cf_add_libs
8712         do
8713                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8714                 then
8715                         cf_add_1lib=
8716                         break
8717                 fi
8718         done
8719         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8720 done
8721 LIBS="$cf_add_libs"
8722
8723 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
8724 then
8725
8726 cf_add_libs="-l$cf_nculib_root"
8727 # Filter out duplicates - this happens with badly-designed ".pc" files...
8728 for cf_add_1lib in $LIBS
8729 do
8730         for cf_add_2lib in $cf_add_libs
8731         do
8732                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
8733                 then
8734                         cf_add_1lib=
8735                         break
8736                 fi
8737         done
8738         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
8739 done
8740 LIBS="$cf_add_libs"
8741
8742 else
8743
8744         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
8745         cf_libdir=""
8746         echo "$as_me:8746: checking for initscr" >&5
8747 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
8748 if test "${ac_cv_func_initscr+set}" = set; then
8749   echo $ECHO_N "(cached) $ECHO_C" >&6
8750 else
8751   cat >conftest.$ac_ext <<_ACEOF
8752 #line 8752 "configure"
8753 #include "confdefs.h"
8754 /* System header to define __stub macros and hopefully few prototypes,
8755     which can conflict with char initscr (); below.  */
8756 #include <assert.h>
8757 /* Override any gcc2 internal prototype to avoid an error.  */
8758 #ifdef __cplusplus
8759 extern "C"
8760 #endif
8761 /* We use char because int might match the return type of a gcc2
8762    builtin and then its argument prototype would still apply.  */
8763 char initscr ();
8764 char (*f) ();
8765
8766 int
8767 main (void)
8768 {
8769 /* The GNU C library defines this for functions which it implements
8770     to always fail with ENOSYS.  Some functions are actually named
8771     something starting with __ and the normal name is an alias.  */
8772 #if defined (__stub_initscr) || defined (__stub___initscr)
8773 choke me
8774 #else
8775 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
8776 #endif
8777
8778   ;
8779   return 0;
8780 }
8781 _ACEOF
8782 rm -f conftest.$ac_objext conftest$ac_exeext
8783 if { (eval echo "$as_me:8783: \"$ac_link\"") >&5
8784   (eval $ac_link) 2>&5
8785   ac_status=$?
8786   echo "$as_me:8786: \$? = $ac_status" >&5
8787   (exit $ac_status); } &&
8788          { ac_try='test -s conftest$ac_exeext'
8789   { (eval echo "$as_me:8789: \"$ac_try\"") >&5
8790   (eval $ac_try) 2>&5
8791   ac_status=$?
8792   echo "$as_me:8792: \$? = $ac_status" >&5
8793   (exit $ac_status); }; }; then
8794   ac_cv_func_initscr=yes
8795 else
8796   echo "$as_me: failed program was:" >&5
8797 cat conftest.$ac_ext >&5
8798 ac_cv_func_initscr=no
8799 fi
8800 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8801 fi
8802 echo "$as_me:8802: result: $ac_cv_func_initscr" >&5
8803 echo "${ECHO_T}$ac_cv_func_initscr" >&6
8804 if test $ac_cv_func_initscr = yes; then
8805   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8806 else
8807
8808                 cf_save_LIBS="$LIBS"
8809                 echo "$as_me:8809: checking for initscr in -l$cf_nculib_root" >&5
8810 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
8811                 LIBS="-l$cf_nculib_root $LIBS"
8812                 cat >conftest.$ac_ext <<_ACEOF
8813 #line 8813 "configure"
8814 #include "confdefs.h"
8815 #include <${cf_cv_ncurses_header:-curses.h}>
8816 int
8817 main (void)
8818 {
8819 initscr()
8820   ;
8821   return 0;
8822 }
8823 _ACEOF
8824 rm -f conftest.$ac_objext conftest$ac_exeext
8825 if { (eval echo "$as_me:8825: \"$ac_link\"") >&5
8826   (eval $ac_link) 2>&5
8827   ac_status=$?
8828   echo "$as_me:8828: \$? = $ac_status" >&5
8829   (exit $ac_status); } &&
8830          { ac_try='test -s conftest$ac_exeext'
8831   { (eval echo "$as_me:8831: \"$ac_try\"") >&5
8832   (eval $ac_try) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit $ac_status); }; }; then
8836   echo "$as_me:8836: result: yes" >&5
8837 echo "${ECHO_T}yes" >&6
8838                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8839
8840 else
8841   echo "$as_me: failed program was:" >&5
8842 cat conftest.$ac_ext >&5
8843 echo "$as_me:8843: result: no" >&5
8844 echo "${ECHO_T}no" >&6
8845
8846 cf_search=
8847 cf_library_path_list=""
8848 if test -n "${LDFLAGS}${LIBS}" ; then
8849         for cf_library_path in $LDFLAGS $LIBS
8850         do
8851                 case $cf_library_path in
8852                 (-L*)
8853                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8854
8855 test "x$cf_library_path" != "xNONE" && \
8856 test -d "$cf_library_path" && \
8857  {
8858         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8859         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8860         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
8861         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
8862         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
8863         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"
8864 }
8865
8866                         cf_library_path_list="$cf_library_path_list $cf_search"
8867                         ;;
8868                 esac
8869         done
8870 fi
8871
8872 cf_search=
8873
8874 test "x$prefix" != "xNONE" && \
8875 test -d "$prefix" && \
8876  {
8877         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8878         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8879         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
8880         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
8881         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
8882         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
8883 }
8884
8885 for cf_subdir_prefix in \
8886         /usr \
8887         /usr/local \
8888         /usr/pkg \
8889         /opt \
8890         /opt/local \
8891         $HOME
8892 do
8893
8894 test "x$cf_subdir_prefix" != "x$prefix" && \
8895 test -d "$cf_subdir_prefix" && \
8896 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
8897         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
8898         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
8899         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
8900         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
8901         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
8902         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"
8903 }
8904
8905 done
8906
8907 cf_search="$cf_library_path_list $cf_search"
8908
8909                         for cf_libdir in $cf_search
8910                         do
8911                                 echo "$as_me:8911: checking for -l$cf_nculib_root in $cf_libdir" >&5
8912 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
8913                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
8914                                 cat >conftest.$ac_ext <<_ACEOF
8915 #line 8915 "configure"
8916 #include "confdefs.h"
8917 #include <${cf_cv_ncurses_header:-curses.h}>
8918 int
8919 main (void)
8920 {
8921 initscr()
8922   ;
8923   return 0;
8924 }
8925 _ACEOF
8926 rm -f conftest.$ac_objext conftest$ac_exeext
8927 if { (eval echo "$as_me:8927: \"$ac_link\"") >&5
8928   (eval $ac_link) 2>&5
8929   ac_status=$?
8930   echo "$as_me:8930: \$? = $ac_status" >&5
8931   (exit $ac_status); } &&
8932          { ac_try='test -s conftest$ac_exeext'
8933   { (eval echo "$as_me:8933: \"$ac_try\"") >&5
8934   (eval $ac_try) 2>&5
8935   ac_status=$?
8936   echo "$as_me:8936: \$? = $ac_status" >&5
8937   (exit $ac_status); }; }; then
8938   echo "$as_me:8938: result: yes" >&5
8939 echo "${ECHO_T}yes" >&6
8940                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
8941                                          break
8942 else
8943   echo "$as_me: failed program was:" >&5
8944 cat conftest.$ac_ext >&5
8945 echo "$as_me:8945: result: no" >&5
8946 echo "${ECHO_T}no" >&6
8947                                          LIBS="$cf_save_LIBS"
8948 fi
8949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8950                         done
8951
8952 fi
8953 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8954
8955 fi
8956
8957 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
8958
8959 if test $cf_found_library = no ; then
8960         { { echo "$as_me:8960: error: Cannot link $cf_nculib_root library" >&5
8961 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
8962    { (exit 1); exit 1; }; }
8963 fi
8964
8965 fi
8966
8967 if test -n "$cf_ncurses_LIBS" ; then
8968         echo "$as_me:8968: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
8969 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
8970         cf_ncurses_SAVE="$LIBS"
8971         for p in $cf_ncurses_LIBS ; do
8972                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
8973                 if test "$q" != "$LIBS" ; then
8974                         LIBS="$q"
8975                 fi
8976         done
8977         cat >conftest.$ac_ext <<_ACEOF
8978 #line 8978 "configure"
8979 #include "confdefs.h"
8980 #include <${cf_cv_ncurses_header:-curses.h}>
8981 int
8982 main (void)
8983 {
8984 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
8985   ;
8986   return 0;
8987 }
8988 _ACEOF
8989 rm -f conftest.$ac_objext conftest$ac_exeext
8990 if { (eval echo "$as_me:8990: \"$ac_link\"") >&5
8991   (eval $ac_link) 2>&5
8992   ac_status=$?
8993   echo "$as_me:8993: \$? = $ac_status" >&5
8994   (exit $ac_status); } &&
8995          { ac_try='test -s conftest$ac_exeext'
8996   { (eval echo "$as_me:8996: \"$ac_try\"") >&5
8997   (eval $ac_try) 2>&5
8998   ac_status=$?
8999   echo "$as_me:8999: \$? = $ac_status" >&5
9000   (exit $ac_status); }; }; then
9001   echo "$as_me:9001: result: yes" >&5
9002 echo "${ECHO_T}yes" >&6
9003 else
9004   echo "$as_me: failed program was:" >&5
9005 cat conftest.$ac_ext >&5
9006 echo "$as_me:9006: result: no" >&5
9007 echo "${ECHO_T}no" >&6
9008                  LIBS="$cf_ncurses_SAVE"
9009 fi
9010 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9011 fi
9012
9013 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9014
9015 cat >>confdefs.h <<EOF
9016 #define $cf_nculib_ROOT 1
9017 EOF
9018
9019         fi
9020 else
9021         NCURSES_CONFIG=none
9022 fi
9023
9024         ;;
9025 (ncurses*)
9026
9027 cf_ncuconfig_root=$cf_cv_screen
9028 cf_have_ncuconfig=no
9029
9030 if test "x${PKG_CONFIG:=none}" != xnone; then
9031         echo "$as_me:9031: checking pkg-config for $cf_ncuconfig_root" >&5
9032 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6
9033         if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
9034                 echo "$as_me:9034: result: yes" >&5
9035 echo "${ECHO_T}yes" >&6
9036
9037                 echo "$as_me:9037: checking if the $cf_ncuconfig_root package files work" >&5
9038 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6
9039                 cf_have_ncuconfig=unknown
9040
9041                 cf_save_CPPFLAGS="$CPPFLAGS"
9042                 cf_save_LIBS="$LIBS"
9043
9044 cf_fix_cppflags=no
9045 cf_new_cflags=
9046 cf_new_cppflags=
9047 cf_new_extra_cppflags=
9048
9049 for cf_add_cflags in `$PKG_CONFIG --cflags $cf_ncuconfig_root`
9050 do
9051 case $cf_fix_cppflags in
9052 (no)
9053         case $cf_add_cflags in
9054         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9055                 case $cf_add_cflags in
9056                 (-D*)
9057                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9058
9059                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9060                                 && test -z "${cf_tst_cflags}" \
9061                                 && cf_fix_cppflags=yes
9062
9063                         if test $cf_fix_cppflags = yes ; then
9064
9065         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9066         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9067
9068                                 continue
9069                         elif test "${cf_tst_cflags}" = "\"'" ; then
9070
9071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9073
9074                                 continue
9075                         fi
9076                         ;;
9077                 esac
9078                 case "$CPPFLAGS" in
9079                 (*$cf_add_cflags)
9080                         ;;
9081                 (*)
9082                         case $cf_add_cflags in
9083                         (-D*)
9084                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9085
9086 CPPFLAGS=`echo "$CPPFLAGS" | \
9087         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9088                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9089
9090                                 ;;
9091                         esac
9092
9093         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9094         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9095
9096                         ;;
9097                 esac
9098                 ;;
9099         (*)
9100
9101         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9102         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9103
9104                 ;;
9105         esac
9106         ;;
9107 (yes)
9108
9109         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9110         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9111
9112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9113
9114         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9115                 && test -z "${cf_tst_cflags}" \
9116                 && cf_fix_cppflags=no
9117         ;;
9118 esac
9119 done
9120
9121 if test -n "$cf_new_cflags" ; then
9122
9123         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9124         CFLAGS="${CFLAGS}$cf_new_cflags"
9125
9126 fi
9127
9128 if test -n "$cf_new_cppflags" ; then
9129
9130         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9131         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9132
9133 fi
9134
9135 if test -n "$cf_new_extra_cppflags" ; then
9136
9137         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9138         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9139
9140 fi
9141
9142 cf_add_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`"
9143 # Filter out duplicates - this happens with badly-designed ".pc" files...
9144 for cf_add_1lib in $LIBS
9145 do
9146         for cf_add_2lib in $cf_add_libs
9147         do
9148                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9149                 then
9150                         cf_add_1lib=
9151                         break
9152                 fi
9153         done
9154         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9155 done
9156 LIBS="$cf_add_libs"
9157
9158                 cat >conftest.$ac_ext <<_ACEOF
9159 #line 9159 "configure"
9160 #include "confdefs.h"
9161 #include <${cf_cv_ncurses_header:-curses.h}>
9162 int
9163 main (void)
9164 {
9165 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9166   ;
9167   return 0;
9168 }
9169 _ACEOF
9170 rm -f conftest.$ac_objext conftest$ac_exeext
9171 if { (eval echo "$as_me:9171: \"$ac_link\"") >&5
9172   (eval $ac_link) 2>&5
9173   ac_status=$?
9174   echo "$as_me:9174: \$? = $ac_status" >&5
9175   (exit $ac_status); } &&
9176          { ac_try='test -s conftest$ac_exeext'
9177   { (eval echo "$as_me:9177: \"$ac_try\"") >&5
9178   (eval $ac_try) 2>&5
9179   ac_status=$?
9180   echo "$as_me:9180: \$? = $ac_status" >&5
9181   (exit $ac_status); }; }; then
9182   if test "$cross_compiling" = yes; then
9183   cf_have_ncuconfig=maybe
9184 else
9185   cat >conftest.$ac_ext <<_ACEOF
9186 #line 9186 "configure"
9187 #include "confdefs.h"
9188 #include <${cf_cv_ncurses_header:-curses.h}>
9189                                 int main(void)
9190                                 { char *xx = curses_version(); return (xx == 0); }
9191 _ACEOF
9192 rm -f conftest$ac_exeext
9193 if { (eval echo "$as_me:9193: \"$ac_link\"") >&5
9194   (eval $ac_link) 2>&5
9195   ac_status=$?
9196   echo "$as_me:9196: \$? = $ac_status" >&5
9197   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9198   { (eval echo "$as_me:9198: \"$ac_try\"") >&5
9199   (eval $ac_try) 2>&5
9200   ac_status=$?
9201   echo "$as_me:9201: \$? = $ac_status" >&5
9202   (exit $ac_status); }; }; then
9203   cf_have_ncuconfig=yes
9204 else
9205   echo "$as_me: program exited with status $ac_status" >&5
9206 echo "$as_me: failed program was:" >&5
9207 cat conftest.$ac_ext >&5
9208 cf_have_ncuconfig=no
9209 fi
9210 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9211 fi
9212 else
9213   echo "$as_me: failed program was:" >&5
9214 cat conftest.$ac_ext >&5
9215 cf_have_ncuconfig=no
9216 fi
9217 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9218                 echo "$as_me:9218: result: $cf_have_ncuconfig" >&5
9219 echo "${ECHO_T}$cf_have_ncuconfig" >&6
9220                 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
9221                 if test "$cf_have_ncuconfig" != "yes"
9222                 then
9223                         CPPFLAGS="$cf_save_CPPFLAGS"
9224                         LIBS="$cf_save_LIBS"
9225                         NCURSES_CONFIG_PKG=none
9226                 else
9227
9228 cat >>confdefs.h <<\EOF
9229 #define NCURSES 1
9230 EOF
9231
9232                         NCURSES_CONFIG_PKG=$cf_ncuconfig_root
9233
9234 echo "$as_me:9234: checking for terminfo header" >&5
9235 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9236 if test "${cf_cv_term_header+set}" = set; then
9237   echo $ECHO_N "(cached) $ECHO_C" >&6
9238 else
9239
9240 case ${cf_cv_ncurses_header} in
9241 (*/ncurses.h|*/ncursesw.h)
9242         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9243         ;;
9244 (*)
9245         cf_term_header=term.h
9246         ;;
9247 esac
9248
9249 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9250 do
9251 cat >conftest.$ac_ext <<_ACEOF
9252 #line 9252 "configure"
9253 #include "confdefs.h"
9254 #include <stdio.h>
9255 #include <${cf_cv_ncurses_header:-curses.h}>
9256 #include <$cf_test>
9257
9258 int
9259 main (void)
9260 {
9261 int x = auto_left_margin
9262   ;
9263   return 0;
9264 }
9265 _ACEOF
9266 rm -f conftest.$ac_objext
9267 if { (eval echo "$as_me:9267: \"$ac_compile\"") >&5
9268   (eval $ac_compile) 2>&5
9269   ac_status=$?
9270   echo "$as_me:9270: \$? = $ac_status" >&5
9271   (exit $ac_status); } &&
9272          { ac_try='test -s conftest.$ac_objext'
9273   { (eval echo "$as_me:9273: \"$ac_try\"") >&5
9274   (eval $ac_try) 2>&5
9275   ac_status=$?
9276   echo "$as_me:9276: \$? = $ac_status" >&5
9277   (exit $ac_status); }; }; then
9278
9279         cf_cv_term_header="$cf_test"
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat conftest.$ac_ext >&5
9283
9284         cf_cv_term_header=unknown
9285
9286 fi
9287 rm -f conftest.$ac_objext conftest.$ac_ext
9288         test "$cf_cv_term_header" != unknown && break
9289 done
9290
9291 fi
9292 echo "$as_me:9292: result: $cf_cv_term_header" >&5
9293 echo "${ECHO_T}$cf_cv_term_header" >&6
9294
9295 # Set definitions to allow ifdef'ing to accommodate subdirectories
9296
9297 case $cf_cv_term_header in
9298 (*term.h)
9299
9300 cat >>confdefs.h <<\EOF
9301 #define HAVE_TERM_H 1
9302 EOF
9303
9304         ;;
9305 esac
9306
9307 case $cf_cv_term_header in
9308 (ncurses/term.h)
9309
9310 cat >>confdefs.h <<\EOF
9311 #define HAVE_NCURSES_TERM_H 1
9312 EOF
9313
9314         ;;
9315 (ncursesw/term.h)
9316
9317 cat >>confdefs.h <<\EOF
9318 #define HAVE_NCURSESW_TERM_H 1
9319 EOF
9320
9321         ;;
9322 esac
9323
9324                 fi
9325
9326         else
9327                 echo "$as_me:9327: result: no" >&5
9328 echo "${ECHO_T}no" >&6
9329                 NCURSES_CONFIG_PKG=none
9330         fi
9331 else
9332         NCURSES_CONFIG_PKG=none
9333 fi
9334
9335 if test "x$cf_have_ncuconfig" = "xno"; then
9336         cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
9337
9338 if test -n "$ac_tool_prefix"; then
9339   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9340   do
9341     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
9342 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
9343 echo "$as_me:9343: checking for $ac_word" >&5
9344 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9345 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
9346   echo $ECHO_N "(cached) $ECHO_C" >&6
9347 else
9348   if test -n "$NCURSES_CONFIG"; then
9349   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
9350 else
9351   ac_save_IFS=$IFS; IFS=$ac_path_separator
9352 ac_dummy="$PATH"
9353 for ac_dir in $ac_dummy; do
9354   IFS=$ac_save_IFS
9355   test -z "$ac_dir" && ac_dir=.
9356   $as_executable_p "$ac_dir/$ac_word" || continue
9357 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
9358 echo "$as_me:9358: found $ac_dir/$ac_word" >&5
9359 break
9360 done
9361
9362 fi
9363 fi
9364 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
9365 if test -n "$NCURSES_CONFIG"; then
9366   echo "$as_me:9366: result: $NCURSES_CONFIG" >&5
9367 echo "${ECHO_T}$NCURSES_CONFIG" >&6
9368 else
9369   echo "$as_me:9369: result: no" >&5
9370 echo "${ECHO_T}no" >&6
9371 fi
9372
9373     test -n "$NCURSES_CONFIG" && break
9374   done
9375 fi
9376 if test -z "$NCURSES_CONFIG"; then
9377   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
9378   for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
9379 do
9380   # Extract the first word of "$ac_prog", so it can be a program name with args.
9381 set dummy $ac_prog; ac_word=$2
9382 echo "$as_me:9382: checking for $ac_word" >&5
9383 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9384 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
9385   echo $ECHO_N "(cached) $ECHO_C" >&6
9386 else
9387   if test -n "$ac_ct_NCURSES_CONFIG"; then
9388   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
9389 else
9390   ac_save_IFS=$IFS; IFS=$ac_path_separator
9391 ac_dummy="$PATH"
9392 for ac_dir in $ac_dummy; do
9393   IFS=$ac_save_IFS
9394   test -z "$ac_dir" && ac_dir=.
9395   $as_executable_p "$ac_dir/$ac_word" || continue
9396 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
9397 echo "$as_me:9397: found $ac_dir/$ac_word" >&5
9398 break
9399 done
9400
9401 fi
9402 fi
9403 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
9404 if test -n "$ac_ct_NCURSES_CONFIG"; then
9405   echo "$as_me:9405: result: $ac_ct_NCURSES_CONFIG" >&5
9406 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
9407 else
9408   echo "$as_me:9408: result: no" >&5
9409 echo "${ECHO_T}no" >&6
9410 fi
9411
9412   test -n "$ac_ct_NCURSES_CONFIG" && break
9413 done
9414 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
9415
9416   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
9417 fi
9418
9419         if test "$NCURSES_CONFIG" != none ; then
9420
9421 cf_fix_cppflags=no
9422 cf_new_cflags=
9423 cf_new_cppflags=
9424 cf_new_extra_cppflags=
9425
9426 for cf_add_cflags in `$NCURSES_CONFIG --cflags`
9427 do
9428 case $cf_fix_cppflags in
9429 (no)
9430         case $cf_add_cflags in
9431         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
9432                 case $cf_add_cflags in
9433                 (-D*)
9434                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
9435
9436                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9437                                 && test -z "${cf_tst_cflags}" \
9438                                 && cf_fix_cppflags=yes
9439
9440                         if test $cf_fix_cppflags = yes ; then
9441
9442         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9443         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9444
9445                                 continue
9446                         elif test "${cf_tst_cflags}" = "\"'" ; then
9447
9448         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9449         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9450
9451                                 continue
9452                         fi
9453                         ;;
9454                 esac
9455                 case "$CPPFLAGS" in
9456                 (*$cf_add_cflags)
9457                         ;;
9458                 (*)
9459                         case $cf_add_cflags in
9460                         (-D*)
9461                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
9462
9463 CPPFLAGS=`echo "$CPPFLAGS" | \
9464         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
9465                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
9466
9467                                 ;;
9468                         esac
9469
9470         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
9471         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
9472
9473                         ;;
9474                 esac
9475                 ;;
9476         (*)
9477
9478         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
9479         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
9480
9481                 ;;
9482         esac
9483         ;;
9484 (yes)
9485
9486         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
9487         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
9488
9489         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
9490
9491         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
9492                 && test -z "${cf_tst_cflags}" \
9493                 && cf_fix_cppflags=no
9494         ;;
9495 esac
9496 done
9497
9498 if test -n "$cf_new_cflags" ; then
9499
9500         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
9501         CFLAGS="${CFLAGS}$cf_new_cflags"
9502
9503 fi
9504
9505 if test -n "$cf_new_cppflags" ; then
9506
9507         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9508         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
9509
9510 fi
9511
9512 if test -n "$cf_new_extra_cppflags" ; then
9513
9514         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
9515         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
9516
9517 fi
9518
9519 cf_add_libs="`$NCURSES_CONFIG --libs`"
9520 # Filter out duplicates - this happens with badly-designed ".pc" files...
9521 for cf_add_1lib in $LIBS
9522 do
9523         for cf_add_2lib in $cf_add_libs
9524         do
9525                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
9526                 then
9527                         cf_add_1lib=
9528                         break
9529                 fi
9530         done
9531         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
9532 done
9533 LIBS="$cf_add_libs"
9534
9535                 # even with config script, some packages use no-override for curses.h
9536
9537 echo "$as_me:9537: checking if we have identified curses headers" >&5
9538 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
9539 if test "${cf_cv_ncurses_header+set}" = set; then
9540   echo $ECHO_N "(cached) $ECHO_C" >&6
9541 else
9542
9543 cf_cv_ncurses_header=none
9544 for cf_header in \
9545         ncurses.h $cf_cv_screen/ncurses.h \
9546         curses.h $cf_cv_screen/curses.h
9547 do
9548 cat >conftest.$ac_ext <<_ACEOF
9549 #line 9549 "configure"
9550 #include "confdefs.h"
9551 #include <${cf_header}>
9552 int
9553 main (void)
9554 {
9555 initscr(); tgoto("?", 0,0)
9556   ;
9557   return 0;
9558 }
9559 _ACEOF
9560 rm -f conftest.$ac_objext
9561 if { (eval echo "$as_me:9561: \"$ac_compile\"") >&5
9562   (eval $ac_compile) 2>&5
9563   ac_status=$?
9564   echo "$as_me:9564: \$? = $ac_status" >&5
9565   (exit $ac_status); } &&
9566          { ac_try='test -s conftest.$ac_objext'
9567   { (eval echo "$as_me:9567: \"$ac_try\"") >&5
9568   (eval $ac_try) 2>&5
9569   ac_status=$?
9570   echo "$as_me:9570: \$? = $ac_status" >&5
9571   (exit $ac_status); }; }; then
9572   cf_cv_ncurses_header=$cf_header; break
9573 else
9574   echo "$as_me: failed program was:" >&5
9575 cat conftest.$ac_ext >&5
9576 fi
9577 rm -f conftest.$ac_objext conftest.$ac_ext
9578 done
9579
9580 fi
9581 echo "$as_me:9581: result: $cf_cv_ncurses_header" >&5
9582 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
9583
9584 if test "$cf_cv_ncurses_header" = none ; then
9585         { { echo "$as_me:9585: error: No curses header-files found" >&5
9586 echo "$as_me: error: No curses header-files found" >&2;}
9587    { (exit 1); exit 1; }; }
9588 fi
9589
9590 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
9591
9592 for ac_header in $cf_cv_ncurses_header
9593 do
9594 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
9595 echo "$as_me:9595: checking for $ac_header" >&5
9596 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
9597 if eval "test \"\${$as_ac_Header+set}\" = set"; then
9598   echo $ECHO_N "(cached) $ECHO_C" >&6
9599 else
9600   cat >conftest.$ac_ext <<_ACEOF
9601 #line 9601 "configure"
9602 #include "confdefs.h"
9603 #include <$ac_header>
9604 _ACEOF
9605 if { (eval echo "$as_me:9605: \"$ac_cpp conftest.$ac_ext\"") >&5
9606   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
9607   ac_status=$?
9608   egrep -v '^ *\+' conftest.er1 >conftest.err
9609   rm -f conftest.er1
9610   cat conftest.err >&5
9611   echo "$as_me:9611: \$? = $ac_status" >&5
9612   (exit $ac_status); } >/dev/null; then
9613   if test -s conftest.err; then
9614     ac_cpp_err=$ac_c_preproc_warn_flag
9615   else
9616     ac_cpp_err=
9617   fi
9618 else
9619   ac_cpp_err=yes
9620 fi
9621 if test -z "$ac_cpp_err"; then
9622   eval "$as_ac_Header=yes"
9623 else
9624   echo "$as_me: failed program was:" >&5
9625   cat conftest.$ac_ext >&5
9626   eval "$as_ac_Header=no"
9627 fi
9628 rm -f conftest.err conftest.$ac_ext
9629 fi
9630 echo "$as_me:9630: result: `eval echo '${'$as_ac_Header'}'`" >&5
9631 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
9632 if test `eval echo '${'$as_ac_Header'}'` = yes; then
9633   cat >>confdefs.h <<EOF
9634 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
9635 EOF
9636
9637 fi
9638 done
9639
9640 cat >>confdefs.h <<\EOF
9641 #define NCURSES 1
9642 EOF
9643
9644 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9645
9646                 cat >>confdefs.h <<EOF
9647 #define $cf_nculib_ROOT 1
9648 EOF
9649
9650                                 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
9651
9652         else
9653
9654 cf_ncuhdr_root=$cf_cv_screen
9655
9656 test -n "$cf_cv_curses_dir" && \
9657 test "$cf_cv_curses_dir" != "no" && { \
9658
9659 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
9660   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
9661   do
9662         while test $cf_add_incdir != /usr/include
9663         do
9664           if test -d $cf_add_incdir
9665           then
9666                 cf_have_incdir=no
9667                 if test -n "$CFLAGS$CPPFLAGS" ; then
9668                   # a loop is needed to ensure we can add subdirs of existing dirs
9669                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9670                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9671                           cf_have_incdir=yes; break
9672                         fi
9673                   done
9674                 fi
9675
9676                 if test "$cf_have_incdir" = no ; then
9677                   if test "$cf_add_incdir" = /usr/local/include ; then
9678                         if test "$GCC" = yes
9679                         then
9680                           cf_save_CPPFLAGS=$CPPFLAGS
9681
9682         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9683         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9684
9685                           cat >conftest.$ac_ext <<_ACEOF
9686 #line 9686 "configure"
9687 #include "confdefs.h"
9688 #include <stdio.h>
9689 int
9690 main (void)
9691 {
9692 printf("Hello")
9693   ;
9694   return 0;
9695 }
9696 _ACEOF
9697 rm -f conftest.$ac_objext
9698 if { (eval echo "$as_me:9698: \"$ac_compile\"") >&5
9699   (eval $ac_compile) 2>&5
9700   ac_status=$?
9701   echo "$as_me:9701: \$? = $ac_status" >&5
9702   (exit $ac_status); } &&
9703          { ac_try='test -s conftest.$ac_objext'
9704   { (eval echo "$as_me:9704: \"$ac_try\"") >&5
9705   (eval $ac_try) 2>&5
9706   ac_status=$?
9707   echo "$as_me:9707: \$? = $ac_status" >&5
9708   (exit $ac_status); }; }; then
9709   :
9710 else
9711   echo "$as_me: failed program was:" >&5
9712 cat conftest.$ac_ext >&5
9713 cf_have_incdir=yes
9714 fi
9715 rm -f conftest.$ac_objext conftest.$ac_ext
9716                           CPPFLAGS=$cf_save_CPPFLAGS
9717                         fi
9718                   fi
9719                 fi
9720
9721                 if test "$cf_have_incdir" = no ; then
9722                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9723
9724 echo "${as_me:-configure}:9724: testing adding $cf_add_incdir to include-path ..." 1>&5
9725
9726                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9727
9728                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9729                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9730                   cf_add_incdir="$cf_top_incdir"
9731                 else
9732                   break
9733                 fi
9734           else
9735                 break
9736           fi
9737         done
9738   done
9739 fi
9740
9741 }
9742
9743 echo "$as_me:9743: checking for $cf_ncuhdr_root header in include-path" >&5
9744 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
9745 if test "${cf_cv_ncurses_h+set}" = set; then
9746   echo $ECHO_N "(cached) $ECHO_C" >&6
9747 else
9748
9749         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
9750         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
9751         for cf_header in $cf_header_list
9752         do
9753
9754         cat >conftest.$ac_ext <<_ACEOF
9755 #line 9755 "configure"
9756 #include "confdefs.h"
9757
9758 #include <$cf_header>
9759 int
9760 main (void)
9761 {
9762
9763 #ifdef NCURSES_VERSION
9764
9765 printf("%s\n", NCURSES_VERSION);
9766 #else
9767 #ifdef __NCURSES_H
9768 printf("old\n");
9769 #else
9770         make an error
9771 #endif
9772 #endif
9773
9774   ;
9775   return 0;
9776 }
9777 _ACEOF
9778 rm -f conftest.$ac_objext
9779 if { (eval echo "$as_me:9779: \"$ac_compile\"") >&5
9780   (eval $ac_compile) 2>&5
9781   ac_status=$?
9782   echo "$as_me:9782: \$? = $ac_status" >&5
9783   (exit $ac_status); } &&
9784          { ac_try='test -s conftest.$ac_objext'
9785   { (eval echo "$as_me:9785: \"$ac_try\"") >&5
9786   (eval $ac_try) 2>&5
9787   ac_status=$?
9788   echo "$as_me:9788: \$? = $ac_status" >&5
9789   (exit $ac_status); }; }; then
9790   cf_cv_ncurses_h=$cf_header
9791
9792 else
9793   echo "$as_me: failed program was:" >&5
9794 cat conftest.$ac_ext >&5
9795 cf_cv_ncurses_h=no
9796 fi
9797 rm -f conftest.$ac_objext conftest.$ac_ext
9798
9799                 test "$cf_cv_ncurses_h" != no && break
9800         done
9801
9802 fi
9803 echo "$as_me:9803: result: $cf_cv_ncurses_h" >&5
9804 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
9805
9806 if test "$cf_cv_ncurses_h" != no ; then
9807         cf_cv_ncurses_header=$cf_cv_ncurses_h
9808 else
9809
9810 echo "$as_me:9810: checking for $cf_ncuhdr_root include-path" >&5
9811 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
9812 if test "${cf_cv_ncurses_h2+set}" = set; then
9813   echo $ECHO_N "(cached) $ECHO_C" >&6
9814 else
9815
9816         test -n "$verbose" && echo
9817
9818 cf_search=
9819
9820 # collect the current set of include-directories from compiler flags
9821 cf_header_path_list=""
9822 if test -n "${CFLAGS}${CPPFLAGS}" ; then
9823         for cf_header_path in $CPPFLAGS $CFLAGS
9824         do
9825                 case $cf_header_path in
9826                 (-I*)
9827                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
9828
9829 test "x$cf_header_path" != "xNONE" && \
9830 test -d "$cf_header_path" && \
9831  {
9832         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
9833         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
9834         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
9835         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
9836         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
9837         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"
9838 }
9839
9840                         cf_header_path_list="$cf_header_path_list $cf_search"
9841                         ;;
9842                 esac
9843         done
9844 fi
9845
9846 # add the variations for the package we are looking for
9847
9848 cf_search=
9849
9850 test "x$prefix" != "xNONE" && \
9851 test -d "$prefix" && \
9852  {
9853         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
9854         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
9855         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
9856         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
9857         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
9858         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
9859 }
9860
9861 for cf_subdir_prefix in \
9862         /usr \
9863         /usr/local \
9864         /usr/pkg \
9865         /opt \
9866         /opt/local \
9867         $HOME
9868 do
9869
9870 test "x$cf_subdir_prefix" != "x$prefix" && \
9871 test -d "$cf_subdir_prefix" && \
9872 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
9873         test -n "$verbose" && echo "    ... testing for include-directories under $cf_subdir_prefix"
9874         test -d $cf_subdir_prefix/include &&          cf_search="$cf_search $cf_subdir_prefix/include"
9875         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root"
9876         test -d $cf_subdir_prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include"
9877         test -d $cf_subdir_prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include"
9878         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"
9879 }
9880
9881 done
9882
9883 test "$includedir" != NONE && \
9884 test "$includedir" != "/usr/include" && \
9885 test -d "$includedir" && {
9886         test -d $includedir &&    cf_search="$cf_search $includedir"
9887         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
9888 }
9889
9890 test "$oldincludedir" != NONE && \
9891 test "$oldincludedir" != "/usr/include" && \
9892 test -d "$oldincludedir" && {
9893         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
9894         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
9895 }
9896
9897 cf_search="$cf_search $cf_header_path_list"
9898
9899         test -n "$verbose" && echo search path $cf_search
9900         cf_save2_CPPFLAGS="$CPPFLAGS"
9901         for cf_incdir in $cf_search
9902         do
9903
9904 if test -n "$cf_incdir" ; then
9905   for cf_add_incdir in $cf_incdir
9906   do
9907         while test $cf_add_incdir != /usr/include
9908         do
9909           if test -d $cf_add_incdir
9910           then
9911                 cf_have_incdir=no
9912                 if test -n "$CFLAGS$CPPFLAGS" ; then
9913                   # a loop is needed to ensure we can add subdirs of existing dirs
9914                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9915                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9916                           cf_have_incdir=yes; break
9917                         fi
9918                   done
9919                 fi
9920
9921                 if test "$cf_have_incdir" = no ; then
9922                   if test "$cf_add_incdir" = /usr/local/include ; then
9923                         if test "$GCC" = yes
9924                         then
9925                           cf_save_CPPFLAGS=$CPPFLAGS
9926
9927         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
9928         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
9929
9930                           cat >conftest.$ac_ext <<_ACEOF
9931 #line 9931 "configure"
9932 #include "confdefs.h"
9933 #include <stdio.h>
9934 int
9935 main (void)
9936 {
9937 printf("Hello")
9938   ;
9939   return 0;
9940 }
9941 _ACEOF
9942 rm -f conftest.$ac_objext
9943 if { (eval echo "$as_me:9943: \"$ac_compile\"") >&5
9944   (eval $ac_compile) 2>&5
9945   ac_status=$?
9946   echo "$as_me:9946: \$? = $ac_status" >&5
9947   (exit $ac_status); } &&
9948          { ac_try='test -s conftest.$ac_objext'
9949   { (eval echo "$as_me:9949: \"$ac_try\"") >&5
9950   (eval $ac_try) 2>&5
9951   ac_status=$?
9952   echo "$as_me:9952: \$? = $ac_status" >&5
9953   (exit $ac_status); }; }; then
9954   :
9955 else
9956   echo "$as_me: failed program was:" >&5
9957 cat conftest.$ac_ext >&5
9958 cf_have_incdir=yes
9959 fi
9960 rm -f conftest.$ac_objext conftest.$ac_ext
9961                           CPPFLAGS=$cf_save_CPPFLAGS
9962                         fi
9963                   fi
9964                 fi
9965
9966                 if test "$cf_have_incdir" = no ; then
9967                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9968
9969 echo "${as_me:-configure}:9969: testing adding $cf_add_incdir to include-path ..." 1>&5
9970
9971                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9972
9973                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9974                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9975                   cf_add_incdir="$cf_top_incdir"
9976                 else
9977                   break
9978                 fi
9979           else
9980                 break
9981           fi
9982         done
9983   done
9984 fi
9985
9986                 for cf_header in \
9987                         ncurses.h \
9988                         curses.h
9989                 do
9990
9991         cat >conftest.$ac_ext <<_ACEOF
9992 #line 9992 "configure"
9993 #include "confdefs.h"
9994
9995 #include <$cf_header>
9996 int
9997 main (void)
9998 {
9999
10000 #ifdef NCURSES_VERSION
10001
10002 printf("%s\n", NCURSES_VERSION);
10003 #else
10004 #ifdef __NCURSES_H
10005 printf("old\n");
10006 #else
10007         make an error
10008 #endif
10009 #endif
10010
10011   ;
10012   return 0;
10013 }
10014 _ACEOF
10015 rm -f conftest.$ac_objext
10016 if { (eval echo "$as_me:10016: \"$ac_compile\"") >&5
10017   (eval $ac_compile) 2>&5
10018   ac_status=$?
10019   echo "$as_me:10019: \$? = $ac_status" >&5
10020   (exit $ac_status); } &&
10021          { ac_try='test -s conftest.$ac_objext'
10022   { (eval echo "$as_me:10022: \"$ac_try\"") >&5
10023   (eval $ac_try) 2>&5
10024   ac_status=$?
10025   echo "$as_me:10025: \$? = $ac_status" >&5
10026   (exit $ac_status); }; }; then
10027   cf_cv_ncurses_h2=$cf_header
10028
10029 else
10030   echo "$as_me: failed program was:" >&5
10031 cat conftest.$ac_ext >&5
10032 cf_cv_ncurses_h2=no
10033 fi
10034 rm -f conftest.$ac_objext conftest.$ac_ext
10035
10036                         if test "$cf_cv_ncurses_h2" != no ; then
10037                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
10038                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
10039                                 break
10040                         fi
10041                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
10042                 done
10043                 CPPFLAGS="$cf_save2_CPPFLAGS"
10044                 test "$cf_cv_ncurses_h2" != no && break
10045         done
10046         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10046: error: not found" >&5
10047 echo "$as_me: error: not found" >&2;}
10048    { (exit 1); exit 1; }; }
10049
10050 fi
10051 echo "$as_me:10051: result: $cf_cv_ncurses_h2" >&5
10052 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
10053
10054         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
10055         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
10056         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
10057                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
10058         fi
10059
10060 if test -n "$cf_1st_incdir" ; then
10061   for cf_add_incdir in $cf_1st_incdir
10062   do
10063         while test $cf_add_incdir != /usr/include
10064         do
10065           if test -d $cf_add_incdir
10066           then
10067                 cf_have_incdir=no
10068                 if test -n "$CFLAGS$CPPFLAGS" ; then
10069                   # a loop is needed to ensure we can add subdirs of existing dirs
10070                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
10071                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
10072                           cf_have_incdir=yes; break
10073                         fi
10074                   done
10075                 fi
10076
10077                 if test "$cf_have_incdir" = no ; then
10078                   if test "$cf_add_incdir" = /usr/local/include ; then
10079                         if test "$GCC" = yes
10080                         then
10081                           cf_save_CPPFLAGS=$CPPFLAGS
10082
10083         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
10084         CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir"
10085
10086                           cat >conftest.$ac_ext <<_ACEOF
10087 #line 10087 "configure"
10088 #include "confdefs.h"
10089 #include <stdio.h>
10090 int
10091 main (void)
10092 {
10093 printf("Hello")
10094   ;
10095   return 0;
10096 }
10097 _ACEOF
10098 rm -f conftest.$ac_objext
10099 if { (eval echo "$as_me:10099: \"$ac_compile\"") >&5
10100   (eval $ac_compile) 2>&5
10101   ac_status=$?
10102   echo "$as_me:10102: \$? = $ac_status" >&5
10103   (exit $ac_status); } &&
10104          { ac_try='test -s conftest.$ac_objext'
10105   { (eval echo "$as_me:10105: \"$ac_try\"") >&5
10106   (eval $ac_try) 2>&5
10107   ac_status=$?
10108   echo "$as_me:10108: \$? = $ac_status" >&5
10109   (exit $ac_status); }; }; then
10110   :
10111 else
10112   echo "$as_me: failed program was:" >&5
10113 cat conftest.$ac_ext >&5
10114 cf_have_incdir=yes
10115 fi
10116 rm -f conftest.$ac_objext conftest.$ac_ext
10117                           CPPFLAGS=$cf_save_CPPFLAGS
10118                         fi
10119                   fi
10120                 fi
10121
10122                 if test "$cf_have_incdir" = no ; then
10123                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
10124
10125 echo "${as_me:-configure}:10125: testing adding $cf_add_incdir to include-path ..." 1>&5
10126
10127                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
10128
10129                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
10130                   test "$cf_top_incdir" = "$cf_add_incdir" && break
10131                   cf_add_incdir="$cf_top_incdir"
10132                 else
10133                   break
10134                 fi
10135           else
10136                 break
10137           fi
10138         done
10139   done
10140 fi
10141
10142 fi
10143
10144 # Set definitions to allow ifdef'ing for ncurses.h
10145
10146 case $cf_cv_ncurses_header in
10147 (*ncurses.h)
10148
10149 cat >>confdefs.h <<\EOF
10150 #define HAVE_NCURSES_H 1
10151 EOF
10152
10153         ;;
10154 esac
10155
10156 case $cf_cv_ncurses_header in
10157 (ncurses/curses.h|ncurses/ncurses.h)
10158
10159 cat >>confdefs.h <<\EOF
10160 #define HAVE_NCURSES_NCURSES_H 1
10161 EOF
10162
10163         ;;
10164 (ncursesw/curses.h|ncursesw/ncurses.h)
10165
10166 cat >>confdefs.h <<\EOF
10167 #define HAVE_NCURSESW_NCURSES_H 1
10168 EOF
10169
10170         ;;
10171 esac
10172
10173 echo "$as_me:10173: checking for terminfo header" >&5
10174 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
10175 if test "${cf_cv_term_header+set}" = set; then
10176   echo $ECHO_N "(cached) $ECHO_C" >&6
10177 else
10178
10179 case ${cf_cv_ncurses_header} in
10180 (*/ncurses.h|*/ncursesw.h)
10181         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
10182         ;;
10183 (*)
10184         cf_term_header=term.h
10185         ;;
10186 esac
10187
10188 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
10189 do
10190 cat >conftest.$ac_ext <<_ACEOF
10191 #line 10191 "configure"
10192 #include "confdefs.h"
10193 #include <stdio.h>
10194 #include <${cf_cv_ncurses_header:-curses.h}>
10195 #include <$cf_test>
10196
10197 int
10198 main (void)
10199 {
10200 int x = auto_left_margin
10201   ;
10202   return 0;
10203 }
10204 _ACEOF
10205 rm -f conftest.$ac_objext
10206 if { (eval echo "$as_me:10206: \"$ac_compile\"") >&5
10207   (eval $ac_compile) 2>&5
10208   ac_status=$?
10209   echo "$as_me:10209: \$? = $ac_status" >&5
10210   (exit $ac_status); } &&
10211          { ac_try='test -s conftest.$ac_objext'
10212   { (eval echo "$as_me:10212: \"$ac_try\"") >&5
10213   (eval $ac_try) 2>&5
10214   ac_status=$?
10215   echo "$as_me:10215: \$? = $ac_status" >&5
10216   (exit $ac_status); }; }; then
10217
10218         cf_cv_term_header="$cf_test"
10219 else
10220   echo "$as_me: failed program was:" >&5
10221 cat conftest.$ac_ext >&5
10222
10223         cf_cv_term_header=unknown
10224
10225 fi
10226 rm -f conftest.$ac_objext conftest.$ac_ext
10227         test "$cf_cv_term_header" != unknown && break
10228 done
10229
10230 fi
10231 echo "$as_me:10231: result: $cf_cv_term_header" >&5
10232 echo "${ECHO_T}$cf_cv_term_header" >&6
10233
10234 # Set definitions to allow ifdef'ing to accommodate subdirectories
10235
10236 case $cf_cv_term_header in
10237 (*term.h)
10238
10239 cat >>confdefs.h <<\EOF
10240 #define HAVE_TERM_H 1
10241 EOF
10242
10243         ;;
10244 esac
10245
10246 case $cf_cv_term_header in
10247 (ncurses/term.h)
10248
10249 cat >>confdefs.h <<\EOF
10250 #define HAVE_NCURSES_TERM_H 1
10251 EOF
10252
10253         ;;
10254 (ncursesw/term.h)
10255
10256 cat >>confdefs.h <<\EOF
10257 #define HAVE_NCURSESW_TERM_H 1
10258 EOF
10259
10260         ;;
10261 esac
10262
10263 # some applications need this, but should check for NCURSES_VERSION
10264
10265 cat >>confdefs.h <<\EOF
10266 #define NCURSES 1
10267 EOF
10268
10269 echo "$as_me:10269: checking for ncurses version" >&5
10270 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
10271 if test "${cf_cv_ncurses_version+set}" = set; then
10272   echo $ECHO_N "(cached) $ECHO_C" >&6
10273 else
10274
10275         cf_cv_ncurses_version=no
10276         cf_tempfile=out$$
10277         rm -f $cf_tempfile
10278         if test "$cross_compiling" = yes; then
10279
10280         # This will not work if the preprocessor splits the line after the
10281         # Autoconf token.  The 'unproto' program does that.
10282         cat > conftest.$ac_ext <<EOF
10283 #include <${cf_cv_ncurses_header:-curses.h}>
10284 #undef Autoconf
10285 #ifdef NCURSES_VERSION
10286 Autoconf NCURSES_VERSION
10287 #else
10288 #ifdef __NCURSES_H
10289 Autoconf "old"
10290 #endif
10291 ;
10292 #endif
10293 EOF
10294         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
10295         { (eval echo "$as_me:10295: \"$cf_try\"") >&5
10296   (eval $cf_try) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); }
10300         if test -f conftest.out ; then
10301                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
10302                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
10303                 rm -f conftest.out
10304         fi
10305
10306 else
10307   cat >conftest.$ac_ext <<_ACEOF
10308 #line 10308 "configure"
10309 #include "confdefs.h"
10310
10311 #include <${cf_cv_ncurses_header:-curses.h}>
10312 #include <stdio.h>
10313 int main(void)
10314 {
10315         FILE *fp = fopen("$cf_tempfile", "w");
10316 #ifdef NCURSES_VERSION
10317 # ifdef NCURSES_VERSION_PATCH
10318         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
10319 # else
10320         fprintf(fp, "%s\n", NCURSES_VERSION);
10321 # endif
10322 #else
10323 # ifdef __NCURSES_H
10324         fprintf(fp, "old\n");
10325 # else
10326         make an error
10327 # endif
10328 #endif
10329         ${cf_cv_main_return:-return}(0);
10330 }
10331 _ACEOF
10332 rm -f conftest$ac_exeext
10333 if { (eval echo "$as_me:10333: \"$ac_link\"") >&5
10334   (eval $ac_link) 2>&5
10335   ac_status=$?
10336   echo "$as_me:10336: \$? = $ac_status" >&5
10337   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10338   { (eval echo "$as_me:10338: \"$ac_try\"") >&5
10339   (eval $ac_try) 2>&5
10340   ac_status=$?
10341   echo "$as_me:10341: \$? = $ac_status" >&5
10342   (exit $ac_status); }; }; then
10343
10344         cf_cv_ncurses_version=`cat $cf_tempfile`
10345 else
10346   echo "$as_me: program exited with status $ac_status" >&5
10347 echo "$as_me: failed program was:" >&5
10348 cat conftest.$ac_ext >&5
10349 fi
10350 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10351 fi
10352         rm -f $cf_tempfile
10353
10354 fi
10355 echo "$as_me:10355: result: $cf_cv_ncurses_version" >&5
10356 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
10357 test "$cf_cv_ncurses_version" = no ||
10358 cat >>confdefs.h <<\EOF
10359 #define NCURSES 1
10360 EOF
10361
10362 cf_nculib_root=$cf_cv_screen
10363         # This works, except for the special case where we find gpm, but
10364         # ncurses is in a nonstandard location via $LIBS, and we really want
10365         # to link gpm.
10366 cf_ncurses_LIBS=""
10367 cf_ncurses_SAVE="$LIBS"
10368 echo "$as_me:10368: checking for Gpm_Open in -lgpm" >&5
10369 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
10370 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
10371   echo $ECHO_N "(cached) $ECHO_C" >&6
10372 else
10373   ac_check_lib_save_LIBS=$LIBS
10374 LIBS="-lgpm  $LIBS"
10375 cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 /* Override any gcc2 internal prototype to avoid an error.  */
10380 #ifdef __cplusplus
10381 extern "C"
10382 #endif
10383 /* We use char because int might match the return type of a gcc2
10384    builtin and then its argument prototype would still apply.  */
10385 char Gpm_Open ();
10386 int
10387 main (void)
10388 {
10389 Gpm_Open ();
10390   ;
10391   return 0;
10392 }
10393 _ACEOF
10394 rm -f conftest.$ac_objext conftest$ac_exeext
10395 if { (eval echo "$as_me:10395: \"$ac_link\"") >&5
10396   (eval $ac_link) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); } &&
10400          { ac_try='test -s conftest$ac_exeext'
10401   { (eval echo "$as_me:10401: \"$ac_try\"") >&5
10402   (eval $ac_try) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); }; }; then
10406   ac_cv_lib_gpm_Gpm_Open=yes
10407 else
10408   echo "$as_me: failed program was:" >&5
10409 cat conftest.$ac_ext >&5
10410 ac_cv_lib_gpm_Gpm_Open=no
10411 fi
10412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10413 LIBS=$ac_check_lib_save_LIBS
10414 fi
10415 echo "$as_me:10415: result: $ac_cv_lib_gpm_Gpm_Open" >&5
10416 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
10417 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
10418   echo "$as_me:10418: checking for initscr in -lgpm" >&5
10419 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
10420 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
10421   echo $ECHO_N "(cached) $ECHO_C" >&6
10422 else
10423   ac_check_lib_save_LIBS=$LIBS
10424 LIBS="-lgpm  $LIBS"
10425 cat >conftest.$ac_ext <<_ACEOF
10426 #line 10426 "configure"
10427 #include "confdefs.h"
10428
10429 /* Override any gcc2 internal prototype to avoid an error.  */
10430 #ifdef __cplusplus
10431 extern "C"
10432 #endif
10433 /* We use char because int might match the return type of a gcc2
10434    builtin and then its argument prototype would still apply.  */
10435 char initscr ();
10436 int
10437 main (void)
10438 {
10439 initscr ();
10440   ;
10441   return 0;
10442 }
10443 _ACEOF
10444 rm -f conftest.$ac_objext conftest$ac_exeext
10445 if { (eval echo "$as_me:10445: \"$ac_link\"") >&5
10446   (eval $ac_link) 2>&5
10447   ac_status=$?
10448   echo "$as_me:10448: \$? = $ac_status" >&5
10449   (exit $ac_status); } &&
10450          { ac_try='test -s conftest$ac_exeext'
10451   { (eval echo "$as_me:10451: \"$ac_try\"") >&5
10452   (eval $ac_try) 2>&5
10453   ac_status=$?
10454   echo "$as_me:10454: \$? = $ac_status" >&5
10455   (exit $ac_status); }; }; then
10456   ac_cv_lib_gpm_initscr=yes
10457 else
10458   echo "$as_me: failed program was:" >&5
10459 cat conftest.$ac_ext >&5
10460 ac_cv_lib_gpm_initscr=no
10461 fi
10462 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10463 LIBS=$ac_check_lib_save_LIBS
10464 fi
10465 echo "$as_me:10465: result: $ac_cv_lib_gpm_initscr" >&5
10466 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
10467 if test $ac_cv_lib_gpm_initscr = yes; then
10468   LIBS="$cf_ncurses_SAVE"
10469 else
10470   cf_ncurses_LIBS="-lgpm"
10471 fi
10472
10473 fi
10474
10475 case $host_os in
10476 (freebsd*)
10477         # This is only necessary if you are linking against an obsolete
10478         # version of ncurses (but it should do no harm, since it's static).
10479         if test "$cf_nculib_root" = ncurses ; then
10480                 echo "$as_me:10480: checking for tgoto in -lmytinfo" >&5
10481 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
10482 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
10483   echo $ECHO_N "(cached) $ECHO_C" >&6
10484 else
10485   ac_check_lib_save_LIBS=$LIBS
10486 LIBS="-lmytinfo  $LIBS"
10487 cat >conftest.$ac_ext <<_ACEOF
10488 #line 10488 "configure"
10489 #include "confdefs.h"
10490
10491 /* Override any gcc2 internal prototype to avoid an error.  */
10492 #ifdef __cplusplus
10493 extern "C"
10494 #endif
10495 /* We use char because int might match the return type of a gcc2
10496    builtin and then its argument prototype would still apply.  */
10497 char tgoto ();
10498 int
10499 main (void)
10500 {
10501 tgoto ();
10502   ;
10503   return 0;
10504 }
10505 _ACEOF
10506 rm -f conftest.$ac_objext conftest$ac_exeext
10507 if { (eval echo "$as_me:10507: \"$ac_link\"") >&5
10508   (eval $ac_link) 2>&5
10509   ac_status=$?
10510   echo "$as_me:10510: \$? = $ac_status" >&5
10511   (exit $ac_status); } &&
10512          { ac_try='test -s conftest$ac_exeext'
10513   { (eval echo "$as_me:10513: \"$ac_try\"") >&5
10514   (eval $ac_try) 2>&5
10515   ac_status=$?
10516   echo "$as_me:10516: \$? = $ac_status" >&5
10517   (exit $ac_status); }; }; then
10518   ac_cv_lib_mytinfo_tgoto=yes
10519 else
10520   echo "$as_me: failed program was:" >&5
10521 cat conftest.$ac_ext >&5
10522 ac_cv_lib_mytinfo_tgoto=no
10523 fi
10524 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10525 LIBS=$ac_check_lib_save_LIBS
10526 fi
10527 echo "$as_me:10527: result: $ac_cv_lib_mytinfo_tgoto" >&5
10528 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
10529 if test $ac_cv_lib_mytinfo_tgoto = yes; then
10530   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
10531 fi
10532
10533         fi
10534         ;;
10535 esac
10536
10537 cf_add_libs="$cf_ncurses_LIBS"
10538 # Filter out duplicates - this happens with badly-designed ".pc" files...
10539 for cf_add_1lib in $LIBS
10540 do
10541         for cf_add_2lib in $cf_add_libs
10542         do
10543                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10544                 then
10545                         cf_add_1lib=
10546                         break
10547                 fi
10548         done
10549         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10550 done
10551 LIBS="$cf_add_libs"
10552
10553 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
10554 then
10555
10556 cf_add_libs="-l$cf_nculib_root"
10557 # Filter out duplicates - this happens with badly-designed ".pc" files...
10558 for cf_add_1lib in $LIBS
10559 do
10560         for cf_add_2lib in $cf_add_libs
10561         do
10562                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
10563                 then
10564                         cf_add_1lib=
10565                         break
10566                 fi
10567         done
10568         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
10569 done
10570 LIBS="$cf_add_libs"
10571
10572 else
10573
10574         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
10575         cf_libdir=""
10576         echo "$as_me:10576: checking for initscr" >&5
10577 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
10578 if test "${ac_cv_func_initscr+set}" = set; then
10579   echo $ECHO_N "(cached) $ECHO_C" >&6
10580 else
10581   cat >conftest.$ac_ext <<_ACEOF
10582 #line 10582 "configure"
10583 #include "confdefs.h"
10584 /* System header to define __stub macros and hopefully few prototypes,
10585     which can conflict with char initscr (); below.  */
10586 #include <assert.h>
10587 /* Override any gcc2 internal prototype to avoid an error.  */
10588 #ifdef __cplusplus
10589 extern "C"
10590 #endif
10591 /* We use char because int might match the return type of a gcc2
10592    builtin and then its argument prototype would still apply.  */
10593 char initscr ();
10594 char (*f) ();
10595
10596 int
10597 main (void)
10598 {
10599 /* The GNU C library defines this for functions which it implements
10600     to always fail with ENOSYS.  Some functions are actually named
10601     something starting with __ and the normal name is an alias.  */
10602 #if defined (__stub_initscr) || defined (__stub___initscr)
10603 choke me
10604 #else
10605 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10606 #endif
10607
10608   ;
10609   return 0;
10610 }
10611 _ACEOF
10612 rm -f conftest.$ac_objext conftest$ac_exeext
10613 if { (eval echo "$as_me:10613: \"$ac_link\"") >&5
10614   (eval $ac_link) 2>&5
10615   ac_status=$?
10616   echo "$as_me:10616: \$? = $ac_status" >&5
10617   (exit $ac_status); } &&
10618          { ac_try='test -s conftest$ac_exeext'
10619   { (eval echo "$as_me:10619: \"$ac_try\"") >&5
10620   (eval $ac_try) 2>&5
10621   ac_status=$?
10622   echo "$as_me:10622: \$? = $ac_status" >&5
10623   (exit $ac_status); }; }; then
10624   ac_cv_func_initscr=yes
10625 else
10626   echo "$as_me: failed program was:" >&5
10627 cat conftest.$ac_ext >&5
10628 ac_cv_func_initscr=no
10629 fi
10630 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10631 fi
10632 echo "$as_me:10632: result: $ac_cv_func_initscr" >&5
10633 echo "${ECHO_T}$ac_cv_func_initscr" >&6
10634 if test $ac_cv_func_initscr = yes; then
10635   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10636 else
10637
10638                 cf_save_LIBS="$LIBS"
10639                 echo "$as_me:10639: checking for initscr in -l$cf_nculib_root" >&5
10640 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
10641                 LIBS="-l$cf_nculib_root $LIBS"
10642                 cat >conftest.$ac_ext <<_ACEOF
10643 #line 10643 "configure"
10644 #include "confdefs.h"
10645 #include <${cf_cv_ncurses_header:-curses.h}>
10646 int
10647 main (void)
10648 {
10649 initscr()
10650   ;
10651   return 0;
10652 }
10653 _ACEOF
10654 rm -f conftest.$ac_objext conftest$ac_exeext
10655 if { (eval echo "$as_me:10655: \"$ac_link\"") >&5
10656   (eval $ac_link) 2>&5
10657   ac_status=$?
10658   echo "$as_me:10658: \$? = $ac_status" >&5
10659   (exit $ac_status); } &&
10660          { ac_try='test -s conftest$ac_exeext'
10661   { (eval echo "$as_me:10661: \"$ac_try\"") >&5
10662   (eval $ac_try) 2>&5
10663   ac_status=$?
10664   echo "$as_me:10664: \$? = $ac_status" >&5
10665   (exit $ac_status); }; }; then
10666   echo "$as_me:10666: result: yes" >&5
10667 echo "${ECHO_T}yes" >&6
10668                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10669
10670 else
10671   echo "$as_me: failed program was:" >&5
10672 cat conftest.$ac_ext >&5
10673 echo "$as_me:10673: result: no" >&5
10674 echo "${ECHO_T}no" >&6
10675
10676 cf_search=
10677 cf_library_path_list=""
10678 if test -n "${LDFLAGS}${LIBS}" ; then
10679         for cf_library_path in $LDFLAGS $LIBS
10680         do
10681                 case $cf_library_path in
10682                 (-L*)
10683                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
10684
10685 test "x$cf_library_path" != "xNONE" && \
10686 test -d "$cf_library_path" && \
10687  {
10688         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
10689         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
10690         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
10691         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
10692         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
10693         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"
10694 }
10695
10696                         cf_library_path_list="$cf_library_path_list $cf_search"
10697                         ;;
10698                 esac
10699         done
10700 fi
10701
10702 cf_search=
10703
10704 test "x$prefix" != "xNONE" && \
10705 test -d "$prefix" && \
10706  {
10707         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
10708         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
10709         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
10710         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
10711         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
10712         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
10713 }
10714
10715 for cf_subdir_prefix in \
10716         /usr \
10717         /usr/local \
10718         /usr/pkg \
10719         /opt \
10720         /opt/local \
10721         $HOME
10722 do
10723
10724 test "x$cf_subdir_prefix" != "x$prefix" && \
10725 test -d "$cf_subdir_prefix" && \
10726 (test -z "$prefix" || test x$prefix = xNONE || test "x$cf_subdir_prefix" != "x$prefix") && {
10727         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_subdir_prefix"
10728         test -d $cf_subdir_prefix/lib &&          cf_search="$cf_search $cf_subdir_prefix/lib"
10729         test -d $cf_subdir_prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root"
10730         test -d $cf_subdir_prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib"
10731         test -d $cf_subdir_prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib"
10732         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"
10733 }
10734
10735 done
10736
10737 cf_search="$cf_library_path_list $cf_search"
10738
10739                         for cf_libdir in $cf_search
10740                         do
10741                                 echo "$as_me:10741: checking for -l$cf_nculib_root in $cf_libdir" >&5
10742 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
10743                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
10744                                 cat >conftest.$ac_ext <<_ACEOF
10745 #line 10745 "configure"
10746 #include "confdefs.h"
10747 #include <${cf_cv_ncurses_header:-curses.h}>
10748 int
10749 main (void)
10750 {
10751 initscr()
10752   ;
10753   return 0;
10754 }
10755 _ACEOF
10756 rm -f conftest.$ac_objext conftest$ac_exeext
10757 if { (eval echo "$as_me:10757: \"$ac_link\"") >&5
10758   (eval $ac_link) 2>&5
10759   ac_status=$?
10760   echo "$as_me:10760: \$? = $ac_status" >&5
10761   (exit $ac_status); } &&
10762          { ac_try='test -s conftest$ac_exeext'
10763   { (eval echo "$as_me:10763: \"$ac_try\"") >&5
10764   (eval $ac_try) 2>&5
10765   ac_status=$?
10766   echo "$as_me:10766: \$? = $ac_status" >&5
10767   (exit $ac_status); }; }; then
10768   echo "$as_me:10768: result: yes" >&5
10769 echo "${ECHO_T}yes" >&6
10770                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
10771                                          break
10772 else
10773   echo "$as_me: failed program was:" >&5
10774 cat conftest.$ac_ext >&5
10775 echo "$as_me:10775: result: no" >&5
10776 echo "${ECHO_T}no" >&6
10777                                          LIBS="$cf_save_LIBS"
10778 fi
10779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10780                         done
10781
10782 fi
10783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10784
10785 fi
10786
10787 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
10788
10789 if test $cf_found_library = no ; then
10790         { { echo "$as_me:10790: error: Cannot link $cf_nculib_root library" >&5
10791 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
10792    { (exit 1); exit 1; }; }
10793 fi
10794
10795 fi
10796
10797 if test -n "$cf_ncurses_LIBS" ; then
10798         echo "$as_me:10798: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
10799 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
10800         cf_ncurses_SAVE="$LIBS"
10801         for p in $cf_ncurses_LIBS ; do
10802                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
10803                 if test "$q" != "$LIBS" ; then
10804                         LIBS="$q"
10805                 fi
10806         done
10807         cat >conftest.$ac_ext <<_ACEOF
10808 #line 10808 "configure"
10809 #include "confdefs.h"
10810 #include <${cf_cv_ncurses_header:-curses.h}>
10811 int
10812 main (void)
10813 {
10814 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
10815   ;
10816   return 0;
10817 }
10818 _ACEOF
10819 rm -f conftest.$ac_objext conftest$ac_exeext
10820 if { (eval echo "$as_me:10820: \"$ac_link\"") >&5
10821   (eval $ac_link) 2>&5
10822   ac_status=$?
10823   echo "$as_me:10823: \$? = $ac_status" >&5
10824   (exit $ac_status); } &&
10825          { ac_try='test -s conftest$ac_exeext'
10826   { (eval echo "$as_me:10826: \"$ac_try\"") >&5
10827   (eval $ac_try) 2>&5
10828   ac_status=$?
10829   echo "$as_me:10829: \$? = $ac_status" >&5
10830   (exit $ac_status); }; }; then
10831   echo "$as_me:10831: result: yes" >&5
10832 echo "${ECHO_T}yes" >&6
10833 else
10834   echo "$as_me: failed program was:" >&5
10835 cat conftest.$ac_ext >&5
10836 echo "$as_me:10836: result: no" >&5
10837 echo "${ECHO_T}no" >&6
10838                  LIBS="$cf_ncurses_SAVE"
10839 fi
10840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10841 fi
10842
10843 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
10844
10845 cat >>confdefs.h <<EOF
10846 #define $cf_nculib_ROOT 1
10847 EOF
10848
10849         fi
10850 else
10851         NCURSES_CONFIG=none
10852 fi
10853
10854         ;;
10855 (pdcurses)
10856         echo "$as_me:10856: checking for X" >&5
10857 echo $ECHO_N "checking for X... $ECHO_C" >&6
10858
10859 # Check whether --with-x or --without-x was given.
10860 if test "${with_x+set}" = set; then
10861   withval="$with_x"
10862
10863 fi;
10864 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10865 if test "x$with_x" = xno; then
10866   # The user explicitly disabled X.
10867   have_x=disabled
10868 else
10869   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10870     # Both variables are already set.
10871     have_x=yes
10872   else
10873     if test "${ac_cv_have_x+set}" = set; then
10874   echo $ECHO_N "(cached) $ECHO_C" >&6
10875 else
10876   # One or both of the vars are not set, and there is no cached value.
10877 ac_x_includes=no ac_x_libraries=no
10878 rm -fr conftest.dir
10879 if mkdir conftest.dir; then
10880   cd conftest.dir
10881   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10882   cat >Imakefile <<'EOF'
10883 acfindx:
10884         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10885 EOF
10886   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10887     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10888     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10889     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10890     for ac_extension in a so sl dylib dll; do
10891       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10892          test -f $ac_im_libdir/libX11.$ac_extension; then
10893         ac_im_usrlibdir=$ac_im_libdir; break
10894       fi
10895     done
10896     # Screen out bogus values from the imake configuration.  They are
10897     # bogus both because they are the default anyway, and because
10898     # using them would break gcc on systems where it needs fixed includes.
10899     case $ac_im_incroot in
10900         /usr/include) ;;
10901         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10902     esac
10903     case $ac_im_usrlibdir in
10904         /usr/lib | /lib) ;;
10905         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10906     esac
10907   fi
10908   cd ..
10909   rm -fr conftest.dir
10910 fi
10911
10912 # Standard set of common directories for X headers.
10913 # Check X11 before X11Rn because it is often a symlink to the current release.
10914 ac_x_header_dirs='
10915 /usr/X11/include
10916 /usr/X11R6/include
10917 /usr/X11R5/include
10918 /usr/X11R4/include
10919
10920 /usr/include/X11
10921 /usr/include/X11R6
10922 /usr/include/X11R5
10923 /usr/include/X11R4
10924
10925 /usr/local/X11/include
10926 /usr/local/X11R6/include
10927 /usr/local/X11R5/include
10928 /usr/local/X11R4/include
10929
10930 /usr/local/include/X11
10931 /usr/local/include/X11R6
10932 /usr/local/include/X11R5
10933 /usr/local/include/X11R4
10934
10935 /usr/X386/include
10936 /usr/x386/include
10937 /usr/XFree86/include/X11
10938
10939 /usr/include
10940 /usr/local/include
10941 /usr/unsupported/include
10942 /usr/athena/include
10943 /usr/local/x11r5/include
10944 /usr/lpp/Xamples/include
10945
10946 /usr/openwin/include
10947 /usr/openwin/share/include'
10948
10949 if test "$ac_x_includes" = no; then
10950   # Guess where to find include files, by looking for Intrinsic.h.
10951   # First, try using that file with no special directory specified.
10952   cat >conftest.$ac_ext <<_ACEOF
10953 #line 10953 "configure"
10954 #include "confdefs.h"
10955 #include <X11/Intrinsic.h>
10956 _ACEOF
10957 if { (eval echo "$as_me:10957: \"$ac_cpp conftest.$ac_ext\"") >&5
10958   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10959   ac_status=$?
10960   egrep -v '^ *\+' conftest.er1 >conftest.err
10961   rm -f conftest.er1
10962   cat conftest.err >&5
10963   echo "$as_me:10963: \$? = $ac_status" >&5
10964   (exit $ac_status); } >/dev/null; then
10965   if test -s conftest.err; then
10966     ac_cpp_err=$ac_c_preproc_warn_flag
10967   else
10968     ac_cpp_err=
10969   fi
10970 else
10971   ac_cpp_err=yes
10972 fi
10973 if test -z "$ac_cpp_err"; then
10974   # We can compile using X headers with no special include directory.
10975 ac_x_includes=
10976 else
10977   echo "$as_me: failed program was:" >&5
10978   cat conftest.$ac_ext >&5
10979   for ac_dir in $ac_x_header_dirs; do
10980   if test -r "$ac_dir/X11/Intrinsic.h"; then
10981     ac_x_includes=$ac_dir
10982     break
10983   fi
10984 done
10985 fi
10986 rm -f conftest.err conftest.$ac_ext
10987 fi # $ac_x_includes = no
10988
10989 if test "$ac_x_libraries" = no; then
10990   # Check for the libraries.
10991   # See if we find them without any special options.
10992   # Don't add to $LIBS permanently.
10993   ac_save_LIBS=$LIBS
10994   LIBS="-lXt $LIBS"
10995   cat >conftest.$ac_ext <<_ACEOF
10996 #line 10996 "configure"
10997 #include "confdefs.h"
10998 #include <X11/Intrinsic.h>
10999 int
11000 main (void)
11001 {
11002 XtMalloc (0)
11003   ;
11004   return 0;
11005 }
11006 _ACEOF
11007 rm -f conftest.$ac_objext conftest$ac_exeext
11008 if { (eval echo "$as_me:11008: \"$ac_link\"") >&5
11009   (eval $ac_link) 2>&5
11010   ac_status=$?
11011   echo "$as_me:11011: \$? = $ac_status" >&5
11012   (exit $ac_status); } &&
11013          { ac_try='test -s conftest$ac_exeext'
11014   { (eval echo "$as_me:11014: \"$ac_try\"") >&5
11015   (eval $ac_try) 2>&5
11016   ac_status=$?
11017   echo "$as_me:11017: \$? = $ac_status" >&5
11018   (exit $ac_status); }; }; then
11019   LIBS=$ac_save_LIBS
11020 # We can link X programs with no special library path.
11021 ac_x_libraries=
11022 else
11023   echo "$as_me: failed program was:" >&5
11024 cat conftest.$ac_ext >&5
11025 LIBS=$ac_save_LIBS
11026 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
11027 do
11028   # Don't even attempt the hair of trying to link an X program!
11029   for ac_extension in a so sl dylib dll; do
11030     if test -r $ac_dir/libXt.$ac_extension; then
11031       ac_x_libraries=$ac_dir
11032       break 2
11033     fi
11034   done
11035 done
11036 fi
11037 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11038 fi # $ac_x_libraries = no
11039
11040 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
11041   # Didn't find X anywhere.  Cache the known absence of X.
11042   ac_cv_have_x="have_x=no"
11043 else
11044   # Record where we found X for the cache.
11045   ac_cv_have_x="have_x=yes \
11046                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
11047 fi
11048 fi
11049
11050   fi
11051   eval "$ac_cv_have_x"
11052 fi # $with_x != no
11053
11054 if test "$have_x" != yes; then
11055   echo "$as_me:11055: result: $have_x" >&5
11056 echo "${ECHO_T}$have_x" >&6
11057   no_x=yes
11058 else
11059   # If each of the values was on the command line, it overrides each guess.
11060   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
11061   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
11062   # Update the cache value to reflect the command line values.
11063   ac_cv_have_x="have_x=yes \
11064                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
11065   echo "$as_me:11065: result: libraries $x_libraries, headers $x_includes" >&5
11066 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
11067 fi
11068
11069 if test "$no_x" = yes; then
11070   # Not all programs may use this symbol, but it does not hurt to define it.
11071
11072 cat >>confdefs.h <<\EOF
11073 #define X_DISPLAY_MISSING 1
11074 EOF
11075
11076   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
11077 else
11078   if test -n "$x_includes"; then
11079     X_CFLAGS="$X_CFLAGS -I$x_includes"
11080   fi
11081
11082   # It would also be nice to do this for all -L options, not just this one.
11083   if test -n "$x_libraries"; then
11084     X_LIBS="$X_LIBS -L$x_libraries"
11085     # For Solaris; some versions of Sun CC require a space after -R and
11086     # others require no space.  Words are not sufficient . . . .
11087     case `(uname -sr) 2>/dev/null` in
11088     "SunOS 5"*)
11089       echo "$as_me:11089: checking whether -R must be followed by a space" >&5
11090 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
11091       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
11092       cat >conftest.$ac_ext <<_ACEOF
11093 #line 11093 "configure"
11094 #include "confdefs.h"
11095
11096 int
11097 main (void)
11098 {
11099
11100   ;
11101   return 0;
11102 }
11103 _ACEOF
11104 rm -f conftest.$ac_objext conftest$ac_exeext
11105 if { (eval echo "$as_me:11105: \"$ac_link\"") >&5
11106   (eval $ac_link) 2>&5
11107   ac_status=$?
11108   echo "$as_me:11108: \$? = $ac_status" >&5
11109   (exit $ac_status); } &&
11110          { ac_try='test -s conftest$ac_exeext'
11111   { (eval echo "$as_me:11111: \"$ac_try\"") >&5
11112   (eval $ac_try) 2>&5
11113   ac_status=$?
11114   echo "$as_me:11114: \$? = $ac_status" >&5
11115   (exit $ac_status); }; }; then
11116   ac_R_nospace=yes
11117 else
11118   echo "$as_me: failed program was:" >&5
11119 cat conftest.$ac_ext >&5
11120 ac_R_nospace=no
11121 fi
11122 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11123       if test $ac_R_nospace = yes; then
11124         echo "$as_me:11124: result: no" >&5
11125 echo "${ECHO_T}no" >&6
11126         X_LIBS="$X_LIBS -R$x_libraries"
11127       else
11128         LIBS="$ac_xsave_LIBS -R $x_libraries"
11129         cat >conftest.$ac_ext <<_ACEOF
11130 #line 11130 "configure"
11131 #include "confdefs.h"
11132
11133 int
11134 main (void)
11135 {
11136
11137   ;
11138   return 0;
11139 }
11140 _ACEOF
11141 rm -f conftest.$ac_objext conftest$ac_exeext
11142 if { (eval echo "$as_me:11142: \"$ac_link\"") >&5
11143   (eval $ac_link) 2>&5
11144   ac_status=$?
11145   echo "$as_me:11145: \$? = $ac_status" >&5
11146   (exit $ac_status); } &&
11147          { ac_try='test -s conftest$ac_exeext'
11148   { (eval echo "$as_me:11148: \"$ac_try\"") >&5
11149   (eval $ac_try) 2>&5
11150   ac_status=$?
11151   echo "$as_me:11151: \$? = $ac_status" >&5
11152   (exit $ac_status); }; }; then
11153   ac_R_space=yes
11154 else
11155   echo "$as_me: failed program was:" >&5
11156 cat conftest.$ac_ext >&5
11157 ac_R_space=no
11158 fi
11159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11160         if test $ac_R_space = yes; then
11161           echo "$as_me:11161: result: yes" >&5
11162 echo "${ECHO_T}yes" >&6
11163           X_LIBS="$X_LIBS -R $x_libraries"
11164         else
11165           echo "$as_me:11165: result: neither works" >&5
11166 echo "${ECHO_T}neither works" >&6
11167         fi
11168       fi
11169       LIBS=$ac_xsave_LIBS
11170     esac
11171   fi
11172
11173   # Check for system-dependent libraries X programs must link with.
11174   # Do this before checking for the system-independent R6 libraries
11175   # (-lICE), since we may need -lsocket or whatever for X linking.
11176
11177   if test "$ISC" = yes; then
11178     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
11179   else
11180     # Martyn Johnson says this is needed for Ultrix, if the X
11181     # libraries were built with DECnet support.  And Karl Berry says
11182     # the Alpha needs dnet_stub (dnet does not exist).
11183     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
11184     cat >conftest.$ac_ext <<_ACEOF
11185 #line 11185 "configure"
11186 #include "confdefs.h"
11187
11188 /* Override any gcc2 internal prototype to avoid an error.  */
11189 #ifdef __cplusplus
11190 extern "C"
11191 #endif
11192 /* We use char because int might match the return type of a gcc2
11193    builtin and then its argument prototype would still apply.  */
11194 char XOpenDisplay ();
11195 int
11196 main (void)
11197 {
11198 XOpenDisplay ();
11199   ;
11200   return 0;
11201 }
11202 _ACEOF
11203 rm -f conftest.$ac_objext conftest$ac_exeext
11204 if { (eval echo "$as_me:11204: \"$ac_link\"") >&5
11205   (eval $ac_link) 2>&5
11206   ac_status=$?
11207   echo "$as_me:11207: \$? = $ac_status" >&5
11208   (exit $ac_status); } &&
11209          { ac_try='test -s conftest$ac_exeext'
11210   { (eval echo "$as_me:11210: \"$ac_try\"") >&5
11211   (eval $ac_try) 2>&5
11212   ac_status=$?
11213   echo "$as_me:11213: \$? = $ac_status" >&5
11214   (exit $ac_status); }; }; then
11215   :
11216 else
11217   echo "$as_me: failed program was:" >&5
11218 cat conftest.$ac_ext >&5
11219 echo "$as_me:11219: checking for dnet_ntoa in -ldnet" >&5
11220 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
11221 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
11222   echo $ECHO_N "(cached) $ECHO_C" >&6
11223 else
11224   ac_check_lib_save_LIBS=$LIBS
11225 LIBS="-ldnet  $LIBS"
11226 cat >conftest.$ac_ext <<_ACEOF
11227 #line 11227 "configure"
11228 #include "confdefs.h"
11229
11230 /* Override any gcc2 internal prototype to avoid an error.  */
11231 #ifdef __cplusplus
11232 extern "C"
11233 #endif
11234 /* We use char because int might match the return type of a gcc2
11235    builtin and then its argument prototype would still apply.  */
11236 char dnet_ntoa ();
11237 int
11238 main (void)
11239 {
11240 dnet_ntoa ();
11241   ;
11242   return 0;
11243 }
11244 _ACEOF
11245 rm -f conftest.$ac_objext conftest$ac_exeext
11246 if { (eval echo "$as_me:11246: \"$ac_link\"") >&5
11247   (eval $ac_link) 2>&5
11248   ac_status=$?
11249   echo "$as_me:11249: \$? = $ac_status" >&5
11250   (exit $ac_status); } &&
11251          { ac_try='test -s conftest$ac_exeext'
11252   { (eval echo "$as_me:11252: \"$ac_try\"") >&5
11253   (eval $ac_try) 2>&5
11254   ac_status=$?
11255   echo "$as_me:11255: \$? = $ac_status" >&5
11256   (exit $ac_status); }; }; then
11257   ac_cv_lib_dnet_dnet_ntoa=yes
11258 else
11259   echo "$as_me: failed program was:" >&5
11260 cat conftest.$ac_ext >&5
11261 ac_cv_lib_dnet_dnet_ntoa=no
11262 fi
11263 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11264 LIBS=$ac_check_lib_save_LIBS
11265 fi
11266 echo "$as_me:11266: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
11267 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
11268 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
11269   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
11270 fi
11271
11272     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
11273       echo "$as_me:11273: checking for dnet_ntoa in -ldnet_stub" >&5
11274 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
11275 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
11276   echo $ECHO_N "(cached) $ECHO_C" >&6
11277 else
11278   ac_check_lib_save_LIBS=$LIBS
11279 LIBS="-ldnet_stub  $LIBS"
11280 cat >conftest.$ac_ext <<_ACEOF
11281 #line 11281 "configure"
11282 #include "confdefs.h"
11283
11284 /* Override any gcc2 internal prototype to avoid an error.  */
11285 #ifdef __cplusplus
11286 extern "C"
11287 #endif
11288 /* We use char because int might match the return type of a gcc2
11289    builtin and then its argument prototype would still apply.  */
11290 char dnet_ntoa ();
11291 int
11292 main (void)
11293 {
11294 dnet_ntoa ();
11295   ;
11296   return 0;
11297 }
11298 _ACEOF
11299 rm -f conftest.$ac_objext conftest$ac_exeext
11300 if { (eval echo "$as_me:11300: \"$ac_link\"") >&5
11301   (eval $ac_link) 2>&5
11302   ac_status=$?
11303   echo "$as_me:11303: \$? = $ac_status" >&5
11304   (exit $ac_status); } &&
11305          { ac_try='test -s conftest$ac_exeext'
11306   { (eval echo "$as_me:11306: \"$ac_try\"") >&5
11307   (eval $ac_try) 2>&5
11308   ac_status=$?
11309   echo "$as_me:11309: \$? = $ac_status" >&5
11310   (exit $ac_status); }; }; then
11311   ac_cv_lib_dnet_stub_dnet_ntoa=yes
11312 else
11313   echo "$as_me: failed program was:" >&5
11314 cat conftest.$ac_ext >&5
11315 ac_cv_lib_dnet_stub_dnet_ntoa=no
11316 fi
11317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11318 LIBS=$ac_check_lib_save_LIBS
11319 fi
11320 echo "$as_me:11320: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
11321 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
11322 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
11323   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
11324 fi
11325
11326     fi
11327 fi
11328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11329     LIBS="$ac_xsave_LIBS"
11330
11331     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
11332     # to get the SysV transport functions.
11333     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
11334     # needs -lnsl.
11335     # The nsl library prevents programs from opening the X display
11336     # on Irix 5.2, according to T.E. Dickey.
11337     # The functions gethostbyname, getservbyname, and inet_addr are
11338     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
11339     echo "$as_me:11339: checking for gethostbyname" >&5
11340 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
11341 if test "${ac_cv_func_gethostbyname+set}" = set; then
11342   echo $ECHO_N "(cached) $ECHO_C" >&6
11343 else
11344   cat >conftest.$ac_ext <<_ACEOF
11345 #line 11345 "configure"
11346 #include "confdefs.h"
11347 /* System header to define __stub macros and hopefully few prototypes,
11348     which can conflict with char gethostbyname (); below.  */
11349 #include <assert.h>
11350 /* Override any gcc2 internal prototype to avoid an error.  */
11351 #ifdef __cplusplus
11352 extern "C"
11353 #endif
11354 /* We use char because int might match the return type of a gcc2
11355    builtin and then its argument prototype would still apply.  */
11356 char gethostbyname ();
11357 char (*f) ();
11358
11359 int
11360 main (void)
11361 {
11362 /* The GNU C library defines this for functions which it implements
11363     to always fail with ENOSYS.  Some functions are actually named
11364     something starting with __ and the normal name is an alias.  */
11365 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
11366 choke me
11367 #else
11368 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11369 #endif
11370
11371   ;
11372   return 0;
11373 }
11374 _ACEOF
11375 rm -f conftest.$ac_objext conftest$ac_exeext
11376 if { (eval echo "$as_me:11376: \"$ac_link\"") >&5
11377   (eval $ac_link) 2>&5
11378   ac_status=$?
11379   echo "$as_me:11379: \$? = $ac_status" >&5
11380   (exit $ac_status); } &&
11381          { ac_try='test -s conftest$ac_exeext'
11382   { (eval echo "$as_me:11382: \"$ac_try\"") >&5
11383   (eval $ac_try) 2>&5
11384   ac_status=$?
11385   echo "$as_me:11385: \$? = $ac_status" >&5
11386   (exit $ac_status); }; }; then
11387   ac_cv_func_gethostbyname=yes
11388 else
11389   echo "$as_me: failed program was:" >&5
11390 cat conftest.$ac_ext >&5
11391 ac_cv_func_gethostbyname=no
11392 fi
11393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11394 fi
11395 echo "$as_me:11395: result: $ac_cv_func_gethostbyname" >&5
11396 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
11397
11398     if test $ac_cv_func_gethostbyname = no; then
11399       echo "$as_me:11399: checking for gethostbyname in -lnsl" >&5
11400 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
11401 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
11402   echo $ECHO_N "(cached) $ECHO_C" >&6
11403 else
11404   ac_check_lib_save_LIBS=$LIBS
11405 LIBS="-lnsl  $LIBS"
11406 cat >conftest.$ac_ext <<_ACEOF
11407 #line 11407 "configure"
11408 #include "confdefs.h"
11409
11410 /* Override any gcc2 internal prototype to avoid an error.  */
11411 #ifdef __cplusplus
11412 extern "C"
11413 #endif
11414 /* We use char because int might match the return type of a gcc2
11415    builtin and then its argument prototype would still apply.  */
11416 char gethostbyname ();
11417 int
11418 main (void)
11419 {
11420 gethostbyname ();
11421   ;
11422   return 0;
11423 }
11424 _ACEOF
11425 rm -f conftest.$ac_objext conftest$ac_exeext
11426 if { (eval echo "$as_me:11426: \"$ac_link\"") >&5
11427   (eval $ac_link) 2>&5
11428   ac_status=$?
11429   echo "$as_me:11429: \$? = $ac_status" >&5
11430   (exit $ac_status); } &&
11431          { ac_try='test -s conftest$ac_exeext'
11432   { (eval echo "$as_me:11432: \"$ac_try\"") >&5
11433   (eval $ac_try) 2>&5
11434   ac_status=$?
11435   echo "$as_me:11435: \$? = $ac_status" >&5
11436   (exit $ac_status); }; }; then
11437   ac_cv_lib_nsl_gethostbyname=yes
11438 else
11439   echo "$as_me: failed program was:" >&5
11440 cat conftest.$ac_ext >&5
11441 ac_cv_lib_nsl_gethostbyname=no
11442 fi
11443 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11444 LIBS=$ac_check_lib_save_LIBS
11445 fi
11446 echo "$as_me:11446: result: $ac_cv_lib_nsl_gethostbyname" >&5
11447 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
11448 if test $ac_cv_lib_nsl_gethostbyname = yes; then
11449   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
11450 fi
11451
11452       if test $ac_cv_lib_nsl_gethostbyname = no; then
11453         echo "$as_me:11453: checking for gethostbyname in -lbsd" >&5
11454 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
11455 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
11456   echo $ECHO_N "(cached) $ECHO_C" >&6
11457 else
11458   ac_check_lib_save_LIBS=$LIBS
11459 LIBS="-lbsd  $LIBS"
11460 cat >conftest.$ac_ext <<_ACEOF
11461 #line 11461 "configure"
11462 #include "confdefs.h"
11463
11464 /* Override any gcc2 internal prototype to avoid an error.  */
11465 #ifdef __cplusplus
11466 extern "C"
11467 #endif
11468 /* We use char because int might match the return type of a gcc2
11469    builtin and then its argument prototype would still apply.  */
11470 char gethostbyname ();
11471 int
11472 main (void)
11473 {
11474 gethostbyname ();
11475   ;
11476   return 0;
11477 }
11478 _ACEOF
11479 rm -f conftest.$ac_objext conftest$ac_exeext
11480 if { (eval echo "$as_me:11480: \"$ac_link\"") >&5
11481   (eval $ac_link) 2>&5
11482   ac_status=$?
11483   echo "$as_me:11483: \$? = $ac_status" >&5
11484   (exit $ac_status); } &&
11485          { ac_try='test -s conftest$ac_exeext'
11486   { (eval echo "$as_me:11486: \"$ac_try\"") >&5
11487   (eval $ac_try) 2>&5
11488   ac_status=$?
11489   echo "$as_me:11489: \$? = $ac_status" >&5
11490   (exit $ac_status); }; }; then
11491   ac_cv_lib_bsd_gethostbyname=yes
11492 else
11493   echo "$as_me: failed program was:" >&5
11494 cat conftest.$ac_ext >&5
11495 ac_cv_lib_bsd_gethostbyname=no
11496 fi
11497 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11498 LIBS=$ac_check_lib_save_LIBS
11499 fi
11500 echo "$as_me:11500: result: $ac_cv_lib_bsd_gethostbyname" >&5
11501 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
11502 if test $ac_cv_lib_bsd_gethostbyname = yes; then
11503   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
11504 fi
11505
11506       fi
11507     fi
11508
11509     # lieder@skyler.mavd.honeywell.com says without -lsocket,
11510     # socket/setsockopt and other routines are undefined under SCO ODT
11511     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
11512     # on later versions), says Simon Leinen: it contains gethostby*
11513     # variants that don't use the nameserver (or something).  -lsocket
11514     # must be given before -lnsl if both are needed.  We assume that
11515     # if connect needs -lnsl, so does gethostbyname.
11516     echo "$as_me:11516: checking for connect" >&5
11517 echo $ECHO_N "checking for connect... $ECHO_C" >&6
11518 if test "${ac_cv_func_connect+set}" = set; then
11519   echo $ECHO_N "(cached) $ECHO_C" >&6
11520 else
11521   cat >conftest.$ac_ext <<_ACEOF
11522 #line 11522 "configure"
11523 #include "confdefs.h"
11524 /* System header to define __stub macros and hopefully few prototypes,
11525     which can conflict with char connect (); below.  */
11526 #include <assert.h>
11527 /* Override any gcc2 internal prototype to avoid an error.  */
11528 #ifdef __cplusplus
11529 extern "C"
11530 #endif
11531 /* We use char because int might match the return type of a gcc2
11532    builtin and then its argument prototype would still apply.  */
11533 char connect ();
11534 char (*f) ();
11535
11536 int
11537 main (void)
11538 {
11539 /* The GNU C library defines this for functions which it implements
11540     to always fail with ENOSYS.  Some functions are actually named
11541     something starting with __ and the normal name is an alias.  */
11542 #if defined (__stub_connect) || defined (__stub___connect)
11543 choke me
11544 #else
11545 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11546 #endif
11547
11548   ;
11549   return 0;
11550 }
11551 _ACEOF
11552 rm -f conftest.$ac_objext conftest$ac_exeext
11553 if { (eval echo "$as_me:11553: \"$ac_link\"") >&5
11554   (eval $ac_link) 2>&5
11555   ac_status=$?
11556   echo "$as_me:11556: \$? = $ac_status" >&5
11557   (exit $ac_status); } &&
11558          { ac_try='test -s conftest$ac_exeext'
11559   { (eval echo "$as_me:11559: \"$ac_try\"") >&5
11560   (eval $ac_try) 2>&5
11561   ac_status=$?
11562   echo "$as_me:11562: \$? = $ac_status" >&5
11563   (exit $ac_status); }; }; then
11564   ac_cv_func_connect=yes
11565 else
11566   echo "$as_me: failed program was:" >&5
11567 cat conftest.$ac_ext >&5
11568 ac_cv_func_connect=no
11569 fi
11570 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11571 fi
11572 echo "$as_me:11572: result: $ac_cv_func_connect" >&5
11573 echo "${ECHO_T}$ac_cv_func_connect" >&6
11574
11575     if test $ac_cv_func_connect = no; then
11576       echo "$as_me:11576: checking for connect in -lsocket" >&5
11577 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
11578 if test "${ac_cv_lib_socket_connect+set}" = set; then
11579   echo $ECHO_N "(cached) $ECHO_C" >&6
11580 else
11581   ac_check_lib_save_LIBS=$LIBS
11582 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
11583 cat >conftest.$ac_ext <<_ACEOF
11584 #line 11584 "configure"
11585 #include "confdefs.h"
11586
11587 /* Override any gcc2 internal prototype to avoid an error.  */
11588 #ifdef __cplusplus
11589 extern "C"
11590 #endif
11591 /* We use char because int might match the return type of a gcc2
11592    builtin and then its argument prototype would still apply.  */
11593 char connect ();
11594 int
11595 main (void)
11596 {
11597 connect ();
11598   ;
11599   return 0;
11600 }
11601 _ACEOF
11602 rm -f conftest.$ac_objext conftest$ac_exeext
11603 if { (eval echo "$as_me:11603: \"$ac_link\"") >&5
11604   (eval $ac_link) 2>&5
11605   ac_status=$?
11606   echo "$as_me:11606: \$? = $ac_status" >&5
11607   (exit $ac_status); } &&
11608          { ac_try='test -s conftest$ac_exeext'
11609   { (eval echo "$as_me:11609: \"$ac_try\"") >&5
11610   (eval $ac_try) 2>&5
11611   ac_status=$?
11612   echo "$as_me:11612: \$? = $ac_status" >&5
11613   (exit $ac_status); }; }; then
11614   ac_cv_lib_socket_connect=yes
11615 else
11616   echo "$as_me: failed program was:" >&5
11617 cat conftest.$ac_ext >&5
11618 ac_cv_lib_socket_connect=no
11619 fi
11620 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11621 LIBS=$ac_check_lib_save_LIBS
11622 fi
11623 echo "$as_me:11623: result: $ac_cv_lib_socket_connect" >&5
11624 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
11625 if test $ac_cv_lib_socket_connect = yes; then
11626   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
11627 fi
11628
11629     fi
11630
11631     # Guillermo Gomez says -lposix is necessary on A/UX.
11632     echo "$as_me:11632: checking for remove" >&5
11633 echo $ECHO_N "checking for remove... $ECHO_C" >&6
11634 if test "${ac_cv_func_remove+set}" = set; then
11635   echo $ECHO_N "(cached) $ECHO_C" >&6
11636 else
11637   cat >conftest.$ac_ext <<_ACEOF
11638 #line 11638 "configure"
11639 #include "confdefs.h"
11640 /* System header to define __stub macros and hopefully few prototypes,
11641     which can conflict with char remove (); below.  */
11642 #include <assert.h>
11643 /* Override any gcc2 internal prototype to avoid an error.  */
11644 #ifdef __cplusplus
11645 extern "C"
11646 #endif
11647 /* We use char because int might match the return type of a gcc2
11648    builtin and then its argument prototype would still apply.  */
11649 char remove ();
11650 char (*f) ();
11651
11652 int
11653 main (void)
11654 {
11655 /* The GNU C library defines this for functions which it implements
11656     to always fail with ENOSYS.  Some functions are actually named
11657     something starting with __ and the normal name is an alias.  */
11658 #if defined (__stub_remove) || defined (__stub___remove)
11659 choke me
11660 #else
11661 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11662 #endif
11663
11664   ;
11665   return 0;
11666 }
11667 _ACEOF
11668 rm -f conftest.$ac_objext conftest$ac_exeext
11669 if { (eval echo "$as_me:11669: \"$ac_link\"") >&5
11670   (eval $ac_link) 2>&5
11671   ac_status=$?
11672   echo "$as_me:11672: \$? = $ac_status" >&5
11673   (exit $ac_status); } &&
11674          { ac_try='test -s conftest$ac_exeext'
11675   { (eval echo "$as_me:11675: \"$ac_try\"") >&5
11676   (eval $ac_try) 2>&5
11677   ac_status=$?
11678   echo "$as_me:11678: \$? = $ac_status" >&5
11679   (exit $ac_status); }; }; then
11680   ac_cv_func_remove=yes
11681 else
11682   echo "$as_me: failed program was:" >&5
11683 cat conftest.$ac_ext >&5
11684 ac_cv_func_remove=no
11685 fi
11686 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11687 fi
11688 echo "$as_me:11688: result: $ac_cv_func_remove" >&5
11689 echo "${ECHO_T}$ac_cv_func_remove" >&6
11690
11691     if test $ac_cv_func_remove = no; then
11692       echo "$as_me:11692: checking for remove in -lposix" >&5
11693 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
11694 if test "${ac_cv_lib_posix_remove+set}" = set; then
11695   echo $ECHO_N "(cached) $ECHO_C" >&6
11696 else
11697   ac_check_lib_save_LIBS=$LIBS
11698 LIBS="-lposix  $LIBS"
11699 cat >conftest.$ac_ext <<_ACEOF
11700 #line 11700 "configure"
11701 #include "confdefs.h"
11702
11703 /* Override any gcc2 internal prototype to avoid an error.  */
11704 #ifdef __cplusplus
11705 extern "C"
11706 #endif
11707 /* We use char because int might match the return type of a gcc2
11708    builtin and then its argument prototype would still apply.  */
11709 char remove ();
11710 int
11711 main (void)
11712 {
11713 remove ();
11714   ;
11715   return 0;
11716 }
11717 _ACEOF
11718 rm -f conftest.$ac_objext conftest$ac_exeext
11719 if { (eval echo "$as_me:11719: \"$ac_link\"") >&5
11720   (eval $ac_link) 2>&5
11721   ac_status=$?
11722   echo "$as_me:11722: \$? = $ac_status" >&5
11723   (exit $ac_status); } &&
11724          { ac_try='test -s conftest$ac_exeext'
11725   { (eval echo "$as_me:11725: \"$ac_try\"") >&5
11726   (eval $ac_try) 2>&5
11727   ac_status=$?
11728   echo "$as_me:11728: \$? = $ac_status" >&5
11729   (exit $ac_status); }; }; then
11730   ac_cv_lib_posix_remove=yes
11731 else
11732   echo "$as_me: failed program was:" >&5
11733 cat conftest.$ac_ext >&5
11734 ac_cv_lib_posix_remove=no
11735 fi
11736 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11737 LIBS=$ac_check_lib_save_LIBS
11738 fi
11739 echo "$as_me:11739: result: $ac_cv_lib_posix_remove" >&5
11740 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
11741 if test $ac_cv_lib_posix_remove = yes; then
11742   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
11743 fi
11744
11745     fi
11746
11747     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
11748     echo "$as_me:11748: checking for shmat" >&5
11749 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
11750 if test "${ac_cv_func_shmat+set}" = set; then
11751   echo $ECHO_N "(cached) $ECHO_C" >&6
11752 else
11753   cat >conftest.$ac_ext <<_ACEOF
11754 #line 11754 "configure"
11755 #include "confdefs.h"
11756 /* System header to define __stub macros and hopefully few prototypes,
11757     which can conflict with char shmat (); below.  */
11758 #include <assert.h>
11759 /* Override any gcc2 internal prototype to avoid an error.  */
11760 #ifdef __cplusplus
11761 extern "C"
11762 #endif
11763 /* We use char because int might match the return type of a gcc2
11764    builtin and then its argument prototype would still apply.  */
11765 char shmat ();
11766 char (*f) ();
11767
11768 int
11769 main (void)
11770 {
11771 /* The GNU C library defines this for functions which it implements
11772     to always fail with ENOSYS.  Some functions are actually named
11773     something starting with __ and the normal name is an alias.  */
11774 #if defined (__stub_shmat) || defined (__stub___shmat)
11775 choke me
11776 #else
11777 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
11778 #endif
11779
11780   ;
11781   return 0;
11782 }
11783 _ACEOF
11784 rm -f conftest.$ac_objext conftest$ac_exeext
11785 if { (eval echo "$as_me:11785: \"$ac_link\"") >&5
11786   (eval $ac_link) 2>&5
11787   ac_status=$?
11788   echo "$as_me:11788: \$? = $ac_status" >&5
11789   (exit $ac_status); } &&
11790          { ac_try='test -s conftest$ac_exeext'
11791   { (eval echo "$as_me:11791: \"$ac_try\"") >&5
11792   (eval $ac_try) 2>&5
11793   ac_status=$?
11794   echo "$as_me:11794: \$? = $ac_status" >&5
11795   (exit $ac_status); }; }; then
11796   ac_cv_func_shmat=yes
11797 else
11798   echo "$as_me: failed program was:" >&5
11799 cat conftest.$ac_ext >&5
11800 ac_cv_func_shmat=no
11801 fi
11802 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11803 fi
11804 echo "$as_me:11804: result: $ac_cv_func_shmat" >&5
11805 echo "${ECHO_T}$ac_cv_func_shmat" >&6
11806
11807     if test $ac_cv_func_shmat = no; then
11808       echo "$as_me:11808: checking for shmat in -lipc" >&5
11809 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11810 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11811   echo $ECHO_N "(cached) $ECHO_C" >&6
11812 else
11813   ac_check_lib_save_LIBS=$LIBS
11814 LIBS="-lipc  $LIBS"
11815 cat >conftest.$ac_ext <<_ACEOF
11816 #line 11816 "configure"
11817 #include "confdefs.h"
11818
11819 /* Override any gcc2 internal prototype to avoid an error.  */
11820 #ifdef __cplusplus
11821 extern "C"
11822 #endif
11823 /* We use char because int might match the return type of a gcc2
11824    builtin and then its argument prototype would still apply.  */
11825 char shmat ();
11826 int
11827 main (void)
11828 {
11829 shmat ();
11830   ;
11831   return 0;
11832 }
11833 _ACEOF
11834 rm -f conftest.$ac_objext conftest$ac_exeext
11835 if { (eval echo "$as_me:11835: \"$ac_link\"") >&5
11836   (eval $ac_link) 2>&5
11837   ac_status=$?
11838   echo "$as_me:11838: \$? = $ac_status" >&5
11839   (exit $ac_status); } &&
11840          { ac_try='test -s conftest$ac_exeext'
11841   { (eval echo "$as_me:11841: \"$ac_try\"") >&5
11842   (eval $ac_try) 2>&5
11843   ac_status=$?
11844   echo "$as_me:11844: \$? = $ac_status" >&5
11845   (exit $ac_status); }; }; then
11846   ac_cv_lib_ipc_shmat=yes
11847 else
11848   echo "$as_me: failed program was:" >&5
11849 cat conftest.$ac_ext >&5
11850 ac_cv_lib_ipc_shmat=no
11851 fi
11852 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11853 LIBS=$ac_check_lib_save_LIBS
11854 fi
11855 echo "$as_me:11855: result: $ac_cv_lib_ipc_shmat" >&5
11856 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11857 if test $ac_cv_lib_ipc_shmat = yes; then
11858   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11859 fi
11860
11861     fi
11862   fi
11863
11864   # Check for libraries that X11R6 Xt/Xaw programs need.
11865   ac_save_LDFLAGS=$LDFLAGS
11866   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11867   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11868   # check for ICE first), but we must link in the order -lSM -lICE or
11869   # we get undefined symbols.  So assume we have SM if we have ICE.
11870   # These have to be linked with before -lX11, unlike the other
11871   # libraries we check for below, so use a different variable.
11872   # John Interrante, Karl Berry
11873   echo "$as_me:11873: checking for IceConnectionNumber in -lICE" >&5
11874 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11875 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11876   echo $ECHO_N "(cached) $ECHO_C" >&6
11877 else
11878   ac_check_lib_save_LIBS=$LIBS
11879 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11880 cat >conftest.$ac_ext <<_ACEOF
11881 #line 11881 "configure"
11882 #include "confdefs.h"
11883
11884 /* Override any gcc2 internal prototype to avoid an error.  */
11885 #ifdef __cplusplus
11886 extern "C"
11887 #endif
11888 /* We use char because int might match the return type of a gcc2
11889    builtin and then its argument prototype would still apply.  */
11890 char IceConnectionNumber ();
11891 int
11892 main (void)
11893 {
11894 IceConnectionNumber ();
11895   ;
11896   return 0;
11897 }
11898 _ACEOF
11899 rm -f conftest.$ac_objext conftest$ac_exeext
11900 if { (eval echo "$as_me:11900: \"$ac_link\"") >&5
11901   (eval $ac_link) 2>&5
11902   ac_status=$?
11903   echo "$as_me:11903: \$? = $ac_status" >&5
11904   (exit $ac_status); } &&
11905          { ac_try='test -s conftest$ac_exeext'
11906   { (eval echo "$as_me:11906: \"$ac_try\"") >&5
11907   (eval $ac_try) 2>&5
11908   ac_status=$?
11909   echo "$as_me:11909: \$? = $ac_status" >&5
11910   (exit $ac_status); }; }; then
11911   ac_cv_lib_ICE_IceConnectionNumber=yes
11912 else
11913   echo "$as_me: failed program was:" >&5
11914 cat conftest.$ac_ext >&5
11915 ac_cv_lib_ICE_IceConnectionNumber=no
11916 fi
11917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11918 LIBS=$ac_check_lib_save_LIBS
11919 fi
11920 echo "$as_me:11920: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11921 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11922 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11923   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11924 fi
11925
11926   LDFLAGS=$ac_save_LDFLAGS
11927
11928 fi
11929
11930 cf_x_athena=${cf_x_athena:-Xaw}
11931
11932 echo "$as_me:11932: checking if you want to link with Xaw 3d library" >&5
11933 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11934 withval=
11935
11936 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11937 if test "${with_Xaw3d+set}" = set; then
11938   withval="$with_Xaw3d"
11939
11940 fi;
11941 if test "$withval" = yes ; then
11942         cf_x_athena=Xaw3d
11943         echo "$as_me:11943: result: yes" >&5
11944 echo "${ECHO_T}yes" >&6
11945 else
11946         echo "$as_me:11946: result: no" >&5
11947 echo "${ECHO_T}no" >&6
11948 fi
11949
11950 echo "$as_me:11950: checking if you want to link with Xaw 3d xft library" >&5
11951 echo $ECHO_N "checking if you want to link with Xaw 3d xft library... $ECHO_C" >&6
11952 withval=
11953
11954 # Check whether --with-Xaw3dxft or --without-Xaw3dxft was given.
11955 if test "${with_Xaw3dxft+set}" = set; then
11956   withval="$with_Xaw3dxft"
11957
11958 fi;
11959 if test "$withval" = yes ; then
11960         cf_x_athena=Xaw3dxft
11961         echo "$as_me:11961: result: yes" >&5
11962 echo "${ECHO_T}yes" >&6
11963 else
11964         echo "$as_me:11964: result: no" >&5
11965 echo "${ECHO_T}no" >&6
11966 fi
11967
11968 echo "$as_me:11968: checking if you want to link with neXT Athena library" >&5
11969 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11970 withval=
11971
11972 # Check whether --with-neXtaw or --without-neXtaw was given.
11973 if test "${with_neXtaw+set}" = set; then
11974   withval="$with_neXtaw"
11975
11976 fi;
11977 if test "$withval" = yes ; then
11978         cf_x_athena=neXtaw
11979         echo "$as_me:11979: result: yes" >&5
11980 echo "${ECHO_T}yes" >&6
11981 else
11982         echo "$as_me:11982: result: no" >&5
11983 echo "${ECHO_T}no" >&6
11984 fi
11985
11986 echo "$as_me:11986: checking if you want to link with Athena-Plus library" >&5
11987 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11988 withval=
11989
11990 # Check whether --with-XawPlus or --without-XawPlus was given.
11991 if test "${with_XawPlus+set}" = set; then
11992   withval="$with_XawPlus"
11993
11994 fi;
11995 if test "$withval" = yes ; then
11996         cf_x_athena=XawPlus
11997         echo "$as_me:11997: result: yes" >&5
11998 echo "${ECHO_T}yes" >&6
11999 else
12000         echo "$as_me:12000: result: no" >&5
12001 echo "${ECHO_T}no" >&6
12002 fi
12003
12004 cf_x_athena_lib=""
12005
12006 if test "$PKG_CONFIG" != none ; then
12007         cf_athena_list=
12008         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
12009         for cf_athena_pkg in \
12010                 $cf_athena_list \
12011                 ${cf_x_athena} \
12012                 ${cf_x_athena}-devel \
12013                 lib${cf_x_athena} \
12014                 lib${cf_x_athena}-devel
12015         do
12016
12017 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
12018         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
12019
12020 echo "${as_me:-configure}:12020: testing found package $cf_athena_pkg ..." 1>&5
12021
12022         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
12023         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
12024         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
12025
12026 echo "${as_me:-configure}:12026: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12027
12028         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
12029
12030 echo "${as_me:-configure}:12030: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
12031
12032 cf_fix_cppflags=no
12033 cf_new_cflags=
12034 cf_new_cppflags=
12035 cf_new_extra_cppflags=
12036
12037 for cf_add_cflags in $cf_pkgconfig_incs
12038 do
12039 case $cf_fix_cppflags in
12040 (no)
12041         case $cf_add_cflags in
12042         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12043                 case $cf_add_cflags in
12044                 (-D*)
12045                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12046
12047                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12048                                 && test -z "${cf_tst_cflags}" \
12049                                 && cf_fix_cppflags=yes
12050
12051                         if test $cf_fix_cppflags = yes ; then
12052
12053         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12054         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12055
12056                                 continue
12057                         elif test "${cf_tst_cflags}" = "\"'" ; then
12058
12059         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12060         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12061
12062                                 continue
12063                         fi
12064                         ;;
12065                 esac
12066                 case "$CPPFLAGS" in
12067                 (*$cf_add_cflags)
12068                         ;;
12069                 (*)
12070                         case $cf_add_cflags in
12071                         (-D*)
12072                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12073
12074 CPPFLAGS=`echo "$CPPFLAGS" | \
12075         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12076                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12077
12078                                 ;;
12079                         esac
12080
12081         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12082         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12083
12084                         ;;
12085                 esac
12086                 ;;
12087         (*)
12088
12089         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12090         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12091
12092                 ;;
12093         esac
12094         ;;
12095 (yes)
12096
12097         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12098         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12099
12100         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12101
12102         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12103                 && test -z "${cf_tst_cflags}" \
12104                 && cf_fix_cppflags=no
12105         ;;
12106 esac
12107 done
12108
12109 if test -n "$cf_new_cflags" ; then
12110
12111         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12112         CFLAGS="${CFLAGS}$cf_new_cflags"
12113
12114 fi
12115
12116 if test -n "$cf_new_cppflags" ; then
12117
12118         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12119         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12120
12121 fi
12122
12123 if test -n "$cf_new_extra_cppflags" ; then
12124
12125         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12126         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12127
12128 fi
12129
12130 cf_add_libs="$cf_pkgconfig_libs"
12131 # Filter out duplicates - this happens with badly-designed ".pc" files...
12132 for cf_add_1lib in $LIBS
12133 do
12134         for cf_add_2lib in $cf_add_libs
12135         do
12136                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12137                 then
12138                         cf_add_1lib=
12139                         break
12140                 fi
12141         done
12142         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12143 done
12144 LIBS="$cf_add_libs"
12145
12146                         cf_x_athena_lib="$cf_pkgconfig_libs"
12147
12148 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12149
12150                         cat >>confdefs.h <<EOF
12151 #define $cf_x_athena_LIBS 1
12152 EOF
12153
12154         for cf_trim_lib in Xmu Xt X11
12155         do
12156                 case "$LIBS" in
12157                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12158                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12159                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12160
12161 echo "${as_me:-configure}:12161: testing ..trimmed $LIBS ..." 1>&5
12162
12163                         ;;
12164                 esac
12165         done
12166
12167 echo "$as_me:12167: checking for usable $cf_x_athena/Xmu package" >&5
12168 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
12169 if test "${cf_cv_xaw_compat+set}" = set; then
12170   echo $ECHO_N "(cached) $ECHO_C" >&6
12171 else
12172
12173 cat >conftest.$ac_ext <<_ACEOF
12174 #line 12174 "configure"
12175 #include "confdefs.h"
12176
12177 #include <X11/Xmu/CharSet.h>
12178
12179 int
12180 main (void)
12181 {
12182
12183 int check = XmuCompareISOLatin1("big", "small")
12184
12185   ;
12186   return 0;
12187 }
12188 _ACEOF
12189 rm -f conftest.$ac_objext conftest$ac_exeext
12190 if { (eval echo "$as_me:12190: \"$ac_link\"") >&5
12191   (eval $ac_link) 2>&5
12192   ac_status=$?
12193   echo "$as_me:12193: \$? = $ac_status" >&5
12194   (exit $ac_status); } &&
12195          { ac_try='test -s conftest$ac_exeext'
12196   { (eval echo "$as_me:12196: \"$ac_try\"") >&5
12197   (eval $ac_try) 2>&5
12198   ac_status=$?
12199   echo "$as_me:12199: \$? = $ac_status" >&5
12200   (exit $ac_status); }; }; then
12201   cf_cv_xaw_compat=yes
12202 else
12203   echo "$as_me: failed program was:" >&5
12204 cat conftest.$ac_ext >&5
12205 cf_cv_xaw_compat=no
12206 fi
12207 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12208 fi
12209 echo "$as_me:12209: result: $cf_cv_xaw_compat" >&5
12210 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
12211
12212                         if test "$cf_cv_xaw_compat" = no
12213                         then
12214                                 # workaround for broken ".pc" files...
12215                                 case "$cf_x_athena_lib" in
12216                                 (*-lXmu*)
12217                                         ;;
12218                                 (*)
12219                                         test -n "$verbose" && echo "    work around broken package" 1>&6
12220
12221 echo "${as_me:-configure}:12221: testing work around broken package ..." 1>&5
12222
12223                                         cf_save_xmu="$LIBS"
12224                                         cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^  *//' -e 's/ .*//'`
12225
12226 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
12227         test -n "$verbose" && echo "    found package xmu" 1>&6
12228
12229 echo "${as_me:-configure}:12229: testing found package xmu ..." 1>&5
12230
12231         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
12232         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
12233         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
12234
12235 echo "${as_me:-configure}:12235: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12236
12237         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
12238
12239 echo "${as_me:-configure}:12239: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
12240
12241 cf_fix_cppflags=no
12242 cf_new_cflags=
12243 cf_new_cppflags=
12244 cf_new_extra_cppflags=
12245
12246 for cf_add_cflags in $cf_pkgconfig_incs
12247 do
12248 case $cf_fix_cppflags in
12249 (no)
12250         case $cf_add_cflags in
12251         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12252                 case $cf_add_cflags in
12253                 (-D*)
12254                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12255
12256                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12257                                 && test -z "${cf_tst_cflags}" \
12258                                 && cf_fix_cppflags=yes
12259
12260                         if test $cf_fix_cppflags = yes ; then
12261
12262         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12263         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12264
12265                                 continue
12266                         elif test "${cf_tst_cflags}" = "\"'" ; then
12267
12268         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12269         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12270
12271                                 continue
12272                         fi
12273                         ;;
12274                 esac
12275                 case "$CPPFLAGS" in
12276                 (*$cf_add_cflags)
12277                         ;;
12278                 (*)
12279                         case $cf_add_cflags in
12280                         (-D*)
12281                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12282
12283 CPPFLAGS=`echo "$CPPFLAGS" | \
12284         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12285                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12286
12287                                 ;;
12288                         esac
12289
12290         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12291         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12292
12293                         ;;
12294                 esac
12295                 ;;
12296         (*)
12297
12298         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12299         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12300
12301                 ;;
12302         esac
12303         ;;
12304 (yes)
12305
12306         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12307         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12308
12309         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12310
12311         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12312                 && test -z "${cf_tst_cflags}" \
12313                 && cf_fix_cppflags=no
12314         ;;
12315 esac
12316 done
12317
12318 if test -n "$cf_new_cflags" ; then
12319
12320         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12321         CFLAGS="${CFLAGS}$cf_new_cflags"
12322
12323 fi
12324
12325 if test -n "$cf_new_cppflags" ; then
12326
12327         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12328         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12329
12330 fi
12331
12332 if test -n "$cf_new_extra_cppflags" ; then
12333
12334         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12335         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12336
12337 fi
12338
12339 cf_add_libs="$cf_pkgconfig_libs"
12340 # Filter out duplicates - this happens with badly-designed ".pc" files...
12341 for cf_add_1lib in $LIBS
12342 do
12343         for cf_add_2lib in $cf_add_libs
12344         do
12345                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12346                 then
12347                         cf_add_1lib=
12348                         break
12349                 fi
12350         done
12351         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12352 done
12353 LIBS="$cf_add_libs"
12354
12355                                                         LIBS="$cf_save_xmu"
12356
12357 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12358
12359 echo "${as_me:-configure}:12359: testing ...before $LIBS ..." 1>&5
12360
12361 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib $cf_pkgconfig_libs %" -e 's%  % %g'`
12362 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12363
12364 echo "${as_me:-configure}:12364: testing ...after  $LIBS ..." 1>&5
12365
12366 else
12367         cf_pkgconfig_incs=
12368         cf_pkgconfig_libs=
12369
12370 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12371
12372 echo "${as_me:-configure}:12372: testing ...before $LIBS ..." 1>&5
12373
12374 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%$cf_first_lib %$cf_first_lib -lXmu %" -e 's%  % %g'`
12375 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12376
12377 echo "${as_me:-configure}:12377: testing ...after  $LIBS ..." 1>&5
12378
12379 fi
12380
12381         for cf_trim_lib in Xmu Xt X11
12382         do
12383                 case "$LIBS" in
12384                 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
12385                         LIBS=`echo "$LIBS " | sed -e 's/  / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
12386                         test -n "$verbose" && echo "    ..trimmed $LIBS" 1>&6
12387
12388 echo "${as_me:-configure}:12388: testing ..trimmed $LIBS ..." 1>&5
12389
12390                         ;;
12391                 esac
12392         done
12393
12394                                         ;;
12395                                 esac
12396                         fi
12397
12398                         break
12399 else
12400         cf_pkgconfig_incs=
12401         cf_pkgconfig_libs=
12402         :
12403 fi
12404
12405         done
12406 fi
12407
12408 if test -z "$cf_x_athena_lib" ; then
12409
12410 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
12411         test -n "$verbose" && echo "    found package Xext" 1>&6
12412
12413 echo "${as_me:-configure}:12413: testing found package Xext ..." 1>&5
12414
12415         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
12416         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
12417         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
12418
12419 echo "${as_me:-configure}:12419: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12420
12421         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
12422
12423 echo "${as_me:-configure}:12423: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
12424
12425 cf_fix_cppflags=no
12426 cf_new_cflags=
12427 cf_new_cppflags=
12428 cf_new_extra_cppflags=
12429
12430 for cf_add_cflags in $cf_pkgconfig_incs
12431 do
12432 case $cf_fix_cppflags in
12433 (no)
12434         case $cf_add_cflags in
12435         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12436                 case $cf_add_cflags in
12437                 (-D*)
12438                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12439
12440                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12441                                 && test -z "${cf_tst_cflags}" \
12442                                 && cf_fix_cppflags=yes
12443
12444                         if test $cf_fix_cppflags = yes ; then
12445
12446         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12447         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12448
12449                                 continue
12450                         elif test "${cf_tst_cflags}" = "\"'" ; then
12451
12452         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12453         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12454
12455                                 continue
12456                         fi
12457                         ;;
12458                 esac
12459                 case "$CPPFLAGS" in
12460                 (*$cf_add_cflags)
12461                         ;;
12462                 (*)
12463                         case $cf_add_cflags in
12464                         (-D*)
12465                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12466
12467 CPPFLAGS=`echo "$CPPFLAGS" | \
12468         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12469                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12470
12471                                 ;;
12472                         esac
12473
12474         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12475         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12476
12477                         ;;
12478                 esac
12479                 ;;
12480         (*)
12481
12482         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12483         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12484
12485                 ;;
12486         esac
12487         ;;
12488 (yes)
12489
12490         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12491         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12492
12493         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12494
12495         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12496                 && test -z "${cf_tst_cflags}" \
12497                 && cf_fix_cppflags=no
12498         ;;
12499 esac
12500 done
12501
12502 if test -n "$cf_new_cflags" ; then
12503
12504         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12505         CFLAGS="${CFLAGS}$cf_new_cflags"
12506
12507 fi
12508
12509 if test -n "$cf_new_cppflags" ; then
12510
12511         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12512         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12513
12514 fi
12515
12516 if test -n "$cf_new_extra_cppflags" ; then
12517
12518         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12519         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12520
12521 fi
12522
12523 cf_add_libs="$cf_pkgconfig_libs"
12524 # Filter out duplicates - this happens with badly-designed ".pc" files...
12525 for cf_add_1lib in $LIBS
12526 do
12527         for cf_add_2lib in $cf_add_libs
12528         do
12529                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12530                 then
12531                         cf_add_1lib=
12532                         break
12533                 fi
12534         done
12535         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12536 done
12537 LIBS="$cf_add_libs"
12538
12539         :
12540 else
12541         cf_pkgconfig_incs=
12542         cf_pkgconfig_libs=
12543
12544         echo "$as_me:12544: checking for XextCreateExtension in -lXext" >&5
12545 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
12546 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
12547   echo $ECHO_N "(cached) $ECHO_C" >&6
12548 else
12549   ac_check_lib_save_LIBS=$LIBS
12550 LIBS="-lXext  $LIBS"
12551 cat >conftest.$ac_ext <<_ACEOF
12552 #line 12552 "configure"
12553 #include "confdefs.h"
12554
12555 /* Override any gcc2 internal prototype to avoid an error.  */
12556 #ifdef __cplusplus
12557 extern "C"
12558 #endif
12559 /* We use char because int might match the return type of a gcc2
12560    builtin and then its argument prototype would still apply.  */
12561 char XextCreateExtension ();
12562 int
12563 main (void)
12564 {
12565 XextCreateExtension ();
12566   ;
12567   return 0;
12568 }
12569 _ACEOF
12570 rm -f conftest.$ac_objext conftest$ac_exeext
12571 if { (eval echo "$as_me:12571: \"$ac_link\"") >&5
12572   (eval $ac_link) 2>&5
12573   ac_status=$?
12574   echo "$as_me:12574: \$? = $ac_status" >&5
12575   (exit $ac_status); } &&
12576          { ac_try='test -s conftest$ac_exeext'
12577   { (eval echo "$as_me:12577: \"$ac_try\"") >&5
12578   (eval $ac_try) 2>&5
12579   ac_status=$?
12580   echo "$as_me:12580: \$? = $ac_status" >&5
12581   (exit $ac_status); }; }; then
12582   ac_cv_lib_Xext_XextCreateExtension=yes
12583 else
12584   echo "$as_me: failed program was:" >&5
12585 cat conftest.$ac_ext >&5
12586 ac_cv_lib_Xext_XextCreateExtension=no
12587 fi
12588 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12589 LIBS=$ac_check_lib_save_LIBS
12590 fi
12591 echo "$as_me:12591: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
12592 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
12593 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
12594
12595 cf_add_libs="-lXext"
12596 # Filter out duplicates - this happens with badly-designed ".pc" files...
12597 for cf_add_1lib in $LIBS
12598 do
12599         for cf_add_2lib in $cf_add_libs
12600         do
12601                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12602                 then
12603                         cf_add_1lib=
12604                         break
12605                 fi
12606         done
12607         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12608 done
12609 LIBS="$cf_add_libs"
12610
12611 fi
12612
12613 fi
12614
12615 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
12616 # in some cases has installed dummy files in the former, other cases replaced
12617 # it with a link to the new location).  This complicates the configure script.
12618 # Check for that pitfall, and recover using pkg-config
12619 #
12620 # If none of these are set, the configuration is almost certainly broken.
12621 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
12622 then
12623
12624 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
12625         test -n "$verbose" && echo "    found package x11" 1>&6
12626
12627 echo "${as_me:-configure}:12627: testing found package x11 ..." 1>&5
12628
12629         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
12630         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
12631         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
12632
12633 echo "${as_me:-configure}:12633: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12634
12635         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
12636
12637 echo "${as_me:-configure}:12637: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
12638
12639 cf_fix_cppflags=no
12640 cf_new_cflags=
12641 cf_new_cppflags=
12642 cf_new_extra_cppflags=
12643
12644 for cf_add_cflags in $cf_pkgconfig_incs
12645 do
12646 case $cf_fix_cppflags in
12647 (no)
12648         case $cf_add_cflags in
12649         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12650                 case $cf_add_cflags in
12651                 (-D*)
12652                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12653
12654                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12655                                 && test -z "${cf_tst_cflags}" \
12656                                 && cf_fix_cppflags=yes
12657
12658                         if test $cf_fix_cppflags = yes ; then
12659
12660         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12661         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12662
12663                                 continue
12664                         elif test "${cf_tst_cflags}" = "\"'" ; then
12665
12666         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12667         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12668
12669                                 continue
12670                         fi
12671                         ;;
12672                 esac
12673                 case "$CPPFLAGS" in
12674                 (*$cf_add_cflags)
12675                         ;;
12676                 (*)
12677                         case $cf_add_cflags in
12678                         (-D*)
12679                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12680
12681 CPPFLAGS=`echo "$CPPFLAGS" | \
12682         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12683                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12684
12685                                 ;;
12686                         esac
12687
12688         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12689         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12690
12691                         ;;
12692                 esac
12693                 ;;
12694         (*)
12695
12696         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12697         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12698
12699                 ;;
12700         esac
12701         ;;
12702 (yes)
12703
12704         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12705         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12706
12707         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12708
12709         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12710                 && test -z "${cf_tst_cflags}" \
12711                 && cf_fix_cppflags=no
12712         ;;
12713 esac
12714 done
12715
12716 if test -n "$cf_new_cflags" ; then
12717
12718         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12719         CFLAGS="${CFLAGS}$cf_new_cflags"
12720
12721 fi
12722
12723 if test -n "$cf_new_cppflags" ; then
12724
12725         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12726         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12727
12728 fi
12729
12730 if test -n "$cf_new_extra_cppflags" ; then
12731
12732         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12733         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12734
12735 fi
12736
12737 cf_add_libs="$cf_pkgconfig_libs"
12738 # Filter out duplicates - this happens with badly-designed ".pc" files...
12739 for cf_add_1lib in $LIBS
12740 do
12741         for cf_add_2lib in $cf_add_libs
12742         do
12743                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12744                 then
12745                         cf_add_1lib=
12746                         break
12747                 fi
12748         done
12749         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12750 done
12751 LIBS="$cf_add_libs"
12752
12753         :
12754 else
12755         cf_pkgconfig_incs=
12756         cf_pkgconfig_libs=
12757         { echo "$as_me:12757: WARNING: unable to find X11 library" >&5
12758 echo "$as_me: WARNING: unable to find X11 library" >&2;}
12759 fi
12760
12761 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
12762         test -n "$verbose" && echo "    found package ice" 1>&6
12763
12764 echo "${as_me:-configure}:12764: testing found package ice ..." 1>&5
12765
12766         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
12767         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
12768         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
12769
12770 echo "${as_me:-configure}:12770: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12771
12772         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
12773
12774 echo "${as_me:-configure}:12774: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
12775
12776 cf_fix_cppflags=no
12777 cf_new_cflags=
12778 cf_new_cppflags=
12779 cf_new_extra_cppflags=
12780
12781 for cf_add_cflags in $cf_pkgconfig_incs
12782 do
12783 case $cf_fix_cppflags in
12784 (no)
12785         case $cf_add_cflags in
12786         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12787                 case $cf_add_cflags in
12788                 (-D*)
12789                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12790
12791                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12792                                 && test -z "${cf_tst_cflags}" \
12793                                 && cf_fix_cppflags=yes
12794
12795                         if test $cf_fix_cppflags = yes ; then
12796
12797         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12798         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12799
12800                                 continue
12801                         elif test "${cf_tst_cflags}" = "\"'" ; then
12802
12803         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12804         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12805
12806                                 continue
12807                         fi
12808                         ;;
12809                 esac
12810                 case "$CPPFLAGS" in
12811                 (*$cf_add_cflags)
12812                         ;;
12813                 (*)
12814                         case $cf_add_cflags in
12815                         (-D*)
12816                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12817
12818 CPPFLAGS=`echo "$CPPFLAGS" | \
12819         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12820                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12821
12822                                 ;;
12823                         esac
12824
12825         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12826         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12827
12828                         ;;
12829                 esac
12830                 ;;
12831         (*)
12832
12833         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12834         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12835
12836                 ;;
12837         esac
12838         ;;
12839 (yes)
12840
12841         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12842         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12843
12844         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12845
12846         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12847                 && test -z "${cf_tst_cflags}" \
12848                 && cf_fix_cppflags=no
12849         ;;
12850 esac
12851 done
12852
12853 if test -n "$cf_new_cflags" ; then
12854
12855         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12856         CFLAGS="${CFLAGS}$cf_new_cflags"
12857
12858 fi
12859
12860 if test -n "$cf_new_cppflags" ; then
12861
12862         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
12863         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
12864
12865 fi
12866
12867 if test -n "$cf_new_extra_cppflags" ; then
12868
12869         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
12870         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
12871
12872 fi
12873
12874 cf_add_libs="$cf_pkgconfig_libs"
12875 # Filter out duplicates - this happens with badly-designed ".pc" files...
12876 for cf_add_1lib in $LIBS
12877 do
12878         for cf_add_2lib in $cf_add_libs
12879         do
12880                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
12881                 then
12882                         cf_add_1lib=
12883                         break
12884                 fi
12885         done
12886         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
12887 done
12888 LIBS="$cf_add_libs"
12889
12890         :
12891 else
12892         cf_pkgconfig_incs=
12893         cf_pkgconfig_libs=
12894         { echo "$as_me:12894: WARNING: unable to find ICE library" >&5
12895 echo "$as_me: WARNING: unable to find ICE library" >&2;}
12896 fi
12897
12898 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12899         test -n "$verbose" && echo "    found package sm" 1>&6
12900
12901 echo "${as_me:-configure}:12901: testing found package sm ..." 1>&5
12902
12903         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12904         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12905         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12906
12907 echo "${as_me:-configure}:12907: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12908
12909         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12910
12911 echo "${as_me:-configure}:12911: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12912
12913 cf_fix_cppflags=no
12914 cf_new_cflags=
12915 cf_new_cppflags=
12916 cf_new_extra_cppflags=
12917
12918 for cf_add_cflags in $cf_pkgconfig_incs
12919 do
12920 case $cf_fix_cppflags in
12921 (no)
12922         case $cf_add_cflags in
12923         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
12924                 case $cf_add_cflags in
12925                 (-D*)
12926                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12927
12928                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12929                                 && test -z "${cf_tst_cflags}" \
12930                                 && cf_fix_cppflags=yes
12931
12932                         if test $cf_fix_cppflags = yes ; then
12933
12934         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12935         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12936
12937                                 continue
12938                         elif test "${cf_tst_cflags}" = "\"'" ; then
12939
12940         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12941         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12942
12943                                 continue
12944                         fi
12945                         ;;
12946                 esac
12947                 case "$CPPFLAGS" in
12948                 (*$cf_add_cflags)
12949                         ;;
12950                 (*)
12951                         case $cf_add_cflags in
12952                         (-D*)
12953                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12954
12955 CPPFLAGS=`echo "$CPPFLAGS" | \
12956         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12957                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12958
12959                                 ;;
12960                         esac
12961
12962         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
12963         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
12964
12965                         ;;
12966                 esac
12967                 ;;
12968         (*)
12969
12970         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
12971         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
12972
12973                 ;;
12974         esac
12975         ;;
12976 (yes)
12977
12978         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
12979         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
12980
12981         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12982
12983         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
12984                 && test -z "${cf_tst_cflags}" \
12985                 && cf_fix_cppflags=no
12986         ;;
12987 esac
12988 done
12989
12990 if test -n "$cf_new_cflags" ; then
12991
12992         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
12993         CFLAGS="${CFLAGS}$cf_new_cflags"
12994
12995 fi
12996
12997 if test -n "$cf_new_cppflags" ; then
12998
12999         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13000         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13001
13002 fi
13003
13004 if test -n "$cf_new_extra_cppflags" ; then
13005
13006         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13007         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13008
13009 fi
13010
13011 cf_add_libs="$cf_pkgconfig_libs"
13012 # Filter out duplicates - this happens with badly-designed ".pc" files...
13013 for cf_add_1lib in $LIBS
13014 do
13015         for cf_add_2lib in $cf_add_libs
13016         do
13017                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13018                 then
13019                         cf_add_1lib=
13020                         break
13021                 fi
13022         done
13023         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13024 done
13025 LIBS="$cf_add_libs"
13026
13027         :
13028 else
13029         cf_pkgconfig_incs=
13030         cf_pkgconfig_libs=
13031         { echo "$as_me:13031: WARNING: unable to find SM library" >&5
13032 echo "$as_me: WARNING: unable to find SM library" >&2;}
13033 fi
13034
13035 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13036         test -n "$verbose" && echo "    found package xt" 1>&6
13037
13038 echo "${as_me:-configure}:13038: testing found package xt ..." 1>&5
13039
13040         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13041         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13042         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13043
13044 echo "${as_me:-configure}:13044: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13045
13046         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13047
13048 echo "${as_me:-configure}:13048: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13049
13050 cf_fix_cppflags=no
13051 cf_new_cflags=
13052 cf_new_cppflags=
13053 cf_new_extra_cppflags=
13054
13055 for cf_add_cflags in $cf_pkgconfig_incs
13056 do
13057 case $cf_fix_cppflags in
13058 (no)
13059         case $cf_add_cflags in
13060         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13061                 case $cf_add_cflags in
13062                 (-D*)
13063                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13064
13065                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13066                                 && test -z "${cf_tst_cflags}" \
13067                                 && cf_fix_cppflags=yes
13068
13069                         if test $cf_fix_cppflags = yes ; then
13070
13071         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13072         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13073
13074                                 continue
13075                         elif test "${cf_tst_cflags}" = "\"'" ; then
13076
13077         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13078         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13079
13080                                 continue
13081                         fi
13082                         ;;
13083                 esac
13084                 case "$CPPFLAGS" in
13085                 (*$cf_add_cflags)
13086                         ;;
13087                 (*)
13088                         case $cf_add_cflags in
13089                         (-D*)
13090                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13091
13092 CPPFLAGS=`echo "$CPPFLAGS" | \
13093         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13094                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13095
13096                                 ;;
13097                         esac
13098
13099         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13100         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13101
13102                         ;;
13103                 esac
13104                 ;;
13105         (*)
13106
13107         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13108         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13109
13110                 ;;
13111         esac
13112         ;;
13113 (yes)
13114
13115         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13116         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13117
13118         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13119
13120         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13121                 && test -z "${cf_tst_cflags}" \
13122                 && cf_fix_cppflags=no
13123         ;;
13124 esac
13125 done
13126
13127 if test -n "$cf_new_cflags" ; then
13128
13129         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13130         CFLAGS="${CFLAGS}$cf_new_cflags"
13131
13132 fi
13133
13134 if test -n "$cf_new_cppflags" ; then
13135
13136         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13137         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13138
13139 fi
13140
13141 if test -n "$cf_new_extra_cppflags" ; then
13142
13143         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13144         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13145
13146 fi
13147
13148 cf_add_libs="$cf_pkgconfig_libs"
13149 # Filter out duplicates - this happens with badly-designed ".pc" files...
13150 for cf_add_1lib in $LIBS
13151 do
13152         for cf_add_2lib in $cf_add_libs
13153         do
13154                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13155                 then
13156                         cf_add_1lib=
13157                         break
13158                 fi
13159         done
13160         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13161 done
13162 LIBS="$cf_add_libs"
13163
13164         :
13165 else
13166         cf_pkgconfig_incs=
13167         cf_pkgconfig_libs=
13168         { echo "$as_me:13168: WARNING: unable to find Xt library" >&5
13169 echo "$as_me: WARNING: unable to find Xt library" >&2;}
13170 fi
13171
13172 fi
13173
13174 cf_have_X_LIBS=no
13175
13176 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
13177         test -n "$verbose" && echo "    found package xt" 1>&6
13178
13179 echo "${as_me:-configure}:13179: testing found package xt ..." 1>&5
13180
13181         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
13182         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
13183         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
13184
13185 echo "${as_me:-configure}:13185: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13186
13187         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
13188
13189 echo "${as_me:-configure}:13189: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
13190
13191 cf_fix_cppflags=no
13192 cf_new_cflags=
13193 cf_new_cppflags=
13194 cf_new_extra_cppflags=
13195
13196 for cf_add_cflags in $cf_pkgconfig_incs
13197 do
13198 case $cf_fix_cppflags in
13199 (no)
13200         case $cf_add_cflags in
13201         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13202                 case $cf_add_cflags in
13203                 (-D*)
13204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13205
13206                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13207                                 && test -z "${cf_tst_cflags}" \
13208                                 && cf_fix_cppflags=yes
13209
13210                         if test $cf_fix_cppflags = yes ; then
13211
13212         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13213         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13214
13215                                 continue
13216                         elif test "${cf_tst_cflags}" = "\"'" ; then
13217
13218         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13219         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13220
13221                                 continue
13222                         fi
13223                         ;;
13224                 esac
13225                 case "$CPPFLAGS" in
13226                 (*$cf_add_cflags)
13227                         ;;
13228                 (*)
13229                         case $cf_add_cflags in
13230                         (-D*)
13231                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13232
13233 CPPFLAGS=`echo "$CPPFLAGS" | \
13234         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13235                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13236
13237                                 ;;
13238                         esac
13239
13240         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13241         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13242
13243                         ;;
13244                 esac
13245                 ;;
13246         (*)
13247
13248         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13249         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13250
13251                 ;;
13252         esac
13253         ;;
13254 (yes)
13255
13256         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13257         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13258
13259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13260
13261         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13262                 && test -z "${cf_tst_cflags}" \
13263                 && cf_fix_cppflags=no
13264         ;;
13265 esac
13266 done
13267
13268 if test -n "$cf_new_cflags" ; then
13269
13270         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13271         CFLAGS="${CFLAGS}$cf_new_cflags"
13272
13273 fi
13274
13275 if test -n "$cf_new_cppflags" ; then
13276
13277         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13278         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13279
13280 fi
13281
13282 if test -n "$cf_new_extra_cppflags" ; then
13283
13284         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13285         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13286
13287 fi
13288
13289 cf_add_libs="$cf_pkgconfig_libs"
13290 # Filter out duplicates - this happens with badly-designed ".pc" files...
13291 for cf_add_1lib in $LIBS
13292 do
13293         for cf_add_2lib in $cf_add_libs
13294         do
13295                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13296                 then
13297                         cf_add_1lib=
13298                         break
13299                 fi
13300         done
13301         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13302 done
13303 LIBS="$cf_add_libs"
13304
13305         case "x$LIBS" in
13306         (*-lX11*)
13307                 ;;
13308         (*)
13309 # we have an "xt" package, but it may omit Xt's dependency on X11
13310 echo "$as_me:13310: checking for usable X dependency" >&5
13311 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
13312 if test "${cf_cv_xt_x11_compat+set}" = set; then
13313   echo $ECHO_N "(cached) $ECHO_C" >&6
13314 else
13315
13316 cat >conftest.$ac_ext <<_ACEOF
13317 #line 13317 "configure"
13318 #include "confdefs.h"
13319
13320 #include <X11/Xlib.h>
13321
13322 int
13323 main (void)
13324 {
13325
13326         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
13327         int rc2 = XClearWindow((Display*) 0, (Window) 0);
13328         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
13329         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
13330
13331   ;
13332   return 0;
13333 }
13334 _ACEOF
13335 rm -f conftest.$ac_objext conftest$ac_exeext
13336 if { (eval echo "$as_me:13336: \"$ac_link\"") >&5
13337   (eval $ac_link) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); } &&
13341          { ac_try='test -s conftest$ac_exeext'
13342   { (eval echo "$as_me:13342: \"$ac_try\"") >&5
13343   (eval $ac_try) 2>&5
13344   ac_status=$?
13345   echo "$as_me:13345: \$? = $ac_status" >&5
13346   (exit $ac_status); }; }; then
13347   cf_cv_xt_x11_compat=yes
13348 else
13349   echo "$as_me: failed program was:" >&5
13350 cat conftest.$ac_ext >&5
13351 cf_cv_xt_x11_compat=no
13352 fi
13353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13354 fi
13355 echo "$as_me:13355: result: $cf_cv_xt_x11_compat" >&5
13356 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
13357                 if test "$cf_cv_xt_x11_compat" = no
13358                 then
13359                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
13360
13361 echo "${as_me:-configure}:13361: testing work around broken X11 dependency ..." 1>&5
13362
13363                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
13364
13365 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
13366         test -n "$verbose" && echo "    found package x11" 1>&6
13367
13368 echo "${as_me:-configure}:13368: testing found package x11 ..." 1>&5
13369
13370         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
13371         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
13372         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
13373
13374 echo "${as_me:-configure}:13374: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13375
13376         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
13377
13378 echo "${as_me:-configure}:13378: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
13379
13380 cf_fix_cppflags=no
13381 cf_new_cflags=
13382 cf_new_cppflags=
13383 cf_new_extra_cppflags=
13384
13385 for cf_add_cflags in $cf_pkgconfig_incs
13386 do
13387 case $cf_fix_cppflags in
13388 (no)
13389         case $cf_add_cflags in
13390         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13391                 case $cf_add_cflags in
13392                 (-D*)
13393                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13394
13395                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13396                                 && test -z "${cf_tst_cflags}" \
13397                                 && cf_fix_cppflags=yes
13398
13399                         if test $cf_fix_cppflags = yes ; then
13400
13401         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13402         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13403
13404                                 continue
13405                         elif test "${cf_tst_cflags}" = "\"'" ; then
13406
13407         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13408         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13409
13410                                 continue
13411                         fi
13412                         ;;
13413                 esac
13414                 case "$CPPFLAGS" in
13415                 (*$cf_add_cflags)
13416                         ;;
13417                 (*)
13418                         case $cf_add_cflags in
13419                         (-D*)
13420                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13421
13422 CPPFLAGS=`echo "$CPPFLAGS" | \
13423         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13424                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13425
13426                                 ;;
13427                         esac
13428
13429         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13430         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13431
13432                         ;;
13433                 esac
13434                 ;;
13435         (*)
13436
13437         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13438         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13439
13440                 ;;
13441         esac
13442         ;;
13443 (yes)
13444
13445         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13446         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13447
13448         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13449
13450         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13451                 && test -z "${cf_tst_cflags}" \
13452                 && cf_fix_cppflags=no
13453         ;;
13454 esac
13455 done
13456
13457 if test -n "$cf_new_cflags" ; then
13458
13459         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13460         CFLAGS="${CFLAGS}$cf_new_cflags"
13461
13462 fi
13463
13464 if test -n "$cf_new_cppflags" ; then
13465
13466         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13467         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13468
13469 fi
13470
13471 if test -n "$cf_new_extra_cppflags" ; then
13472
13473         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13474         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13475
13476 fi
13477
13478 cf_add_libs="$cf_pkgconfig_libs"
13479 # Filter out duplicates - this happens with badly-designed ".pc" files...
13480 for cf_add_1lib in $LIBS
13481 do
13482         for cf_add_2lib in $cf_add_libs
13483         do
13484                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13485                 then
13486                         cf_add_1lib=
13487                         break
13488                 fi
13489         done
13490         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13491 done
13492 LIBS="$cf_add_libs"
13493
13494         :
13495 else
13496         cf_pkgconfig_incs=
13497         cf_pkgconfig_libs=
13498
13499 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13500
13501 echo "${as_me:-configure}:13501: testing ...before $LIBS ..." 1>&5
13502
13503 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt -lX11 %" -e 's%  % %g'`
13504 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13505
13506 echo "${as_me:-configure}:13506: testing ...after  $LIBS ..." 1>&5
13507
13508 fi
13509
13510                 fi
13511                 ;;
13512         esac
13513
13514 echo "$as_me:13514: checking for usable X Toolkit package" >&5
13515 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
13516 if test "${cf_cv_xt_ice_compat+set}" = set; then
13517   echo $ECHO_N "(cached) $ECHO_C" >&6
13518 else
13519
13520 cat >conftest.$ac_ext <<_ACEOF
13521 #line 13521 "configure"
13522 #include "confdefs.h"
13523
13524 #include <X11/Shell.h>
13525
13526 int
13527 main (void)
13528 {
13529 int num = IceConnectionNumber(0)
13530
13531   ;
13532   return 0;
13533 }
13534 _ACEOF
13535 rm -f conftest.$ac_objext conftest$ac_exeext
13536 if { (eval echo "$as_me:13536: \"$ac_link\"") >&5
13537   (eval $ac_link) 2>&5
13538   ac_status=$?
13539   echo "$as_me:13539: \$? = $ac_status" >&5
13540   (exit $ac_status); } &&
13541          { ac_try='test -s conftest$ac_exeext'
13542   { (eval echo "$as_me:13542: \"$ac_try\"") >&5
13543   (eval $ac_try) 2>&5
13544   ac_status=$?
13545   echo "$as_me:13545: \$? = $ac_status" >&5
13546   (exit $ac_status); }; }; then
13547   cf_cv_xt_ice_compat=yes
13548 else
13549   echo "$as_me: failed program was:" >&5
13550 cat conftest.$ac_ext >&5
13551 cf_cv_xt_ice_compat=no
13552 fi
13553 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13554 fi
13555 echo "$as_me:13555: result: $cf_cv_xt_ice_compat" >&5
13556 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
13557
13558         if test "$cf_cv_xt_ice_compat" = no
13559         then
13560                 # workaround for broken ".pc" files used for X Toolkit.
13561                 case "x$X_PRE_LIBS" in
13562                 (*-lICE*)
13563                         case "x$LIBS" in
13564                         (*-lICE*)
13565                                 ;;
13566                         (*)
13567                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
13568
13569 echo "${as_me:-configure}:13569: testing work around broken ICE dependency ..." 1>&5
13570
13571 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
13572         test -n "$verbose" && echo "    found package ice" 1>&6
13573
13574 echo "${as_me:-configure}:13574: testing found package ice ..." 1>&5
13575
13576         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
13577         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
13578         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
13579
13580 echo "${as_me:-configure}:13580: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13581
13582         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
13583
13584 echo "${as_me:-configure}:13584: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
13585
13586 cf_fix_cppflags=no
13587 cf_new_cflags=
13588 cf_new_cppflags=
13589 cf_new_extra_cppflags=
13590
13591 for cf_add_cflags in $cf_pkgconfig_incs
13592 do
13593 case $cf_fix_cppflags in
13594 (no)
13595         case $cf_add_cflags in
13596         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13597                 case $cf_add_cflags in
13598                 (-D*)
13599                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13600
13601                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13602                                 && test -z "${cf_tst_cflags}" \
13603                                 && cf_fix_cppflags=yes
13604
13605                         if test $cf_fix_cppflags = yes ; then
13606
13607         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13608         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13609
13610                                 continue
13611                         elif test "${cf_tst_cflags}" = "\"'" ; then
13612
13613         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13614         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13615
13616                                 continue
13617                         fi
13618                         ;;
13619                 esac
13620                 case "$CPPFLAGS" in
13621                 (*$cf_add_cflags)
13622                         ;;
13623                 (*)
13624                         case $cf_add_cflags in
13625                         (-D*)
13626                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13627
13628 CPPFLAGS=`echo "$CPPFLAGS" | \
13629         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13630                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13631
13632                                 ;;
13633                         esac
13634
13635         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13636         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13637
13638                         ;;
13639                 esac
13640                 ;;
13641         (*)
13642
13643         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13644         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13645
13646                 ;;
13647         esac
13648         ;;
13649 (yes)
13650
13651         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13652         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13653
13654         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13655
13656         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13657                 && test -z "${cf_tst_cflags}" \
13658                 && cf_fix_cppflags=no
13659         ;;
13660 esac
13661 done
13662
13663 if test -n "$cf_new_cflags" ; then
13664
13665         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13666         CFLAGS="${CFLAGS}$cf_new_cflags"
13667
13668 fi
13669
13670 if test -n "$cf_new_cppflags" ; then
13671
13672         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13673         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13674
13675 fi
13676
13677 if test -n "$cf_new_extra_cppflags" ; then
13678
13679         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13680         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13681
13682 fi
13683
13684 cf_add_libs="$cf_pkgconfig_libs"
13685 # Filter out duplicates - this happens with badly-designed ".pc" files...
13686 for cf_add_1lib in $LIBS
13687 do
13688         for cf_add_2lib in $cf_add_libs
13689         do
13690                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13691                 then
13692                         cf_add_1lib=
13693                         break
13694                 fi
13695         done
13696         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13697 done
13698 LIBS="$cf_add_libs"
13699
13700 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
13701         test -n "$verbose" && echo "    found package sm" 1>&6
13702
13703 echo "${as_me:-configure}:13703: testing found package sm ..." 1>&5
13704
13705         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
13706         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
13707         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
13708
13709 echo "${as_me:-configure}:13709: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
13710
13711         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
13712
13713 echo "${as_me:-configure}:13713: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
13714
13715 cf_fix_cppflags=no
13716 cf_new_cflags=
13717 cf_new_cppflags=
13718 cf_new_extra_cppflags=
13719
13720 for cf_add_cflags in $cf_pkgconfig_incs
13721 do
13722 case $cf_fix_cppflags in
13723 (no)
13724         case $cf_add_cflags in
13725         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13726                 case $cf_add_cflags in
13727                 (-D*)
13728                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13729
13730                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13731                                 && test -z "${cf_tst_cflags}" \
13732                                 && cf_fix_cppflags=yes
13733
13734                         if test $cf_fix_cppflags = yes ; then
13735
13736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13738
13739                                 continue
13740                         elif test "${cf_tst_cflags}" = "\"'" ; then
13741
13742         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13743         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13744
13745                                 continue
13746                         fi
13747                         ;;
13748                 esac
13749                 case "$CPPFLAGS" in
13750                 (*$cf_add_cflags)
13751                         ;;
13752                 (*)
13753                         case $cf_add_cflags in
13754                         (-D*)
13755                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13756
13757 CPPFLAGS=`echo "$CPPFLAGS" | \
13758         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13759                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13760
13761                                 ;;
13762                         esac
13763
13764         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13765         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13766
13767                         ;;
13768                 esac
13769                 ;;
13770         (*)
13771
13772         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13773         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13774
13775                 ;;
13776         esac
13777         ;;
13778 (yes)
13779
13780         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13781         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13782
13783         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13784
13785         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13786                 && test -z "${cf_tst_cflags}" \
13787                 && cf_fix_cppflags=no
13788         ;;
13789 esac
13790 done
13791
13792 if test -n "$cf_new_cflags" ; then
13793
13794         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13795         CFLAGS="${CFLAGS}$cf_new_cflags"
13796
13797 fi
13798
13799 if test -n "$cf_new_cppflags" ; then
13800
13801         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13802         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13803
13804 fi
13805
13806 if test -n "$cf_new_extra_cppflags" ; then
13807
13808         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13809         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13810
13811 fi
13812
13813 cf_add_libs="$cf_pkgconfig_libs"
13814 # Filter out duplicates - this happens with badly-designed ".pc" files...
13815 for cf_add_1lib in $LIBS
13816 do
13817         for cf_add_2lib in $cf_add_libs
13818         do
13819                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
13820                 then
13821                         cf_add_1lib=
13822                         break
13823                 fi
13824         done
13825         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
13826 done
13827 LIBS="$cf_add_libs"
13828
13829         :
13830 else
13831         cf_pkgconfig_incs=
13832         cf_pkgconfig_libs=
13833         :
13834 fi
13835
13836 else
13837         cf_pkgconfig_incs=
13838         cf_pkgconfig_libs=
13839
13840 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
13841
13842 echo "${as_me:-configure}:13842: testing ...before $LIBS ..." 1>&5
13843
13844 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s%-lXt %-lXt $X_PRE_LIBS %" -e 's%  % %g'`
13845 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
13846
13847 echo "${as_me:-configure}:13847: testing ...after  $LIBS ..." 1>&5
13848
13849 fi
13850
13851                                 ;;
13852                         esac
13853                         ;;
13854                 esac
13855         fi
13856
13857         cf_have_X_LIBS=yes
13858
13859 else
13860         cf_pkgconfig_incs=
13861         cf_pkgconfig_libs=
13862
13863         LDFLAGS="$X_LIBS $LDFLAGS"
13864
13865 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
13866
13867 echo "${as_me:-configure}:13867: testing checking additions to CFLAGS ..." 1>&5
13868
13869 cf_check_cflags="$CFLAGS"
13870 cf_check_cppflags="$CPPFLAGS"
13871
13872 cf_fix_cppflags=no
13873 cf_new_cflags=
13874 cf_new_cppflags=
13875 cf_new_extra_cppflags=
13876
13877 for cf_add_cflags in $X_CFLAGS
13878 do
13879 case $cf_fix_cppflags in
13880 (no)
13881         case $cf_add_cflags in
13882         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
13883                 case $cf_add_cflags in
13884                 (-D*)
13885                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
13886
13887                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13888                                 && test -z "${cf_tst_cflags}" \
13889                                 && cf_fix_cppflags=yes
13890
13891                         if test $cf_fix_cppflags = yes ; then
13892
13893         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13894         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13895
13896                                 continue
13897                         elif test "${cf_tst_cflags}" = "\"'" ; then
13898
13899         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13900         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13901
13902                                 continue
13903                         fi
13904                         ;;
13905                 esac
13906                 case "$CPPFLAGS" in
13907                 (*$cf_add_cflags)
13908                         ;;
13909                 (*)
13910                         case $cf_add_cflags in
13911                         (-D*)
13912                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
13913
13914 CPPFLAGS=`echo "$CPPFLAGS" | \
13915         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
13916                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
13917
13918                                 ;;
13919                         esac
13920
13921         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
13922         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
13923
13924                         ;;
13925                 esac
13926                 ;;
13927         (*)
13928
13929         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
13930         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
13931
13932                 ;;
13933         esac
13934         ;;
13935 (yes)
13936
13937         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
13938         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
13939
13940         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
13941
13942         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
13943                 && test -z "${cf_tst_cflags}" \
13944                 && cf_fix_cppflags=no
13945         ;;
13946 esac
13947 done
13948
13949 if test -n "$cf_new_cflags" ; then
13950         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
13951
13952 echo "${as_me:-configure}:13952: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
13953
13954         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
13955         CFLAGS="${CFLAGS}$cf_new_cflags"
13956
13957 fi
13958
13959 if test -n "$cf_new_cppflags" ; then
13960         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
13961
13962 echo "${as_me:-configure}:13962: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
13963
13964         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
13965         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
13966
13967 fi
13968
13969 if test -n "$cf_new_extra_cppflags" ; then
13970         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
13971
13972 echo "${as_me:-configure}:13972: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
13973
13974         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
13975         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
13976
13977 fi
13978
13979 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
13980 cat >conftest.$ac_ext <<_ACEOF
13981 #line 13981 "configure"
13982 #include "confdefs.h"
13983 #include <stdio.h>
13984 int
13985 main (void)
13986 {
13987 printf("Hello world");
13988   ;
13989   return 0;
13990 }
13991 _ACEOF
13992 rm -f conftest.$ac_objext conftest$ac_exeext
13993 if { (eval echo "$as_me:13993: \"$ac_link\"") >&5
13994   (eval $ac_link) 2>&5
13995   ac_status=$?
13996   echo "$as_me:13996: \$? = $ac_status" >&5
13997   (exit $ac_status); } &&
13998          { ac_try='test -s conftest$ac_exeext'
13999   { (eval echo "$as_me:13999: \"$ac_try\"") >&5
14000   (eval $ac_try) 2>&5
14001   ac_status=$?
14002   echo "$as_me:14002: \$? = $ac_status" >&5
14003   (exit $ac_status); }; }; then
14004   :
14005 else
14006   echo "$as_me: failed program was:" >&5
14007 cat conftest.$ac_ext >&5
14008 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14009
14010 echo "${as_me:-configure}:14010: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14011
14012          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14013                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14014
14015 echo "${as_me:-configure}:14015: testing but keeping change to \$CPPFLAGS ..." 1>&5
14016
14017          fi
14018          CFLAGS="$cf_check_flags"
14019 fi
14020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14021 fi
14022
14023         echo "$as_me:14023: checking for XOpenDisplay" >&5
14024 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
14025 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
14026   echo $ECHO_N "(cached) $ECHO_C" >&6
14027 else
14028   cat >conftest.$ac_ext <<_ACEOF
14029 #line 14029 "configure"
14030 #include "confdefs.h"
14031 /* System header to define __stub macros and hopefully few prototypes,
14032     which can conflict with char XOpenDisplay (); below.  */
14033 #include <assert.h>
14034 /* Override any gcc2 internal prototype to avoid an error.  */
14035 #ifdef __cplusplus
14036 extern "C"
14037 #endif
14038 /* We use char because int might match the return type of a gcc2
14039    builtin and then its argument prototype would still apply.  */
14040 char XOpenDisplay ();
14041 char (*f) ();
14042
14043 int
14044 main (void)
14045 {
14046 /* The GNU C library defines this for functions which it implements
14047     to always fail with ENOSYS.  Some functions are actually named
14048     something starting with __ and the normal name is an alias.  */
14049 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
14050 choke me
14051 #else
14052 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14053 #endif
14054
14055   ;
14056   return 0;
14057 }
14058 _ACEOF
14059 rm -f conftest.$ac_objext conftest$ac_exeext
14060 if { (eval echo "$as_me:14060: \"$ac_link\"") >&5
14061   (eval $ac_link) 2>&5
14062   ac_status=$?
14063   echo "$as_me:14063: \$? = $ac_status" >&5
14064   (exit $ac_status); } &&
14065          { ac_try='test -s conftest$ac_exeext'
14066   { (eval echo "$as_me:14066: \"$ac_try\"") >&5
14067   (eval $ac_try) 2>&5
14068   ac_status=$?
14069   echo "$as_me:14069: \$? = $ac_status" >&5
14070   (exit $ac_status); }; }; then
14071   ac_cv_func_XOpenDisplay=yes
14072 else
14073   echo "$as_me: failed program was:" >&5
14074 cat conftest.$ac_ext >&5
14075 ac_cv_func_XOpenDisplay=no
14076 fi
14077 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14078 fi
14079 echo "$as_me:14079: result: $ac_cv_func_XOpenDisplay" >&5
14080 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
14081 if test $ac_cv_func_XOpenDisplay = yes; then
14082   :
14083 else
14084
14085         echo "$as_me:14085: checking for XOpenDisplay in -lX11" >&5
14086 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14087 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14088   echo $ECHO_N "(cached) $ECHO_C" >&6
14089 else
14090   ac_check_lib_save_LIBS=$LIBS
14091 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14092 cat >conftest.$ac_ext <<_ACEOF
14093 #line 14093 "configure"
14094 #include "confdefs.h"
14095
14096 /* Override any gcc2 internal prototype to avoid an error.  */
14097 #ifdef __cplusplus
14098 extern "C"
14099 #endif
14100 /* We use char because int might match the return type of a gcc2
14101    builtin and then its argument prototype would still apply.  */
14102 char XOpenDisplay ();
14103 int
14104 main (void)
14105 {
14106 XOpenDisplay ();
14107   ;
14108   return 0;
14109 }
14110 _ACEOF
14111 rm -f conftest.$ac_objext conftest$ac_exeext
14112 if { (eval echo "$as_me:14112: \"$ac_link\"") >&5
14113   (eval $ac_link) 2>&5
14114   ac_status=$?
14115   echo "$as_me:14115: \$? = $ac_status" >&5
14116   (exit $ac_status); } &&
14117          { ac_try='test -s conftest$ac_exeext'
14118   { (eval echo "$as_me:14118: \"$ac_try\"") >&5
14119   (eval $ac_try) 2>&5
14120   ac_status=$?
14121   echo "$as_me:14121: \$? = $ac_status" >&5
14122   (exit $ac_status); }; }; then
14123   ac_cv_lib_X11_XOpenDisplay=yes
14124 else
14125   echo "$as_me: failed program was:" >&5
14126 cat conftest.$ac_ext >&5
14127 ac_cv_lib_X11_XOpenDisplay=no
14128 fi
14129 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14130 LIBS=$ac_check_lib_save_LIBS
14131 fi
14132 echo "$as_me:14132: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14133 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14134 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14135
14136 cf_add_libs="-lX11"
14137 # Filter out duplicates - this happens with badly-designed ".pc" files...
14138 for cf_add_1lib in $LIBS
14139 do
14140         for cf_add_2lib in $cf_add_libs
14141         do
14142                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14143                 then
14144                         cf_add_1lib=
14145                         break
14146                 fi
14147         done
14148         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14149 done
14150 LIBS="$cf_add_libs"
14151
14152 fi
14153
14154 fi
14155
14156         echo "$as_me:14156: checking for XtAppInitialize" >&5
14157 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
14158 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
14159   echo $ECHO_N "(cached) $ECHO_C" >&6
14160 else
14161   cat >conftest.$ac_ext <<_ACEOF
14162 #line 14162 "configure"
14163 #include "confdefs.h"
14164 /* System header to define __stub macros and hopefully few prototypes,
14165     which can conflict with char XtAppInitialize (); below.  */
14166 #include <assert.h>
14167 /* Override any gcc2 internal prototype to avoid an error.  */
14168 #ifdef __cplusplus
14169 extern "C"
14170 #endif
14171 /* We use char because int might match the return type of a gcc2
14172    builtin and then its argument prototype would still apply.  */
14173 char XtAppInitialize ();
14174 char (*f) ();
14175
14176 int
14177 main (void)
14178 {
14179 /* The GNU C library defines this for functions which it implements
14180     to always fail with ENOSYS.  Some functions are actually named
14181     something starting with __ and the normal name is an alias.  */
14182 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
14183 choke me
14184 #else
14185 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
14186 #endif
14187
14188   ;
14189   return 0;
14190 }
14191 _ACEOF
14192 rm -f conftest.$ac_objext conftest$ac_exeext
14193 if { (eval echo "$as_me:14193: \"$ac_link\"") >&5
14194   (eval $ac_link) 2>&5
14195   ac_status=$?
14196   echo "$as_me:14196: \$? = $ac_status" >&5
14197   (exit $ac_status); } &&
14198          { ac_try='test -s conftest$ac_exeext'
14199   { (eval echo "$as_me:14199: \"$ac_try\"") >&5
14200   (eval $ac_try) 2>&5
14201   ac_status=$?
14202   echo "$as_me:14202: \$? = $ac_status" >&5
14203   (exit $ac_status); }; }; then
14204   ac_cv_func_XtAppInitialize=yes
14205 else
14206   echo "$as_me: failed program was:" >&5
14207 cat conftest.$ac_ext >&5
14208 ac_cv_func_XtAppInitialize=no
14209 fi
14210 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14211 fi
14212 echo "$as_me:14212: result: $ac_cv_func_XtAppInitialize" >&5
14213 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
14214 if test $ac_cv_func_XtAppInitialize = yes; then
14215   :
14216 else
14217
14218         echo "$as_me:14218: checking for XtAppInitialize in -lXt" >&5
14219 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
14220 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
14221   echo $ECHO_N "(cached) $ECHO_C" >&6
14222 else
14223   ac_check_lib_save_LIBS=$LIBS
14224 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14225 cat >conftest.$ac_ext <<_ACEOF
14226 #line 14226 "configure"
14227 #include "confdefs.h"
14228
14229 /* Override any gcc2 internal prototype to avoid an error.  */
14230 #ifdef __cplusplus
14231 extern "C"
14232 #endif
14233 /* We use char because int might match the return type of a gcc2
14234    builtin and then its argument prototype would still apply.  */
14235 char XtAppInitialize ();
14236 int
14237 main (void)
14238 {
14239 XtAppInitialize ();
14240   ;
14241   return 0;
14242 }
14243 _ACEOF
14244 rm -f conftest.$ac_objext conftest$ac_exeext
14245 if { (eval echo "$as_me:14245: \"$ac_link\"") >&5
14246   (eval $ac_link) 2>&5
14247   ac_status=$?
14248   echo "$as_me:14248: \$? = $ac_status" >&5
14249   (exit $ac_status); } &&
14250          { ac_try='test -s conftest$ac_exeext'
14251   { (eval echo "$as_me:14251: \"$ac_try\"") >&5
14252   (eval $ac_try) 2>&5
14253   ac_status=$?
14254   echo "$as_me:14254: \$? = $ac_status" >&5
14255   (exit $ac_status); }; }; then
14256   ac_cv_lib_Xt_XtAppInitialize=yes
14257 else
14258   echo "$as_me: failed program was:" >&5
14259 cat conftest.$ac_ext >&5
14260 ac_cv_lib_Xt_XtAppInitialize=no
14261 fi
14262 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14263 LIBS=$ac_check_lib_save_LIBS
14264 fi
14265 echo "$as_me:14265: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
14266 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
14267 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
14268
14269 cat >>confdefs.h <<\EOF
14270 #define HAVE_LIBXT 1
14271 EOF
14272
14273                  cf_have_X_LIBS=Xt
14274                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
14275 fi
14276
14277 fi
14278
14279 fi
14280
14281 if test $cf_have_X_LIBS = no ; then
14282         { echo "$as_me:14282: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14283 test program.  You will have to check and add the proper libraries by hand
14284 to makefile." >&5
14285 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
14286 test program.  You will have to check and add the proper libraries by hand
14287 to makefile." >&2;}
14288 fi
14289
14290 cf_x_athena_root=$cf_x_athena
14291 cf_x_athena_inc=""
14292
14293 for cf_path in default \
14294         /usr/contrib/X11R6 \
14295         /usr/contrib/X11R5 \
14296         /usr/lib/X11R5 \
14297         /usr/local
14298 do
14299         if test -z "$cf_x_athena_inc" ; then
14300                 cf_save="$CPPFLAGS"
14301                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
14302                 if test $cf_path != default ; then
14303                         CPPFLAGS="$cf_save"
14304
14305         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14306         CPPFLAGS="${CPPFLAGS}-I$cf_path/include"
14307
14308                         echo "$as_me:14308: checking for $cf_test in $cf_path" >&5
14309 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
14310                 else
14311                         echo "$as_me:14311: checking for $cf_test" >&5
14312 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
14313                 fi
14314                 cat >conftest.$ac_ext <<_ACEOF
14315 #line 14315 "configure"
14316 #include "confdefs.h"
14317
14318 #include <X11/Intrinsic.h>
14319 #include <$cf_test>
14320 int
14321 main (void)
14322 {
14323
14324   ;
14325   return 0;
14326 }
14327 _ACEOF
14328 rm -f conftest.$ac_objext
14329 if { (eval echo "$as_me:14329: \"$ac_compile\"") >&5
14330   (eval $ac_compile) 2>&5
14331   ac_status=$?
14332   echo "$as_me:14332: \$? = $ac_status" >&5
14333   (exit $ac_status); } &&
14334          { ac_try='test -s conftest.$ac_objext'
14335   { (eval echo "$as_me:14335: \"$ac_try\"") >&5
14336   (eval $ac_try) 2>&5
14337   ac_status=$?
14338   echo "$as_me:14338: \$? = $ac_status" >&5
14339   (exit $ac_status); }; }; then
14340   cf_result=yes
14341 else
14342   echo "$as_me: failed program was:" >&5
14343 cat conftest.$ac_ext >&5
14344 cf_result=no
14345 fi
14346 rm -f conftest.$ac_objext conftest.$ac_ext
14347                 echo "$as_me:14347: result: $cf_result" >&5
14348 echo "${ECHO_T}$cf_result" >&6
14349                 if test "$cf_result" = yes ; then
14350                         cf_x_athena_inc=$cf_path
14351                         break
14352                 else
14353                         CPPFLAGS="$cf_save"
14354                 fi
14355         fi
14356 done
14357
14358 if test -z "$cf_x_athena_inc" ; then
14359         { echo "$as_me:14359: WARNING: Unable to successfully find Athena header files with test program" >&5
14360 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
14361 elif test "$cf_x_athena_inc" != default ; then
14362
14363         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14364         CPPFLAGS="${CPPFLAGS}-I$cf_x_athena_inc"
14365
14366 fi
14367
14368 cf_x_athena_root=$cf_x_athena
14369 cf_x_athena_lib=""
14370
14371 for cf_path in default \
14372         /usr/contrib/X11R6 \
14373         /usr/contrib/X11R5 \
14374         /usr/lib/X11R5 \
14375         /usr/local
14376 do
14377         for cf_lib in \
14378                 ${cf_x_athena_root} \
14379                 ${cf_x_athena_root}7 \
14380                 ${cf_x_athena_root}6
14381         do
14382         for cf_libs in \
14383                 "-l$cf_lib -lXmu" \
14384                 "-l$cf_lib -lXpm -lXmu" \
14385                 "-l${cf_lib}_s -lXmu_s"
14386         do
14387                 if test -z "$cf_x_athena_lib" ; then
14388                         cf_save="$LIBS"
14389                         cf_test=XawSimpleMenuAddGlobalActions
14390                         if test $cf_path != default ; then
14391
14392 cf_add_libs="-L$cf_path/lib $cf_libs"
14393 # Filter out duplicates - this happens with badly-designed ".pc" files...
14394 for cf_add_1lib in $LIBS
14395 do
14396         for cf_add_2lib in $cf_add_libs
14397         do
14398                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14399                 then
14400                         cf_add_1lib=
14401                         break
14402                 fi
14403         done
14404         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14405 done
14406 LIBS="$cf_add_libs"
14407
14408                                 echo "$as_me:14408: checking for $cf_libs in $cf_path" >&5
14409 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
14410                         else
14411
14412 cf_add_libs="$cf_libs"
14413 # Filter out duplicates - this happens with badly-designed ".pc" files...
14414 for cf_add_1lib in $LIBS
14415 do
14416         for cf_add_2lib in $cf_add_libs
14417         do
14418                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14419                 then
14420                         cf_add_1lib=
14421                         break
14422                 fi
14423         done
14424         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14425 done
14426 LIBS="$cf_add_libs"
14427
14428                                 echo "$as_me:14428: checking for $cf_test in $cf_libs" >&5
14429 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
14430                         fi
14431                         cat >conftest.$ac_ext <<_ACEOF
14432 #line 14432 "configure"
14433 #include "confdefs.h"
14434
14435 #include <X11/Intrinsic.h>
14436 #include <X11/$cf_x_athena_root/SimpleMenu.h>
14437
14438 int
14439 main (void)
14440 {
14441
14442 $cf_test((XtAppContext) 0)
14443   ;
14444   return 0;
14445 }
14446 _ACEOF
14447 rm -f conftest.$ac_objext conftest$ac_exeext
14448 if { (eval echo "$as_me:14448: \"$ac_link\"") >&5
14449   (eval $ac_link) 2>&5
14450   ac_status=$?
14451   echo "$as_me:14451: \$? = $ac_status" >&5
14452   (exit $ac_status); } &&
14453          { ac_try='test -s conftest$ac_exeext'
14454   { (eval echo "$as_me:14454: \"$ac_try\"") >&5
14455   (eval $ac_try) 2>&5
14456   ac_status=$?
14457   echo "$as_me:14457: \$? = $ac_status" >&5
14458   (exit $ac_status); }; }; then
14459   cf_result=yes
14460 else
14461   echo "$as_me: failed program was:" >&5
14462 cat conftest.$ac_ext >&5
14463 cf_result=no
14464 fi
14465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14466                         echo "$as_me:14466: result: $cf_result" >&5
14467 echo "${ECHO_T}$cf_result" >&6
14468                         if test "$cf_result" = yes ; then
14469                                 cf_x_athena_lib="$cf_libs"
14470                                 break
14471                         fi
14472                         LIBS="$cf_save"
14473                 fi
14474         done # cf_libs
14475                 test -n "$cf_x_athena_lib" && break
14476         done # cf_lib
14477 done
14478
14479 if test -z "$cf_x_athena_lib" ; then
14480         { { echo "$as_me:14480: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
14481 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
14482    { (exit 1); exit 1; }; }
14483 fi
14484
14485 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14486
14487 cat >>confdefs.h <<EOF
14488 #define $cf_x_athena_LIBS 1
14489 EOF
14490
14491 fi
14492
14493 if test -n "$ac_tool_prefix"; then
14494   for ac_prog in xcurses-config
14495   do
14496     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
14497 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
14498 echo "$as_me:14498: checking for $ac_word" >&5
14499 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14500 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
14501   echo $ECHO_N "(cached) $ECHO_C" >&6
14502 else
14503   if test -n "$XCURSES_CONFIG"; then
14504   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
14505 else
14506   ac_save_IFS=$IFS; IFS=$ac_path_separator
14507 ac_dummy="$PATH"
14508 for ac_dir in $ac_dummy; do
14509   IFS=$ac_save_IFS
14510   test -z "$ac_dir" && ac_dir=.
14511   $as_executable_p "$ac_dir/$ac_word" || continue
14512 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
14513 echo "$as_me:14513: found $ac_dir/$ac_word" >&5
14514 break
14515 done
14516
14517 fi
14518 fi
14519 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
14520 if test -n "$XCURSES_CONFIG"; then
14521   echo "$as_me:14521: result: $XCURSES_CONFIG" >&5
14522 echo "${ECHO_T}$XCURSES_CONFIG" >&6
14523 else
14524   echo "$as_me:14524: result: no" >&5
14525 echo "${ECHO_T}no" >&6
14526 fi
14527
14528     test -n "$XCURSES_CONFIG" && break
14529   done
14530 fi
14531 if test -z "$XCURSES_CONFIG"; then
14532   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
14533   for ac_prog in xcurses-config
14534 do
14535   # Extract the first word of "$ac_prog", so it can be a program name with args.
14536 set dummy $ac_prog; ac_word=$2
14537 echo "$as_me:14537: checking for $ac_word" >&5
14538 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
14539 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
14540   echo $ECHO_N "(cached) $ECHO_C" >&6
14541 else
14542   if test -n "$ac_ct_XCURSES_CONFIG"; then
14543   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
14544 else
14545   ac_save_IFS=$IFS; IFS=$ac_path_separator
14546 ac_dummy="$PATH"
14547 for ac_dir in $ac_dummy; do
14548   IFS=$ac_save_IFS
14549   test -z "$ac_dir" && ac_dir=.
14550   $as_executable_p "$ac_dir/$ac_word" || continue
14551 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
14552 echo "$as_me:14552: found $ac_dir/$ac_word" >&5
14553 break
14554 done
14555
14556 fi
14557 fi
14558 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
14559 if test -n "$ac_ct_XCURSES_CONFIG"; then
14560   echo "$as_me:14560: result: $ac_ct_XCURSES_CONFIG" >&5
14561 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
14562 else
14563   echo "$as_me:14563: result: no" >&5
14564 echo "${ECHO_T}no" >&6
14565 fi
14566
14567   test -n "$ac_ct_XCURSES_CONFIG" && break
14568 done
14569 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
14570
14571   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
14572 fi
14573
14574 if test "$XCURSES_CONFIG" != none ; then
14575
14576 cf_fix_cppflags=no
14577 cf_new_cflags=
14578 cf_new_cppflags=
14579 cf_new_extra_cppflags=
14580
14581 for cf_add_cflags in `$XCURSES_CONFIG --cflags`
14582 do
14583 case $cf_fix_cppflags in
14584 (no)
14585         case $cf_add_cflags in
14586         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14587                 case $cf_add_cflags in
14588                 (-D*)
14589                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14590
14591                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14592                                 && test -z "${cf_tst_cflags}" \
14593                                 && cf_fix_cppflags=yes
14594
14595                         if test $cf_fix_cppflags = yes ; then
14596
14597         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14598         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14599
14600                                 continue
14601                         elif test "${cf_tst_cflags}" = "\"'" ; then
14602
14603         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14604         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14605
14606                                 continue
14607                         fi
14608                         ;;
14609                 esac
14610                 case "$CPPFLAGS" in
14611                 (*$cf_add_cflags)
14612                         ;;
14613                 (*)
14614                         case $cf_add_cflags in
14615                         (-D*)
14616                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14617
14618 CPPFLAGS=`echo "$CPPFLAGS" | \
14619         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14620                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14621
14622                                 ;;
14623                         esac
14624
14625         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14626         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14627
14628                         ;;
14629                 esac
14630                 ;;
14631         (*)
14632
14633         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14634         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14635
14636                 ;;
14637         esac
14638         ;;
14639 (yes)
14640
14641         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14642         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14643
14644         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14645
14646         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14647                 && test -z "${cf_tst_cflags}" \
14648                 && cf_fix_cppflags=no
14649         ;;
14650 esac
14651 done
14652
14653 if test -n "$cf_new_cflags" ; then
14654
14655         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14656         CFLAGS="${CFLAGS}$cf_new_cflags"
14657
14658 fi
14659
14660 if test -n "$cf_new_cppflags" ; then
14661
14662         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14663         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14664
14665 fi
14666
14667 if test -n "$cf_new_extra_cppflags" ; then
14668
14669         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14670         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14671
14672 fi
14673
14674 cf_add_libs="`$XCURSES_CONFIG --libs`"
14675 # Filter out duplicates - this happens with badly-designed ".pc" files...
14676 for cf_add_1lib in $LIBS
14677 do
14678         for cf_add_2lib in $cf_add_libs
14679         do
14680                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14681                 then
14682                         cf_add_1lib=
14683                         break
14684                 fi
14685         done
14686         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14687 done
14688 LIBS="$cf_add_libs"
14689
14690 cf_cv_lib_XCurses=yes
14691
14692 else
14693
14694 LDFLAGS="$LDFLAGS $X_LIBS"
14695
14696 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
14697
14698 echo "${as_me:-configure}:14698: testing checking additions to CFLAGS ..." 1>&5
14699
14700 cf_check_cflags="$CFLAGS"
14701 cf_check_cppflags="$CPPFLAGS"
14702
14703 cf_fix_cppflags=no
14704 cf_new_cflags=
14705 cf_new_cppflags=
14706 cf_new_extra_cppflags=
14707
14708 for cf_add_cflags in $X_CFLAGS
14709 do
14710 case $cf_fix_cppflags in
14711 (no)
14712         case $cf_add_cflags in
14713         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
14714                 case $cf_add_cflags in
14715                 (-D*)
14716                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
14717
14718                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14719                                 && test -z "${cf_tst_cflags}" \
14720                                 && cf_fix_cppflags=yes
14721
14722                         if test $cf_fix_cppflags = yes ; then
14723
14724         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14725         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14726
14727                                 continue
14728                         elif test "${cf_tst_cflags}" = "\"'" ; then
14729
14730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14732
14733                                 continue
14734                         fi
14735                         ;;
14736                 esac
14737                 case "$CPPFLAGS" in
14738                 (*$cf_add_cflags)
14739                         ;;
14740                 (*)
14741                         case $cf_add_cflags in
14742                         (-D*)
14743                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
14744
14745 CPPFLAGS=`echo "$CPPFLAGS" | \
14746         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
14747                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
14748
14749                                 ;;
14750                         esac
14751
14752         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
14753         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
14754
14755                         ;;
14756                 esac
14757                 ;;
14758         (*)
14759
14760         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
14761         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
14762
14763                 ;;
14764         esac
14765         ;;
14766 (yes)
14767
14768         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
14769         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
14770
14771         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
14772
14773         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
14774                 && test -z "${cf_tst_cflags}" \
14775                 && cf_fix_cppflags=no
14776         ;;
14777 esac
14778 done
14779
14780 if test -n "$cf_new_cflags" ; then
14781         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
14782
14783 echo "${as_me:-configure}:14783: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
14784
14785         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
14786         CFLAGS="${CFLAGS}$cf_new_cflags"
14787
14788 fi
14789
14790 if test -n "$cf_new_cppflags" ; then
14791         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
14792
14793 echo "${as_me:-configure}:14793: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
14794
14795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
14796         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
14797
14798 fi
14799
14800 if test -n "$cf_new_extra_cppflags" ; then
14801         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
14802
14803 echo "${as_me:-configure}:14803: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
14804
14805         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
14806         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
14807
14808 fi
14809
14810 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
14811 cat >conftest.$ac_ext <<_ACEOF
14812 #line 14812 "configure"
14813 #include "confdefs.h"
14814 #include <stdio.h>
14815 int
14816 main (void)
14817 {
14818 printf("Hello world");
14819   ;
14820   return 0;
14821 }
14822 _ACEOF
14823 rm -f conftest.$ac_objext conftest$ac_exeext
14824 if { (eval echo "$as_me:14824: \"$ac_link\"") >&5
14825   (eval $ac_link) 2>&5
14826   ac_status=$?
14827   echo "$as_me:14827: \$? = $ac_status" >&5
14828   (exit $ac_status); } &&
14829          { ac_try='test -s conftest$ac_exeext'
14830   { (eval echo "$as_me:14830: \"$ac_try\"") >&5
14831   (eval $ac_try) 2>&5
14832   ac_status=$?
14833   echo "$as_me:14833: \$? = $ac_status" >&5
14834   (exit $ac_status); }; }; then
14835   :
14836 else
14837   echo "$as_me: failed program was:" >&5
14838 cat conftest.$ac_ext >&5
14839 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
14840
14841 echo "${as_me:-configure}:14841: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
14842
14843          if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
14844                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
14845
14846 echo "${as_me:-configure}:14846: testing but keeping change to \$CPPFLAGS ..." 1>&5
14847
14848          fi
14849          CFLAGS="$cf_check_flags"
14850 fi
14851 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14852 fi
14853
14854 echo "$as_me:14854: checking for XOpenDisplay in -lX11" >&5
14855 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
14856 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
14857   echo $ECHO_N "(cached) $ECHO_C" >&6
14858 else
14859   ac_check_lib_save_LIBS=$LIBS
14860 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
14861 cat >conftest.$ac_ext <<_ACEOF
14862 #line 14862 "configure"
14863 #include "confdefs.h"
14864
14865 /* Override any gcc2 internal prototype to avoid an error.  */
14866 #ifdef __cplusplus
14867 extern "C"
14868 #endif
14869 /* We use char because int might match the return type of a gcc2
14870    builtin and then its argument prototype would still apply.  */
14871 char XOpenDisplay ();
14872 int
14873 main (void)
14874 {
14875 XOpenDisplay ();
14876   ;
14877   return 0;
14878 }
14879 _ACEOF
14880 rm -f conftest.$ac_objext conftest$ac_exeext
14881 if { (eval echo "$as_me:14881: \"$ac_link\"") >&5
14882   (eval $ac_link) 2>&5
14883   ac_status=$?
14884   echo "$as_me:14884: \$? = $ac_status" >&5
14885   (exit $ac_status); } &&
14886          { ac_try='test -s conftest$ac_exeext'
14887   { (eval echo "$as_me:14887: \"$ac_try\"") >&5
14888   (eval $ac_try) 2>&5
14889   ac_status=$?
14890   echo "$as_me:14890: \$? = $ac_status" >&5
14891   (exit $ac_status); }; }; then
14892   ac_cv_lib_X11_XOpenDisplay=yes
14893 else
14894   echo "$as_me: failed program was:" >&5
14895 cat conftest.$ac_ext >&5
14896 ac_cv_lib_X11_XOpenDisplay=no
14897 fi
14898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14899 LIBS=$ac_check_lib_save_LIBS
14900 fi
14901 echo "$as_me:14901: result: $ac_cv_lib_X11_XOpenDisplay" >&5
14902 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
14903 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
14904
14905 cf_add_libs="-lX11"
14906 # Filter out duplicates - this happens with badly-designed ".pc" files...
14907 for cf_add_1lib in $LIBS
14908 do
14909         for cf_add_2lib in $cf_add_libs
14910         do
14911                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14912                 then
14913                         cf_add_1lib=
14914                         break
14915                 fi
14916         done
14917         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14918 done
14919 LIBS="$cf_add_libs"
14920
14921 fi
14922
14923 echo "$as_me:14923: checking for XCurses library" >&5
14924 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
14925 if test "${cf_cv_lib_XCurses+set}" = set; then
14926   echo $ECHO_N "(cached) $ECHO_C" >&6
14927 else
14928
14929 cf_add_libs="-lXCurses"
14930 # Filter out duplicates - this happens with badly-designed ".pc" files...
14931 for cf_add_1lib in $LIBS
14932 do
14933         for cf_add_2lib in $cf_add_libs
14934         do
14935                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
14936                 then
14937                         cf_add_1lib=
14938                         break
14939                 fi
14940         done
14941         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
14942 done
14943 LIBS="$cf_add_libs"
14944
14945 cat >conftest.$ac_ext <<_ACEOF
14946 #line 14946 "configure"
14947 #include "confdefs.h"
14948
14949 #include <xcurses.h>
14950 char *XCursesProgramName = "test";
14951
14952 int
14953 main (void)
14954 {
14955 XCursesExit();
14956   ;
14957   return 0;
14958 }
14959 _ACEOF
14960 rm -f conftest.$ac_objext conftest$ac_exeext
14961 if { (eval echo "$as_me:14961: \"$ac_link\"") >&5
14962   (eval $ac_link) 2>&5
14963   ac_status=$?
14964   echo "$as_me:14964: \$? = $ac_status" >&5
14965   (exit $ac_status); } &&
14966          { ac_try='test -s conftest$ac_exeext'
14967   { (eval echo "$as_me:14967: \"$ac_try\"") >&5
14968   (eval $ac_try) 2>&5
14969   ac_status=$?
14970   echo "$as_me:14970: \$? = $ac_status" >&5
14971   (exit $ac_status); }; }; then
14972   cf_cv_lib_XCurses=yes
14973 else
14974   echo "$as_me: failed program was:" >&5
14975 cat conftest.$ac_ext >&5
14976 cf_cv_lib_XCurses=no
14977 fi
14978 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14979
14980 fi
14981 echo "$as_me:14981: result: $cf_cv_lib_XCurses" >&5
14982 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
14983
14984 fi
14985
14986 if test $cf_cv_lib_XCurses = yes ; then
14987
14988 cat >>confdefs.h <<\EOF
14989 #define UNIX 1
14990 EOF
14991
14992 cat >>confdefs.h <<\EOF
14993 #define XCURSES 1
14994 EOF
14995
14996         echo "$as_me:14996: checking for xcurses.h" >&5
14997 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
14998 if test "${ac_cv_header_xcurses_h+set}" = set; then
14999   echo $ECHO_N "(cached) $ECHO_C" >&6
15000 else
15001   cat >conftest.$ac_ext <<_ACEOF
15002 #line 15002 "configure"
15003 #include "confdefs.h"
15004 #include <xcurses.h>
15005 _ACEOF
15006 if { (eval echo "$as_me:15006: \"$ac_cpp conftest.$ac_ext\"") >&5
15007   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
15008   ac_status=$?
15009   egrep -v '^ *\+' conftest.er1 >conftest.err
15010   rm -f conftest.er1
15011   cat conftest.err >&5
15012   echo "$as_me:15012: \$? = $ac_status" >&5
15013   (exit $ac_status); } >/dev/null; then
15014   if test -s conftest.err; then
15015     ac_cpp_err=$ac_c_preproc_warn_flag
15016   else
15017     ac_cpp_err=
15018   fi
15019 else
15020   ac_cpp_err=yes
15021 fi
15022 if test -z "$ac_cpp_err"; then
15023   ac_cv_header_xcurses_h=yes
15024 else
15025   echo "$as_me: failed program was:" >&5
15026   cat conftest.$ac_ext >&5
15027   ac_cv_header_xcurses_h=no
15028 fi
15029 rm -f conftest.err conftest.$ac_ext
15030 fi
15031 echo "$as_me:15031: result: $ac_cv_header_xcurses_h" >&5
15032 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
15033 if test $ac_cv_header_xcurses_h = yes; then
15034
15035 cat >>confdefs.h <<\EOF
15036 #define HAVE_XCURSES 1
15037 EOF
15038
15039 fi
15040
15041 else
15042         { { echo "$as_me:15042: error: Cannot link with XCurses" >&5
15043 echo "$as_me: error: Cannot link with XCurses" >&2;}
15044    { (exit 1); exit 1; }; }
15045 fi
15046
15047         ;;
15048 (*)
15049         { { echo "$as_me:15049: error: unexpected screen-value: $cf_cv_screen" >&5
15050 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;}
15051    { (exit 1); exit 1; }; }
15052         ;;
15053 esac
15054
15055 : ${cf_nculib_root:=$cf_cv_screen}
15056 as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh`
15057 echo "$as_me:15057: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5
15058 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6
15059 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15060   echo $ECHO_N "(cached) $ECHO_C" >&6
15061 else
15062   ac_check_lib_save_LIBS=$LIBS
15063 LIBS="-l$cf_nculib_root  $LIBS"
15064 cat >conftest.$ac_ext <<_ACEOF
15065 #line 15065 "configure"
15066 #include "confdefs.h"
15067
15068 /* Override any gcc2 internal prototype to avoid an error.  */
15069 #ifdef __cplusplus
15070 extern "C"
15071 #endif
15072 /* We use char because int might match the return type of a gcc2
15073    builtin and then its argument prototype would still apply.  */
15074 char _nc_init_pthreads ();
15075 int
15076 main (void)
15077 {
15078 _nc_init_pthreads ();
15079   ;
15080   return 0;
15081 }
15082 _ACEOF
15083 rm -f conftest.$ac_objext conftest$ac_exeext
15084 if { (eval echo "$as_me:15084: \"$ac_link\"") >&5
15085   (eval $ac_link) 2>&5
15086   ac_status=$?
15087   echo "$as_me:15087: \$? = $ac_status" >&5
15088   (exit $ac_status); } &&
15089          { ac_try='test -s conftest$ac_exeext'
15090   { (eval echo "$as_me:15090: \"$ac_try\"") >&5
15091   (eval $ac_try) 2>&5
15092   ac_status=$?
15093   echo "$as_me:15093: \$? = $ac_status" >&5
15094   (exit $ac_status); }; }; then
15095   eval "$as_ac_Lib=yes"
15096 else
15097   echo "$as_me: failed program was:" >&5
15098 cat conftest.$ac_ext >&5
15099 eval "$as_ac_Lib=no"
15100 fi
15101 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15102 LIBS=$ac_check_lib_save_LIBS
15103 fi
15104 echo "$as_me:15104: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15105 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15106 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15107   cf_cv_ncurses_pthreads=yes
15108 else
15109   cf_cv_ncurses_pthreads=no
15110 fi
15111
15112 if test "$cf_cv_ncurses_pthreads" = yes
15113 then
15114
15115 cf_add_libs="-lpthread"
15116 # Filter out duplicates - this happens with badly-designed ".pc" files...
15117 for cf_add_1lib in $LIBS
15118 do
15119         for cf_add_2lib in $cf_add_libs
15120         do
15121                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15122                 then
15123                         cf_add_1lib=
15124                         break
15125                 fi
15126         done
15127         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15128 done
15129 LIBS="$cf_add_libs"
15130
15131 fi
15132
15133 case $cf_cv_screen in
15134 (ncurses*)
15135         cf_cv_libtype=`echo "$cf_cv_screen" | sed -e 's/^ncurses//'`
15136         ;;
15137 esac
15138
15139 echo "$as_me:15139: checking for X11 rgb file" >&5
15140 echo $ECHO_N "checking for X11 rgb file... $ECHO_C" >&6
15141
15142 # Check whether --with-x11-rgb or --without-x11-rgb was given.
15143 if test "${with_x11_rgb+set}" = set; then
15144   withval="$with_x11_rgb"
15145   RGB_PATH=$withval
15146 else
15147   RGB_PATH=auto
15148 fi;
15149
15150 if test "x$RGB_PATH" = xauto
15151 then
15152         RGB_PATH='${exec_prefix}/lib/X11/rgb.txt'
15153         for cf_path in \
15154                 /opt/local/share/X11/rgb.txt \
15155                 /opt/X11/share/X11/rgb.txt \
15156                 /usr/share/X11/rgb.txt \
15157                 /usr/X11/share/X11/rgb.txt \
15158                 /usr/X11/lib/X11/rgb.txt \
15159                 /usr/lib/X11/rgb.txt \
15160                 /etc/X11/rgb.txt \
15161                 /usr/pkg/lib/X11/rgb.txt \
15162                 /usr/X11R7/lib/X11/rgb.txt \
15163                 /usr/X11R6/lib/X11/rgb.txt \
15164                 /usr/X11R5/lib/X11/rgb.txt \
15165                 /usr/X11R4/lib/X11/rgb.txt \
15166                 /usr/local/lib/X11/rgb.txt \
15167                 /usr/local/share/X11/rgb.txt \
15168                 /usr/lib64/X11/rgb.txt
15169         do
15170                 if test -f "$cf_path" ; then
15171                         RGB_PATH="$cf_path"
15172                         break
15173                 fi
15174         done
15175 else
15176         cf_path=$RGB_PATH
15177
15178 if test "x$prefix" != xNONE; then
15179         cf_path_syntax="$prefix"
15180 else
15181         cf_path_syntax="$ac_default_prefix"
15182 fi
15183
15184 case ".$cf_path" in
15185 (.\$\(*\)*|.\'*\'*)
15186         ;;
15187 (..|./*|.\\*)
15188         ;;
15189 (.[a-zA-Z]:[\\/]*) # OS/2 EMX
15190         ;;
15191 (.\${*prefix}*|.\${*dir}*)
15192         eval cf_path="$cf_path"
15193         case ".$cf_path" in
15194         (.NONE/*)
15195                 cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15196                 ;;
15197         esac
15198         ;;
15199 (.no|.NONE/*)
15200         cf_path=`echo $cf_path | sed -e s%NONE%$cf_path_syntax%`
15201         ;;
15202 (*)
15203         { { echo "$as_me:15203: error: expected a pathname, not \"$cf_path\"" >&5
15204 echo "$as_me: error: expected a pathname, not \"$cf_path\"" >&2;}
15205    { (exit 1); exit 1; }; }
15206         ;;
15207 esac
15208
15209 fi
15210
15211 echo "$as_me:15211: result: $RGB_PATH" >&5
15212 echo "${ECHO_T}$RGB_PATH" >&6
15213
15214 cat >>confdefs.h <<EOF
15215 #define RGB_PATH "$cf_path"
15216 EOF
15217
15218 no_x11_rgb=
15219 if test "$RGB_PATH" = no
15220 then
15221         no_x11_rgb="#"
15222 fi
15223
15224 cf_curses_headers=
15225
15226 case $cf_cv_screen in
15227 (pdcurses)
15228         cf_default_panel=no
15229         cf_default_form=no
15230         cf_default_menu=no
15231         cf_default_tinfo=no
15232         ;;
15233 (xcurses|bsdcurses)
15234         cf_default_panel=no
15235         cf_default_form=no
15236         cf_default_menu=no
15237         cf_default_tinfo=yes
15238         ;;
15239 (*)
15240         cf_default_panel=yes
15241         cf_default_form=yes
15242         cf_default_menu=yes
15243         cf_default_tinfo=yes
15244         case $cf_cv_screen in
15245         (ncurses*)
15246                 cf_curses_headers="nc_alloc.h nomacros.h term_entry.h"
15247                 ;;
15248         esac
15249         ;;
15250 esac
15251
15252 echo "$as_me:15252: checking if you want to check for panel functions" >&5
15253 echo $ECHO_N "checking if you want to check for panel functions... $ECHO_C" >&6
15254
15255 # Check whether --enable-panel or --disable-panel was given.
15256 if test "${enable_panel+set}" = set; then
15257   enableval="$enable_panel"
15258   test "$enableval" != no && enableval=yes
15259         if test "$enableval" != "yes" ; then
15260     cf_enable_panel=no
15261         else
15262                 cf_enable_panel=$cf_default_panel
15263         fi
15264 else
15265   enableval=yes
15266         cf_enable_panel=$cf_default_panel
15267
15268 fi;
15269 echo "$as_me:15269: result: $cf_enable_panel" >&5
15270 echo "${ECHO_T}$cf_enable_panel" >&6
15271 if test $cf_enable_panel = yes
15272 then
15273
15274 cf_have_curses_lib=no
15275
15276 : ${NCURSES_CONFIG_PKG:=none}
15277 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15278         :
15279 elif test "x${PKG_CONFIG:=none}" != xnone; then
15280         echo "$as_me:15280: checking pkg-config for panel$cf_cv_libtype" >&5
15281 echo $ECHO_N "checking pkg-config for panel$cf_cv_libtype... $ECHO_C" >&6
15282         if "$PKG_CONFIG" --exists panel$cf_cv_libtype ; then
15283                 echo "$as_me:15283: result: yes" >&5
15284 echo "${ECHO_T}yes" >&6
15285
15286                 echo "$as_me:15286: checking if the panel$cf_cv_libtype package files work" >&5
15287 echo $ECHO_N "checking if the panel$cf_cv_libtype package files work... $ECHO_C" >&6
15288
15289                 cf_save_CPPFLAGS="$CPPFLAGS"
15290                 cf_save_LIBS="$LIBS"
15291
15292 cf_fix_cppflags=no
15293 cf_new_cflags=
15294 cf_new_cppflags=
15295 cf_new_extra_cppflags=
15296
15297 for cf_add_cflags in `$PKG_CONFIG --cflags panel$cf_cv_libtype`
15298 do
15299 case $cf_fix_cppflags in
15300 (no)
15301         case $cf_add_cflags in
15302         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15303                 case $cf_add_cflags in
15304                 (-D*)
15305                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15306
15307                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15308                                 && test -z "${cf_tst_cflags}" \
15309                                 && cf_fix_cppflags=yes
15310
15311                         if test $cf_fix_cppflags = yes ; then
15312
15313         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15314         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15315
15316                                 continue
15317                         elif test "${cf_tst_cflags}" = "\"'" ; then
15318
15319         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15320         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15321
15322                                 continue
15323                         fi
15324                         ;;
15325                 esac
15326                 case "$CPPFLAGS" in
15327                 (*$cf_add_cflags)
15328                         ;;
15329                 (*)
15330                         case $cf_add_cflags in
15331                         (-D*)
15332                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15333
15334 CPPFLAGS=`echo "$CPPFLAGS" | \
15335         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15336                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15337
15338                                 ;;
15339                         esac
15340
15341         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15342         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15343
15344                         ;;
15345                 esac
15346                 ;;
15347         (*)
15348
15349         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15350         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15351
15352                 ;;
15353         esac
15354         ;;
15355 (yes)
15356
15357         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15358         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15359
15360         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15361
15362         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15363                 && test -z "${cf_tst_cflags}" \
15364                 && cf_fix_cppflags=no
15365         ;;
15366 esac
15367 done
15368
15369 if test -n "$cf_new_cflags" ; then
15370
15371         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15372         CFLAGS="${CFLAGS}$cf_new_cflags"
15373
15374 fi
15375
15376 if test -n "$cf_new_cppflags" ; then
15377
15378         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15379         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15380
15381 fi
15382
15383 if test -n "$cf_new_extra_cppflags" ; then
15384
15385         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15386         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15387
15388 fi
15389
15390 cf_add_libs="`$PKG_CONFIG --libs panel$cf_cv_libtype`"
15391 # Filter out duplicates - this happens with badly-designed ".pc" files...
15392 for cf_add_1lib in $LIBS
15393 do
15394         for cf_add_2lib in $cf_add_libs
15395         do
15396                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15397                 then
15398                         cf_add_1lib=
15399                         break
15400                 fi
15401         done
15402         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15403 done
15404 LIBS="$cf_add_libs"
15405
15406                 cat >conftest.$ac_ext <<_ACEOF
15407 #line 15407 "configure"
15408 #include "confdefs.h"
15409 #include <panel.h>
15410 int
15411 main (void)
15412 {
15413 (void) new_panel ( 0 );
15414   ;
15415   return 0;
15416 }
15417 _ACEOF
15418 rm -f conftest.$ac_objext conftest$ac_exeext
15419 if { (eval echo "$as_me:15419: \"$ac_link\"") >&5
15420   (eval $ac_link) 2>&5
15421   ac_status=$?
15422   echo "$as_me:15422: \$? = $ac_status" >&5
15423   (exit $ac_status); } &&
15424          { ac_try='test -s conftest$ac_exeext'
15425   { (eval echo "$as_me:15425: \"$ac_try\"") >&5
15426   (eval $ac_try) 2>&5
15427   ac_status=$?
15428   echo "$as_me:15428: \$? = $ac_status" >&5
15429   (exit $ac_status); }; }; then
15430   if test "$cross_compiling" = yes; then
15431   cf_have_curses_lib=maybe
15432 else
15433   cat >conftest.$ac_ext <<_ACEOF
15434 #line 15434 "configure"
15435 #include "confdefs.h"
15436 #include <panel.h>
15437                                 int main(void)
15438                                 { (void) new_panel ( 0 ); return 0; }
15439 _ACEOF
15440 rm -f conftest$ac_exeext
15441 if { (eval echo "$as_me:15441: \"$ac_link\"") >&5
15442   (eval $ac_link) 2>&5
15443   ac_status=$?
15444   echo "$as_me:15444: \$? = $ac_status" >&5
15445   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15446   { (eval echo "$as_me:15446: \"$ac_try\"") >&5
15447   (eval $ac_try) 2>&5
15448   ac_status=$?
15449   echo "$as_me:15449: \$? = $ac_status" >&5
15450   (exit $ac_status); }; }; then
15451   cf_have_curses_lib=yes
15452 else
15453   echo "$as_me: program exited with status $ac_status" >&5
15454 echo "$as_me: failed program was:" >&5
15455 cat conftest.$ac_ext >&5
15456 cf_have_curses_lib=no
15457 fi
15458 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15459 fi
15460 else
15461   echo "$as_me: failed program was:" >&5
15462 cat conftest.$ac_ext >&5
15463 cf_have_curses_lib=no
15464 fi
15465 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15466                 echo "$as_me:15466: result: $cf_have_curses_lib" >&5
15467 echo "${ECHO_T}$cf_have_curses_lib" >&6
15468                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15469                 if test "$cf_have_curses_lib" != "yes"
15470                 then
15471                         CPPFLAGS="$cf_save_CPPFLAGS"
15472                         LIBS="$cf_save_LIBS"
15473                 else
15474
15475 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15476
15477                         cat >>confdefs.h <<EOF
15478 #define $cf_upper 1
15479 EOF
15480
15481                 fi
15482         fi
15483 fi
15484 if test "$cf_have_curses_lib" = no; then
15485         as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
15486 echo "$as_me:15486: checking for new_panel in -lpanel$cf_cv_libtype" >&5
15487 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
15488 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15489   echo $ECHO_N "(cached) $ECHO_C" >&6
15490 else
15491   ac_check_lib_save_LIBS=$LIBS
15492 LIBS="-lpanel$cf_cv_libtype  $LIBS"
15493 cat >conftest.$ac_ext <<_ACEOF
15494 #line 15494 "configure"
15495 #include "confdefs.h"
15496
15497 /* Override any gcc2 internal prototype to avoid an error.  */
15498 #ifdef __cplusplus
15499 extern "C"
15500 #endif
15501 /* We use char because int might match the return type of a gcc2
15502    builtin and then its argument prototype would still apply.  */
15503 char new_panel ();
15504 int
15505 main (void)
15506 {
15507 new_panel ();
15508   ;
15509   return 0;
15510 }
15511 _ACEOF
15512 rm -f conftest.$ac_objext conftest$ac_exeext
15513 if { (eval echo "$as_me:15513: \"$ac_link\"") >&5
15514   (eval $ac_link) 2>&5
15515   ac_status=$?
15516   echo "$as_me:15516: \$? = $ac_status" >&5
15517   (exit $ac_status); } &&
15518          { ac_try='test -s conftest$ac_exeext'
15519   { (eval echo "$as_me:15519: \"$ac_try\"") >&5
15520   (eval $ac_try) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit $ac_status); }; }; then
15524   eval "$as_ac_Lib=yes"
15525 else
15526   echo "$as_me: failed program was:" >&5
15527 cat conftest.$ac_ext >&5
15528 eval "$as_ac_Lib=no"
15529 fi
15530 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15531 LIBS=$ac_check_lib_save_LIBS
15532 fi
15533 echo "$as_me:15533: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15534 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15535 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15536
15537 cf_upper=`echo "have_libpanel" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15538
15539 cf_add_libs="-lpanel$cf_cv_libtype"
15540 # Filter out duplicates - this happens with badly-designed ".pc" files...
15541 for cf_add_1lib in $LIBS
15542 do
15543         for cf_add_2lib in $cf_add_libs
15544         do
15545                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15546                 then
15547                         cf_add_1lib=
15548                         break
15549                 fi
15550         done
15551         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15552 done
15553 LIBS="$cf_add_libs"
15554
15555                 cat >>confdefs.h <<EOF
15556 #define $cf_upper 1
15557 EOF
15558
15559 fi
15560
15561 fi
15562
15563         cf_curses_headers="$cf_curses_headers panel.h"
15564 fi
15565
15566 echo "$as_me:15566: checking if you want to check for menu functions" >&5
15567 echo $ECHO_N "checking if you want to check for menu functions... $ECHO_C" >&6
15568
15569 # Check whether --enable-menu or --disable-menu was given.
15570 if test "${enable_menu+set}" = set; then
15571   enableval="$enable_menu"
15572   test "$enableval" != no && enableval=yes
15573         if test "$enableval" != "yes" ; then
15574     cf_enable_menu=no
15575         else
15576                 cf_enable_menu=$cf_default_menu
15577         fi
15578 else
15579   enableval=yes
15580         cf_enable_menu=$cf_default_menu
15581
15582 fi;
15583 echo "$as_me:15583: result: $cf_enable_menu" >&5
15584 echo "${ECHO_T}$cf_enable_menu" >&6
15585 if test $cf_enable_menu = yes
15586 then
15587         case $cf_cv_screen in
15588         (ncurses*)
15589                 ;;
15590         (curses*)
15591
15592 echo "$as_me:15592: checking for NetBSD menu.h" >&5
15593 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
15594 if test "${cf_cv_netbsd_menu_h+set}" = set; then
15595   echo $ECHO_N "(cached) $ECHO_C" >&6
15596 else
15597
15598 cat >conftest.$ac_ext <<_ACEOF
15599 #line 15599 "configure"
15600 #include "confdefs.h"
15601
15602 #include <${cf_cv_ncurses_header:-curses.h}>
15603 #include <menu.h>
15604
15605 int
15606 main (void)
15607 {
15608
15609         MENU *menu;
15610         int y = menu->max_item_width;
15611
15612   ;
15613   return 0;
15614 }
15615 _ACEOF
15616 rm -f conftest.$ac_objext
15617 if { (eval echo "$as_me:15617: \"$ac_compile\"") >&5
15618   (eval $ac_compile) 2>&5
15619   ac_status=$?
15620   echo "$as_me:15620: \$? = $ac_status" >&5
15621   (exit $ac_status); } &&
15622          { ac_try='test -s conftest.$ac_objext'
15623   { (eval echo "$as_me:15623: \"$ac_try\"") >&5
15624   (eval $ac_try) 2>&5
15625   ac_status=$?
15626   echo "$as_me:15626: \$? = $ac_status" >&5
15627   (exit $ac_status); }; }; then
15628   cf_cv_netbsd_menu_h=yes
15629
15630 else
15631   echo "$as_me: failed program was:" >&5
15632 cat conftest.$ac_ext >&5
15633 cf_cv_netbsd_menu_h=no
15634 fi
15635 rm -f conftest.$ac_objext conftest.$ac_ext
15636
15637 fi
15638 echo "$as_me:15638: result: $cf_cv_netbsd_menu_h" >&5
15639 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
15640
15641 test "$cf_cv_netbsd_menu_h" = yes &&
15642 cat >>confdefs.h <<\EOF
15643 #define HAVE_NETBSD_MENU_H 1
15644 EOF
15645
15646                 ;;
15647         esac
15648
15649 cf_have_curses_lib=no
15650
15651 : ${NCURSES_CONFIG_PKG:=none}
15652 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
15653         :
15654 elif test "x${PKG_CONFIG:=none}" != xnone; then
15655         echo "$as_me:15655: checking pkg-config for menu$cf_cv_libtype" >&5
15656 echo $ECHO_N "checking pkg-config for menu$cf_cv_libtype... $ECHO_C" >&6
15657         if "$PKG_CONFIG" --exists menu$cf_cv_libtype ; then
15658                 echo "$as_me:15658: result: yes" >&5
15659 echo "${ECHO_T}yes" >&6
15660
15661                 echo "$as_me:15661: checking if the menu$cf_cv_libtype package files work" >&5
15662 echo $ECHO_N "checking if the menu$cf_cv_libtype package files work... $ECHO_C" >&6
15663
15664                 cf_save_CPPFLAGS="$CPPFLAGS"
15665                 cf_save_LIBS="$LIBS"
15666
15667 cf_fix_cppflags=no
15668 cf_new_cflags=
15669 cf_new_cppflags=
15670 cf_new_extra_cppflags=
15671
15672 for cf_add_cflags in `$PKG_CONFIG --cflags menu$cf_cv_libtype`
15673 do
15674 case $cf_fix_cppflags in
15675 (no)
15676         case $cf_add_cflags in
15677         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
15678                 case $cf_add_cflags in
15679                 (-D*)
15680                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
15681
15682                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15683                                 && test -z "${cf_tst_cflags}" \
15684                                 && cf_fix_cppflags=yes
15685
15686                         if test $cf_fix_cppflags = yes ; then
15687
15688         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15689         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15690
15691                                 continue
15692                         elif test "${cf_tst_cflags}" = "\"'" ; then
15693
15694         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15695         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15696
15697                                 continue
15698                         fi
15699                         ;;
15700                 esac
15701                 case "$CPPFLAGS" in
15702                 (*$cf_add_cflags)
15703                         ;;
15704                 (*)
15705                         case $cf_add_cflags in
15706                         (-D*)
15707                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
15708
15709 CPPFLAGS=`echo "$CPPFLAGS" | \
15710         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
15711                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
15712
15713                                 ;;
15714                         esac
15715
15716         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
15717         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
15718
15719                         ;;
15720                 esac
15721                 ;;
15722         (*)
15723
15724         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
15725         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
15726
15727                 ;;
15728         esac
15729         ;;
15730 (yes)
15731
15732         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
15733         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
15734
15735         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
15736
15737         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
15738                 && test -z "${cf_tst_cflags}" \
15739                 && cf_fix_cppflags=no
15740         ;;
15741 esac
15742 done
15743
15744 if test -n "$cf_new_cflags" ; then
15745
15746         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
15747         CFLAGS="${CFLAGS}$cf_new_cflags"
15748
15749 fi
15750
15751 if test -n "$cf_new_cppflags" ; then
15752
15753         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
15754         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
15755
15756 fi
15757
15758 if test -n "$cf_new_extra_cppflags" ; then
15759
15760         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
15761         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
15762
15763 fi
15764
15765 cf_add_libs="`$PKG_CONFIG --libs menu$cf_cv_libtype`"
15766 # Filter out duplicates - this happens with badly-designed ".pc" files...
15767 for cf_add_1lib in $LIBS
15768 do
15769         for cf_add_2lib in $cf_add_libs
15770         do
15771                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15772                 then
15773                         cf_add_1lib=
15774                         break
15775                 fi
15776         done
15777         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15778 done
15779 LIBS="$cf_add_libs"
15780
15781                 cat >conftest.$ac_ext <<_ACEOF
15782 #line 15782 "configure"
15783 #include "confdefs.h"
15784 #include <menu.h>
15785 int
15786 main (void)
15787 {
15788 (void) menu_driver ( 0,0 );
15789   ;
15790   return 0;
15791 }
15792 _ACEOF
15793 rm -f conftest.$ac_objext conftest$ac_exeext
15794 if { (eval echo "$as_me:15794: \"$ac_link\"") >&5
15795   (eval $ac_link) 2>&5
15796   ac_status=$?
15797   echo "$as_me:15797: \$? = $ac_status" >&5
15798   (exit $ac_status); } &&
15799          { ac_try='test -s conftest$ac_exeext'
15800   { (eval echo "$as_me:15800: \"$ac_try\"") >&5
15801   (eval $ac_try) 2>&5
15802   ac_status=$?
15803   echo "$as_me:15803: \$? = $ac_status" >&5
15804   (exit $ac_status); }; }; then
15805   if test "$cross_compiling" = yes; then
15806   cf_have_curses_lib=maybe
15807 else
15808   cat >conftest.$ac_ext <<_ACEOF
15809 #line 15809 "configure"
15810 #include "confdefs.h"
15811 #include <menu.h>
15812                                 int main(void)
15813                                 { (void) menu_driver ( 0,0 ); return 0; }
15814 _ACEOF
15815 rm -f conftest$ac_exeext
15816 if { (eval echo "$as_me:15816: \"$ac_link\"") >&5
15817   (eval $ac_link) 2>&5
15818   ac_status=$?
15819   echo "$as_me:15819: \$? = $ac_status" >&5
15820   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15821   { (eval echo "$as_me:15821: \"$ac_try\"") >&5
15822   (eval $ac_try) 2>&5
15823   ac_status=$?
15824   echo "$as_me:15824: \$? = $ac_status" >&5
15825   (exit $ac_status); }; }; then
15826   cf_have_curses_lib=yes
15827 else
15828   echo "$as_me: program exited with status $ac_status" >&5
15829 echo "$as_me: failed program was:" >&5
15830 cat conftest.$ac_ext >&5
15831 cf_have_curses_lib=no
15832 fi
15833 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15834 fi
15835 else
15836   echo "$as_me: failed program was:" >&5
15837 cat conftest.$ac_ext >&5
15838 cf_have_curses_lib=no
15839 fi
15840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15841                 echo "$as_me:15841: result: $cf_have_curses_lib" >&5
15842 echo "${ECHO_T}$cf_have_curses_lib" >&6
15843                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
15844                 if test "$cf_have_curses_lib" != "yes"
15845                 then
15846                         CPPFLAGS="$cf_save_CPPFLAGS"
15847                         LIBS="$cf_save_LIBS"
15848                 else
15849
15850 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15851
15852                         cat >>confdefs.h <<EOF
15853 #define $cf_upper 1
15854 EOF
15855
15856                 fi
15857         fi
15858 fi
15859 if test "$cf_have_curses_lib" = no; then
15860         as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
15861 echo "$as_me:15861: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
15862 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
15863 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
15864   echo $ECHO_N "(cached) $ECHO_C" >&6
15865 else
15866   ac_check_lib_save_LIBS=$LIBS
15867 LIBS="-lmenu$cf_cv_libtype  $LIBS"
15868 cat >conftest.$ac_ext <<_ACEOF
15869 #line 15869 "configure"
15870 #include "confdefs.h"
15871
15872 /* Override any gcc2 internal prototype to avoid an error.  */
15873 #ifdef __cplusplus
15874 extern "C"
15875 #endif
15876 /* We use char because int might match the return type of a gcc2
15877    builtin and then its argument prototype would still apply.  */
15878 char menu_driver ();
15879 int
15880 main (void)
15881 {
15882 menu_driver ();
15883   ;
15884   return 0;
15885 }
15886 _ACEOF
15887 rm -f conftest.$ac_objext conftest$ac_exeext
15888 if { (eval echo "$as_me:15888: \"$ac_link\"") >&5
15889   (eval $ac_link) 2>&5
15890   ac_status=$?
15891   echo "$as_me:15891: \$? = $ac_status" >&5
15892   (exit $ac_status); } &&
15893          { ac_try='test -s conftest$ac_exeext'
15894   { (eval echo "$as_me:15894: \"$ac_try\"") >&5
15895   (eval $ac_try) 2>&5
15896   ac_status=$?
15897   echo "$as_me:15897: \$? = $ac_status" >&5
15898   (exit $ac_status); }; }; then
15899   eval "$as_ac_Lib=yes"
15900 else
15901   echo "$as_me: failed program was:" >&5
15902 cat conftest.$ac_ext >&5
15903 eval "$as_ac_Lib=no"
15904 fi
15905 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15906 LIBS=$ac_check_lib_save_LIBS
15907 fi
15908 echo "$as_me:15908: result: `eval echo '${'$as_ac_Lib'}'`" >&5
15909 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
15910 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
15911
15912 cf_upper=`echo "have_libmenu" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15913
15914 cf_add_libs="-lmenu$cf_cv_libtype"
15915 # Filter out duplicates - this happens with badly-designed ".pc" files...
15916 for cf_add_1lib in $LIBS
15917 do
15918         for cf_add_2lib in $cf_add_libs
15919         do
15920                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
15921                 then
15922                         cf_add_1lib=
15923                         break
15924                 fi
15925         done
15926         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
15927 done
15928 LIBS="$cf_add_libs"
15929
15930                 cat >>confdefs.h <<EOF
15931 #define $cf_upper 1
15932 EOF
15933
15934 fi
15935
15936 fi
15937
15938         cf_curses_headers="$cf_curses_headers menu.h"
15939 fi
15940
15941 echo "$as_me:15941: checking if you want to check for form functions" >&5
15942 echo $ECHO_N "checking if you want to check for form functions... $ECHO_C" >&6
15943
15944 # Check whether --enable-form or --disable-form was given.
15945 if test "${enable_form+set}" = set; then
15946   enableval="$enable_form"
15947   test "$enableval" != no && enableval=yes
15948         if test "$enableval" != "yes" ; then
15949     cf_enable_form=no
15950         else
15951                 cf_enable_form=$cf_default_form
15952         fi
15953 else
15954   enableval=yes
15955         cf_enable_form=$cf_default_form
15956
15957 fi;
15958 echo "$as_me:15958: result: $cf_enable_form" >&5
15959 echo "${ECHO_T}$cf_enable_form" >&6
15960 if test $cf_enable_form = yes
15961 then
15962         case $cf_cv_screen in
15963         (ncurses*)
15964                 ;;
15965         (curses*)
15966
15967 echo "$as_me:15967: checking for NetBSD form.h" >&5
15968 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
15969 if test "${cf_cv_netbsd_form_h+set}" = set; then
15970   echo $ECHO_N "(cached) $ECHO_C" >&6
15971 else
15972
15973 cat >conftest.$ac_ext <<_ACEOF
15974 #line 15974 "configure"
15975 #include "confdefs.h"
15976
15977 #include <${cf_cv_ncurses_header:-curses.h}>
15978 #include <form.h>
15979
15980 int
15981 main (void)
15982 {
15983
15984         FORM *form;
15985         int y = current_field(form)->cursor_ypos;
15986         int x = current_field(form)->cursor_xpos;
15987
15988   ;
15989   return 0;
15990 }
15991 _ACEOF
15992 rm -f conftest.$ac_objext
15993 if { (eval echo "$as_me:15993: \"$ac_compile\"") >&5
15994   (eval $ac_compile) 2>&5
15995   ac_status=$?
15996   echo "$as_me:15996: \$? = $ac_status" >&5
15997   (exit $ac_status); } &&
15998          { ac_try='test -s conftest.$ac_objext'
15999   { (eval echo "$as_me:15999: \"$ac_try\"") >&5
16000   (eval $ac_try) 2>&5
16001   ac_status=$?
16002   echo "$as_me:16002: \$? = $ac_status" >&5
16003   (exit $ac_status); }; }; then
16004   cf_cv_netbsd_form_h=yes
16005
16006 else
16007   echo "$as_me: failed program was:" >&5
16008 cat conftest.$ac_ext >&5
16009 cf_cv_netbsd_form_h=no
16010 fi
16011 rm -f conftest.$ac_objext conftest.$ac_ext
16012
16013 fi
16014 echo "$as_me:16014: result: $cf_cv_netbsd_form_h" >&5
16015 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
16016
16017 test "$cf_cv_netbsd_form_h" = yes &&
16018 cat >>confdefs.h <<\EOF
16019 #define HAVE_NETBSD_FORM_H 1
16020 EOF
16021
16022                 ;;
16023         esac
16024
16025 cf_have_curses_lib=no
16026
16027 : ${NCURSES_CONFIG_PKG:=none}
16028 if test "x${NCURSES_CONFIG_PKG}" = xnone; then
16029         :
16030 elif test "x${PKG_CONFIG:=none}" != xnone; then
16031         echo "$as_me:16031: checking pkg-config for form$cf_cv_libtype" >&5
16032 echo $ECHO_N "checking pkg-config for form$cf_cv_libtype... $ECHO_C" >&6
16033         if "$PKG_CONFIG" --exists form$cf_cv_libtype ; then
16034                 echo "$as_me:16034: result: yes" >&5
16035 echo "${ECHO_T}yes" >&6
16036
16037                 echo "$as_me:16037: checking if the form$cf_cv_libtype package files work" >&5
16038 echo $ECHO_N "checking if the form$cf_cv_libtype package files work... $ECHO_C" >&6
16039
16040                 cf_save_CPPFLAGS="$CPPFLAGS"
16041                 cf_save_LIBS="$LIBS"
16042
16043 cf_fix_cppflags=no
16044 cf_new_cflags=
16045 cf_new_cppflags=
16046 cf_new_extra_cppflags=
16047
16048 for cf_add_cflags in `$PKG_CONFIG --cflags form$cf_cv_libtype`
16049 do
16050 case $cf_fix_cppflags in
16051 (no)
16052         case $cf_add_cflags in
16053         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
16054                 case $cf_add_cflags in
16055                 (-D*)
16056                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
16057
16058                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16059                                 && test -z "${cf_tst_cflags}" \
16060                                 && cf_fix_cppflags=yes
16061
16062                         if test $cf_fix_cppflags = yes ; then
16063
16064         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16065         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16066
16067                                 continue
16068                         elif test "${cf_tst_cflags}" = "\"'" ; then
16069
16070         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16071         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16072
16073                                 continue
16074                         fi
16075                         ;;
16076                 esac
16077                 case "$CPPFLAGS" in
16078                 (*$cf_add_cflags)
16079                         ;;
16080                 (*)
16081                         case $cf_add_cflags in
16082                         (-D*)
16083                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
16084
16085 CPPFLAGS=`echo "$CPPFLAGS" | \
16086         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
16087                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
16088
16089                                 ;;
16090                         esac
16091
16092         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
16093         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
16094
16095                         ;;
16096                 esac
16097                 ;;
16098         (*)
16099
16100         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
16101         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
16102
16103                 ;;
16104         esac
16105         ;;
16106 (yes)
16107
16108         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
16109         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
16110
16111         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
16112
16113         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
16114                 && test -z "${cf_tst_cflags}" \
16115                 && cf_fix_cppflags=no
16116         ;;
16117 esac
16118 done
16119
16120 if test -n "$cf_new_cflags" ; then
16121
16122         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
16123         CFLAGS="${CFLAGS}$cf_new_cflags"
16124
16125 fi
16126
16127 if test -n "$cf_new_cppflags" ; then
16128
16129         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
16130         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
16131
16132 fi
16133
16134 if test -n "$cf_new_extra_cppflags" ; then
16135
16136         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
16137         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
16138
16139 fi
16140
16141 cf_add_libs="`$PKG_CONFIG --libs form$cf_cv_libtype`"
16142 # Filter out duplicates - this happens with badly-designed ".pc" files...
16143 for cf_add_1lib in $LIBS
16144 do
16145         for cf_add_2lib in $cf_add_libs
16146         do
16147                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16148                 then
16149                         cf_add_1lib=
16150                         break
16151                 fi
16152         done
16153         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16154 done
16155 LIBS="$cf_add_libs"
16156
16157                 cat >conftest.$ac_ext <<_ACEOF
16158 #line 16158 "configure"
16159 #include "confdefs.h"
16160 #include <form.h>
16161 int
16162 main (void)
16163 {
16164 (void) form_driver ( 0,0 );
16165   ;
16166   return 0;
16167 }
16168 _ACEOF
16169 rm -f conftest.$ac_objext conftest$ac_exeext
16170 if { (eval echo "$as_me:16170: \"$ac_link\"") >&5
16171   (eval $ac_link) 2>&5
16172   ac_status=$?
16173   echo "$as_me:16173: \$? = $ac_status" >&5
16174   (exit $ac_status); } &&
16175          { ac_try='test -s conftest$ac_exeext'
16176   { (eval echo "$as_me:16176: \"$ac_try\"") >&5
16177   (eval $ac_try) 2>&5
16178   ac_status=$?
16179   echo "$as_me:16179: \$? = $ac_status" >&5
16180   (exit $ac_status); }; }; then
16181   if test "$cross_compiling" = yes; then
16182   cf_have_curses_lib=maybe
16183 else
16184   cat >conftest.$ac_ext <<_ACEOF
16185 #line 16185 "configure"
16186 #include "confdefs.h"
16187 #include <form.h>
16188                                 int main(void)
16189                                 { (void) form_driver ( 0,0 ); return 0; }
16190 _ACEOF
16191 rm -f conftest$ac_exeext
16192 if { (eval echo "$as_me:16192: \"$ac_link\"") >&5
16193   (eval $ac_link) 2>&5
16194   ac_status=$?
16195   echo "$as_me:16195: \$? = $ac_status" >&5
16196   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16197   { (eval echo "$as_me:16197: \"$ac_try\"") >&5
16198   (eval $ac_try) 2>&5
16199   ac_status=$?
16200   echo "$as_me:16200: \$? = $ac_status" >&5
16201   (exit $ac_status); }; }; then
16202   cf_have_curses_lib=yes
16203 else
16204   echo "$as_me: program exited with status $ac_status" >&5
16205 echo "$as_me: failed program was:" >&5
16206 cat conftest.$ac_ext >&5
16207 cf_have_curses_lib=no
16208 fi
16209 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16210 fi
16211 else
16212   echo "$as_me: failed program was:" >&5
16213 cat conftest.$ac_ext >&5
16214 cf_have_curses_lib=no
16215 fi
16216 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16217                 echo "$as_me:16217: result: $cf_have_curses_lib" >&5
16218 echo "${ECHO_T}$cf_have_curses_lib" >&6
16219                 test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes
16220                 if test "$cf_have_curses_lib" != "yes"
16221                 then
16222                         CPPFLAGS="$cf_save_CPPFLAGS"
16223                         LIBS="$cf_save_LIBS"
16224                 else
16225
16226 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16227
16228                         cat >>confdefs.h <<EOF
16229 #define $cf_upper 1
16230 EOF
16231
16232                 fi
16233         fi
16234 fi
16235 if test "$cf_have_curses_lib" = no; then
16236         as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
16237 echo "$as_me:16237: checking for form_driver in -lform$cf_cv_libtype" >&5
16238 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
16239 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
16240   echo $ECHO_N "(cached) $ECHO_C" >&6
16241 else
16242   ac_check_lib_save_LIBS=$LIBS
16243 LIBS="-lform$cf_cv_libtype  $LIBS"
16244 cat >conftest.$ac_ext <<_ACEOF
16245 #line 16245 "configure"
16246 #include "confdefs.h"
16247
16248 /* Override any gcc2 internal prototype to avoid an error.  */
16249 #ifdef __cplusplus
16250 extern "C"
16251 #endif
16252 /* We use char because int might match the return type of a gcc2
16253    builtin and then its argument prototype would still apply.  */
16254 char form_driver ();
16255 int
16256 main (void)
16257 {
16258 form_driver ();
16259   ;
16260   return 0;
16261 }
16262 _ACEOF
16263 rm -f conftest.$ac_objext conftest$ac_exeext
16264 if { (eval echo "$as_me:16264: \"$ac_link\"") >&5
16265   (eval $ac_link) 2>&5
16266   ac_status=$?
16267   echo "$as_me:16267: \$? = $ac_status" >&5
16268   (exit $ac_status); } &&
16269          { ac_try='test -s conftest$ac_exeext'
16270   { (eval echo "$as_me:16270: \"$ac_try\"") >&5
16271   (eval $ac_try) 2>&5
16272   ac_status=$?
16273   echo "$as_me:16273: \$? = $ac_status" >&5
16274   (exit $ac_status); }; }; then
16275   eval "$as_ac_Lib=yes"
16276 else
16277   echo "$as_me: failed program was:" >&5
16278 cat conftest.$ac_ext >&5
16279 eval "$as_ac_Lib=no"
16280 fi
16281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16282 LIBS=$ac_check_lib_save_LIBS
16283 fi
16284 echo "$as_me:16284: result: `eval echo '${'$as_ac_Lib'}'`" >&5
16285 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
16286 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
16287
16288 cf_upper=`echo "have_libform" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16289
16290 cf_add_libs="-lform$cf_cv_libtype"
16291 # Filter out duplicates - this happens with badly-designed ".pc" files...
16292 for cf_add_1lib in $LIBS
16293 do
16294         for cf_add_2lib in $cf_add_libs
16295         do
16296                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
16297                 then
16298                         cf_add_1lib=
16299                         break
16300                 fi
16301         done
16302         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
16303 done
16304 LIBS="$cf_add_libs"
16305
16306                 cat >>confdefs.h <<EOF
16307 #define $cf_upper 1
16308 EOF
16309
16310 fi
16311
16312 fi
16313
16314         cf_curses_headers="$cf_curses_headers form.h"
16315 fi
16316
16317 # look for curses-related headers
16318
16319 for ac_header in $cf_curses_headers
16320 do
16321 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16322 echo "$as_me:16322: checking for $ac_header" >&5
16323 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16324 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16325   echo $ECHO_N "(cached) $ECHO_C" >&6
16326 else
16327   cat >conftest.$ac_ext <<_ACEOF
16328 #line 16328 "configure"
16329 #include "confdefs.h"
16330 #include <$ac_header>
16331 _ACEOF
16332 if { (eval echo "$as_me:16332: \"$ac_cpp conftest.$ac_ext\"") >&5
16333   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16334   ac_status=$?
16335   egrep -v '^ *\+' conftest.er1 >conftest.err
16336   rm -f conftest.er1
16337   cat conftest.err >&5
16338   echo "$as_me:16338: \$? = $ac_status" >&5
16339   (exit $ac_status); } >/dev/null; then
16340   if test -s conftest.err; then
16341     ac_cpp_err=$ac_c_preproc_warn_flag
16342   else
16343     ac_cpp_err=
16344   fi
16345 else
16346   ac_cpp_err=yes
16347 fi
16348 if test -z "$ac_cpp_err"; then
16349   eval "$as_ac_Header=yes"
16350 else
16351   echo "$as_me: failed program was:" >&5
16352   cat conftest.$ac_ext >&5
16353   eval "$as_ac_Header=no"
16354 fi
16355 rm -f conftest.err conftest.$ac_ext
16356 fi
16357 echo "$as_me:16357: result: `eval echo '${'$as_ac_Header'}'`" >&5
16358 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16359 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16360   cat >>confdefs.h <<EOF
16361 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16362 EOF
16363
16364 fi
16365 done
16366
16367 echo "$as_me:16367: checking for ANSI C header files" >&5
16368 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
16369 if test "${ac_cv_header_stdc+set}" = set; then
16370   echo $ECHO_N "(cached) $ECHO_C" >&6
16371 else
16372   cat >conftest.$ac_ext <<_ACEOF
16373 #line 16373 "configure"
16374 #include "confdefs.h"
16375 #include <stdlib.h>
16376 #include <stdarg.h>
16377 #include <string.h>
16378 #include <float.h>
16379
16380 _ACEOF
16381 if { (eval echo "$as_me:16381: \"$ac_cpp conftest.$ac_ext\"") >&5
16382   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16383   ac_status=$?
16384   egrep -v '^ *\+' conftest.er1 >conftest.err
16385   rm -f conftest.er1
16386   cat conftest.err >&5
16387   echo "$as_me:16387: \$? = $ac_status" >&5
16388   (exit $ac_status); } >/dev/null; then
16389   if test -s conftest.err; then
16390     ac_cpp_err=$ac_c_preproc_warn_flag
16391   else
16392     ac_cpp_err=
16393   fi
16394 else
16395   ac_cpp_err=yes
16396 fi
16397 if test -z "$ac_cpp_err"; then
16398   ac_cv_header_stdc=yes
16399 else
16400   echo "$as_me: failed program was:" >&5
16401   cat conftest.$ac_ext >&5
16402   ac_cv_header_stdc=no
16403 fi
16404 rm -f conftest.err conftest.$ac_ext
16405
16406 if test $ac_cv_header_stdc = yes; then
16407   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
16408   cat >conftest.$ac_ext <<_ACEOF
16409 #line 16409 "configure"
16410 #include "confdefs.h"
16411 #include <string.h>
16412
16413 _ACEOF
16414 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16415   egrep "memchr" >/dev/null 2>&1; then
16416   :
16417 else
16418   ac_cv_header_stdc=no
16419 fi
16420 rm -rf conftest*
16421
16422 fi
16423
16424 if test $ac_cv_header_stdc = yes; then
16425   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
16426   cat >conftest.$ac_ext <<_ACEOF
16427 #line 16427 "configure"
16428 #include "confdefs.h"
16429 #include <stdlib.h>
16430
16431 _ACEOF
16432 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
16433   egrep "free" >/dev/null 2>&1; then
16434   :
16435 else
16436   ac_cv_header_stdc=no
16437 fi
16438 rm -rf conftest*
16439
16440 fi
16441
16442 if test $ac_cv_header_stdc = yes; then
16443   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
16444   if test "$cross_compiling" = yes; then
16445   :
16446 else
16447   cat >conftest.$ac_ext <<_ACEOF
16448 #line 16448 "configure"
16449 #include "confdefs.h"
16450 #include <ctype.h>
16451 #if ((' ' & 0x0FF) == 0x020)
16452 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
16453 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
16454 #else
16455 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
16456                      || ('j' <= (c) && (c) <= 'r') \
16457                      || ('s' <= (c) && (c) <= 'z'))
16458 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
16459 #endif
16460
16461 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
16462 int
16463 main (void)
16464 {
16465   int i;
16466   for (i = 0; i < 256; i++)
16467     if (XOR (islower (i), ISLOWER (i))
16468         || toupper (i) != TOUPPER (i))
16469       $ac_main_return(2);
16470   $ac_main_return (0);
16471 }
16472 _ACEOF
16473 rm -f conftest$ac_exeext
16474 if { (eval echo "$as_me:16474: \"$ac_link\"") >&5
16475   (eval $ac_link) 2>&5
16476   ac_status=$?
16477   echo "$as_me:16477: \$? = $ac_status" >&5
16478   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16479   { (eval echo "$as_me:16479: \"$ac_try\"") >&5
16480   (eval $ac_try) 2>&5
16481   ac_status=$?
16482   echo "$as_me:16482: \$? = $ac_status" >&5
16483   (exit $ac_status); }; }; then
16484   :
16485 else
16486   echo "$as_me: program exited with status $ac_status" >&5
16487 echo "$as_me: failed program was:" >&5
16488 cat conftest.$ac_ext >&5
16489 ac_cv_header_stdc=no
16490 fi
16491 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16492 fi
16493 fi
16494 fi
16495 echo "$as_me:16495: result: $ac_cv_header_stdc" >&5
16496 echo "${ECHO_T}$ac_cv_header_stdc" >&6
16497 if test $ac_cv_header_stdc = yes; then
16498
16499 cat >>confdefs.h <<\EOF
16500 #define STDC_HEADERS 1
16501 EOF
16502
16503 fi
16504
16505 echo "$as_me:16505: checking whether time.h and sys/time.h may both be included" >&5
16506 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
16507 if test "${ac_cv_header_time+set}" = set; then
16508   echo $ECHO_N "(cached) $ECHO_C" >&6
16509 else
16510   cat >conftest.$ac_ext <<_ACEOF
16511 #line 16511 "configure"
16512 #include "confdefs.h"
16513 #include <sys/types.h>
16514 #include <sys/time.h>
16515 #include <time.h>
16516
16517 int
16518 main (void)
16519 {
16520 if ((struct tm *) 0)
16521 return 0;
16522   ;
16523   return 0;
16524 }
16525 _ACEOF
16526 rm -f conftest.$ac_objext
16527 if { (eval echo "$as_me:16527: \"$ac_compile\"") >&5
16528   (eval $ac_compile) 2>&5
16529   ac_status=$?
16530   echo "$as_me:16530: \$? = $ac_status" >&5
16531   (exit $ac_status); } &&
16532          { ac_try='test -s conftest.$ac_objext'
16533   { (eval echo "$as_me:16533: \"$ac_try\"") >&5
16534   (eval $ac_try) 2>&5
16535   ac_status=$?
16536   echo "$as_me:16536: \$? = $ac_status" >&5
16537   (exit $ac_status); }; }; then
16538   ac_cv_header_time=yes
16539 else
16540   echo "$as_me: failed program was:" >&5
16541 cat conftest.$ac_ext >&5
16542 ac_cv_header_time=no
16543 fi
16544 rm -f conftest.$ac_objext conftest.$ac_ext
16545 fi
16546 echo "$as_me:16546: result: $ac_cv_header_time" >&5
16547 echo "${ECHO_T}$ac_cv_header_time" >&6
16548 if test $ac_cv_header_time = yes; then
16549
16550 cat >>confdefs.h <<\EOF
16551 #define TIME_WITH_SYS_TIME 1
16552 EOF
16553
16554 fi
16555
16556 for ac_header in \
16557 getopt.h \
16558 locale.h \
16559 math.h \
16560 stdarg.h \
16561 stdint.h \
16562 sys/ioctl.h \
16563 sys/select.h \
16564 sys/time.h \
16565 termios.h \
16566 unistd.h \
16567
16568 do
16569 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16570 echo "$as_me:16570: checking for $ac_header" >&5
16571 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16572 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16573   echo $ECHO_N "(cached) $ECHO_C" >&6
16574 else
16575   cat >conftest.$ac_ext <<_ACEOF
16576 #line 16576 "configure"
16577 #include "confdefs.h"
16578 #include <$ac_header>
16579 _ACEOF
16580 if { (eval echo "$as_me:16580: \"$ac_cpp conftest.$ac_ext\"") >&5
16581   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16582   ac_status=$?
16583   egrep -v '^ *\+' conftest.er1 >conftest.err
16584   rm -f conftest.er1
16585   cat conftest.err >&5
16586   echo "$as_me:16586: \$? = $ac_status" >&5
16587   (exit $ac_status); } >/dev/null; then
16588   if test -s conftest.err; then
16589     ac_cpp_err=$ac_c_preproc_warn_flag
16590   else
16591     ac_cpp_err=
16592   fi
16593 else
16594   ac_cpp_err=yes
16595 fi
16596 if test -z "$ac_cpp_err"; then
16597   eval "$as_ac_Header=yes"
16598 else
16599   echo "$as_me: failed program was:" >&5
16600   cat conftest.$ac_ext >&5
16601   eval "$as_ac_Header=no"
16602 fi
16603 rm -f conftest.err conftest.$ac_ext
16604 fi
16605 echo "$as_me:16605: result: `eval echo '${'$as_ac_Header'}'`" >&5
16606 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16607 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16608   cat >>confdefs.h <<EOF
16609 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16610 EOF
16611
16612 fi
16613 done
16614
16615 for ac_header in unistd.h getopt.h
16616 do
16617 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
16618 echo "$as_me:16618: checking for $ac_header" >&5
16619 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
16620 if eval "test \"\${$as_ac_Header+set}\" = set"; then
16621   echo $ECHO_N "(cached) $ECHO_C" >&6
16622 else
16623   cat >conftest.$ac_ext <<_ACEOF
16624 #line 16624 "configure"
16625 #include "confdefs.h"
16626 #include <$ac_header>
16627 _ACEOF
16628 if { (eval echo "$as_me:16628: \"$ac_cpp conftest.$ac_ext\"") >&5
16629   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
16630   ac_status=$?
16631   egrep -v '^ *\+' conftest.er1 >conftest.err
16632   rm -f conftest.er1
16633   cat conftest.err >&5
16634   echo "$as_me:16634: \$? = $ac_status" >&5
16635   (exit $ac_status); } >/dev/null; then
16636   if test -s conftest.err; then
16637     ac_cpp_err=$ac_c_preproc_warn_flag
16638   else
16639     ac_cpp_err=
16640   fi
16641 else
16642   ac_cpp_err=yes
16643 fi
16644 if test -z "$ac_cpp_err"; then
16645   eval "$as_ac_Header=yes"
16646 else
16647   echo "$as_me: failed program was:" >&5
16648   cat conftest.$ac_ext >&5
16649   eval "$as_ac_Header=no"
16650 fi
16651 rm -f conftest.err conftest.$ac_ext
16652 fi
16653 echo "$as_me:16653: result: `eval echo '${'$as_ac_Header'}'`" >&5
16654 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
16655 if test `eval echo '${'$as_ac_Header'}'` = yes; then
16656   cat >>confdefs.h <<EOF
16657 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
16658 EOF
16659
16660 fi
16661 done
16662
16663 echo "$as_me:16663: checking for header declaring getopt variables" >&5
16664 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
16665 if test "${cf_cv_getopt_header+set}" = set; then
16666   echo $ECHO_N "(cached) $ECHO_C" >&6
16667 else
16668
16669 cf_cv_getopt_header=none
16670 for cf_header in stdio.h stdlib.h unistd.h getopt.h
16671 do
16672 cat >conftest.$ac_ext <<_ACEOF
16673 #line 16673 "configure"
16674 #include "confdefs.h"
16675
16676 #include <$cf_header>
16677 int
16678 main (void)
16679 {
16680 int x = optind; char *y = optarg
16681   ;
16682   return 0;
16683 }
16684 _ACEOF
16685 rm -f conftest.$ac_objext
16686 if { (eval echo "$as_me:16686: \"$ac_compile\"") >&5
16687   (eval $ac_compile) 2>&5
16688   ac_status=$?
16689   echo "$as_me:16689: \$? = $ac_status" >&5
16690   (exit $ac_status); } &&
16691          { ac_try='test -s conftest.$ac_objext'
16692   { (eval echo "$as_me:16692: \"$ac_try\"") >&5
16693   (eval $ac_try) 2>&5
16694   ac_status=$?
16695   echo "$as_me:16695: \$? = $ac_status" >&5
16696   (exit $ac_status); }; }; then
16697   cf_cv_getopt_header=$cf_header
16698  break
16699 else
16700   echo "$as_me: failed program was:" >&5
16701 cat conftest.$ac_ext >&5
16702 fi
16703 rm -f conftest.$ac_objext conftest.$ac_ext
16704 done
16705
16706 fi
16707 echo "$as_me:16707: result: $cf_cv_getopt_header" >&5
16708 echo "${ECHO_T}$cf_cv_getopt_header" >&6
16709 if test $cf_cv_getopt_header != none ; then
16710
16711 cat >>confdefs.h <<\EOF
16712 #define HAVE_GETOPT_HEADER 1
16713 EOF
16714
16715 fi
16716 if test $cf_cv_getopt_header = getopt.h ; then
16717
16718 cat >>confdefs.h <<\EOF
16719 #define NEED_GETOPT_H 1
16720 EOF
16721
16722 fi
16723
16724 for ac_func in \
16725 getopt \
16726 gettimeofday \
16727 tdestroy \
16728 tsearch \
16729
16730 do
16731 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16732 echo "$as_me:16732: checking for $ac_func" >&5
16733 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16734 if eval "test \"\${$as_ac_var+set}\" = set"; then
16735   echo $ECHO_N "(cached) $ECHO_C" >&6
16736 else
16737   cat >conftest.$ac_ext <<_ACEOF
16738 #line 16738 "configure"
16739 #include "confdefs.h"
16740 /* System header to define __stub macros and hopefully few prototypes,
16741     which can conflict with char $ac_func (); below.  */
16742 #include <assert.h>
16743 /* Override any gcc2 internal prototype to avoid an error.  */
16744 #ifdef __cplusplus
16745 extern "C"
16746 #endif
16747 /* We use char because int might match the return type of a gcc2
16748    builtin and then its argument prototype would still apply.  */
16749 char $ac_func ();
16750 char (*f) ();
16751
16752 int
16753 main (void)
16754 {
16755 /* The GNU C library defines this for functions which it implements
16756     to always fail with ENOSYS.  Some functions are actually named
16757     something starting with __ and the normal name is an alias.  */
16758 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16759 choke me
16760 #else
16761 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16762 #endif
16763
16764   ;
16765   return 0;
16766 }
16767 _ACEOF
16768 rm -f conftest.$ac_objext conftest$ac_exeext
16769 if { (eval echo "$as_me:16769: \"$ac_link\"") >&5
16770   (eval $ac_link) 2>&5
16771   ac_status=$?
16772   echo "$as_me:16772: \$? = $ac_status" >&5
16773   (exit $ac_status); } &&
16774          { ac_try='test -s conftest$ac_exeext'
16775   { (eval echo "$as_me:16775: \"$ac_try\"") >&5
16776   (eval $ac_try) 2>&5
16777   ac_status=$?
16778   echo "$as_me:16778: \$? = $ac_status" >&5
16779   (exit $ac_status); }; }; then
16780   eval "$as_ac_var=yes"
16781 else
16782   echo "$as_me: failed program was:" >&5
16783 cat conftest.$ac_ext >&5
16784 eval "$as_ac_var=no"
16785 fi
16786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16787 fi
16788 echo "$as_me:16788: result: `eval echo '${'$as_ac_var'}'`" >&5
16789 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16790 if test `eval echo '${'$as_ac_var'}'` = yes; then
16791   cat >>confdefs.h <<EOF
16792 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16793 EOF
16794
16795 fi
16796 done
16797
16798 # use a compile-check to work with ncurses*-config and subdirectory includes
16799 echo "$as_me:16799: checking if we can use termcap.h" >&5
16800 echo $ECHO_N "checking if we can use termcap.h... $ECHO_C" >&6
16801 if test "${cf_cv_have_termcap_h+set}" = set; then
16802   echo $ECHO_N "(cached) $ECHO_C" >&6
16803 else
16804
16805         cat >conftest.$ac_ext <<_ACEOF
16806 #line 16806 "configure"
16807 #include "confdefs.h"
16808
16809 #include <curses.h>
16810 #include <termcap.h>
16811
16812 int
16813 main (void)
16814 {
16815 return 0;
16816   ;
16817   return 0;
16818 }
16819 _ACEOF
16820 rm -f conftest.$ac_objext
16821 if { (eval echo "$as_me:16821: \"$ac_compile\"") >&5
16822   (eval $ac_compile) 2>&5
16823   ac_status=$?
16824   echo "$as_me:16824: \$? = $ac_status" >&5
16825   (exit $ac_status); } &&
16826          { ac_try='test -s conftest.$ac_objext'
16827   { (eval echo "$as_me:16827: \"$ac_try\"") >&5
16828   (eval $ac_try) 2>&5
16829   ac_status=$?
16830   echo "$as_me:16830: \$? = $ac_status" >&5
16831   (exit $ac_status); }; }; then
16832   cf_cv_have_termcap_h=yes
16833 else
16834   echo "$as_me: failed program was:" >&5
16835 cat conftest.$ac_ext >&5
16836 cf_cv_have_termcap_h=no
16837 fi
16838 rm -f conftest.$ac_objext conftest.$ac_ext
16839 fi
16840 echo "$as_me:16840: result: $cf_cv_have_termcap_h" >&5
16841 echo "${ECHO_T}$cf_cv_have_termcap_h" >&6
16842 test "x$cf_cv_have_termcap_h" = xyes && cat >>confdefs.h <<\EOF
16843 #define HAVE_TERMCAP_H 1
16844 EOF
16845
16846 if test "x$ac_cv_func_getopt" = xno; then
16847         { { echo "$as_me:16847: error: getopt is required for building programs" >&5
16848 echo "$as_me: error: getopt is required for building programs" >&2;}
16849    { (exit 1); exit 1; }; }
16850 fi
16851
16852 if test "$cf_enable_widec" = yes; then
16853
16854 for ac_func in \
16855 mblen \
16856 mbrlen \
16857 mbrtowc \
16858 mbsrtowcs \
16859 mbstowcs \
16860 mbtowc \
16861 wcsrtombs \
16862 wcstombs \
16863
16864 do
16865 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
16866 echo "$as_me:16866: checking for $ac_func" >&5
16867 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
16868 if eval "test \"\${$as_ac_var+set}\" = set"; then
16869   echo $ECHO_N "(cached) $ECHO_C" >&6
16870 else
16871   cat >conftest.$ac_ext <<_ACEOF
16872 #line 16872 "configure"
16873 #include "confdefs.h"
16874 /* System header to define __stub macros and hopefully few prototypes,
16875     which can conflict with char $ac_func (); below.  */
16876 #include <assert.h>
16877 /* Override any gcc2 internal prototype to avoid an error.  */
16878 #ifdef __cplusplus
16879 extern "C"
16880 #endif
16881 /* We use char because int might match the return type of a gcc2
16882    builtin and then its argument prototype would still apply.  */
16883 char $ac_func ();
16884 char (*f) ();
16885
16886 int
16887 main (void)
16888 {
16889 /* The GNU C library defines this for functions which it implements
16890     to always fail with ENOSYS.  Some functions are actually named
16891     something starting with __ and the normal name is an alias.  */
16892 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
16893 choke me
16894 #else
16895 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
16896 #endif
16897
16898   ;
16899   return 0;
16900 }
16901 _ACEOF
16902 rm -f conftest.$ac_objext conftest$ac_exeext
16903 if { (eval echo "$as_me:16903: \"$ac_link\"") >&5
16904   (eval $ac_link) 2>&5
16905   ac_status=$?
16906   echo "$as_me:16906: \$? = $ac_status" >&5
16907   (exit $ac_status); } &&
16908          { ac_try='test -s conftest$ac_exeext'
16909   { (eval echo "$as_me:16909: \"$ac_try\"") >&5
16910   (eval $ac_try) 2>&5
16911   ac_status=$?
16912   echo "$as_me:16912: \$? = $ac_status" >&5
16913   (exit $ac_status); }; }; then
16914   eval "$as_ac_var=yes"
16915 else
16916   echo "$as_me: failed program was:" >&5
16917 cat conftest.$ac_ext >&5
16918 eval "$as_ac_var=no"
16919 fi
16920 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16921 fi
16922 echo "$as_me:16922: result: `eval echo '${'$as_ac_var'}'`" >&5
16923 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
16924 if test `eval echo '${'$as_ac_var'}'` = yes; then
16925   cat >>confdefs.h <<EOF
16926 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
16927 EOF
16928
16929 fi
16930 done
16931
16932 fi
16933
16934 echo "$as_me:16934: checking definition to turn on extended curses functions" >&5
16935 echo $ECHO_N "checking definition to turn on extended curses functions... $ECHO_C" >&6
16936 if test "${cf_cv_need_xopen_extension+set}" = set; then
16937   echo $ECHO_N "(cached) $ECHO_C" >&6
16938 else
16939
16940 cf_cv_need_xopen_extension=unknown
16941 cat >conftest.$ac_ext <<_ACEOF
16942 #line 16942 "configure"
16943 #include "confdefs.h"
16944
16945 #include <stdlib.h>
16946 #include <${cf_cv_ncurses_header:-curses.h}>
16947 int
16948 main (void)
16949 {
16950
16951 #if defined(NCURSES_VERSION_PATCH)
16952 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
16953         make an error
16954 #endif
16955 #endif
16956 #ifdef NCURSES_VERSION
16957         cchar_t check;
16958         int check2 = curs_set((int)sizeof(check));
16959 #endif
16960         long x = winnstr(stdscr, "", 0);
16961         int x1, y1;
16962         getbegyx(stdscr, y1, x1)
16963   ;
16964   return 0;
16965 }
16966 _ACEOF
16967 rm -f conftest.$ac_objext conftest$ac_exeext
16968 if { (eval echo "$as_me:16968: \"$ac_link\"") >&5
16969   (eval $ac_link) 2>&5
16970   ac_status=$?
16971   echo "$as_me:16971: \$? = $ac_status" >&5
16972   (exit $ac_status); } &&
16973          { ac_try='test -s conftest$ac_exeext'
16974   { (eval echo "$as_me:16974: \"$ac_try\"") >&5
16975   (eval $ac_try) 2>&5
16976   ac_status=$?
16977   echo "$as_me:16977: \$? = $ac_status" >&5
16978   (exit $ac_status); }; }; then
16979   cf_cv_need_xopen_extension=none
16980 else
16981   echo "$as_me: failed program was:" >&5
16982 cat conftest.$ac_ext >&5
16983
16984         for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
16985         do
16986                 cat >conftest.$ac_ext <<_ACEOF
16987 #line 16987 "configure"
16988 #include "confdefs.h"
16989
16990 #define $cf_try_xopen_extension 1
16991 #include <stdlib.h>
16992 #include <${cf_cv_ncurses_header:-curses.h}>
16993 int
16994 main (void)
16995 {
16996
16997 #ifdef NCURSES_VERSION
16998                 cchar_t check;
16999                 int check2 = curs_set((int)sizeof(check));
17000 #endif
17001                 long x = winnstr(stdscr, "", 0);
17002                 int x1, y1;
17003                 getbegyx(stdscr, y1, x1)
17004   ;
17005   return 0;
17006 }
17007 _ACEOF
17008 rm -f conftest.$ac_objext conftest$ac_exeext
17009 if { (eval echo "$as_me:17009: \"$ac_link\"") >&5
17010   (eval $ac_link) 2>&5
17011   ac_status=$?
17012   echo "$as_me:17012: \$? = $ac_status" >&5
17013   (exit $ac_status); } &&
17014          { ac_try='test -s conftest$ac_exeext'
17015   { (eval echo "$as_me:17015: \"$ac_try\"") >&5
17016   (eval $ac_try) 2>&5
17017   ac_status=$?
17018   echo "$as_me:17018: \$? = $ac_status" >&5
17019   (exit $ac_status); }; }; then
17020   cf_cv_need_xopen_extension=$cf_try_xopen_extension; break
17021 else
17022   echo "$as_me: failed program was:" >&5
17023 cat conftest.$ac_ext >&5
17024 fi
17025 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17026         done
17027
17028 fi
17029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17030
17031 fi
17032 echo "$as_me:17032: result: $cf_cv_need_xopen_extension" >&5
17033 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
17034
17035 case $cf_cv_need_xopen_extension in
17036 (*_*)
17037
17038         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
17039         CPPFLAGS="${CPPFLAGS}-D$cf_cv_need_xopen_extension"
17040
17041         ;;
17042 esac
17043
17044 echo "$as_me:17044: checking for term.h" >&5
17045 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
17046 if test "${cf_cv_term_header+set}" = set; then
17047   echo $ECHO_N "(cached) $ECHO_C" >&6
17048 else
17049
17050 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
17051 # for <term.h> if we do not find the variant.
17052
17053 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
17054
17055 case ${cf_cv_ncurses_header:-curses.h} in
17056 (*/*)
17057         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
17058         cf_header_list="$cf_header_item $cf_header_list"
17059         ;;
17060 esac
17061
17062 for cf_header in $cf_header_list
17063 do
17064         cat >conftest.$ac_ext <<_ACEOF
17065 #line 17065 "configure"
17066 #include "confdefs.h"
17067
17068 #include <${cf_cv_ncurses_header:-curses.h}>
17069 #include <${cf_header}>
17070 int
17071 main (void)
17072 {
17073 WINDOW *x
17074   ;
17075   return 0;
17076 }
17077 _ACEOF
17078 rm -f conftest.$ac_objext
17079 if { (eval echo "$as_me:17079: \"$ac_compile\"") >&5
17080   (eval $ac_compile) 2>&5
17081   ac_status=$?
17082   echo "$as_me:17082: \$? = $ac_status" >&5
17083   (exit $ac_status); } &&
17084          { ac_try='test -s conftest.$ac_objext'
17085   { (eval echo "$as_me:17085: \"$ac_try\"") >&5
17086   (eval $ac_try) 2>&5
17087   ac_status=$?
17088   echo "$as_me:17088: \$? = $ac_status" >&5
17089   (exit $ac_status); }; }; then
17090   cf_cv_term_header=$cf_header
17091          break
17092 else
17093   echo "$as_me: failed program was:" >&5
17094 cat conftest.$ac_ext >&5
17095 cf_cv_term_header=no
17096 fi
17097 rm -f conftest.$ac_objext conftest.$ac_ext
17098 done
17099
17100 case $cf_cv_term_header in
17101 (no)
17102         # If curses is ncurses, some packagers still mess it up by trying to make
17103         # us use GNU termcap.  This handles the most common case.
17104         for cf_header in ncurses/term.h ncursesw/term.h
17105         do
17106                 cat >conftest.$ac_ext <<_ACEOF
17107 #line 17107 "configure"
17108 #include "confdefs.h"
17109
17110 #include <${cf_cv_ncurses_header:-curses.h}>
17111 #ifdef NCURSES_VERSION
17112 #include <${cf_header}>
17113 #else
17114 make an error
17115 #endif
17116 int
17117 main (void)
17118 {
17119 WINDOW *x
17120   ;
17121   return 0;
17122 }
17123 _ACEOF
17124 rm -f conftest.$ac_objext
17125 if { (eval echo "$as_me:17125: \"$ac_compile\"") >&5
17126   (eval $ac_compile) 2>&5
17127   ac_status=$?
17128   echo "$as_me:17128: \$? = $ac_status" >&5
17129   (exit $ac_status); } &&
17130          { ac_try='test -s conftest.$ac_objext'
17131   { (eval echo "$as_me:17131: \"$ac_try\"") >&5
17132   (eval $ac_try) 2>&5
17133   ac_status=$?
17134   echo "$as_me:17134: \$? = $ac_status" >&5
17135   (exit $ac_status); }; }; then
17136   cf_cv_term_header=$cf_header
17137                          break
17138 else
17139   echo "$as_me: failed program was:" >&5
17140 cat conftest.$ac_ext >&5
17141 cf_cv_term_header=no
17142 fi
17143 rm -f conftest.$ac_objext conftest.$ac_ext
17144         done
17145         ;;
17146 esac
17147
17148 fi
17149 echo "$as_me:17149: result: $cf_cv_term_header" >&5
17150 echo "${ECHO_T}$cf_cv_term_header" >&6
17151
17152 case $cf_cv_term_header in
17153 (term.h)
17154
17155 cat >>confdefs.h <<\EOF
17156 #define HAVE_TERM_H 1
17157 EOF
17158
17159         ;;
17160 (ncurses/term.h)
17161
17162 cat >>confdefs.h <<\EOF
17163 #define HAVE_NCURSES_TERM_H 1
17164 EOF
17165
17166         ;;
17167 (ncursesw/term.h)
17168
17169 cat >>confdefs.h <<\EOF
17170 #define HAVE_NCURSESW_TERM_H 1
17171 EOF
17172
17173         ;;
17174 esac
17175
17176 echo "$as_me:17176: checking for unctrl.h" >&5
17177 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
17178 if test "${cf_cv_unctrl_header+set}" = set; then
17179   echo $ECHO_N "(cached) $ECHO_C" >&6
17180 else
17181
17182 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
17183 # for <unctrl.h> if we do not find the variant.
17184
17185 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
17186
17187 case ${cf_cv_ncurses_header:-curses.h} in
17188 (*/*)
17189         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
17190         cf_header_list="$cf_header_item $cf_header_list"
17191         ;;
17192 esac
17193
17194 for cf_header in $cf_header_list
17195 do
17196         cat >conftest.$ac_ext <<_ACEOF
17197 #line 17197 "configure"
17198 #include "confdefs.h"
17199
17200 #include <${cf_cv_ncurses_header:-curses.h}>
17201 #include <${cf_header}>
17202 int
17203 main (void)
17204 {
17205 WINDOW *x
17206   ;
17207   return 0;
17208 }
17209 _ACEOF
17210 rm -f conftest.$ac_objext
17211 if { (eval echo "$as_me:17211: \"$ac_compile\"") >&5
17212   (eval $ac_compile) 2>&5
17213   ac_status=$?
17214   echo "$as_me:17214: \$? = $ac_status" >&5
17215   (exit $ac_status); } &&
17216          { ac_try='test -s conftest.$ac_objext'
17217   { (eval echo "$as_me:17217: \"$ac_try\"") >&5
17218   (eval $ac_try) 2>&5
17219   ac_status=$?
17220   echo "$as_me:17220: \$? = $ac_status" >&5
17221   (exit $ac_status); }; }; then
17222   cf_cv_unctrl_header=$cf_header
17223          break
17224 else
17225   echo "$as_me: failed program was:" >&5
17226 cat conftest.$ac_ext >&5
17227 cf_cv_unctrl_header=no
17228 fi
17229 rm -f conftest.$ac_objext conftest.$ac_ext
17230 done
17231
17232 fi
17233 echo "$as_me:17233: result: $cf_cv_unctrl_header" >&5
17234 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
17235
17236 case $cf_cv_unctrl_header in
17237 (no)
17238         { echo "$as_me:17238: WARNING: unctrl.h header not found" >&5
17239 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
17240         ;;
17241 esac
17242
17243 case $cf_cv_unctrl_header in
17244 (unctrl.h)
17245
17246 cat >>confdefs.h <<\EOF
17247 #define HAVE_UNCTRL_H 1
17248 EOF
17249
17250         ;;
17251 (ncurses/unctrl.h)
17252
17253 cat >>confdefs.h <<\EOF
17254 #define HAVE_NCURSES_UNCTRL_H 1
17255 EOF
17256
17257         ;;
17258 (ncursesw/unctrl.h)
17259
17260 cat >>confdefs.h <<\EOF
17261 #define HAVE_NCURSESW_UNCTRL_H 1
17262 EOF
17263
17264         ;;
17265 esac
17266
17267 for cf_func in \
17268 alloc_pair \
17269 assume_default_colors \
17270 chgat \
17271 color_content \
17272 color_set \
17273 copywin \
17274 delscreen \
17275 dupwin \
17276 filter \
17277 getbegx \
17278 getcurx \
17279 getmaxx \
17280 getnstr \
17281 getparx \
17282 getwin \
17283 halfdelay \
17284 init_extended_color \
17285 mvderwin \
17286 mvvline \
17287 mvwin \
17288 mvwvline \
17289 napms \
17290 newpad \
17291 putwin \
17292 reset_color_pairs \
17293 resize_term \
17294 resizeterm \
17295 restartterm \
17296 ripoffline \
17297 scr_dump \
17298 setupterm \
17299 slk_color \
17300 slk_init \
17301 termattrs \
17302 tgetent \
17303 tigetnum \
17304 tigetstr \
17305 tputs_sp \
17306 typeahead \
17307 use_default_colors \
17308 use_env \
17309 use_extended_names \
17310 use_screen \
17311 use_window \
17312 vid_puts \
17313 vidputs \
17314 vsscanf \
17315 vw_printw \
17316 wchgat \
17317 winsdelln \
17318 winsstr \
17319 wresize \
17320 wsyncdown \
17321 _tracef \
17322
17323 do
17324
17325 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17326
17327         echo "$as_me:17327: checking for ${cf_func}" >&5
17328 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17329
17330 echo "${as_me:-configure}:17330: testing ${cf_func} ..." 1>&5
17331
17332         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17333   echo $ECHO_N "(cached) $ECHO_C" >&6
17334 else
17335
17336                 eval cf_result='$ac_cv_func_'$cf_func
17337                 if test ".$cf_result" != ".no"; then
17338                         cat >conftest.$ac_ext <<_ACEOF
17339 #line 17339 "configure"
17340 #include "confdefs.h"
17341
17342 #ifdef HAVE_XCURSES
17343 #include <xcurses.h>
17344 char * XCursesProgramName = "test";
17345 #else
17346 #include <${cf_cv_ncurses_header:-curses.h}>
17347 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17348 #include <ncursesw/term.h>
17349 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17350 #include <ncurses/term.h>
17351 #elif defined(HAVE_TERM_H)
17352 #include <term.h>
17353 #endif
17354 #endif
17355
17356 int
17357 main (void)
17358 {
17359
17360 #ifndef ${cf_func}
17361 long foo = (long)(&${cf_func});
17362 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17363 if (foo + 1234L > 5678L)
17364         ${cf_cv_main_return:-return}(foo != 0);
17365 #endif
17366
17367   ;
17368   return 0;
17369 }
17370 _ACEOF
17371 rm -f conftest.$ac_objext conftest$ac_exeext
17372 if { (eval echo "$as_me:17372: \"$ac_link\"") >&5
17373   (eval $ac_link) 2>&5
17374   ac_status=$?
17375   echo "$as_me:17375: \$? = $ac_status" >&5
17376   (exit $ac_status); } &&
17377          { ac_try='test -s conftest$ac_exeext'
17378   { (eval echo "$as_me:17378: \"$ac_try\"") >&5
17379   (eval $ac_try) 2>&5
17380   ac_status=$?
17381   echo "$as_me:17381: \$? = $ac_status" >&5
17382   (exit $ac_status); }; }; then
17383   cf_result=yes
17384 else
17385   echo "$as_me: failed program was:" >&5
17386 cat conftest.$ac_ext >&5
17387 cf_result=no
17388 fi
17389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17390                 fi
17391                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17392
17393 fi
17394
17395         # use the computed/retrieved cache-value:
17396         eval 'cf_result=$cf_cv_func_'$cf_func
17397         echo "$as_me:17397: result: $cf_result" >&5
17398 echo "${ECHO_T}$cf_result" >&6
17399         if test $cf_result != no; then
17400                 cat >>confdefs.h <<EOF
17401 #define HAVE_${cf_tr_func} 1
17402 EOF
17403
17404         fi
17405 done
17406
17407 for cf_func in tputs
17408 do
17409
17410 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
17411
17412         echo "$as_me:17412: checking for ${cf_func}" >&5
17413 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
17414
17415 echo "${as_me:-configure}:17415: testing ${cf_func} ..." 1>&5
17416
17417         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
17418   echo $ECHO_N "(cached) $ECHO_C" >&6
17419 else
17420
17421                 eval cf_result='$ac_cv_func_'$cf_func
17422                 if test ".$cf_result" != ".no"; then
17423                         cat >conftest.$ac_ext <<_ACEOF
17424 #line 17424 "configure"
17425 #include "confdefs.h"
17426
17427 #ifdef HAVE_XCURSES
17428 #include <xcurses.h>
17429 char * XCursesProgramName = "test";
17430 #else
17431 #include <${cf_cv_ncurses_header:-curses.h}>
17432 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
17433 #include <ncursesw/term.h>
17434 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
17435 #include <ncurses/term.h>
17436 #elif defined(HAVE_TERM_H)
17437 #include <term.h>
17438 #endif
17439 #endif
17440
17441 int
17442 main (void)
17443 {
17444
17445 #ifndef ${cf_func}
17446 long foo = (long)(&${cf_func});
17447 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
17448 if (foo + 1234L > 5678L)
17449         ${cf_cv_main_return:-return}(foo != 0);
17450 #endif
17451
17452   ;
17453   return 0;
17454 }
17455 _ACEOF
17456 rm -f conftest.$ac_objext conftest$ac_exeext
17457 if { (eval echo "$as_me:17457: \"$ac_link\"") >&5
17458   (eval $ac_link) 2>&5
17459   ac_status=$?
17460   echo "$as_me:17460: \$? = $ac_status" >&5
17461   (exit $ac_status); } &&
17462          { ac_try='test -s conftest$ac_exeext'
17463   { (eval echo "$as_me:17463: \"$ac_try\"") >&5
17464   (eval $ac_try) 2>&5
17465   ac_status=$?
17466   echo "$as_me:17466: \$? = $ac_status" >&5
17467   (exit $ac_status); }; }; then
17468   cf_result=yes
17469 else
17470   echo "$as_me: failed program was:" >&5
17471 cat conftest.$ac_ext >&5
17472 cf_result=no
17473 fi
17474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17475                 fi
17476                 eval 'cf_cv_func_'$cf_func'=$cf_result'
17477
17478 fi
17479
17480         # use the computed/retrieved cache-value:
17481         eval 'cf_result=$cf_cv_func_'$cf_func
17482         echo "$as_me:17482: result: $cf_result" >&5
17483 echo "${ECHO_T}$cf_result" >&6
17484         if test $cf_result != no; then
17485                 cat >>confdefs.h <<EOF
17486 #define HAVE_${cf_tr_func} 1
17487 EOF
17488
17489         fi
17490 done
17491
17492 if test x$cf_cv_func_tputs = xyes
17493 then
17494         cf_done=no
17495         for cf_arg in int char
17496         do
17497                 for cf_ret in int void
17498                 do
17499                         if test $cf_ret = void
17500                         then
17501                                 cf_return="/* nothing */"
17502                         else
17503                                 cf_return="return value"
17504                         fi
17505                         cat >conftest.$ac_ext <<_ACEOF
17506 #line 17506 "configure"
17507 #include "confdefs.h"
17508
17509 #include <${cf_cv_ncurses_header:-curses.h}>
17510 #include <$cf_cv_term_header>
17511
17512 static $cf_ret outc($cf_arg value) { $cf_return; }
17513
17514 int
17515 main (void)
17516 {
17517
17518         tputs("hello", 0, outc);
17519         ${cf_cv_main_return:-return}(0);
17520
17521   ;
17522   return 0;
17523 }
17524 _ACEOF
17525 rm -f conftest.$ac_objext
17526 if { (eval echo "$as_me:17526: \"$ac_compile\"") >&5
17527   (eval $ac_compile) 2>&5
17528   ac_status=$?
17529   echo "$as_me:17529: \$? = $ac_status" >&5
17530   (exit $ac_status); } &&
17531          { ac_try='test -s conftest.$ac_objext'
17532   { (eval echo "$as_me:17532: \"$ac_try\"") >&5
17533   (eval $ac_try) 2>&5
17534   ac_status=$?
17535   echo "$as_me:17535: \$? = $ac_status" >&5
17536   (exit $ac_status); }; }; then
17537
17538                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
17539
17540 echo "${as_me:-configure}:17540: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
17541
17542                 cat >>confdefs.h <<EOF
17543 #define TPUTS_ARG               $cf_arg
17544 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
17545 #define TPUTS_RETURN(value)     $cf_return
17546 EOF
17547                 cf_done=yes
17548                 break
17549
17550 else
17551   echo "$as_me: failed program was:" >&5
17552 cat conftest.$ac_ext >&5
17553 fi
17554 rm -f conftest.$ac_objext conftest.$ac_ext
17555                 done
17556                 test $cf_done = yes && break
17557         done
17558 fi
17559
17560 echo "$as_me:17560: checking for ncurses extended functions" >&5
17561 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
17562 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
17563   echo $ECHO_N "(cached) $ECHO_C" >&6
17564 else
17565
17566 cat >conftest.$ac_ext <<_ACEOF
17567 #line 17567 "configure"
17568 #include "confdefs.h"
17569
17570 #include <${cf_cv_ncurses_header:-curses.h}>
17571 int
17572 main (void)
17573 {
17574
17575 int x = NCURSES_EXT_FUNCS
17576
17577   ;
17578   return 0;
17579 }
17580 _ACEOF
17581 rm -f conftest.$ac_objext
17582 if { (eval echo "$as_me:17582: \"$ac_compile\"") >&5
17583   (eval $ac_compile) 2>&5
17584   ac_status=$?
17585   echo "$as_me:17585: \$? = $ac_status" >&5
17586   (exit $ac_status); } &&
17587          { ac_try='test -s conftest.$ac_objext'
17588   { (eval echo "$as_me:17588: \"$ac_try\"") >&5
17589   (eval $ac_try) 2>&5
17590   ac_status=$?
17591   echo "$as_me:17591: \$? = $ac_status" >&5
17592   (exit $ac_status); }; }; then
17593   cf_cv_ncurses_ext_funcs=defined
17594 else
17595   echo "$as_me: failed program was:" >&5
17596 cat conftest.$ac_ext >&5
17597
17598 cat >conftest.$ac_ext <<_ACEOF
17599 #line 17599 "configure"
17600 #include "confdefs.h"
17601
17602 #include <${cf_cv_ncurses_header:-curses.h}>
17603 int
17604 main (void)
17605 {
17606
17607         (void) assume_default_colors (0, 0);
17608         (void) curses_version ();
17609         (void) define_key (0, 0);
17610         (void) is_term_resized (0, 0);
17611         (void) key_defined (0);
17612         (void) keybound (0, 0);
17613         (void) keyok (0, 0);
17614         (void) resize_term (0, 0);
17615         (void) resizeterm (0, 0);
17616         (void) use_default_colors ();
17617         (void) use_extended_names (0);
17618         (void) wresize (0, 0, 0);
17619   ;
17620   return 0;
17621 }
17622 _ACEOF
17623 rm -f conftest.$ac_objext conftest$ac_exeext
17624 if { (eval echo "$as_me:17624: \"$ac_link\"") >&5
17625   (eval $ac_link) 2>&5
17626   ac_status=$?
17627   echo "$as_me:17627: \$? = $ac_status" >&5
17628   (exit $ac_status); } &&
17629          { ac_try='test -s conftest$ac_exeext'
17630   { (eval echo "$as_me:17630: \"$ac_try\"") >&5
17631   (eval $ac_try) 2>&5
17632   ac_status=$?
17633   echo "$as_me:17633: \$? = $ac_status" >&5
17634   (exit $ac_status); }; }; then
17635   cf_cv_ncurses_ext_funcs=yes
17636 else
17637   echo "$as_me: failed program was:" >&5
17638 cat conftest.$ac_ext >&5
17639 cf_cv_ncurses_ext_funcs=no
17640 fi
17641 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17642
17643 fi
17644 rm -f conftest.$ac_objext conftest.$ac_ext
17645
17646 fi
17647 echo "$as_me:17647: result: $cf_cv_ncurses_ext_funcs" >&5
17648 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
17649 test "$cf_cv_ncurses_ext_funcs" = yes &&
17650 cat >>confdefs.h <<\EOF
17651 #define NCURSES_EXT_FUNCS 1
17652 EOF
17653
17654 if test "$cf_enable_widec" = yes
17655 then
17656         # workaround for systems with ncurses before 20111029, due to change of
17657         # feature test macro from _XPG5 to _XOPEN_SOURCE
17658         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
17659         then
17660                 cf_define_xpg5=no
17661                 echo "$as_me:17661: checking if _XPG5 should be defined to enable wide-characters" >&5
17662 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
17663
17664                 cat >conftest.$ac_ext <<_ACEOF
17665 #line 17665 "configure"
17666 #include "confdefs.h"
17667
17668 #include <${cf_cv_ncurses_header:-curses.h}>
17669 int
17670 main (void)
17671 {
17672 int x = _XPG5
17673   ;
17674   return 0;
17675 }
17676 _ACEOF
17677 rm -f conftest.$ac_objext
17678 if { (eval echo "$as_me:17678: \"$ac_compile\"") >&5
17679   (eval $ac_compile) 2>&5
17680   ac_status=$?
17681   echo "$as_me:17681: \$? = $ac_status" >&5
17682   (exit $ac_status); } &&
17683          { ac_try='test -s conftest.$ac_objext'
17684   { (eval echo "$as_me:17684: \"$ac_try\"") >&5
17685   (eval $ac_try) 2>&5
17686   ac_status=$?
17687   echo "$as_me:17687: \$? = $ac_status" >&5
17688   (exit $ac_status); }; }; then
17689   :
17690 else
17691   echo "$as_me: failed program was:" >&5
17692 cat conftest.$ac_ext >&5
17693 cf_save_cppflags="$CPPFLAGS"
17694                          CPPFLAGS="$CPPFLAGS -D_XPG5"
17695                          cat >conftest.$ac_ext <<_ACEOF
17696 #line 17696 "configure"
17697 #include "confdefs.h"
17698
17699 #include <${cf_cv_ncurses_header:-curses.h}>
17700 int
17701 main (void)
17702 {
17703 int x = _XPG5
17704   ;
17705   return 0;
17706 }
17707 _ACEOF
17708 rm -f conftest.$ac_objext
17709 if { (eval echo "$as_me:17709: \"$ac_compile\"") >&5
17710   (eval $ac_compile) 2>&5
17711   ac_status=$?
17712   echo "$as_me:17712: \$? = $ac_status" >&5
17713   (exit $ac_status); } &&
17714          { ac_try='test -s conftest.$ac_objext'
17715   { (eval echo "$as_me:17715: \"$ac_try\"") >&5
17716   (eval $ac_try) 2>&5
17717   ac_status=$?
17718   echo "$as_me:17718: \$? = $ac_status" >&5
17719   (exit $ac_status); }; }; then
17720   cf_define_xpg5=yes
17721 else
17722   echo "$as_me: failed program was:" >&5
17723 cat conftest.$ac_ext >&5
17724 fi
17725 rm -f conftest.$ac_objext conftest.$ac_ext
17726                          CPPFLAGS="$cf_save_cppflags"
17727 fi
17728 rm -f conftest.$ac_objext conftest.$ac_ext
17729                 echo "$as_me:17729: result: $cf_define_xpg5" >&5
17730 echo "${ECHO_T}$cf_define_xpg5" >&6
17731
17732                 if test "$cf_define_xpg5" = yes
17733                 then
17734                         CPPFLAGS="$CPPFLAGS -D_XPG5"
17735                 fi
17736         fi
17737
17738         echo "$as_me:17738: checking for wide-character functions" >&5
17739 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
17740 if test "${cf_cv_widechar_funcs+set}" = set; then
17741   echo $ECHO_N "(cached) $ECHO_C" >&6
17742 else
17743
17744         cat >conftest.$ac_ext <<_ACEOF
17745 #line 17745 "configure"
17746 #include "confdefs.h"
17747
17748 #include <${cf_cv_ncurses_header:-curses.h}>
17749 int
17750 main (void)
17751 {
17752
17753                 static wchar_t src_wchar[2];
17754                 static cchar_t dst_cchar;
17755                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
17756
17757   ;
17758   return 0;
17759 }
17760 _ACEOF
17761 rm -f conftest.$ac_objext conftest$ac_exeext
17762 if { (eval echo "$as_me:17762: \"$ac_link\"") >&5
17763   (eval $ac_link) 2>&5
17764   ac_status=$?
17765   echo "$as_me:17765: \$? = $ac_status" >&5
17766   (exit $ac_status); } &&
17767          { ac_try='test -s conftest$ac_exeext'
17768   { (eval echo "$as_me:17768: \"$ac_try\"") >&5
17769   (eval $ac_try) 2>&5
17770   ac_status=$?
17771   echo "$as_me:17771: \$? = $ac_status" >&5
17772   (exit $ac_status); }; }; then
17773   cf_cv_widechar_funcs=yes
17774 else
17775   echo "$as_me: failed program was:" >&5
17776 cat conftest.$ac_ext >&5
17777 cf_cv_widechar_funcs=no
17778 fi
17779 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17780
17781 fi
17782 echo "$as_me:17782: result: $cf_cv_widechar_funcs" >&5
17783 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
17784         if test "$cf_cv_widechar_funcs" != no ; then
17785
17786 cat >>confdefs.h <<\EOF
17787 #define USE_WIDEC_SUPPORT 1
17788 EOF
17789
17790         else
17791                 cat >>confdefs.h <<\EOF
17792 #define USE_WIDEC_SUPPORT 0
17793 EOF
17794
17795         fi
17796 else
17797         cat >>confdefs.h <<\EOF
17798 #define USE_WIDEC_SUPPORT 0
17799 EOF
17800
17801 fi
17802
17803 echo "$as_me:17803: checking if $cf_cv_screen library uses pthreads" >&5
17804 echo $ECHO_N "checking if $cf_cv_screen library uses pthreads... $ECHO_C" >&6
17805 if test "${cf_cv_use_pthreads+set}" = set; then
17806   echo $ECHO_N "(cached) $ECHO_C" >&6
17807 else
17808
17809 cat >conftest.$ac_ext <<_ACEOF
17810 #line 17810 "configure"
17811 #include "confdefs.h"
17812
17813 #include <${cf_cv_ncurses_header:-curses.h}>
17814 extern void _nc_init_pthreads(void);
17815
17816 int
17817 main (void)
17818 {
17819
17820         initscr();
17821         _nc_init_pthreads();
17822
17823   ;
17824   return 0;
17825 }
17826 _ACEOF
17827 rm -f conftest.$ac_objext conftest$ac_exeext
17828 if { (eval echo "$as_me:17828: \"$ac_link\"") >&5
17829   (eval $ac_link) 2>&5
17830   ac_status=$?
17831   echo "$as_me:17831: \$? = $ac_status" >&5
17832   (exit $ac_status); } &&
17833          { ac_try='test -s conftest$ac_exeext'
17834   { (eval echo "$as_me:17834: \"$ac_try\"") >&5
17835   (eval $ac_try) 2>&5
17836   ac_status=$?
17837   echo "$as_me:17837: \$? = $ac_status" >&5
17838   (exit $ac_status); }; }; then
17839   cf_cv_use_pthreads=yes
17840 else
17841   echo "$as_me: failed program was:" >&5
17842 cat conftest.$ac_ext >&5
17843 cf_cv_use_pthreads=no
17844 fi
17845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17846
17847 fi
17848 echo "$as_me:17848: result: $cf_cv_use_pthreads" >&5
17849 echo "${ECHO_T}$cf_cv_use_pthreads" >&6
17850 test $cf_cv_use_pthreads = yes && cat >>confdefs.h <<\EOF
17851 #define USE_PTHREADS 1
17852 EOF
17853
17854 echo "$as_me:17854: checking if sys/time.h works with sys/select.h" >&5
17855 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
17856 if test "${cf_cv_sys_time_select+set}" = set; then
17857   echo $ECHO_N "(cached) $ECHO_C" >&6
17858 else
17859
17860 cat >conftest.$ac_ext <<_ACEOF
17861 #line 17861 "configure"
17862 #include "confdefs.h"
17863
17864 #include <sys/types.h>
17865 #ifdef HAVE_SYS_TIME_H
17866 #include <sys/time.h>
17867 #endif
17868 #ifdef HAVE_SYS_SELECT_H
17869 #include <sys/select.h>
17870 #endif
17871
17872 int
17873 main (void)
17874 {
17875
17876   ;
17877   return 0;
17878 }
17879 _ACEOF
17880 rm -f conftest.$ac_objext
17881 if { (eval echo "$as_me:17881: \"$ac_compile\"") >&5
17882   (eval $ac_compile) 2>&5
17883   ac_status=$?
17884   echo "$as_me:17884: \$? = $ac_status" >&5
17885   (exit $ac_status); } &&
17886          { ac_try='test -s conftest.$ac_objext'
17887   { (eval echo "$as_me:17887: \"$ac_try\"") >&5
17888   (eval $ac_try) 2>&5
17889   ac_status=$?
17890   echo "$as_me:17890: \$? = $ac_status" >&5
17891   (exit $ac_status); }; }; then
17892   cf_cv_sys_time_select=yes
17893 else
17894   echo "$as_me: failed program was:" >&5
17895 cat conftest.$ac_ext >&5
17896 cf_cv_sys_time_select=no
17897 fi
17898 rm -f conftest.$ac_objext conftest.$ac_ext
17899
17900 fi
17901
17902 echo "$as_me:17902: result: $cf_cv_sys_time_select" >&5
17903 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
17904 test "$cf_cv_sys_time_select" = yes &&
17905 cat >>confdefs.h <<\EOF
17906 #define HAVE_SYS_TIME_SELECT 1
17907 EOF
17908
17909 # special check for test/ditto.c
17910
17911 echo "$as_me:17911: checking for openpty in -lutil" >&5
17912 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6
17913 if test "${ac_cv_lib_util_openpty+set}" = set; then
17914   echo $ECHO_N "(cached) $ECHO_C" >&6
17915 else
17916   ac_check_lib_save_LIBS=$LIBS
17917 LIBS="-lutil  $LIBS"
17918 cat >conftest.$ac_ext <<_ACEOF
17919 #line 17919 "configure"
17920 #include "confdefs.h"
17921
17922 /* Override any gcc2 internal prototype to avoid an error.  */
17923 #ifdef __cplusplus
17924 extern "C"
17925 #endif
17926 /* We use char because int might match the return type of a gcc2
17927    builtin and then its argument prototype would still apply.  */
17928 char openpty ();
17929 int
17930 main (void)
17931 {
17932 openpty ();
17933   ;
17934   return 0;
17935 }
17936 _ACEOF
17937 rm -f conftest.$ac_objext conftest$ac_exeext
17938 if { (eval echo "$as_me:17938: \"$ac_link\"") >&5
17939   (eval $ac_link) 2>&5
17940   ac_status=$?
17941   echo "$as_me:17941: \$? = $ac_status" >&5
17942   (exit $ac_status); } &&
17943          { ac_try='test -s conftest$ac_exeext'
17944   { (eval echo "$as_me:17944: \"$ac_try\"") >&5
17945   (eval $ac_try) 2>&5
17946   ac_status=$?
17947   echo "$as_me:17947: \$? = $ac_status" >&5
17948   (exit $ac_status); }; }; then
17949   ac_cv_lib_util_openpty=yes
17950 else
17951   echo "$as_me: failed program was:" >&5
17952 cat conftest.$ac_ext >&5
17953 ac_cv_lib_util_openpty=no
17954 fi
17955 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
17956 LIBS=$ac_check_lib_save_LIBS
17957 fi
17958 echo "$as_me:17958: result: $ac_cv_lib_util_openpty" >&5
17959 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6
17960 if test $ac_cv_lib_util_openpty = yes; then
17961   cf_cv_lib_util=yes
17962 else
17963   cf_cv_lib_util=no
17964 fi
17965
17966 echo "$as_me:17966: checking for openpty header" >&5
17967 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6
17968 if test "${cf_cv_func_openpty+set}" = set; then
17969   echo $ECHO_N "(cached) $ECHO_C" >&6
17970 else
17971
17972         cf_save_LIBS="$LIBS"
17973         test $cf_cv_lib_util = yes && {
17974 cf_add_libs="-lutil"
17975 # Filter out duplicates - this happens with badly-designed ".pc" files...
17976 for cf_add_1lib in $LIBS
17977 do
17978         for cf_add_2lib in $cf_add_libs
17979         do
17980                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
17981                 then
17982                         cf_add_1lib=
17983                         break
17984                 fi
17985         done
17986         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
17987 done
17988 LIBS="$cf_add_libs"
17989  }
17990         for cf_header in pty.h libutil.h util.h
17991         do
17992         cat >conftest.$ac_ext <<_ACEOF
17993 #line 17993 "configure"
17994 #include "confdefs.h"
17995
17996 #include <$cf_header>
17997
17998 int
17999 main (void)
18000 {
18001
18002         int x = openpty((int *)0, (int *)0, (char *)0,
18003                                    (struct termios *)0, (struct winsize *)0);
18004
18005   ;
18006   return 0;
18007 }
18008 _ACEOF
18009 rm -f conftest.$ac_objext conftest$ac_exeext
18010 if { (eval echo "$as_me:18010: \"$ac_link\"") >&5
18011   (eval $ac_link) 2>&5
18012   ac_status=$?
18013   echo "$as_me:18013: \$? = $ac_status" >&5
18014   (exit $ac_status); } &&
18015          { ac_try='test -s conftest$ac_exeext'
18016   { (eval echo "$as_me:18016: \"$ac_try\"") >&5
18017   (eval $ac_try) 2>&5
18018   ac_status=$?
18019   echo "$as_me:18019: \$? = $ac_status" >&5
18020   (exit $ac_status); }; }; then
18021
18022                 cf_cv_func_openpty=$cf_header
18023                 break
18024
18025 else
18026   echo "$as_me: failed program was:" >&5
18027 cat conftest.$ac_ext >&5
18028
18029                 cf_cv_func_openpty=no
18030
18031 fi
18032 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18033         done
18034         LIBS="$cf_save_LIBS"
18035
18036 fi
18037 echo "$as_me:18037: result: $cf_cv_func_openpty" >&5
18038 echo "${ECHO_T}$cf_cv_func_openpty" >&6
18039
18040 if test "$cf_cv_func_openpty" != no ; then
18041
18042 cat >>confdefs.h <<EOF
18043 #define USE_OPENPTY_HEADER <$cf_cv_func_openpty>
18044 EOF
18045
18046 cat >>confdefs.h <<\EOF
18047 #define USE_XTERM_PTY 1
18048 EOF
18049
18050         if test "x$cf_cv_lib_util" = xyes ; then
18051
18052 cf_add_libs="-lutil"
18053 # Filter out duplicates - this happens with badly-designed ".pc" files...
18054 for cf_add_1lib in $TEST_LIBS
18055 do
18056         for cf_add_2lib in $cf_add_libs
18057         do
18058                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
18059                 then
18060                         cf_add_1lib=
18061                         break
18062                 fi
18063         done
18064         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
18065 done
18066 TEST_LIBS="$cf_add_libs"
18067
18068         fi
18069 fi
18070
18071 echo "$as_me:18071: checking for function curses_version" >&5
18072 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
18073 if test "${cf_cv_func_curses_version+set}" = set; then
18074   echo $ECHO_N "(cached) $ECHO_C" >&6
18075 else
18076
18077 if test "$cross_compiling" = yes; then
18078   cf_cv_func_curses_version=unknown
18079 else
18080   cat >conftest.$ac_ext <<_ACEOF
18081 #line 18081 "configure"
18082 #include "confdefs.h"
18083
18084 #include <${cf_cv_ncurses_header:-curses.h}>
18085 int main(void)
18086 {
18087         char temp[1024];
18088         sprintf(temp, "%s\n", curses_version());
18089         ${cf_cv_main_return:-return}(0);
18090 }
18091
18092 _ACEOF
18093 rm -f conftest$ac_exeext
18094 if { (eval echo "$as_me:18094: \"$ac_link\"") >&5
18095   (eval $ac_link) 2>&5
18096   ac_status=$?
18097   echo "$as_me:18097: \$? = $ac_status" >&5
18098   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
18099   { (eval echo "$as_me:18099: \"$ac_try\"") >&5
18100   (eval $ac_try) 2>&5
18101   ac_status=$?
18102   echo "$as_me:18102: \$? = $ac_status" >&5
18103   (exit $ac_status); }; }; then
18104   cf_cv_func_curses_version=yes
18105
18106 else
18107   echo "$as_me: program exited with status $ac_status" >&5
18108 echo "$as_me: failed program was:" >&5
18109 cat conftest.$ac_ext >&5
18110 cf_cv_func_curses_version=no
18111
18112 fi
18113 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
18114 fi
18115 rm -f core
18116 fi
18117 echo "$as_me:18117: result: $cf_cv_func_curses_version" >&5
18118 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
18119 test "$cf_cv_func_curses_version" = yes &&
18120 cat >>confdefs.h <<\EOF
18121 #define HAVE_CURSES_VERSION 1
18122 EOF
18123
18124 echo "$as_me:18124: checking for alternate character set array" >&5
18125 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
18126 if test "${cf_cv_curses_acs_map+set}" = set; then
18127   echo $ECHO_N "(cached) $ECHO_C" >&6
18128 else
18129
18130 cf_cv_curses_acs_map=unknown
18131 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
18132 do
18133 cat >conftest.$ac_ext <<_ACEOF
18134 #line 18134 "configure"
18135 #include "confdefs.h"
18136
18137 #include <${cf_cv_ncurses_header:-curses.h}>
18138
18139 int
18140 main (void)
18141 {
18142
18143 $name['k'] = ACS_PLUS
18144
18145   ;
18146   return 0;
18147 }
18148 _ACEOF
18149 rm -f conftest.$ac_objext conftest$ac_exeext
18150 if { (eval echo "$as_me:18150: \"$ac_link\"") >&5
18151   (eval $ac_link) 2>&5
18152   ac_status=$?
18153   echo "$as_me:18153: \$? = $ac_status" >&5
18154   (exit $ac_status); } &&
18155          { ac_try='test -s conftest$ac_exeext'
18156   { (eval echo "$as_me:18156: \"$ac_try\"") >&5
18157   (eval $ac_try) 2>&5
18158   ac_status=$?
18159   echo "$as_me:18159: \$? = $ac_status" >&5
18160   (exit $ac_status); }; }; then
18161   cf_cv_curses_acs_map=$name; break
18162 else
18163   echo "$as_me: failed program was:" >&5
18164 cat conftest.$ac_ext >&5
18165 fi
18166 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18167 done
18168
18169 fi
18170 echo "$as_me:18170: result: $cf_cv_curses_acs_map" >&5
18171 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
18172
18173 test "$cf_cv_curses_acs_map" != unknown &&
18174 cat >>confdefs.h <<EOF
18175 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
18176 EOF
18177
18178 if test "$cf_enable_widec" = yes; then
18179
18180 echo "$as_me:18180: checking for wide alternate character set array" >&5
18181 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
18182 if test "${cf_cv_curses_wacs_map+set}" = set; then
18183   echo $ECHO_N "(cached) $ECHO_C" >&6
18184 else
18185
18186         cf_cv_curses_wacs_map=unknown
18187         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
18188         do
18189         cat >conftest.$ac_ext <<_ACEOF
18190 #line 18190 "configure"
18191 #include "confdefs.h"
18192
18193 #ifndef _XOPEN_SOURCE_EXTENDED
18194 #define _XOPEN_SOURCE_EXTENDED
18195 #endif
18196 #include <${cf_cv_ncurses_header:-curses.h}>
18197 int
18198 main (void)
18199 {
18200 void *foo = &($name['k'])
18201   ;
18202   return 0;
18203 }
18204 _ACEOF
18205 rm -f conftest.$ac_objext conftest$ac_exeext
18206 if { (eval echo "$as_me:18206: \"$ac_link\"") >&5
18207   (eval $ac_link) 2>&5
18208   ac_status=$?
18209   echo "$as_me:18209: \$? = $ac_status" >&5
18210   (exit $ac_status); } &&
18211          { ac_try='test -s conftest$ac_exeext'
18212   { (eval echo "$as_me:18212: \"$ac_try\"") >&5
18213   (eval $ac_try) 2>&5
18214   ac_status=$?
18215   echo "$as_me:18215: \$? = $ac_status" >&5
18216   (exit $ac_status); }; }; then
18217   cf_cv_curses_wacs_map=$name
18218          break
18219 else
18220   echo "$as_me: failed program was:" >&5
18221 cat conftest.$ac_ext >&5
18222 fi
18223 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18224         done
18225 fi
18226 echo "$as_me:18226: result: $cf_cv_curses_wacs_map" >&5
18227 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
18228
18229 test "$cf_cv_curses_wacs_map" != unknown &&
18230 cat >>confdefs.h <<EOF
18231 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
18232 EOF
18233
18234 echo "$as_me:18234: checking for wide alternate character constants" >&5
18235 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
18236 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
18237   echo $ECHO_N "(cached) $ECHO_C" >&6
18238 else
18239
18240 cf_cv_curses_wacs_symbols=no
18241 if test "$cf_cv_curses_wacs_map" != unknown
18242 then
18243         cat >conftest.$ac_ext <<_ACEOF
18244 #line 18244 "configure"
18245 #include "confdefs.h"
18246
18247 #ifndef _XOPEN_SOURCE_EXTENDED
18248 #define _XOPEN_SOURCE_EXTENDED
18249 #endif
18250 #include <${cf_cv_ncurses_header:-curses.h}>
18251 int
18252 main (void)
18253 {
18254 cchar_t *foo = WACS_PLUS;
18255          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
18256   ;
18257   return 0;
18258 }
18259 _ACEOF
18260 rm -f conftest.$ac_objext conftest$ac_exeext
18261 if { (eval echo "$as_me:18261: \"$ac_link\"") >&5
18262   (eval $ac_link) 2>&5
18263   ac_status=$?
18264   echo "$as_me:18264: \$? = $ac_status" >&5
18265   (exit $ac_status); } &&
18266          { ac_try='test -s conftest$ac_exeext'
18267   { (eval echo "$as_me:18267: \"$ac_try\"") >&5
18268   (eval $ac_try) 2>&5
18269   ac_status=$?
18270   echo "$as_me:18270: \$? = $ac_status" >&5
18271   (exit $ac_status); }; }; then
18272   cf_cv_curses_wacs_symbols=yes
18273 else
18274   echo "$as_me: failed program was:" >&5
18275 cat conftest.$ac_ext >&5
18276 fi
18277 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18278 else
18279         cat >conftest.$ac_ext <<_ACEOF
18280 #line 18280 "configure"
18281 #include "confdefs.h"
18282
18283 #ifndef _XOPEN_SOURCE_EXTENDED
18284 #define _XOPEN_SOURCE_EXTENDED
18285 #endif
18286 #include <${cf_cv_ncurses_header:-curses.h}>
18287 int
18288 main (void)
18289 {
18290 cchar_t *foo = WACS_PLUS
18291   ;
18292   return 0;
18293 }
18294 _ACEOF
18295 rm -f conftest.$ac_objext conftest$ac_exeext
18296 if { (eval echo "$as_me:18296: \"$ac_link\"") >&5
18297   (eval $ac_link) 2>&5
18298   ac_status=$?
18299   echo "$as_me:18299: \$? = $ac_status" >&5
18300   (exit $ac_status); } &&
18301          { ac_try='test -s conftest$ac_exeext'
18302   { (eval echo "$as_me:18302: \"$ac_try\"") >&5
18303   (eval $ac_try) 2>&5
18304   ac_status=$?
18305   echo "$as_me:18305: \$? = $ac_status" >&5
18306   (exit $ac_status); }; }; then
18307   cf_cv_curses_wacs_symbols=yes
18308 else
18309   echo "$as_me: failed program was:" >&5
18310 cat conftest.$ac_ext >&5
18311 fi
18312 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
18313 fi
18314
18315 fi
18316 echo "$as_me:18316: result: $cf_cv_curses_wacs_symbols" >&5
18317 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
18318
18319 test "$cf_cv_curses_wacs_symbols" != no &&
18320 cat >>confdefs.h <<\EOF
18321 #define CURSES_WACS_SYMBOLS 1
18322 EOF
18323
18324 fi
18325
18326 echo "$as_me:18326: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18327 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18328 cat >conftest.$ac_ext <<_ACEOF
18329 #line 18329 "configure"
18330 #include "confdefs.h"
18331
18332 #ifndef _XOPEN_SOURCE_EXTENDED
18333 #define _XOPEN_SOURCE_EXTENDED
18334 #endif
18335 #include <${cf_cv_ncurses_header:-curses.h}>
18336 int
18337 main (void)
18338 {
18339
18340 attr_t foo
18341
18342   ;
18343   return 0;
18344 }
18345 _ACEOF
18346 rm -f conftest.$ac_objext
18347 if { (eval echo "$as_me:18347: \"$ac_compile\"") >&5
18348   (eval $ac_compile) 2>&5
18349   ac_status=$?
18350   echo "$as_me:18350: \$? = $ac_status" >&5
18351   (exit $ac_status); } &&
18352          { ac_try='test -s conftest.$ac_objext'
18353   { (eval echo "$as_me:18353: \"$ac_try\"") >&5
18354   (eval $ac_try) 2>&5
18355   ac_status=$?
18356   echo "$as_me:18356: \$? = $ac_status" >&5
18357   (exit $ac_status); }; }; then
18358   cf_result=yes
18359 else
18360   echo "$as_me: failed program was:" >&5
18361 cat conftest.$ac_ext >&5
18362 cf_result=no
18363 fi
18364 rm -f conftest.$ac_objext conftest.$ac_ext
18365 echo "$as_me:18365: result: $cf_result" >&5
18366 echo "${ECHO_T}$cf_result" >&6
18367 if test $cf_result = yes ; then
18368
18369 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18370
18371 cat >>confdefs.h <<EOF
18372 #define $cf_result 1
18373 EOF
18374
18375 else
18376
18377 cat >>confdefs.h <<EOF
18378 #define attr_t long
18379 EOF
18380
18381 fi
18382
18383 if test "$cf_enable_widec" = yes; then
18384
18385 # This is needed on Tru64 5.0 to declare mbstate_t
18386 echo "$as_me:18386: checking if we must include wchar.h to declare mbstate_t" >&5
18387 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
18388 if test "${cf_cv_mbstate_t+set}" = set; then
18389   echo $ECHO_N "(cached) $ECHO_C" >&6
18390 else
18391
18392 cat >conftest.$ac_ext <<_ACEOF
18393 #line 18393 "configure"
18394 #include "confdefs.h"
18395
18396 #include <stdlib.h>
18397 #include <stdarg.h>
18398 #include <stdio.h>
18399 #ifdef HAVE_LIBUTF8_H
18400 #include <libutf8.h>
18401 #endif
18402 int
18403 main (void)
18404 {
18405 mbstate_t state
18406   ;
18407   return 0;
18408 }
18409 _ACEOF
18410 rm -f conftest.$ac_objext
18411 if { (eval echo "$as_me:18411: \"$ac_compile\"") >&5
18412   (eval $ac_compile) 2>&5
18413   ac_status=$?
18414   echo "$as_me:18414: \$? = $ac_status" >&5
18415   (exit $ac_status); } &&
18416          { ac_try='test -s conftest.$ac_objext'
18417   { (eval echo "$as_me:18417: \"$ac_try\"") >&5
18418   (eval $ac_try) 2>&5
18419   ac_status=$?
18420   echo "$as_me:18420: \$? = $ac_status" >&5
18421   (exit $ac_status); }; }; then
18422   cf_cv_mbstate_t=no
18423 else
18424   echo "$as_me: failed program was:" >&5
18425 cat conftest.$ac_ext >&5
18426 cat >conftest.$ac_ext <<_ACEOF
18427 #line 18427 "configure"
18428 #include "confdefs.h"
18429
18430 #include <stdlib.h>
18431 #include <stdarg.h>
18432 #include <stdio.h>
18433 #include <wchar.h>
18434 #ifdef HAVE_LIBUTF8_H
18435 #include <libutf8.h>
18436 #endif
18437 int
18438 main (void)
18439 {
18440 mbstate_t value
18441   ;
18442   return 0;
18443 }
18444 _ACEOF
18445 rm -f conftest.$ac_objext
18446 if { (eval echo "$as_me:18446: \"$ac_compile\"") >&5
18447   (eval $ac_compile) 2>&5
18448   ac_status=$?
18449   echo "$as_me:18449: \$? = $ac_status" >&5
18450   (exit $ac_status); } &&
18451          { ac_try='test -s conftest.$ac_objext'
18452   { (eval echo "$as_me:18452: \"$ac_try\"") >&5
18453   (eval $ac_try) 2>&5
18454   ac_status=$?
18455   echo "$as_me:18455: \$? = $ac_status" >&5
18456   (exit $ac_status); }; }; then
18457   cf_cv_mbstate_t=yes
18458 else
18459   echo "$as_me: failed program was:" >&5
18460 cat conftest.$ac_ext >&5
18461 cf_cv_mbstate_t=unknown
18462 fi
18463 rm -f conftest.$ac_objext conftest.$ac_ext
18464 fi
18465 rm -f conftest.$ac_objext conftest.$ac_ext
18466 fi
18467 echo "$as_me:18467: result: $cf_cv_mbstate_t" >&5
18468 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
18469
18470 if test "$cf_cv_mbstate_t" = yes ; then
18471
18472 cat >>confdefs.h <<\EOF
18473 #define NEED_WCHAR_H 1
18474 EOF
18475
18476         NEED_WCHAR_H=1
18477 fi
18478
18479 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
18480 if test "$cf_cv_mbstate_t" = unknown ; then
18481         NCURSES_MBSTATE_T=1
18482 fi
18483
18484 # if we find mbstate_t in either place, use substitution to provide a fallback.
18485 if test "$cf_cv_mbstate_t" != unknown ; then
18486         NCURSES_OK_MBSTATE_T=1
18487 fi
18488
18489 # This is needed on Tru64 5.0 to declare wchar_t
18490 echo "$as_me:18490: checking if we must include wchar.h to declare wchar_t" >&5
18491 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
18492 if test "${cf_cv_wchar_t+set}" = set; then
18493   echo $ECHO_N "(cached) $ECHO_C" >&6
18494 else
18495
18496 cat >conftest.$ac_ext <<_ACEOF
18497 #line 18497 "configure"
18498 #include "confdefs.h"
18499
18500 #include <stdlib.h>
18501 #include <stdarg.h>
18502 #include <stdio.h>
18503 #ifdef HAVE_LIBUTF8_H
18504 #include <libutf8.h>
18505 #endif
18506 int
18507 main (void)
18508 {
18509 wchar_t state
18510   ;
18511   return 0;
18512 }
18513 _ACEOF
18514 rm -f conftest.$ac_objext
18515 if { (eval echo "$as_me:18515: \"$ac_compile\"") >&5
18516   (eval $ac_compile) 2>&5
18517   ac_status=$?
18518   echo "$as_me:18518: \$? = $ac_status" >&5
18519   (exit $ac_status); } &&
18520          { ac_try='test -s conftest.$ac_objext'
18521   { (eval echo "$as_me:18521: \"$ac_try\"") >&5
18522   (eval $ac_try) 2>&5
18523   ac_status=$?
18524   echo "$as_me:18524: \$? = $ac_status" >&5
18525   (exit $ac_status); }; }; then
18526   cf_cv_wchar_t=no
18527 else
18528   echo "$as_me: failed program was:" >&5
18529 cat conftest.$ac_ext >&5
18530 cat >conftest.$ac_ext <<_ACEOF
18531 #line 18531 "configure"
18532 #include "confdefs.h"
18533
18534 #include <stdlib.h>
18535 #include <stdarg.h>
18536 #include <stdio.h>
18537 #include <wchar.h>
18538 #ifdef HAVE_LIBUTF8_H
18539 #include <libutf8.h>
18540 #endif
18541 int
18542 main (void)
18543 {
18544 wchar_t value
18545   ;
18546   return 0;
18547 }
18548 _ACEOF
18549 rm -f conftest.$ac_objext
18550 if { (eval echo "$as_me:18550: \"$ac_compile\"") >&5
18551   (eval $ac_compile) 2>&5
18552   ac_status=$?
18553   echo "$as_me:18553: \$? = $ac_status" >&5
18554   (exit $ac_status); } &&
18555          { ac_try='test -s conftest.$ac_objext'
18556   { (eval echo "$as_me:18556: \"$ac_try\"") >&5
18557   (eval $ac_try) 2>&5
18558   ac_status=$?
18559   echo "$as_me:18559: \$? = $ac_status" >&5
18560   (exit $ac_status); }; }; then
18561   cf_cv_wchar_t=yes
18562 else
18563   echo "$as_me: failed program was:" >&5
18564 cat conftest.$ac_ext >&5
18565 cf_cv_wchar_t=unknown
18566 fi
18567 rm -f conftest.$ac_objext conftest.$ac_ext
18568 fi
18569 rm -f conftest.$ac_objext conftest.$ac_ext
18570 fi
18571 echo "$as_me:18571: result: $cf_cv_wchar_t" >&5
18572 echo "${ECHO_T}$cf_cv_wchar_t" >&6
18573
18574 if test "$cf_cv_wchar_t" = yes ; then
18575
18576 cat >>confdefs.h <<\EOF
18577 #define NEED_WCHAR_H 1
18578 EOF
18579
18580         NEED_WCHAR_H=1
18581 fi
18582
18583 # if we do not find wchar_t in either place, use substitution to provide a fallback.
18584 if test "$cf_cv_wchar_t" = unknown ; then
18585         NCURSES_WCHAR_T=1
18586 fi
18587
18588 # if we find wchar_t in either place, use substitution to provide a fallback.
18589 if test "$cf_cv_wchar_t" != unknown ; then
18590         NCURSES_OK_WCHAR_T=1
18591 fi
18592
18593 # This is needed on Tru64 5.0 to declare wint_t
18594 echo "$as_me:18594: checking if we must include wchar.h to declare wint_t" >&5
18595 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
18596 if test "${cf_cv_wint_t+set}" = set; then
18597   echo $ECHO_N "(cached) $ECHO_C" >&6
18598 else
18599
18600 cat >conftest.$ac_ext <<_ACEOF
18601 #line 18601 "configure"
18602 #include "confdefs.h"
18603
18604 #include <stdlib.h>
18605 #include <stdarg.h>
18606 #include <stdio.h>
18607 #ifdef HAVE_LIBUTF8_H
18608 #include <libutf8.h>
18609 #endif
18610 int
18611 main (void)
18612 {
18613 wint_t state
18614   ;
18615   return 0;
18616 }
18617 _ACEOF
18618 rm -f conftest.$ac_objext
18619 if { (eval echo "$as_me:18619: \"$ac_compile\"") >&5
18620   (eval $ac_compile) 2>&5
18621   ac_status=$?
18622   echo "$as_me:18622: \$? = $ac_status" >&5
18623   (exit $ac_status); } &&
18624          { ac_try='test -s conftest.$ac_objext'
18625   { (eval echo "$as_me:18625: \"$ac_try\"") >&5
18626   (eval $ac_try) 2>&5
18627   ac_status=$?
18628   echo "$as_me:18628: \$? = $ac_status" >&5
18629   (exit $ac_status); }; }; then
18630   cf_cv_wint_t=no
18631 else
18632   echo "$as_me: failed program was:" >&5
18633 cat conftest.$ac_ext >&5
18634 cat >conftest.$ac_ext <<_ACEOF
18635 #line 18635 "configure"
18636 #include "confdefs.h"
18637
18638 #include <stdlib.h>
18639 #include <stdarg.h>
18640 #include <stdio.h>
18641 #include <wchar.h>
18642 #ifdef HAVE_LIBUTF8_H
18643 #include <libutf8.h>
18644 #endif
18645 int
18646 main (void)
18647 {
18648 wint_t value
18649   ;
18650   return 0;
18651 }
18652 _ACEOF
18653 rm -f conftest.$ac_objext
18654 if { (eval echo "$as_me:18654: \"$ac_compile\"") >&5
18655   (eval $ac_compile) 2>&5
18656   ac_status=$?
18657   echo "$as_me:18657: \$? = $ac_status" >&5
18658   (exit $ac_status); } &&
18659          { ac_try='test -s conftest.$ac_objext'
18660   { (eval echo "$as_me:18660: \"$ac_try\"") >&5
18661   (eval $ac_try) 2>&5
18662   ac_status=$?
18663   echo "$as_me:18663: \$? = $ac_status" >&5
18664   (exit $ac_status); }; }; then
18665   cf_cv_wint_t=yes
18666 else
18667   echo "$as_me: failed program was:" >&5
18668 cat conftest.$ac_ext >&5
18669 cf_cv_wint_t=unknown
18670 fi
18671 rm -f conftest.$ac_objext conftest.$ac_ext
18672 fi
18673 rm -f conftest.$ac_objext conftest.$ac_ext
18674 fi
18675 echo "$as_me:18675: result: $cf_cv_wint_t" >&5
18676 echo "${ECHO_T}$cf_cv_wint_t" >&6
18677
18678 if test "$cf_cv_wint_t" = yes ; then
18679
18680 cat >>confdefs.h <<\EOF
18681 #define NEED_WCHAR_H 1
18682 EOF
18683
18684         NEED_WCHAR_H=1
18685 fi
18686
18687 # if we do not find wint_t in either place, use substitution to provide a fallback.
18688 if test "$cf_cv_wint_t" = unknown ; then
18689         NCURSES_WINT_T=1
18690 fi
18691
18692 # if we find wint_t in either place, use substitution to provide a fallback.
18693 if test "$cf_cv_wint_t" != unknown ; then
18694         NCURSES_OK_WINT_T=1
18695 fi
18696
18697         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
18698
18699 echo "$as_me:18699: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18700 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18701 cat >conftest.$ac_ext <<_ACEOF
18702 #line 18702 "configure"
18703 #include "confdefs.h"
18704
18705 #ifndef _XOPEN_SOURCE_EXTENDED
18706 #define _XOPEN_SOURCE_EXTENDED
18707 #endif
18708 #include <${cf_cv_ncurses_header:-curses.h}>
18709 int
18710 main (void)
18711 {
18712
18713 mbstate_t foo
18714
18715   ;
18716   return 0;
18717 }
18718 _ACEOF
18719 rm -f conftest.$ac_objext
18720 if { (eval echo "$as_me:18720: \"$ac_compile\"") >&5
18721   (eval $ac_compile) 2>&5
18722   ac_status=$?
18723   echo "$as_me:18723: \$? = $ac_status" >&5
18724   (exit $ac_status); } &&
18725          { ac_try='test -s conftest.$ac_objext'
18726   { (eval echo "$as_me:18726: \"$ac_try\"") >&5
18727   (eval $ac_try) 2>&5
18728   ac_status=$?
18729   echo "$as_me:18729: \$? = $ac_status" >&5
18730   (exit $ac_status); }; }; then
18731   cf_result=yes
18732 else
18733   echo "$as_me: failed program was:" >&5
18734 cat conftest.$ac_ext >&5
18735 cf_result=no
18736 fi
18737 rm -f conftest.$ac_objext conftest.$ac_ext
18738 echo "$as_me:18738: result: $cf_result" >&5
18739 echo "${ECHO_T}$cf_result" >&6
18740 if test $cf_result = yes ; then
18741
18742 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18743
18744 cat >>confdefs.h <<EOF
18745 #define $cf_result 1
18746 EOF
18747
18748 else
18749
18750 cat >>confdefs.h <<EOF
18751 #define mbstate_t long
18752 EOF
18753
18754 fi
18755
18756         fi
18757
18758         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
18759
18760 echo "$as_me:18760: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18761 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18762 cat >conftest.$ac_ext <<_ACEOF
18763 #line 18763 "configure"
18764 #include "confdefs.h"
18765
18766 #ifndef _XOPEN_SOURCE_EXTENDED
18767 #define _XOPEN_SOURCE_EXTENDED
18768 #endif
18769 #include <${cf_cv_ncurses_header:-curses.h}>
18770 int
18771 main (void)
18772 {
18773
18774 wchar_t foo
18775
18776   ;
18777   return 0;
18778 }
18779 _ACEOF
18780 rm -f conftest.$ac_objext
18781 if { (eval echo "$as_me:18781: \"$ac_compile\"") >&5
18782   (eval $ac_compile) 2>&5
18783   ac_status=$?
18784   echo "$as_me:18784: \$? = $ac_status" >&5
18785   (exit $ac_status); } &&
18786          { ac_try='test -s conftest.$ac_objext'
18787   { (eval echo "$as_me:18787: \"$ac_try\"") >&5
18788   (eval $ac_try) 2>&5
18789   ac_status=$?
18790   echo "$as_me:18790: \$? = $ac_status" >&5
18791   (exit $ac_status); }; }; then
18792   cf_result=yes
18793 else
18794   echo "$as_me: failed program was:" >&5
18795 cat conftest.$ac_ext >&5
18796 cf_result=no
18797 fi
18798 rm -f conftest.$ac_objext conftest.$ac_ext
18799 echo "$as_me:18799: result: $cf_result" >&5
18800 echo "${ECHO_T}$cf_result" >&6
18801 if test $cf_result = yes ; then
18802
18803 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18804
18805 cat >>confdefs.h <<EOF
18806 #define $cf_result 1
18807 EOF
18808
18809 else
18810
18811 cat >>confdefs.h <<EOF
18812 #define wchar_t long
18813 EOF
18814
18815 fi
18816
18817         fi
18818
18819         if test "$NCURSES_OK_WINT_T" = 0 ; then
18820
18821 echo "$as_me:18821: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
18822 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18823 cat >conftest.$ac_ext <<_ACEOF
18824 #line 18824 "configure"
18825 #include "confdefs.h"
18826
18827 #ifndef _XOPEN_SOURCE_EXTENDED
18828 #define _XOPEN_SOURCE_EXTENDED
18829 #endif
18830 #include <${cf_cv_ncurses_header:-curses.h}>
18831 int
18832 main (void)
18833 {
18834
18835 wint_t foo
18836
18837   ;
18838   return 0;
18839 }
18840 _ACEOF
18841 rm -f conftest.$ac_objext
18842 if { (eval echo "$as_me:18842: \"$ac_compile\"") >&5
18843   (eval $ac_compile) 2>&5
18844   ac_status=$?
18845   echo "$as_me:18845: \$? = $ac_status" >&5
18846   (exit $ac_status); } &&
18847          { ac_try='test -s conftest.$ac_objext'
18848   { (eval echo "$as_me:18848: \"$ac_try\"") >&5
18849   (eval $ac_try) 2>&5
18850   ac_status=$?
18851   echo "$as_me:18851: \$? = $ac_status" >&5
18852   (exit $ac_status); }; }; then
18853   cf_result=yes
18854 else
18855   echo "$as_me: failed program was:" >&5
18856 cat conftest.$ac_ext >&5
18857 cf_result=no
18858 fi
18859 rm -f conftest.$ac_objext conftest.$ac_ext
18860 echo "$as_me:18860: result: $cf_result" >&5
18861 echo "${ECHO_T}$cf_result" >&6
18862 if test $cf_result = yes ; then
18863
18864 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18865
18866 cat >>confdefs.h <<EOF
18867 #define $cf_result 1
18868 EOF
18869
18870 else
18871
18872 cat >>confdefs.h <<EOF
18873 #define wint_t long
18874 EOF
18875
18876 fi
18877
18878         fi
18879 fi
18880
18881 for cf_data in \
18882 curscr \
18883 ospeed \
18884 boolnames \
18885 boolfnames \
18886 ttytype
18887 do
18888 echo "$as_me:18888: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
18889 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
18890
18891 cat >conftest.$ac_ext <<_ACEOF
18892 #line 18892 "configure"
18893 #include "confdefs.h"
18894
18895 #ifdef HAVE_XCURSES
18896 #include <xcurses.h>
18897 char * XCursesProgramName = "test";
18898 #else
18899 #include <${cf_cv_ncurses_header:-curses.h}>
18900 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18901 #include <ncursesw/term.h>
18902 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18903 #include <ncurses/term.h>
18904 #elif defined(HAVE_TERM_H)
18905 #include <term.h>
18906 #endif
18907 #endif
18908
18909 int
18910 main (void)
18911 {
18912
18913 void *foo = &($cf_data)
18914
18915   ;
18916   return 0;
18917 }
18918 _ACEOF
18919 rm -f conftest.$ac_objext
18920 if { (eval echo "$as_me:18920: \"$ac_compile\"") >&5
18921   (eval $ac_compile) 2>&5
18922   ac_status=$?
18923   echo "$as_me:18923: \$? = $ac_status" >&5
18924   (exit $ac_status); } &&
18925          { ac_try='test -s conftest.$ac_objext'
18926   { (eval echo "$as_me:18926: \"$ac_try\"") >&5
18927   (eval $ac_try) 2>&5
18928   ac_status=$?
18929   echo "$as_me:18929: \$? = $ac_status" >&5
18930   (exit $ac_status); }; }; then
18931   cf_result=yes
18932
18933 else
18934   echo "$as_me: failed program was:" >&5
18935 cat conftest.$ac_ext >&5
18936 cf_result=no
18937 fi
18938 rm -f conftest.$ac_objext conftest.$ac_ext
18939 echo "$as_me:18939: result: $cf_result" >&5
18940 echo "${ECHO_T}$cf_result" >&6
18941
18942 if test $cf_result = yes ; then
18943
18944 cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
18945
18946         cat >>confdefs.h <<EOF
18947 #define $cf_result 1
18948 EOF
18949
18950 else
18951         echo "$as_me:18951: checking for data $cf_data in library" >&5
18952 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6
18953         # BSD linkers insist on making weak linkage, but resolve at runtime.
18954         if test "$cross_compiling" = yes; then
18955
18956         # cross-compiling
18957         cat >conftest.$ac_ext <<_ACEOF
18958 #line 18958 "configure"
18959 #include "confdefs.h"
18960
18961 #ifdef HAVE_XCURSES
18962 #include <xcurses.h>
18963 char * XCursesProgramName = "test";
18964 #else
18965 #include <${cf_cv_ncurses_header:-curses.h}>
18966 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
18967 #include <ncursesw/term.h>
18968 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
18969 #include <ncurses/term.h>
18970 #elif defined(HAVE_TERM_H)
18971 #include <term.h>
18972 #endif
18973 #endif
18974
18975 extern char $cf_data;
18976 int
18977 main (void)
18978 {
18979
18980         do {
18981                 void *foo = &($cf_data);
18982                 fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
18983                 ${cf_cv_main_return:-return}(foo == 0);
18984         } while (0)
18985
18986   ;
18987   return 0;
18988 }
18989 _ACEOF
18990 rm -f conftest.$ac_objext conftest$ac_exeext
18991 if { (eval echo "$as_me:18991: \"$ac_link\"") >&5
18992   (eval $ac_link) 2>&5
18993   ac_status=$?
18994   echo "$as_me:18994: \$? = $ac_status" >&5
18995   (exit $ac_status); } &&
18996          { ac_try='test -s conftest$ac_exeext'
18997   { (eval echo "$as_me:18997: \"$ac_try\"") >&5
18998   (eval $ac_try) 2>&5
18999   ac_status=$?
19000   echo "$as_me:19000: \$? = $ac_status" >&5
19001   (exit $ac_status); }; }; then
19002   cf_result=yes
19003 else
19004   echo "$as_me: failed program was:" >&5
19005 cat conftest.$ac_ext >&5
19006 cf_result=no
19007 fi
19008 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19009
19010 else
19011   cat >conftest.$ac_ext <<_ACEOF
19012 #line 19012 "configure"
19013 #include "confdefs.h"
19014
19015 #ifdef HAVE_XCURSES
19016 #include <xcurses.h>
19017 char * XCursesProgramName = "test";
19018 #else
19019 #include <${cf_cv_ncurses_header:-curses.h}>
19020 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
19021 #include <ncursesw/term.h>
19022 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
19023 #include <ncurses/term.h>
19024 #elif defined(HAVE_TERM_H)
19025 #include <term.h>
19026 #endif
19027 #endif
19028
19029 extern char $cf_data;
19030 int main(void)
19031 {
19032         void *foo = &($cf_data);
19033         fprintf(stderr, "testing linkage of $cf_data:%p\n", (void *)foo);
19034         ${cf_cv_main_return:-return}(foo == 0);
19035 }
19036 _ACEOF
19037 rm -f conftest$ac_exeext
19038 if { (eval echo "$as_me:19038: \"$ac_link\"") >&5
19039   (eval $ac_link) 2>&5
19040   ac_status=$?
19041   echo "$as_me:19041: \$? = $ac_status" >&5
19042   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
19043   { (eval echo "$as_me:19043: \"$ac_try\"") >&5
19044   (eval $ac_try) 2>&5
19045   ac_status=$?
19046   echo "$as_me:19046: \$? = $ac_status" >&5
19047   (exit $ac_status); }; }; then
19048   cf_result=yes
19049
19050 else
19051   echo "$as_me: program exited with status $ac_status" >&5
19052 echo "$as_me: failed program was:" >&5
19053 cat conftest.$ac_ext >&5
19054 cf_result=no
19055 fi
19056 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
19057 fi
19058         echo "$as_me:19058: result: $cf_result" >&5
19059 echo "${ECHO_T}$cf_result" >&6
19060         if test $cf_result = yes ; then
19061
19062 cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19063
19064                 cat >>confdefs.h <<EOF
19065 #define $cf_result 1
19066 EOF
19067
19068                 # do not exit loop here, since we prefer system's declarations
19069         fi
19070 fi
19071 done
19072
19073 if ( test "$GCC" = yes || test "$GXX" = yes )
19074 then
19075 echo "$as_me:19075: checking if you want to turn on gcc warnings" >&5
19076 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
19077
19078 # Check whether --enable-warnings or --disable-warnings was given.
19079 if test "${enable_warnings+set}" = set; then
19080   enableval="$enable_warnings"
19081   test "$enableval" != yes && enableval=no
19082         if test "$enableval" != "no" ; then
19083     with_warnings=yes
19084         else
19085                 with_warnings=no
19086         fi
19087 else
19088   enableval=no
19089         with_warnings=no
19090
19091 fi;
19092 echo "$as_me:19092: result: $with_warnings" >&5
19093 echo "${ECHO_T}$with_warnings" >&6
19094 if test "$with_warnings" = "yes"
19095 then
19096
19097 if test "$GCC" = yes
19098 then
19099 cat > conftest.i <<EOF
19100 #ifndef GCC_PRINTF
19101 #define GCC_PRINTF 0
19102 #endif
19103 #ifndef GCC_SCANF
19104 #define GCC_SCANF 0
19105 #endif
19106 #ifndef GCC_NORETURN
19107 #define GCC_NORETURN /* nothing */
19108 #endif
19109 #ifndef GCC_UNUSED
19110 #define GCC_UNUSED /* nothing */
19111 #endif
19112 EOF
19113 if test "$GCC" = yes
19114 then
19115         { echo "$as_me:19115: checking for $CC __attribute__ directives..." >&5
19116 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
19117 cat > conftest.$ac_ext <<EOF
19118 #line 19118 "${as_me:-configure}"
19119 #include "confdefs.h"
19120 #include "conftest.h"
19121 #include "conftest.i"
19122 #if     GCC_PRINTF
19123 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
19124 #else
19125 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
19126 #endif
19127 #if     GCC_SCANF
19128 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
19129 #else
19130 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
19131 #endif
19132 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
19133 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
19134 extern void foo(void) GCC_NORETURN;
19135 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
19136 EOF
19137         cf_printf_attribute=no
19138         cf_scanf_attribute=no
19139         for cf_attribute in scanf printf unused noreturn
19140         do
19141
19142 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
19143
19144                 cf_directive="__attribute__(($cf_attribute))"
19145                 echo "checking for $CC $cf_directive" 1>&5
19146
19147                 case $cf_attribute in
19148                 (printf)
19149                         cf_printf_attribute=yes
19150                         cat >conftest.h <<EOF
19151 #define GCC_$cf_ATTRIBUTE 1
19152 EOF
19153                         ;;
19154                 (scanf)
19155                         cf_scanf_attribute=yes
19156                         cat >conftest.h <<EOF
19157 #define GCC_$cf_ATTRIBUTE 1
19158 EOF
19159                         ;;
19160                 (*)
19161                         cat >conftest.h <<EOF
19162 #define GCC_$cf_ATTRIBUTE $cf_directive
19163 EOF
19164                         ;;
19165                 esac
19166
19167                 if { (eval echo "$as_me:19167: \"$ac_compile\"") >&5
19168   (eval $ac_compile) 2>&5
19169   ac_status=$?
19170   echo "$as_me:19170: \$? = $ac_status" >&5
19171   (exit $ac_status); }; then
19172                         test -n "$verbose" && echo "$as_me:19172: result: ... $cf_attribute" >&5
19173 echo "${ECHO_T}... $cf_attribute" >&6
19174                         cat conftest.h >>confdefs.h
19175                         case $cf_attribute in
19176                         (noreturn)
19177
19178 cat >>confdefs.h <<EOF
19179 #define GCC_NORETURN $cf_directive
19180 EOF
19181
19182                                 ;;
19183                         (printf)
19184                                 cf_value='/* nothing */'
19185                                 if test "$cf_printf_attribute" != no ; then
19186                                         cf_value='__attribute__((format(printf,fmt,var)))'
19187
19188 cat >>confdefs.h <<\EOF
19189 #define GCC_PRINTF 1
19190 EOF
19191
19192                                 fi
19193
19194 cat >>confdefs.h <<EOF
19195 #define GCC_PRINTFLIKE(fmt,var) $cf_value
19196 EOF
19197
19198                                 ;;
19199                         (scanf)
19200                                 cf_value='/* nothing */'
19201                                 if test "$cf_scanf_attribute" != no ; then
19202                                         cf_value='__attribute__((format(scanf,fmt,var)))'
19203
19204 cat >>confdefs.h <<\EOF
19205 #define GCC_SCANF 1
19206 EOF
19207
19208                                 fi
19209
19210 cat >>confdefs.h <<EOF
19211 #define GCC_SCANFLIKE(fmt,var) $cf_value
19212 EOF
19213
19214                                 ;;
19215                         (unused)
19216
19217 cat >>confdefs.h <<EOF
19218 #define GCC_UNUSED $cf_directive
19219 EOF
19220
19221                                 ;;
19222                         esac
19223                 fi
19224         done
19225 else
19226         fgrep define conftest.i >>confdefs.h
19227 fi
19228 rm -rf conftest*
19229 fi
19230
19231 INTEL_COMPILER=no
19232
19233 if test "$GCC" = yes ; then
19234         case $host_os in
19235         (linux*|gnu*)
19236                 echo "$as_me:19236: checking if this is really Intel C compiler" >&5
19237 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
19238                 cf_save_CFLAGS="$CFLAGS"
19239                 CFLAGS="$CFLAGS -no-gcc"
19240                 cat >conftest.$ac_ext <<_ACEOF
19241 #line 19241 "configure"
19242 #include "confdefs.h"
19243
19244 int
19245 main (void)
19246 {
19247
19248 #ifdef __INTEL_COMPILER
19249 #else
19250 make an error
19251 #endif
19252
19253   ;
19254   return 0;
19255 }
19256 _ACEOF
19257 rm -f conftest.$ac_objext
19258 if { (eval echo "$as_me:19258: \"$ac_compile\"") >&5
19259   (eval $ac_compile) 2>&5
19260   ac_status=$?
19261   echo "$as_me:19261: \$? = $ac_status" >&5
19262   (exit $ac_status); } &&
19263          { ac_try='test -s conftest.$ac_objext'
19264   { (eval echo "$as_me:19264: \"$ac_try\"") >&5
19265   (eval $ac_try) 2>&5
19266   ac_status=$?
19267   echo "$as_me:19267: \$? = $ac_status" >&5
19268   (exit $ac_status); }; }; then
19269   INTEL_COMPILER=yes
19270 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
19271
19272 else
19273   echo "$as_me: failed program was:" >&5
19274 cat conftest.$ac_ext >&5
19275 fi
19276 rm -f conftest.$ac_objext conftest.$ac_ext
19277                 CFLAGS="$cf_save_CFLAGS"
19278                 echo "$as_me:19278: result: $INTEL_COMPILER" >&5
19279 echo "${ECHO_T}$INTEL_COMPILER" >&6
19280                 ;;
19281         esac
19282 fi
19283
19284 CLANG_COMPILER=no
19285
19286 if test "$GCC" = yes ; then
19287         echo "$as_me:19287: checking if this is really Clang C compiler" >&5
19288 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
19289         cf_save_CFLAGS="$CFLAGS"
19290         CFLAGS="$CFLAGS -Qunused-arguments"
19291         cat >conftest.$ac_ext <<_ACEOF
19292 #line 19292 "configure"
19293 #include "confdefs.h"
19294
19295 int
19296 main (void)
19297 {
19298
19299 #ifdef __clang__
19300 #else
19301 make an error
19302 #endif
19303
19304   ;
19305   return 0;
19306 }
19307 _ACEOF
19308 rm -f conftest.$ac_objext
19309 if { (eval echo "$as_me:19309: \"$ac_compile\"") >&5
19310   (eval $ac_compile) 2>&5
19311   ac_status=$?
19312   echo "$as_me:19312: \$? = $ac_status" >&5
19313   (exit $ac_status); } &&
19314          { ac_try='test -s conftest.$ac_objext'
19315   { (eval echo "$as_me:19315: \"$ac_try\"") >&5
19316   (eval $ac_try) 2>&5
19317   ac_status=$?
19318   echo "$as_me:19318: \$? = $ac_status" >&5
19319   (exit $ac_status); }; }; then
19320   CLANG_COMPILER=yes
19321 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
19322
19323 else
19324   echo "$as_me: failed program was:" >&5
19325 cat conftest.$ac_ext >&5
19326 fi
19327 rm -f conftest.$ac_objext conftest.$ac_ext
19328         CFLAGS="$cf_save_CFLAGS"
19329         echo "$as_me:19329: result: $CLANG_COMPILER" >&5
19330 echo "${ECHO_T}$CLANG_COMPILER" >&6
19331 fi
19332
19333 cat > conftest.$ac_ext <<EOF
19334 #line 19334 "${as_me:-configure}"
19335 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
19336 EOF
19337
19338 if test "$INTEL_COMPILER" = yes
19339 then
19340 # The "-wdXXX" options suppress warnings:
19341 # remark #1419: external declaration in primary source file
19342 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
19343 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
19344 # remark #193: zero used for undefined preprocessing identifier
19345 # remark #593: variable "curs_sb_left_arrow" was set but never used
19346 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
19347 # remark #869: parameter "tw" was never referenced
19348 # remark #981: operands are evaluated in unspecified order
19349 # warning #279: controlling expression is constant
19350
19351         { echo "$as_me:19351: checking for $CC warning options..." >&5
19352 echo "$as_me: checking for $CC warning options..." >&6;}
19353         cf_save_CFLAGS="$CFLAGS"
19354         EXTRA_CFLAGS="-Wall"
19355         for cf_opt in \
19356                 wd1419 \
19357                 wd1683 \
19358                 wd1684 \
19359                 wd193 \
19360                 wd593 \
19361                 wd279 \
19362                 wd810 \
19363                 wd869 \
19364                 wd981
19365         do
19366                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19367                 if { (eval echo "$as_me:19367: \"$ac_compile\"") >&5
19368   (eval $ac_compile) 2>&5
19369   ac_status=$?
19370   echo "$as_me:19370: \$? = $ac_status" >&5
19371   (exit $ac_status); }; then
19372                         test -n "$verbose" && echo "$as_me:19372: result: ... -$cf_opt" >&5
19373 echo "${ECHO_T}... -$cf_opt" >&6
19374                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19375                 fi
19376         done
19377         CFLAGS="$cf_save_CFLAGS"
19378
19379 elif test "$GCC" = yes
19380 then
19381         { echo "$as_me:19381: checking for $CC warning options..." >&5
19382 echo "$as_me: checking for $CC warning options..." >&6;}
19383         cf_save_CFLAGS="$CFLAGS"
19384         EXTRA_CFLAGS=
19385         cf_warn_CONST=""
19386         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
19387         cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
19388         test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
19389         for cf_opt in W Wall \
19390                 Wbad-function-cast \
19391                 Wcast-align \
19392                 Wcast-qual \
19393                 Wdeclaration-after-statement \
19394                 Wextra \
19395                 Winline \
19396                 Wmissing-declarations \
19397                 Wmissing-prototypes \
19398                 Wnested-externs \
19399                 Wpointer-arith \
19400                 Wshadow \
19401                 Wstrict-prototypes \
19402                 Wundef $cf_gcc_warnings $cf_warn_CONST Wno-unknown-pragmas
19403         do
19404                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
19405                 if { (eval echo "$as_me:19405: \"$ac_compile\"") >&5
19406   (eval $ac_compile) 2>&5
19407   ac_status=$?
19408   echo "$as_me:19408: \$? = $ac_status" >&5
19409   (exit $ac_status); }; then
19410                         test -n "$verbose" && echo "$as_me:19410: result: ... -$cf_opt" >&5
19411 echo "${ECHO_T}... -$cf_opt" >&6
19412                         case $cf_opt in
19413                         (Wcast-qual)
19414
19415         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19416         CPPFLAGS="${CPPFLAGS}-DXTSTRINGDEFINES"
19417
19418                                 ;;
19419                         (Winline)
19420                                 case $GCC_VERSION in
19421                                 ([34].*)
19422                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19423
19424 echo "${as_me:-configure}:19424: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19425
19426                                         continue;;
19427                                 esac
19428                                 ;;
19429                         (Wpointer-arith)
19430                                 case $GCC_VERSION in
19431                                 ([12].*)
19432                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
19433
19434 echo "${as_me:-configure}:19434: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
19435
19436                                         continue;;
19437                                 esac
19438                                 ;;
19439                         esac
19440                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
19441                 fi
19442         done
19443         CFLAGS="$cf_save_CFLAGS"
19444 fi
19445 rm -rf conftest*
19446
19447 fi
19448 fi
19449
19450 echo "$as_me:19450: checking if you want to use dmalloc for testing" >&5
19451 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
19452
19453 # Check whether --with-dmalloc or --without-dmalloc was given.
19454 if test "${with_dmalloc+set}" = set; then
19455   withval="$with_dmalloc"
19456
19457 cat >>confdefs.h <<EOF
19458 #define USE_DMALLOC 1
19459 EOF
19460
19461         : ${with_cflags:=-g}
19462         : ${with_no_leaks:=yes}
19463          with_dmalloc=yes
19464 else
19465   with_dmalloc=
19466 fi;
19467 echo "$as_me:19467: result: ${with_dmalloc:-no}" >&5
19468 echo "${ECHO_T}${with_dmalloc:-no}" >&6
19469
19470 case .$with_cflags in
19471 (.*-g*)
19472         case .$CFLAGS in
19473         (.*-g*)
19474                 ;;
19475         (*)
19476
19477 cf_fix_cppflags=no
19478 cf_new_cflags=
19479 cf_new_cppflags=
19480 cf_new_extra_cppflags=
19481
19482 for cf_add_cflags in -g
19483 do
19484 case $cf_fix_cppflags in
19485 (no)
19486         case $cf_add_cflags in
19487         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19488                 case $cf_add_cflags in
19489                 (-D*)
19490                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19491
19492                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19493                                 && test -z "${cf_tst_cflags}" \
19494                                 && cf_fix_cppflags=yes
19495
19496                         if test $cf_fix_cppflags = yes ; then
19497
19498         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19499         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19500
19501                                 continue
19502                         elif test "${cf_tst_cflags}" = "\"'" ; then
19503
19504         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19505         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19506
19507                                 continue
19508                         fi
19509                         ;;
19510                 esac
19511                 case "$CPPFLAGS" in
19512                 (*$cf_add_cflags)
19513                         ;;
19514                 (*)
19515                         case $cf_add_cflags in
19516                         (-D*)
19517                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19518
19519 CPPFLAGS=`echo "$CPPFLAGS" | \
19520         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19521                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19522
19523                                 ;;
19524                         esac
19525
19526         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19527         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19528
19529                         ;;
19530                 esac
19531                 ;;
19532         (*)
19533
19534         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19535         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19536
19537                 ;;
19538         esac
19539         ;;
19540 (yes)
19541
19542         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19543         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19544
19545         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19546
19547         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19548                 && test -z "${cf_tst_cflags}" \
19549                 && cf_fix_cppflags=no
19550         ;;
19551 esac
19552 done
19553
19554 if test -n "$cf_new_cflags" ; then
19555
19556         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19557         CFLAGS="${CFLAGS}$cf_new_cflags"
19558
19559 fi
19560
19561 if test -n "$cf_new_cppflags" ; then
19562
19563         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19564         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19565
19566 fi
19567
19568 if test -n "$cf_new_extra_cppflags" ; then
19569
19570         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19571         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19572
19573 fi
19574
19575                 ;;
19576         esac
19577         ;;
19578 esac
19579
19580 if test "$with_dmalloc" = yes ; then
19581         echo "$as_me:19581: checking for dmalloc.h" >&5
19582 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
19583 if test "${ac_cv_header_dmalloc_h+set}" = set; then
19584   echo $ECHO_N "(cached) $ECHO_C" >&6
19585 else
19586   cat >conftest.$ac_ext <<_ACEOF
19587 #line 19587 "configure"
19588 #include "confdefs.h"
19589 #include <dmalloc.h>
19590 _ACEOF
19591 if { (eval echo "$as_me:19591: \"$ac_cpp conftest.$ac_ext\"") >&5
19592   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19593   ac_status=$?
19594   egrep -v '^ *\+' conftest.er1 >conftest.err
19595   rm -f conftest.er1
19596   cat conftest.err >&5
19597   echo "$as_me:19597: \$? = $ac_status" >&5
19598   (exit $ac_status); } >/dev/null; then
19599   if test -s conftest.err; then
19600     ac_cpp_err=$ac_c_preproc_warn_flag
19601   else
19602     ac_cpp_err=
19603   fi
19604 else
19605   ac_cpp_err=yes
19606 fi
19607 if test -z "$ac_cpp_err"; then
19608   ac_cv_header_dmalloc_h=yes
19609 else
19610   echo "$as_me: failed program was:" >&5
19611   cat conftest.$ac_ext >&5
19612   ac_cv_header_dmalloc_h=no
19613 fi
19614 rm -f conftest.err conftest.$ac_ext
19615 fi
19616 echo "$as_me:19616: result: $ac_cv_header_dmalloc_h" >&5
19617 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
19618 if test $ac_cv_header_dmalloc_h = yes; then
19619
19620 echo "$as_me:19620: checking for dmalloc_debug in -ldmalloc" >&5
19621 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
19622 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
19623   echo $ECHO_N "(cached) $ECHO_C" >&6
19624 else
19625   ac_check_lib_save_LIBS=$LIBS
19626 LIBS="-ldmalloc  $LIBS"
19627 cat >conftest.$ac_ext <<_ACEOF
19628 #line 19628 "configure"
19629 #include "confdefs.h"
19630
19631 /* Override any gcc2 internal prototype to avoid an error.  */
19632 #ifdef __cplusplus
19633 extern "C"
19634 #endif
19635 /* We use char because int might match the return type of a gcc2
19636    builtin and then its argument prototype would still apply.  */
19637 char dmalloc_debug ();
19638 int
19639 main (void)
19640 {
19641 dmalloc_debug ();
19642   ;
19643   return 0;
19644 }
19645 _ACEOF
19646 rm -f conftest.$ac_objext conftest$ac_exeext
19647 if { (eval echo "$as_me:19647: \"$ac_link\"") >&5
19648   (eval $ac_link) 2>&5
19649   ac_status=$?
19650   echo "$as_me:19650: \$? = $ac_status" >&5
19651   (exit $ac_status); } &&
19652          { ac_try='test -s conftest$ac_exeext'
19653   { (eval echo "$as_me:19653: \"$ac_try\"") >&5
19654   (eval $ac_try) 2>&5
19655   ac_status=$?
19656   echo "$as_me:19656: \$? = $ac_status" >&5
19657   (exit $ac_status); }; }; then
19658   ac_cv_lib_dmalloc_dmalloc_debug=yes
19659 else
19660   echo "$as_me: failed program was:" >&5
19661 cat conftest.$ac_ext >&5
19662 ac_cv_lib_dmalloc_dmalloc_debug=no
19663 fi
19664 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19665 LIBS=$ac_check_lib_save_LIBS
19666 fi
19667 echo "$as_me:19667: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
19668 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
19669 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
19670   cat >>confdefs.h <<EOF
19671 #define HAVE_LIBDMALLOC 1
19672 EOF
19673
19674   LIBS="-ldmalloc $LIBS"
19675
19676 fi
19677
19678 fi
19679
19680 fi
19681
19682 echo "$as_me:19682: checking if you want to use dbmalloc for testing" >&5
19683 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
19684
19685 # Check whether --with-dbmalloc or --without-dbmalloc was given.
19686 if test "${with_dbmalloc+set}" = set; then
19687   withval="$with_dbmalloc"
19688
19689 cat >>confdefs.h <<EOF
19690 #define USE_DBMALLOC 1
19691 EOF
19692
19693         : ${with_cflags:=-g}
19694         : ${with_no_leaks:=yes}
19695          with_dbmalloc=yes
19696 else
19697   with_dbmalloc=
19698 fi;
19699 echo "$as_me:19699: result: ${with_dbmalloc:-no}" >&5
19700 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
19701
19702 case .$with_cflags in
19703 (.*-g*)
19704         case .$CFLAGS in
19705         (.*-g*)
19706                 ;;
19707         (*)
19708
19709 cf_fix_cppflags=no
19710 cf_new_cflags=
19711 cf_new_cppflags=
19712 cf_new_extra_cppflags=
19713
19714 for cf_add_cflags in -g
19715 do
19716 case $cf_fix_cppflags in
19717 (no)
19718         case $cf_add_cflags in
19719         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19720                 case $cf_add_cflags in
19721                 (-D*)
19722                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19723
19724                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19725                                 && test -z "${cf_tst_cflags}" \
19726                                 && cf_fix_cppflags=yes
19727
19728                         if test $cf_fix_cppflags = yes ; then
19729
19730         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19731         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19732
19733                                 continue
19734                         elif test "${cf_tst_cflags}" = "\"'" ; then
19735
19736         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19737         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19738
19739                                 continue
19740                         fi
19741                         ;;
19742                 esac
19743                 case "$CPPFLAGS" in
19744                 (*$cf_add_cflags)
19745                         ;;
19746                 (*)
19747                         case $cf_add_cflags in
19748                         (-D*)
19749                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19750
19751 CPPFLAGS=`echo "$CPPFLAGS" | \
19752         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19753                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19754
19755                                 ;;
19756                         esac
19757
19758         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19759         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19760
19761                         ;;
19762                 esac
19763                 ;;
19764         (*)
19765
19766         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19767         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
19768
19769                 ;;
19770         esac
19771         ;;
19772 (yes)
19773
19774         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19775         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19776
19777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
19778
19779         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19780                 && test -z "${cf_tst_cflags}" \
19781                 && cf_fix_cppflags=no
19782         ;;
19783 esac
19784 done
19785
19786 if test -n "$cf_new_cflags" ; then
19787
19788         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
19789         CFLAGS="${CFLAGS}$cf_new_cflags"
19790
19791 fi
19792
19793 if test -n "$cf_new_cppflags" ; then
19794
19795         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
19796         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
19797
19798 fi
19799
19800 if test -n "$cf_new_extra_cppflags" ; then
19801
19802         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
19803         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
19804
19805 fi
19806
19807                 ;;
19808         esac
19809         ;;
19810 esac
19811
19812 if test "$with_dbmalloc" = yes ; then
19813         echo "$as_me:19813: checking for dbmalloc.h" >&5
19814 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
19815 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
19816   echo $ECHO_N "(cached) $ECHO_C" >&6
19817 else
19818   cat >conftest.$ac_ext <<_ACEOF
19819 #line 19819 "configure"
19820 #include "confdefs.h"
19821 #include <dbmalloc.h>
19822 _ACEOF
19823 if { (eval echo "$as_me:19823: \"$ac_cpp conftest.$ac_ext\"") >&5
19824   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
19825   ac_status=$?
19826   egrep -v '^ *\+' conftest.er1 >conftest.err
19827   rm -f conftest.er1
19828   cat conftest.err >&5
19829   echo "$as_me:19829: \$? = $ac_status" >&5
19830   (exit $ac_status); } >/dev/null; then
19831   if test -s conftest.err; then
19832     ac_cpp_err=$ac_c_preproc_warn_flag
19833   else
19834     ac_cpp_err=
19835   fi
19836 else
19837   ac_cpp_err=yes
19838 fi
19839 if test -z "$ac_cpp_err"; then
19840   ac_cv_header_dbmalloc_h=yes
19841 else
19842   echo "$as_me: failed program was:" >&5
19843   cat conftest.$ac_ext >&5
19844   ac_cv_header_dbmalloc_h=no
19845 fi
19846 rm -f conftest.err conftest.$ac_ext
19847 fi
19848 echo "$as_me:19848: result: $ac_cv_header_dbmalloc_h" >&5
19849 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
19850 if test $ac_cv_header_dbmalloc_h = yes; then
19851
19852 echo "$as_me:19852: checking for debug_malloc in -ldbmalloc" >&5
19853 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
19854 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
19855   echo $ECHO_N "(cached) $ECHO_C" >&6
19856 else
19857   ac_check_lib_save_LIBS=$LIBS
19858 LIBS="-ldbmalloc  $LIBS"
19859 cat >conftest.$ac_ext <<_ACEOF
19860 #line 19860 "configure"
19861 #include "confdefs.h"
19862
19863 /* Override any gcc2 internal prototype to avoid an error.  */
19864 #ifdef __cplusplus
19865 extern "C"
19866 #endif
19867 /* We use char because int might match the return type of a gcc2
19868    builtin and then its argument prototype would still apply.  */
19869 char debug_malloc ();
19870 int
19871 main (void)
19872 {
19873 debug_malloc ();
19874   ;
19875   return 0;
19876 }
19877 _ACEOF
19878 rm -f conftest.$ac_objext conftest$ac_exeext
19879 if { (eval echo "$as_me:19879: \"$ac_link\"") >&5
19880   (eval $ac_link) 2>&5
19881   ac_status=$?
19882   echo "$as_me:19882: \$? = $ac_status" >&5
19883   (exit $ac_status); } &&
19884          { ac_try='test -s conftest$ac_exeext'
19885   { (eval echo "$as_me:19885: \"$ac_try\"") >&5
19886   (eval $ac_try) 2>&5
19887   ac_status=$?
19888   echo "$as_me:19888: \$? = $ac_status" >&5
19889   (exit $ac_status); }; }; then
19890   ac_cv_lib_dbmalloc_debug_malloc=yes
19891 else
19892   echo "$as_me: failed program was:" >&5
19893 cat conftest.$ac_ext >&5
19894 ac_cv_lib_dbmalloc_debug_malloc=no
19895 fi
19896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
19897 LIBS=$ac_check_lib_save_LIBS
19898 fi
19899 echo "$as_me:19899: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
19900 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
19901 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
19902   cat >>confdefs.h <<EOF
19903 #define HAVE_LIBDBMALLOC 1
19904 EOF
19905
19906   LIBS="-ldbmalloc $LIBS"
19907
19908 fi
19909
19910 fi
19911
19912 fi
19913
19914 echo "$as_me:19914: checking if you want to use valgrind for testing" >&5
19915 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
19916
19917 # Check whether --with-valgrind or --without-valgrind was given.
19918 if test "${with_valgrind+set}" = set; then
19919   withval="$with_valgrind"
19920
19921 cat >>confdefs.h <<EOF
19922 #define USE_VALGRIND 1
19923 EOF
19924
19925         : ${with_cflags:=-g}
19926         : ${with_no_leaks:=yes}
19927          with_valgrind=yes
19928 else
19929   with_valgrind=
19930 fi;
19931 echo "$as_me:19931: result: ${with_valgrind:-no}" >&5
19932 echo "${ECHO_T}${with_valgrind:-no}" >&6
19933
19934 case .$with_cflags in
19935 (.*-g*)
19936         case .$CFLAGS in
19937         (.*-g*)
19938                 ;;
19939         (*)
19940
19941 cf_fix_cppflags=no
19942 cf_new_cflags=
19943 cf_new_cppflags=
19944 cf_new_extra_cppflags=
19945
19946 for cf_add_cflags in -g
19947 do
19948 case $cf_fix_cppflags in
19949 (no)
19950         case $cf_add_cflags in
19951         (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
19952                 case $cf_add_cflags in
19953                 (-D*)
19954                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
19955
19956                         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
19957                                 && test -z "${cf_tst_cflags}" \
19958                                 && cf_fix_cppflags=yes
19959
19960                         if test $cf_fix_cppflags = yes ; then
19961
19962         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19963         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19964
19965                                 continue
19966                         elif test "${cf_tst_cflags}" = "\"'" ; then
19967
19968         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
19969         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
19970
19971                                 continue
19972                         fi
19973                         ;;
19974                 esac
19975                 case "$CPPFLAGS" in
19976                 (*$cf_add_cflags)
19977                         ;;
19978                 (*)
19979                         case $cf_add_cflags in
19980                         (-D*)
19981                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
19982
19983 CPPFLAGS=`echo "$CPPFLAGS" | \
19984         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
19985                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
19986
19987                                 ;;
19988                         esac
19989
19990         test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags "
19991         cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags"
19992
19993                         ;;
19994                 esac
19995                 ;;
19996         (*)
19997
19998         test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags "
19999         cf_new_cflags="${cf_new_cflags}$cf_add_cflags"
20000
20001                 ;;
20002         esac
20003         ;;
20004 (yes)
20005
20006         test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags "
20007         cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags"
20008
20009         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
20010
20011         test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
20012                 && test -z "${cf_tst_cflags}" \
20013                 && cf_fix_cppflags=no
20014         ;;
20015 esac
20016 done
20017
20018 if test -n "$cf_new_cflags" ; then
20019
20020         test -n "$CFLAGS" && CFLAGS="$CFLAGS "
20021         CFLAGS="${CFLAGS}$cf_new_cflags"
20022
20023 fi
20024
20025 if test -n "$cf_new_cppflags" ; then
20026
20027         test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS "
20028         CPPFLAGS="${CPPFLAGS}$cf_new_cppflags"
20029
20030 fi
20031
20032 if test -n "$cf_new_extra_cppflags" ; then
20033
20034         test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS "
20035         EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags"
20036
20037 fi
20038
20039                 ;;
20040         esac
20041         ;;
20042 esac
20043
20044 echo "$as_me:20044: checking if you want to perform memory-leak testing" >&5
20045 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
20046
20047 # Check whether --enable-leaks or --disable-leaks was given.
20048 if test "${enable_leaks+set}" = set; then
20049   enableval="$enable_leaks"
20050   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
20051 else
20052   : ${with_no_leaks:=no}
20053 fi;
20054 echo "$as_me:20054: result: $with_no_leaks" >&5
20055 echo "${ECHO_T}$with_no_leaks" >&6
20056
20057 if test "$with_no_leaks" = yes ; then
20058
20059 cat >>confdefs.h <<\EOF
20060 #define NO_LEAKS 1
20061 EOF
20062
20063 cat >>confdefs.h <<\EOF
20064 #define YY_NO_LEAKS 1
20065 EOF
20066
20067 fi
20068
20069 LD_RPATH_OPT=
20070 echo "$as_me:20070: checking for an rpath option" >&5
20071 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
20072 case $cf_cv_system_name in
20073 (irix*)
20074         if test "$GCC" = yes; then
20075                 LD_RPATH_OPT="-Wl,-rpath,"
20076         else
20077                 LD_RPATH_OPT="-rpath "
20078         fi
20079         ;;
20080 (linux*|gnu*|k*bsd*-gnu|freebsd*)
20081         LD_RPATH_OPT="-Wl,-rpath,"
20082         ;;
20083 (openbsd[2-9].*|mirbsd*)
20084         LD_RPATH_OPT="-Wl,-rpath,"
20085         ;;
20086 (dragonfly*)
20087         LD_RPATH_OPT="-rpath "
20088         ;;
20089 (netbsd*)
20090         LD_RPATH_OPT="-Wl,-rpath,"
20091         ;;
20092 (osf*|mls+*)
20093         LD_RPATH_OPT="-rpath "
20094         ;;
20095 (solaris2*)
20096         LD_RPATH_OPT="-R"
20097         ;;
20098 (*)
20099         ;;
20100 esac
20101 echo "$as_me:20101: result: $LD_RPATH_OPT" >&5
20102 echo "${ECHO_T}$LD_RPATH_OPT" >&6
20103
20104 case "x$LD_RPATH_OPT" in
20105 (x-R*)
20106         echo "$as_me:20106: checking if we need a space after rpath option" >&5
20107 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
20108         cf_save_LIBS="$LIBS"
20109
20110 cf_add_libs="${LD_RPATH_OPT}$libdir"
20111 # Filter out duplicates - this happens with badly-designed ".pc" files...
20112 for cf_add_1lib in $LIBS
20113 do
20114         for cf_add_2lib in $cf_add_libs
20115         do
20116                 if test "x$cf_add_1lib" = "x$cf_add_2lib"
20117                 then
20118                         cf_add_1lib=
20119                         break
20120                 fi
20121         done
20122         test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
20123 done
20124 LIBS="$cf_add_libs"
20125
20126         cat >conftest.$ac_ext <<_ACEOF
20127 #line 20127 "configure"
20128 #include "confdefs.h"
20129
20130 int
20131 main (void)
20132 {
20133
20134   ;
20135   return 0;
20136 }
20137 _ACEOF
20138 rm -f conftest.$ac_objext conftest$ac_exeext
20139 if { (eval echo "$as_me:20139: \"$ac_link\"") >&5
20140   (eval $ac_link) 2>&5
20141   ac_status=$?
20142   echo "$as_me:20142: \$? = $ac_status" >&5
20143   (exit $ac_status); } &&
20144          { ac_try='test -s conftest$ac_exeext'
20145   { (eval echo "$as_me:20145: \"$ac_try\"") >&5
20146   (eval $ac_try) 2>&5
20147   ac_status=$?
20148   echo "$as_me:20148: \$? = $ac_status" >&5
20149   (exit $ac_status); }; }; then
20150   cf_rpath_space=no
20151 else
20152   echo "$as_me: failed program was:" >&5
20153 cat conftest.$ac_ext >&5
20154 cf_rpath_space=yes
20155 fi
20156 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20157         LIBS="$cf_save_LIBS"
20158         echo "$as_me:20158: result: $cf_rpath_space" >&5
20159 echo "${ECHO_T}$cf_rpath_space" >&6
20160         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
20161         ;;
20162 esac
20163
20164 echo "$as_me:20164: checking if rpath-hack should be disabled" >&5
20165 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
20166
20167 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
20168 if test "${enable_rpath_hack+set}" = set; then
20169   enableval="$enable_rpath_hack"
20170   test "$enableval" != no && enableval=yes
20171         if test "$enableval" != "yes" ; then
20172     cf_disable_rpath_hack=yes
20173         else
20174                 cf_disable_rpath_hack=no
20175         fi
20176 else
20177   enableval=yes
20178         cf_disable_rpath_hack=no
20179
20180 fi;
20181 echo "$as_me:20181: result: $cf_disable_rpath_hack" >&5
20182 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
20183 if test "$cf_disable_rpath_hack" = no ; then
20184
20185 echo "$as_me:20185: checking for updated LDFLAGS" >&5
20186 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
20187 if test -n "$LD_RPATH_OPT" ; then
20188         echo "$as_me:20188: result: maybe" >&5
20189 echo "${ECHO_T}maybe" >&6
20190
20191         for ac_prog in ldd
20192 do
20193   # Extract the first word of "$ac_prog", so it can be a program name with args.
20194 set dummy $ac_prog; ac_word=$2
20195 echo "$as_me:20195: checking for $ac_word" >&5
20196 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
20197 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
20198   echo $ECHO_N "(cached) $ECHO_C" >&6
20199 else
20200   if test -n "$cf_ldd_prog"; then
20201   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
20202 else
20203   ac_save_IFS=$IFS; IFS=$ac_path_separator
20204 ac_dummy="$PATH"
20205 for ac_dir in $ac_dummy; do
20206   IFS=$ac_save_IFS
20207   test -z "$ac_dir" && ac_dir=.
20208   $as_executable_p "$ac_dir/$ac_word" || continue
20209 ac_cv_prog_cf_ldd_prog="$ac_prog"
20210 echo "$as_me:20210: found $ac_dir/$ac_word" >&5
20211 break
20212 done
20213
20214 fi
20215 fi
20216 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
20217 if test -n "$cf_ldd_prog"; then
20218   echo "$as_me:20218: result: $cf_ldd_prog" >&5
20219 echo "${ECHO_T}$cf_ldd_prog" >&6
20220 else
20221   echo "$as_me:20221: result: no" >&5
20222 echo "${ECHO_T}no" >&6
20223 fi
20224
20225   test -n "$cf_ldd_prog" && break
20226 done
20227 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
20228
20229         cf_rpath_list="/usr/lib /lib"
20230         if test "$cf_ldd_prog" != no
20231         then
20232                 cf_rpath_oops=
20233
20234 cat >conftest.$ac_ext <<_ACEOF
20235 #line 20235 "configure"
20236 #include "confdefs.h"
20237 #include <stdio.h>
20238 int
20239 main (void)
20240 {
20241 printf("Hello");
20242   ;
20243   return 0;
20244 }
20245 _ACEOF
20246 rm -f conftest.$ac_objext conftest$ac_exeext
20247 if { (eval echo "$as_me:20247: \"$ac_link\"") >&5
20248   (eval $ac_link) 2>&5
20249   ac_status=$?
20250   echo "$as_me:20250: \$? = $ac_status" >&5
20251   (exit $ac_status); } &&
20252          { ac_try='test -s conftest$ac_exeext'
20253   { (eval echo "$as_me:20253: \"$ac_try\"") >&5
20254   (eval $ac_try) 2>&5
20255   ac_status=$?
20256   echo "$as_me:20256: \$? = $ac_status" >&5
20257   (exit $ac_status); }; }; then
20258   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
20259                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq`
20260 else
20261   echo "$as_me: failed program was:" >&5
20262 cat conftest.$ac_ext >&5
20263 fi
20264 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
20265
20266                 # If we passed the link-test, but get a "not found" on a given library,
20267                 # this could be due to inept reconfiguration of gcc to make it only
20268                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
20269                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
20270                 # /usr/local libraries.
20271                 if test -n "$cf_rpath_oops"
20272                 then
20273                         for cf_rpath_src in $cf_rpath_oops
20274                         do
20275                                 for cf_rpath_dir in \
20276                                         /usr/local \
20277                                         /usr/pkg \
20278                                         /opt/sfw
20279                                 do
20280                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
20281                                         then
20282                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
20283
20284 echo "${as_me:-configure}:20284: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
20285
20286                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
20287                                                 break
20288                                         fi
20289                                 done
20290                         done
20291                 fi
20292         fi
20293
20294         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20295
20296 echo "${as_me:-configure}:20296: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20297
20298 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
20299
20300 echo "${as_me:-configure}:20300: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
20301
20302 cf_rpath_dst=
20303 for cf_rpath_src in $LDFLAGS
20304 do
20305         case $cf_rpath_src in
20306         (-L*)
20307
20308                 # check if this refers to a directory which we will ignore
20309                 cf_rpath_skip=no
20310                 if test -n "$cf_rpath_list"
20311                 then
20312                         for cf_rpath_item in $cf_rpath_list
20313                         do
20314                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20315                                 then
20316                                         cf_rpath_skip=yes
20317                                         break
20318                                 fi
20319                         done
20320                 fi
20321
20322                 if test "$cf_rpath_skip" = no
20323                 then
20324                         # transform the option
20325                         if test "$LD_RPATH_OPT" = "-R " ; then
20326                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20327                         else
20328                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20329                         fi
20330
20331                         # if we have not already added this, add it now
20332                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20333                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20334                         then
20335                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20336
20337 echo "${as_me:-configure}:20337: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20338
20339                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20340                         fi
20341                 fi
20342                 ;;
20343         esac
20344         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20345 done
20346 LDFLAGS=$cf_rpath_dst
20347
20348 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
20349
20350 echo "${as_me:-configure}:20350: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
20351
20352 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
20353
20354 echo "${as_me:-configure}:20354: testing ...checking LIBS $LIBS ..." 1>&5
20355
20356 cf_rpath_dst=
20357 for cf_rpath_src in $LIBS
20358 do
20359         case $cf_rpath_src in
20360         (-L*)
20361
20362                 # check if this refers to a directory which we will ignore
20363                 cf_rpath_skip=no
20364                 if test -n "$cf_rpath_list"
20365                 then
20366                         for cf_rpath_item in $cf_rpath_list
20367                         do
20368                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
20369                                 then
20370                                         cf_rpath_skip=yes
20371                                         break
20372                                 fi
20373                         done
20374                 fi
20375
20376                 if test "$cf_rpath_skip" = no
20377                 then
20378                         # transform the option
20379                         if test "$LD_RPATH_OPT" = "-R " ; then
20380                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
20381                         else
20382                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
20383                         fi
20384
20385                         # if we have not already added this, add it now
20386                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
20387                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
20388                         then
20389                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
20390
20391 echo "${as_me:-configure}:20391: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
20392
20393                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
20394                         fi
20395                 fi
20396                 ;;
20397         esac
20398         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
20399 done
20400 LIBS=$cf_rpath_dst
20401
20402 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
20403
20404 echo "${as_me:-configure}:20404: testing ...checked LIBS $LIBS ..." 1>&5
20405
20406         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
20407
20408 echo "${as_me:-configure}:20408: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
20409
20410 else
20411         echo "$as_me:20411: result: no" >&5
20412 echo "${ECHO_T}no" >&6
20413 fi
20414
20415 fi
20416
20417 TEST_ARGS="$LIBS"
20418 LIBS=
20419
20420 ac_config_files="$ac_config_files Makefile"
20421 ac_config_commands="$ac_config_commands default"
20422 cat >confcache <<\_ACEOF
20423 # This file is a shell script that caches the results of configure
20424 # tests run on this system so they can be shared between configure
20425 # scripts and configure runs, see configure's option --config-cache.
20426 # It is not useful on other systems.  If it contains results you don't
20427 # want to keep, you may remove or edit it.
20428 #
20429 # config.status only pays attention to the cache file if you give it
20430 # the --recheck option to rerun configure.
20431 #
20432 # `ac_cv_env_foo' variables (set or unset) will be overriden when
20433 # loading this file, other *unset* `ac_cv_foo' will be assigned the
20434 # following values.
20435
20436 _ACEOF
20437
20438 # The following way of writing the cache mishandles newlines in values,
20439 # but we know of no workaround that is simple, portable, and efficient.
20440 # So, don't put newlines in cache variables' values.
20441 # Ultrix sh set writes to stderr and can't be redirected directly,
20442 # and sets the high bit in the cache file unless we assign to the vars.
20443 {
20444   (set) 2>&1 |
20445     case `(ac_space=' '; set | grep ac_space) 2>&1` in
20446     *ac_space=\ *)
20447       # `set' does not quote correctly, so add quotes (double-quote
20448       # substitution turns \\\\ into \\, and sed turns \\ into \).
20449       sed -n \
20450         "s/'/'\\\\''/g;
20451           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
20452       ;;
20453     *)
20454       # `set' quotes correctly as required by POSIX, so do not add quotes.
20455       sed -n \
20456         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
20457       ;;
20458     esac;
20459 } |
20460   sed '
20461      t clear
20462      : clear
20463      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
20464      t end
20465      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
20466      : end' >>confcache
20467 if cmp -s $cache_file confcache; then :; else
20468   if test -w $cache_file; then
20469     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
20470     cat confcache >$cache_file
20471   else
20472     echo "not updating unwritable cache $cache_file"
20473   fi
20474 fi
20475 rm -f confcache
20476
20477 test "x$prefix" = xNONE && prefix=$ac_default_prefix
20478 # Let make expand exec_prefix.
20479 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
20480
20481 # VPATH may cause trouble with some makes, so we remove $(srcdir),
20482 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
20483 # trailing colons and then remove the whole line if VPATH becomes empty
20484 # (actually we leave an empty line to preserve line numbers).
20485 if test "x$srcdir" = x.; then
20486   ac_vpsub='/^[         ]*VPATH[        ]*=/{
20487 s/:*\$(srcdir):*/:/;
20488 s/:*\${srcdir}:*/:/;
20489 s/:*@srcdir@:*/:/;
20490 s/^\([^=]*=[    ]*\):*/\1/;
20491 s/:*$//;
20492 s/^[^=]*=[      ]*$//;
20493 }'
20494 fi
20495
20496 DEFS=-DHAVE_CONFIG_H
20497
20498 : ${CONFIG_STATUS=./config.status}
20499 ac_clean_files_save=$ac_clean_files
20500 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
20501 { echo "$as_me:20501: creating $CONFIG_STATUS" >&5
20502 echo "$as_me: creating $CONFIG_STATUS" >&6;}
20503 cat >$CONFIG_STATUS <<_ACEOF
20504 #! $SHELL
20505 # Generated automatically by configure.
20506 # Run this file to recreate the current configuration.
20507 # Compiler output produced by configure, useful for debugging
20508 # configure, is in config.log if it exists.
20509
20510 debug=false
20511 SHELL=\${CONFIG_SHELL-$SHELL}
20512 ac_cs_invocation="\$0 \$@"
20513
20514 _ACEOF
20515
20516 cat >>$CONFIG_STATUS <<\_ACEOF
20517 # Be Bourne compatible
20518 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
20519   emulate sh
20520   NULLCMD=:
20521 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
20522   set -o posix
20523 fi
20524
20525 # Name of the executable.
20526 as_me=`echo "$0" |sed 's,.*[\\/],,'`
20527
20528 if expr a : '\(a\)' >/dev/null 2>&1; then
20529   as_expr=expr
20530 else
20531   as_expr=false
20532 fi
20533
20534 rm -f conf$$ conf$$.exe conf$$.file
20535 echo >conf$$.file
20536 if ln -s conf$$.file conf$$ 2>/dev/null; then
20537   # We could just check for DJGPP; but this test a) works b) is more generic
20538   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
20539   if test -f conf$$.exe; then
20540     # Don't use ln at all; we don't have any links
20541     as_ln_s='cp -p'
20542   else
20543     as_ln_s='ln -s'
20544   fi
20545 elif ln conf$$.file conf$$ 2>/dev/null; then
20546   as_ln_s=ln
20547 else
20548   as_ln_s='cp -p'
20549 fi
20550 rm -f conf$$ conf$$.exe conf$$.file
20551
20552 as_executable_p="test -f"
20553
20554 # Support unset when possible.
20555 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
20556   as_unset=unset
20557 else
20558   as_unset=false
20559 fi
20560
20561 # NLS nuisances.
20562 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
20563 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
20564 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
20565 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
20566 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
20567 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
20568 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
20569 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
20570
20571 # IFS
20572 # We need space, tab and new line, in precisely that order.
20573 as_nl='
20574 '
20575 IFS="   $as_nl"
20576
20577 # CDPATH.
20578 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
20579
20580 exec 6>&1
20581
20582 _ACEOF
20583
20584 # Files that config.status was made for.
20585 if test -n "$ac_config_files"; then
20586   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
20587 fi
20588
20589 if test -n "$ac_config_headers"; then
20590   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
20591 fi
20592
20593 if test -n "$ac_config_links"; then
20594   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
20595 fi
20596
20597 if test -n "$ac_config_commands"; then
20598   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
20599 fi
20600
20601 cat >>$CONFIG_STATUS <<\EOF
20602
20603 ac_cs_usage="\
20604 \`$as_me' instantiates files from templates according to the
20605 current configuration.
20606
20607 Usage: $0 [OPTIONS] [FILE]...
20608
20609   -h, --help       print this help, then exit
20610   -V, --version    print version number, then exit
20611   -d, --debug      don't remove temporary files
20612       --recheck    update $as_me by reconfiguring in the same conditions
20613   --file=FILE[:TEMPLATE]
20614                    instantiate the configuration file FILE
20615   --header=FILE[:TEMPLATE]
20616                    instantiate the configuration header FILE
20617
20618 Configuration files:
20619 $config_files
20620
20621 Configuration headers:
20622 $config_headers
20623
20624 Configuration commands:
20625 $config_commands
20626
20627 Report bugs to <dickey@invisible-island.net>."
20628 EOF
20629
20630 cat >>$CONFIG_STATUS <<EOF
20631 ac_cs_version="\\
20632 config.status
20633 configured by $0, generated by GNU Autoconf 2.52.20170501,
20634   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
20635
20636 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
20637 Free Software Foundation, Inc.
20638 This config.status script is free software; the Free Software Foundation
20639 gives unlimited permission to copy, distribute and modify it."
20640 srcdir=$srcdir
20641 INSTALL="$INSTALL"
20642 EOF
20643
20644 cat >>$CONFIG_STATUS <<\EOF
20645 # If no file are specified by the user, then we need to provide default
20646 # value.  By we need to know if files were specified by the user.
20647 ac_need_defaults=:
20648 while test $# != 0
20649 do
20650   case $1 in
20651   --*=*)
20652     ac_option=`expr "x$1" : 'x\([^=]*\)='`
20653     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
20654     shift
20655     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
20656     shift
20657     ;;
20658   -*);;
20659   *) # This is not an option, so the user has probably given explicit
20660      # arguments.
20661      ac_need_defaults=false;;
20662   esac
20663
20664   case $1 in
20665   # Handling of the options.
20666 EOF
20667 cat >>$CONFIG_STATUS <<EOF
20668   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
20669     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
20670     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
20671 EOF
20672 cat >>$CONFIG_STATUS <<\EOF
20673   --version | --vers* | -V )
20674     echo "$ac_cs_version"; exit 0 ;;
20675   --he | --h)
20676     # Conflict between --help and --header
20677     { { echo "$as_me:20677: error: ambiguous option: $1
20678 Try \`$0 --help' for more information." >&5
20679 echo "$as_me: error: ambiguous option: $1
20680 Try \`$0 --help' for more information." >&2;}
20681    { (exit 1); exit 1; }; };;
20682   --help | --hel | -h )
20683     echo "$ac_cs_usage"; exit 0 ;;
20684   --debug | --d* | -d )
20685     debug=: ;;
20686   --file | --fil | --fi | --f )
20687     shift
20688     CONFIG_FILES="$CONFIG_FILES $1"
20689     ac_need_defaults=false;;
20690   --header | --heade | --head | --hea )
20691     shift
20692     CONFIG_HEADERS="$CONFIG_HEADERS $1"
20693     ac_need_defaults=false;;
20694
20695   # This is an error.
20696   -*) { { echo "$as_me:20696: error: unrecognized option: $1
20697 Try \`$0 --help' for more information." >&5
20698 echo "$as_me: error: unrecognized option: $1
20699 Try \`$0 --help' for more information." >&2;}
20700    { (exit 1); exit 1; }; } ;;
20701
20702   *) ac_config_targets="$ac_config_targets $1" ;;
20703
20704   esac
20705   shift
20706 done
20707
20708 exec 5>>config.log
20709 cat >&5 << _ACEOF
20710
20711 ## ----------------------- ##
20712 ## Running config.status.  ##
20713 ## ----------------------- ##
20714
20715 This file was extended by $as_me 2.52.20170501, executed with
20716   CONFIG_FILES    = $CONFIG_FILES
20717   CONFIG_HEADERS  = $CONFIG_HEADERS
20718   CONFIG_LINKS    = $CONFIG_LINKS
20719   CONFIG_COMMANDS = $CONFIG_COMMANDS
20720   > $ac_cs_invocation
20721 on `(hostname || uname -n) 2>/dev/null | sed 1q`
20722
20723 _ACEOF
20724 EOF
20725
20726 cat >>$CONFIG_STATUS <<EOF
20727 #
20728 # INIT-COMMANDS section.
20729 #
20730
20731 AWK="$AWK"
20732 ECHO_CC="$ECHO_CC"
20733 ECHO_LD="$ECHO_LD"
20734 SHOW_CC="$SHOW_LD"
20735
20736 EOF
20737
20738 cat >>$CONFIG_STATUS <<\EOF
20739 for ac_config_target in $ac_config_targets
20740 do
20741   case "$ac_config_target" in
20742   # Handling of arguments.
20743   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
20744   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
20745   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
20746   *) { { echo "$as_me:20746: error: invalid argument: $ac_config_target" >&5
20747 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
20748    { (exit 1); exit 1; }; };;
20749   esac
20750 done
20751
20752 # If the user did not use the arguments to specify the items to instantiate,
20753 # then the envvar interface is used.  Set only those that are not.
20754 # We use the long form for the default assignment because of an extremely
20755 # bizarre bug on SunOS 4.1.3.
20756 if $ac_need_defaults; then
20757   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
20758   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
20759   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
20760 fi
20761
20762 # Create a temporary directory, and hook for its removal unless debugging.
20763 $debug ||
20764 {
20765   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
20766   trap '{ (exit 1); exit 1; }' 1 2 13 15
20767 }
20768
20769 # Create a (secure) tmp directory for tmp files.
20770 : ${TMPDIR=/tmp}
20771 {
20772   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
20773   test -n "$tmp" && test -d "$tmp"
20774 }  ||
20775 {
20776   tmp=$TMPDIR/cs$$-$RANDOM
20777   (umask 077 && mkdir $tmp)
20778 } ||
20779 {
20780    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
20781    { (exit 1); exit 1; }
20782 }
20783
20784 EOF
20785
20786 cat >>$CONFIG_STATUS <<EOF
20787
20788 #
20789 # CONFIG_FILES section.
20790 #
20791
20792 # No need to generate the scripts if there are no CONFIG_FILES.
20793 # This happens for instance when ./config.status config.h
20794 if test -n "\$CONFIG_FILES"; then
20795   # Protect against being on the right side of a sed subst in config.status.
20796   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
20797    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
20798 s,@SHELL@,$SHELL,;t t
20799 s,@exec_prefix@,$exec_prefix,;t t
20800 s,@prefix@,$prefix,;t t
20801 s,@program_transform_name@,$program_transform_name,;t t
20802 s,@bindir@,$bindir,;t t
20803 s,@sbindir@,$sbindir,;t t
20804 s,@libexecdir@,$libexecdir,;t t
20805 s,@datarootdir@,$datarootdir,;t t
20806 s,@datadir@,$datadir,;t t
20807 s,@sysconfdir@,$sysconfdir,;t t
20808 s,@sharedstatedir@,$sharedstatedir,;t t
20809 s,@localstatedir@,$localstatedir,;t t
20810 s,@libdir@,$libdir,;t t
20811 s,@includedir@,$includedir,;t t
20812 s,@oldincludedir@,$oldincludedir,;t t
20813 s,@infodir@,$infodir,;t t
20814 s,@mandir@,$mandir,;t t
20815 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
20816 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
20817 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
20818 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
20819 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
20820 s,@build_alias@,$build_alias,;t t
20821 s,@host_alias@,$host_alias,;t t
20822 s,@target_alias@,$target_alias,;t t
20823 s,@ECHO_C@,$ECHO_C,;t t
20824 s,@ECHO_N@,$ECHO_N,;t t
20825 s,@ECHO_T@,$ECHO_T,;t t
20826 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
20827 s,@DEFS@,$DEFS,;t t
20828 s,@LIBS@,$LIBS,;t t
20829 s,@build@,$build,;t t
20830 s,@build_cpu@,$build_cpu,;t t
20831 s,@build_vendor@,$build_vendor,;t t
20832 s,@build_os@,$build_os,;t t
20833 s,@host@,$host,;t t
20834 s,@host_cpu@,$host_cpu,;t t
20835 s,@host_vendor@,$host_vendor,;t t
20836 s,@host_os@,$host_os,;t t
20837 s,@SET_MAKE@,$SET_MAKE,;t t
20838 s,@CC@,$CC,;t t
20839 s,@CFLAGS@,$CFLAGS,;t t
20840 s,@LDFLAGS@,$LDFLAGS,;t t
20841 s,@CPPFLAGS@,$CPPFLAGS,;t t
20842 s,@ac_ct_CC@,$ac_ct_CC,;t t
20843 s,@EXEEXT@,$EXEEXT,;t t
20844 s,@OBJEXT@,$OBJEXT,;t t
20845 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
20846 s,@CPP@,$CPP,;t t
20847 s,@AWK@,$AWK,;t t
20848 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
20849 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
20850 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
20851 s,@INSTALL_OPT_S@,$INSTALL_OPT_S,;t t
20852 s,@INSTALL_OPT_O@,$INSTALL_OPT_O,;t t
20853 s,@LINT@,$LINT,;t t
20854 s,@LINT_OPTS@,$LINT_OPTS,;t t
20855 s,@CTAGS@,$CTAGS,;t t
20856 s,@ETAGS@,$ETAGS,;t t
20857 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
20858 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
20859 s,@MATH_LIB@,$MATH_LIB,;t t
20860 s,@top_builddir@,$top_builddir,;t t
20861 s,@CC_G_OPT@,$CC_G_OPT,;t t
20862 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
20863 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
20864 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
20865 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
20866 s,@LD@,$LD,;t t
20867 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
20868 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
20869 s,@LD_MODEL@,$LD_MODEL,;t t
20870 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
20871 s,@LIBTOOL@,$LIBTOOL,;t t
20872 s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t
20873 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
20874 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
20875 s,@LIB_LINK@,$LIB_LINK,;t t
20876 s,@LINK_TESTS@,$LINK_TESTS,;t t
20877 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
20878 s,@PACKAGE@,$PACKAGE,;t t
20879 s,@PTHREAD@,$PTHREAD,;t t
20880 s,@TEST_ARGS@,$TEST_ARGS,;t t
20881 s,@TEST_DEPS@,$TEST_DEPS,;t t
20882 s,@TEST_LIBS@,$TEST_LIBS,;t t
20883 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
20884 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
20885 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
20886 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
20887 s,@includesubdir@,$includesubdir,;t t
20888 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
20889 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
20890 s,@ECHO_LT@,$ECHO_LT,;t t
20891 s,@ECHO_LD@,$ECHO_LD,;t t
20892 s,@RULE_CC@,$RULE_CC,;t t
20893 s,@SHOW_CC@,$SHOW_CC,;t t
20894 s,@ECHO_CC@,$ECHO_CC,;t t
20895 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
20896 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
20897 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
20898 s,@X_CFLAGS@,$X_CFLAGS,;t t
20899 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
20900 s,@X_LIBS@,$X_LIBS,;t t
20901 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
20902 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
20903 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
20904 s,@RGB_PATH@,$RGB_PATH,;t t
20905 s,@no_x11_rgb@,$no_x11_rgb,;t t
20906 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
20907 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
20908 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
20909 CEOF
20910
20911 EOF
20912
20913   cat >>$CONFIG_STATUS <<\EOF
20914   # Split the substitutions into bite-sized pieces for seds with
20915   # small command number limits, like on Digital OSF/1 and HP-UX.
20916   ac_max_sed_lines=48
20917   ac_sed_frag=1 # Number of current file.
20918   ac_beg=1 # First line for current file.
20919   ac_end=$ac_max_sed_lines # Line after last line for current file.
20920   ac_more_lines=:
20921   ac_sed_cmds=
20922   while $ac_more_lines; do
20923     if test $ac_beg -gt 1; then
20924       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20925     else
20926       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
20927     fi
20928     if test ! -s $tmp/subs.frag; then
20929       ac_more_lines=false
20930     else
20931       # The purpose of the label and of the branching condition is to
20932       # speed up the sed processing (if there are no `@' at all, there
20933       # is no need to browse any of the substitutions).
20934       # These are the two extra sed commands mentioned above.
20935       (echo ':t
20936   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
20937       # It is possible to make a multiline substitution using escaped newlines.
20938       # Ensure that we do not split the substitution between script fragments.
20939       ac_BEG=$ac_end
20940       ac_END=`expr $ac_end + $ac_max_sed_lines`
20941       sed "1,${ac_BEG}d; ${ac_END}p; q" $tmp/subs.sed >$tmp/subs.next
20942       if test -s $tmp/subs.next; then
20943         grep '^s,@[^@,][^@,]*@,.*\\$' $tmp/subs.next >$tmp/subs.edit
20944         if test ! -s $tmp/subs.edit; then
20945           grep "^s,@[^@,][^@,]*@,.*,;t t$" $tmp/subs.next >$tmp/subs.edit
20946           if test ! -s $tmp/subs.edit; then
20947             if test $ac_beg -gt 1; then
20948               ac_end=`expr $ac_end - 1`
20949               continue
20950             fi
20951           fi
20952         fi
20953       fi
20954
20955       if test -z "$ac_sed_cmds"; then
20956         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
20957       else
20958         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
20959       fi
20960       ac_sed_frag=`expr $ac_sed_frag + 1`
20961       ac_beg=$ac_end
20962       ac_end=`expr $ac_end + $ac_max_sed_lines`
20963     fi
20964   done
20965   if test -z "$ac_sed_cmds"; then
20966     ac_sed_cmds=cat
20967   fi
20968 fi # test -n "$CONFIG_FILES"
20969
20970 EOF
20971 cat >>$CONFIG_STATUS <<\EOF
20972 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
20973   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
20974   case $ac_file in
20975   - | *:- | *:-:* ) # input from stdin
20976         cat >$tmp/stdin
20977         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20978         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20979   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
20980         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
20981   * )   ac_file_in=$ac_file.in ;;
20982   esac
20983
20984   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
20985   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
20986          X"$ac_file" : 'X\(//\)[^/]' \| \
20987          X"$ac_file" : 'X\(//\)$' \| \
20988          X"$ac_file" : 'X\(/\)' \| \
20989          .     : '\(.\)' 2>/dev/null ||
20990 echo X"$ac_file" |
20991     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
20992           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
20993           /^X\(\/\/\)$/{ s//\1/; q; }
20994           /^X\(\/\).*/{ s//\1/; q; }
20995           s/.*/./; q'`
20996   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
20997     { case "$ac_dir" in
20998   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
20999   *)                      as_incr_dir=.;;
21000 esac
21001 as_dummy="$ac_dir"
21002 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21003   case $as_mkdir_dir in
21004     # Skip DOS drivespec
21005     ?:) as_incr_dir=$as_mkdir_dir ;;
21006     *)
21007       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21008       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21009     ;;
21010   esac
21011 done; }
21012
21013     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
21014     # A "../" for each directory in $ac_dir_suffix.
21015     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
21016   else
21017     ac_dir_suffix= ac_dots=
21018   fi
21019
21020   case $srcdir in
21021   .)  ac_srcdir=.
21022       if test -z "$ac_dots"; then
21023          ac_top_srcdir=.
21024       else
21025          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
21026       fi ;;
21027   [\\/]* | ?:[\\/]* )
21028       ac_srcdir=$srcdir$ac_dir_suffix;
21029       ac_top_srcdir=$srcdir ;;
21030   *) # Relative path.
21031     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
21032     ac_top_srcdir=$ac_dots$srcdir ;;
21033   esac
21034
21035   case $INSTALL in
21036   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
21037   *) ac_INSTALL=$ac_dots$INSTALL ;;
21038   esac
21039
21040   if test x"$ac_file" != x-; then
21041     { echo "$as_me:21041: creating $ac_file" >&5
21042 echo "$as_me: creating $ac_file" >&6;}
21043     rm -f "$ac_file"
21044   fi
21045   # Let's still pretend it is `configure' which instantiates (i.e., don't
21046   # use $as_me), people would be surprised to read:
21047   #    /* config.h.  Generated automatically by config.status.  */
21048   configure_input="Generated automatically from `echo $ac_file_in |
21049                                                  sed 's,.*/,,'` by configure."
21050
21051   # First look for the input files in the build tree, otherwise in the
21052   # src tree.
21053   ac_file_inputs=`IFS=:
21054     for f in $ac_file_in; do
21055       case $f in
21056       -) echo $tmp/stdin ;;
21057       [\\/$]*)
21058          # Absolute (can't be DOS-style, as IFS=:)
21059          test -f "$f" || { { echo "$as_me:21059: error: cannot find input file: $f" >&5
21060 echo "$as_me: error: cannot find input file: $f" >&2;}
21061    { (exit 1); exit 1; }; }
21062          echo $f;;
21063       *) # Relative
21064          if test -f "$f"; then
21065            # Build tree
21066            echo $f
21067          elif test -f "$srcdir/$f"; then
21068            # Source tree
21069            echo $srcdir/$f
21070          else
21071            # /dev/null tree
21072            { { echo "$as_me:21072: error: cannot find input file: $f" >&5
21073 echo "$as_me: error: cannot find input file: $f" >&2;}
21074    { (exit 1); exit 1; }; }
21075          fi;;
21076       esac
21077     done` || { (exit 1); exit 1; }
21078 EOF
21079 cat >>$CONFIG_STATUS <<\EOF
21080   ac_warn_datarootdir=no
21081   if test x"$ac_file" != x-; then
21082     for ac_item in $ac_file_inputs
21083     do
21084       ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' $ac_item`
21085       if test -n "$ac_seen"; then
21086         ac_used=`grep '@datarootdir@' $ac_item`
21087         if test -z "$ac_used"; then
21088           { echo "$as_me:21088: WARNING: datarootdir was used implicitly but not set:
21089 $ac_seen" >&5
21090 echo "$as_me: WARNING: datarootdir was used implicitly but not set:
21091 $ac_seen" >&2;}
21092           ac_warn_datarootdir=yes
21093         fi
21094       fi
21095       ac_seen=`grep '${datarootdir}' $ac_item`
21096       if test -n "$ac_seen"; then
21097         { echo "$as_me:21097: WARNING: datarootdir was used explicitly but not set:
21098 $ac_seen" >&5
21099 echo "$as_me: WARNING: datarootdir was used explicitly but not set:
21100 $ac_seen" >&2;}
21101         ac_warn_datarootdir=yes
21102       fi
21103     done
21104   fi
21105
21106 if test "x$ac_warn_datarootdir" = xyes; then
21107   ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'"
21108 fi
21109
21110 EOF
21111 cat >>$CONFIG_STATUS <<EOF
21112   sed "$ac_vpsub
21113 $extrasub
21114 EOF
21115 cat >>$CONFIG_STATUS <<\EOF
21116 :t
21117 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
21118 s,@configure_input@,$configure_input,;t t
21119 s,@srcdir@,$ac_srcdir,;t t
21120 s,@top_srcdir@,$ac_top_srcdir,;t t
21121 s,@INSTALL@,$ac_INSTALL,;t t
21122 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
21123   rm -f $tmp/stdin
21124   if test x"$ac_file" != x-; then
21125     cp $tmp/out $ac_file
21126
21127     for ac_name in prefix exec_prefix datarootdir
21128     do
21129         ac_seen=`fgrep -n '${'$ac_name'[:=].*}' $ac_file`
21130         if test -n "$ac_seen"; then
21131             ac_init=`egrep '[   ]*'$ac_name'[   ]*=' $ac_file`
21132             if test -z "$ac_init"; then
21133               ac_seen=`echo "$ac_seen" |sed -e 's,^,'$ac_file':,'`
21134               { echo "$as_me:21134: WARNING: Variable $ac_name is used but was not set:
21135 $ac_seen" >&5
21136 echo "$as_me: WARNING: Variable $ac_name is used but was not set:
21137 $ac_seen" >&2;}
21138             fi
21139         fi
21140     done
21141     egrep -n '@[a-z_][a-z_0-9]+@' $ac_file >$tmp/out
21142     egrep -n '@[A-Z_][A-Z_0-9]+@' $ac_file >>$tmp/out
21143     if test -s $tmp/out; then
21144       ac_seen=`sed -e 's,^,'$ac_file':,' < $tmp/out`
21145       { echo "$as_me:21145: WARNING: Some variables may not be substituted:
21146 $ac_seen" >&5
21147 echo "$as_me: WARNING: Some variables may not be substituted:
21148 $ac_seen" >&2;}
21149     fi
21150   else
21151     cat $tmp/out
21152   fi
21153   rm -f $tmp/out
21154
21155 done
21156 EOF
21157 cat >>$CONFIG_STATUS <<\EOF
21158
21159 #
21160 # CONFIG_HEADER section.
21161 #
21162
21163 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
21164 # NAME is the cpp macro being defined and VALUE is the value it is being given.
21165 #
21166 # ac_d sets the value in "#define NAME VALUE" lines.
21167 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
21168 ac_dB='[        ].*$,\1#\2'
21169 ac_dC=' '
21170 ac_dD=',;t'
21171 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
21172 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21173 ac_iB='\([      ]\),\1#\2define\3'
21174 ac_iC=' '
21175 ac_iD='\4,;t'
21176 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
21177 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
21178 ac_uB='$,\1#\2define\3'
21179 ac_uC=' '
21180 ac_uD=',;t'
21181
21182 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
21183   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
21184   case $ac_file in
21185   - | *:- | *:-:* ) # input from stdin
21186         cat >$tmp/stdin
21187         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21188         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21189   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
21190         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
21191   * )   ac_file_in=$ac_file.in ;;
21192   esac
21193
21194   test x"$ac_file" != x- && { echo "$as_me:21194: creating $ac_file" >&5
21195 echo "$as_me: creating $ac_file" >&6;}
21196
21197   # First look for the input files in the build tree, otherwise in the
21198   # src tree.
21199   ac_file_inputs=`IFS=:
21200     for f in $ac_file_in; do
21201       case $f in
21202       -) echo $tmp/stdin ;;
21203       [\\/$]*)
21204          # Absolute (can't be DOS-style, as IFS=:)
21205          test -f "$f" || { { echo "$as_me:21205: error: cannot find input file: $f" >&5
21206 echo "$as_me: error: cannot find input file: $f" >&2;}
21207    { (exit 1); exit 1; }; }
21208          echo $f;;
21209       *) # Relative
21210          if test -f "$f"; then
21211            # Build tree
21212            echo $f
21213          elif test -f "$srcdir/$f"; then
21214            # Source tree
21215            echo $srcdir/$f
21216          else
21217            # /dev/null tree
21218            { { echo "$as_me:21218: error: cannot find input file: $f" >&5
21219 echo "$as_me: error: cannot find input file: $f" >&2;}
21220    { (exit 1); exit 1; }; }
21221          fi;;
21222       esac
21223     done` || { (exit 1); exit 1; }
21224   # Remove the trailing spaces.
21225   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
21226
21227 EOF
21228
21229 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
21230 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
21231 # be either 'cat' or 'sort'.
21232 cat confdefs.h | uniq >conftest.vals
21233
21234 # Break up conftest.vals because some shells have a limit on
21235 # the size of here documents, and old seds have small limits too.
21236
21237 rm -f conftest.tail
21238 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
21239 while grep . conftest.vals >/dev/null
21240 do
21241   # Write chunks of a limited-size here document to conftest.frag.
21242   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
21243   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
21244   echo 'CEOF' >> $CONFIG_STATUS
21245   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
21246   rm -f conftest.vals
21247   mv conftest.tail conftest.vals
21248 done
21249 rm -f conftest.vals
21250
21251 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
21252 # marker @DEFS@.
21253 echo '  cat >> conftest.edit <<CEOF
21254 /@DEFS@/r conftest.frag
21255 /@DEFS@/d
21256 CEOF
21257 sed -f conftest.edit $tmp/in > $tmp/out
21258 rm -f $tmp/in
21259 mv $tmp/out $tmp/in
21260 rm -f conftest.edit conftest.frag
21261 ' >> $CONFIG_STATUS
21262
21263 cat >>$CONFIG_STATUS <<\EOF
21264   # Let's still pretend it is `configure' which instantiates (i.e., don't
21265   # use $as_me), people would be surprised to read:
21266   #    /* config.h.  Generated automatically by config.status.  */
21267   if test x"$ac_file" = x-; then
21268     echo "/* Generated automatically by configure.  */" >$tmp/config.h
21269   else
21270     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
21271   fi
21272   cat $tmp/in >>$tmp/config.h
21273   rm -f $tmp/in
21274   if test x"$ac_file" != x-; then
21275     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
21276       { echo "$as_me:21276: $ac_file is unchanged" >&5
21277 echo "$as_me: $ac_file is unchanged" >&6;}
21278     else
21279       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
21280          X"$ac_file" : 'X\(//\)[^/]' \| \
21281          X"$ac_file" : 'X\(//\)$' \| \
21282          X"$ac_file" : 'X\(/\)' \| \
21283          .     : '\(.\)' 2>/dev/null ||
21284 echo X"$ac_file" |
21285     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
21286           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
21287           /^X\(\/\/\)$/{ s//\1/; q; }
21288           /^X\(\/\).*/{ s//\1/; q; }
21289           s/.*/./; q'`
21290       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
21291         { case "$ac_dir" in
21292   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
21293   *)                      as_incr_dir=.;;
21294 esac
21295 as_dummy="$ac_dir"
21296 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
21297   case $as_mkdir_dir in
21298     # Skip DOS drivespec
21299     ?:) as_incr_dir=$as_mkdir_dir ;;
21300     *)
21301       as_incr_dir=$as_incr_dir/$as_mkdir_dir
21302       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
21303     ;;
21304   esac
21305 done; }
21306
21307       fi
21308       rm -f $ac_file
21309       mv $tmp/config.h $ac_file
21310     fi
21311   else
21312     cat $tmp/config.h
21313     rm -f $tmp/config.h
21314   fi
21315 done
21316 EOF
21317 cat >>$CONFIG_STATUS <<\EOF
21318 #
21319 # CONFIG_COMMANDS section.
21320 #
21321 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
21322   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
21323   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
21324
21325   case $ac_dest in
21326     default )
21327
21328 for cf_dir in .
21329 do
21330         if test ! -d $srcdir/$cf_dir; then
21331                 continue
21332         elif test -f $srcdir/$cf_dir/programs; then
21333                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
21334         fi
21335 done
21336
21337         cat >>Makefile <<TEST_EOF
21338
21339 # These rules are generated so we do not rely on suffix rules, which do not
21340 # work consistently for different make-programs (the '\$(MODEL)/' confuses
21341 # some, and the '\$x' confuses others).
21342 TEST_EOF
21343
21344 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
21345 for N in $LIST
21346 do
21347         cat >>Makefile <<TEST_EOF
21348
21349 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
21350         \$(srcdir)/test.priv.h \\
21351         ncurses_cfg.h
21352         $SHOW_CC
21353         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) -DMODULE_NAME="$N" \$(srcdir)/$N.c
21354 TEST_EOF
21355 done
21356
21357 if test -f ../config.guess && test -f ../config.sub
21358 then
21359         cat >>Makefile <<TEST_EOF
21360
21361 # if we used CF_INHERIT for getting these files, we can remove them
21362 distclean::
21363         rm -f config.guess config.sub
21364 TEST_EOF
21365 fi
21366  ;;
21367   esac
21368 done
21369 EOF
21370
21371 cat >>$CONFIG_STATUS <<\EOF
21372
21373 { (exit 0); exit 0; }
21374 EOF
21375 chmod +x $CONFIG_STATUS
21376 ac_clean_files=$ac_clean_files_save
21377
21378 # configure is writing to config.log, and then calls config.status.
21379 # config.status does its own redirection, appending to config.log.
21380 # Unfortunately, on DOS this fails, as config.log is still kept open
21381 # by configure, so config.status won't be able to write to it; its
21382 # output is simply discarded.  So we exec the FD to /dev/null,
21383 # effectively closing config.log, so it can be properly (re)opened and
21384 # appended to by config.status.  When coming back to configure, we
21385 # need to make the FD available again.
21386 if test "$no_create" != yes; then
21387   ac_cs_success=:
21388   exec 5>/dev/null
21389   $SHELL $CONFIG_STATUS || ac_cs_success=false
21390   exec 5>>config.log
21391   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
21392   # would make configure fail if this is the last instruction.
21393   $ac_cs_success || { (exit 1); exit 1; }
21394 fi
21395