]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20111203
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20101002.
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 datadir='${prefix}/share'
138 sysconfdir='${prefix}/etc'
139 sharedstatedir='${prefix}/com'
140 localstatedir='${prefix}/var'
141 libdir='${exec_prefix}/lib'
142 includedir='${prefix}/include'
143 oldincludedir='/usr/include'
144 infodir='${prefix}/info'
145 mandir='${prefix}/man'
146
147 # Identity of this package.
148 PACKAGE_NAME=
149 PACKAGE_TARNAME=
150 PACKAGE_VERSION=
151 PACKAGE_STRING=
152 PACKAGE_BUGREPORT=
153
154 ac_prev=
155 for ac_option
156 do
157   # If the previous option needs an argument, assign it.
158   if test -n "$ac_prev"; then
159     eval "$ac_prev=\$ac_option"
160     ac_prev=
161     continue
162   fi
163
164   ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
165
166   # Accept the important Cygnus configure options, so we can diagnose typos.
167
168   case $ac_option in
169
170   -bindir | --bindir | --bindi | --bind | --bin | --bi)
171     ac_prev=bindir ;;
172   -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
173     bindir=$ac_optarg ;;
174
175   -build | --build | --buil | --bui | --bu)
176     ac_prev=build_alias ;;
177   -build=* | --build=* | --buil=* | --bui=* | --bu=*)
178     build_alias=$ac_optarg ;;
179
180   -cache-file | --cache-file | --cache-fil | --cache-fi \
181   | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
182     ac_prev=cache_file ;;
183   -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
184   | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
185     cache_file=$ac_optarg ;;
186
187   --config-cache | -C)
188     cache_file=config.cache ;;
189
190   -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
191     ac_prev=datadir ;;
192   -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
193   | --da=*)
194     datadir=$ac_optarg ;;
195
196   -disable-* | --disable-*)
197     ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
198     # Reject names that are not valid shell variable names.
199     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
200       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
201    { (exit 1); exit 1; }; }
202     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
203     eval "enable_$ac_feature=no" ;;
204
205   -enable-* | --enable-*)
206     ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
207     # Reject names that are not valid shell variable names.
208     expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
209       { echo "$as_me: error: invalid feature name: $ac_feature" >&2
210    { (exit 1); exit 1; }; }
211     ac_feature=`echo $ac_feature | sed 's/-/_/g'`
212     case $ac_option in
213       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
214       *) ac_optarg=yes ;;
215     esac
216     eval "enable_$ac_feature='$ac_optarg'" ;;
217
218   -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
219   | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
220   | --exec | --exe | --ex)
221     ac_prev=exec_prefix ;;
222   -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
223   | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
224   | --exec=* | --exe=* | --ex=*)
225     exec_prefix=$ac_optarg ;;
226
227   -gas | --gas | --ga | --g)
228     # Obsolete; use --with-gas.
229     with_gas=yes ;;
230
231   -help | --help | --hel | --he | -h)
232     ac_init_help=long ;;
233   -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
234     ac_init_help=recursive ;;
235   -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
236     ac_init_help=short ;;
237
238   -host | --host | --hos | --ho)
239     ac_prev=host_alias ;;
240   -host=* | --host=* | --hos=* | --ho=*)
241     host_alias=$ac_optarg ;;
242
243   -includedir | --includedir | --includedi | --included | --include \
244   | --includ | --inclu | --incl | --inc)
245     ac_prev=includedir ;;
246   -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
247   | --includ=* | --inclu=* | --incl=* | --inc=*)
248     includedir=$ac_optarg ;;
249
250   -infodir | --infodir | --infodi | --infod | --info | --inf)
251     ac_prev=infodir ;;
252   -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
253     infodir=$ac_optarg ;;
254
255   -libdir | --libdir | --libdi | --libd)
256     ac_prev=libdir ;;
257   -libdir=* | --libdir=* | --libdi=* | --libd=*)
258     libdir=$ac_optarg ;;
259
260   -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
261   | --libexe | --libex | --libe)
262     ac_prev=libexecdir ;;
263   -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
264   | --libexe=* | --libex=* | --libe=*)
265     libexecdir=$ac_optarg ;;
266
267   -localstatedir | --localstatedir | --localstatedi | --localstated \
268   | --localstate | --localstat | --localsta | --localst \
269   | --locals | --local | --loca | --loc | --lo)
270     ac_prev=localstatedir ;;
271   -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
272   | --localstate=* | --localstat=* | --localsta=* | --localst=* \
273   | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
274     localstatedir=$ac_optarg ;;
275
276   -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
277     ac_prev=mandir ;;
278   -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
279     mandir=$ac_optarg ;;
280
281   -nfp | --nfp | --nf)
282     # Obsolete; use --without-fp.
283     with_fp=no ;;
284
285   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
286   | --no-cr | --no-c)
287     no_create=yes ;;
288
289   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
290   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
291     no_recursion=yes ;;
292
293   -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
294   | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
295   | --oldin | --oldi | --old | --ol | --o)
296     ac_prev=oldincludedir ;;
297   -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
298   | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
299   | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
300     oldincludedir=$ac_optarg ;;
301
302   -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
303     ac_prev=prefix ;;
304   -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
305     prefix=$ac_optarg ;;
306
307   -program-prefix | --program-prefix | --program-prefi | --program-pref \
308   | --program-pre | --program-pr | --program-p)
309     ac_prev=program_prefix ;;
310   -program-prefix=* | --program-prefix=* | --program-prefi=* \
311   | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
312     program_prefix=$ac_optarg ;;
313
314   -program-suffix | --program-suffix | --program-suffi | --program-suff \
315   | --program-suf | --program-su | --program-s)
316     ac_prev=program_suffix ;;
317   -program-suffix=* | --program-suffix=* | --program-suffi=* \
318   | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
319     program_suffix=$ac_optarg ;;
320
321   -program-transform-name | --program-transform-name \
322   | --program-transform-nam | --program-transform-na \
323   | --program-transform-n | --program-transform- \
324   | --program-transform | --program-transfor \
325   | --program-transfo | --program-transf \
326   | --program-trans | --program-tran \
327   | --progr-tra | --program-tr | --program-t)
328     ac_prev=program_transform_name ;;
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     program_transform_name=$ac_optarg ;;
337
338   -q | -quiet | --quiet | --quie | --qui | --qu | --q \
339   | -silent | --silent | --silen | --sile | --sil)
340     silent=yes ;;
341
342   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
343     ac_prev=sbindir ;;
344   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
345   | --sbi=* | --sb=*)
346     sbindir=$ac_optarg ;;
347
348   -sharedstatedir | --sharedstatedir | --sharedstatedi \
349   | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
350   | --sharedst | --shareds | --shared | --share | --shar \
351   | --sha | --sh)
352     ac_prev=sharedstatedir ;;
353   -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
354   | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
355   | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
356   | --sha=* | --sh=*)
357     sharedstatedir=$ac_optarg ;;
358
359   -site | --site | --sit)
360     ac_prev=site ;;
361   -site=* | --site=* | --sit=*)
362     site=$ac_optarg ;;
363
364   -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
365     ac_prev=srcdir ;;
366   -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
367     srcdir=$ac_optarg ;;
368
369   -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
370   | --syscon | --sysco | --sysc | --sys | --sy)
371     ac_prev=sysconfdir ;;
372   -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
373   | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
374     sysconfdir=$ac_optarg ;;
375
376   -target | --target | --targe | --targ | --tar | --ta | --t)
377     ac_prev=target_alias ;;
378   -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
379     target_alias=$ac_optarg ;;
380
381   -v | -verbose | --verbose | --verbos | --verbo | --verb)
382     verbose=yes ;;
383
384   -version | --version | --versio | --versi | --vers | -V)
385     ac_init_version=: ;;
386
387   -with-* | --with-*)
388     ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
389     # Reject names that are not valid shell variable names.
390     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
391       { echo "$as_me: error: invalid package name: $ac_package" >&2
392    { (exit 1); exit 1; }; }
393     ac_package=`echo $ac_package| sed 's/-/_/g'`
394     case $ac_option in
395       *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
396       *) ac_optarg=yes ;;
397     esac
398     eval "with_$ac_package='$ac_optarg'" ;;
399
400   -without-* | --without-*)
401     ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
402     # Reject names that are not valid shell variable names.
403     expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
404       { echo "$as_me: error: invalid package name: $ac_package" >&2
405    { (exit 1); exit 1; }; }
406     ac_package=`echo $ac_package | sed 's/-/_/g'`
407     eval "with_$ac_package=no" ;;
408
409   --x)
410     # Obsolete; use --with-x.
411     with_x=yes ;;
412
413   -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
414   | --x-incl | --x-inc | --x-in | --x-i)
415     ac_prev=x_includes ;;
416   -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
417   | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
418     x_includes=$ac_optarg ;;
419
420   -x-libraries | --x-libraries | --x-librarie | --x-librari \
421   | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
422     ac_prev=x_libraries ;;
423   -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
424   | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
425     x_libraries=$ac_optarg ;;
426
427   -*) { echo "$as_me: error: unrecognized option: $ac_option
428 Try \`$0 --help' for more information." >&2
429    { (exit 1); exit 1; }; }
430     ;;
431
432   *=*)
433     ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
434     # Reject names that are not valid shell variable names.
435     expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
436       { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
437    { (exit 1); exit 1; }; }
438     ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
439     eval "$ac_envvar='$ac_optarg'"
440     export $ac_envvar ;;
441
442   *)
443     # FIXME: should be removed in autoconf 3.0.
444     echo "$as_me: WARNING: you should use --build, --host, --target" >&2
445     expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
446       echo "$as_me: WARNING: invalid host type: $ac_option" >&2
447     : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
448     ;;
449
450   esac
451 done
452
453 if test -n "$ac_prev"; then
454   ac_option=--`echo $ac_prev | sed 's/_/-/g'`
455   { echo "$as_me: error: missing argument to $ac_option" >&2
456    { (exit 1); exit 1; }; }
457 fi
458
459 # Be sure to have absolute paths.
460 for ac_var in exec_prefix prefix
461 do
462   eval ac_val=$`echo $ac_var`
463   case $ac_val in
464     [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
465     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
466    { (exit 1); exit 1; }; };;
467   esac
468 done
469
470 # Be sure to have absolute paths.
471 for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
472               localstatedir libdir includedir oldincludedir infodir mandir
473 do
474   eval ac_val=$`echo $ac_var`
475   case $ac_val in
476     [\\/$]* | ?:[\\/]* ) ;;
477     *)  { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2
478    { (exit 1); exit 1; }; };;
479   esac
480 done
481
482 # There might be people who depend on the old broken behavior: `$host'
483 # used to hold the argument of --host etc.
484 build=$build_alias
485 host=$host_alias
486 target=$target_alias
487
488 # FIXME: should be removed in autoconf 3.0.
489 if test "x$host_alias" != x; then
490   if test "x$build_alias" = x; then
491     cross_compiling=maybe
492     echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
493     If a cross compiler is detected then cross compile mode will be used." >&2
494   elif test "x$build_alias" != "x$host_alias"; then
495     cross_compiling=yes
496   fi
497 fi
498
499 ac_tool_prefix=
500 test -n "$host_alias" && ac_tool_prefix=$host_alias-
501
502 test "$silent" = yes && exec 6>/dev/null
503
504 # Find the source files, if location was not specified.
505 if test -z "$srcdir"; then
506   ac_srcdir_defaulted=yes
507   # Try the directory containing this script, then its parent.
508   ac_prog=$0
509   ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'`
510   test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
511   srcdir=$ac_confdir
512   if test ! -r $srcdir/$ac_unique_file; then
513     srcdir=..
514   fi
515 else
516   ac_srcdir_defaulted=no
517 fi
518 if test ! -r $srcdir/$ac_unique_file; then
519   if test "$ac_srcdir_defaulted" = yes; then
520     { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2
521    { (exit 1); exit 1; }; }
522   else
523     { echo "$as_me: error: cannot find sources in $srcdir" >&2
524    { (exit 1); exit 1; }; }
525   fi
526 fi
527 srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
528 ac_env_build_alias_set=${build_alias+set}
529 ac_env_build_alias_value=$build_alias
530 ac_cv_env_build_alias_set=${build_alias+set}
531 ac_cv_env_build_alias_value=$build_alias
532 ac_env_host_alias_set=${host_alias+set}
533 ac_env_host_alias_value=$host_alias
534 ac_cv_env_host_alias_set=${host_alias+set}
535 ac_cv_env_host_alias_value=$host_alias
536 ac_env_target_alias_set=${target_alias+set}
537 ac_env_target_alias_value=$target_alias
538 ac_cv_env_target_alias_set=${target_alias+set}
539 ac_cv_env_target_alias_value=$target_alias
540 ac_env_CC_set=${CC+set}
541 ac_env_CC_value=$CC
542 ac_cv_env_CC_set=${CC+set}
543 ac_cv_env_CC_value=$CC
544 ac_env_CFLAGS_set=${CFLAGS+set}
545 ac_env_CFLAGS_value=$CFLAGS
546 ac_cv_env_CFLAGS_set=${CFLAGS+set}
547 ac_cv_env_CFLAGS_value=$CFLAGS
548 ac_env_LDFLAGS_set=${LDFLAGS+set}
549 ac_env_LDFLAGS_value=$LDFLAGS
550 ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
551 ac_cv_env_LDFLAGS_value=$LDFLAGS
552 ac_env_CPPFLAGS_set=${CPPFLAGS+set}
553 ac_env_CPPFLAGS_value=$CPPFLAGS
554 ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
555 ac_cv_env_CPPFLAGS_value=$CPPFLAGS
556 ac_env_CPP_set=${CPP+set}
557 ac_env_CPP_value=$CPP
558 ac_cv_env_CPP_set=${CPP+set}
559 ac_cv_env_CPP_value=$CPP
560
561 #
562 # Report the --help message.
563 #
564 if test "$ac_init_help" = "long"; then
565   # Omit some internal or obsolete options to make the list less imposing.
566   # This message is too long to be a string in the A/UX 3.1 sh.
567   cat <<EOF
568 \`configure' configures this package to adapt to many kinds of systems.
569
570 Usage: $0 [OPTION]... [VAR=VALUE]...
571
572 To assign environment variables (e.g., CC, CFLAGS...), specify them as
573 VAR=VALUE.  See below for descriptions of some of the useful variables.
574
575 Defaults for the options are specified in brackets.
576
577 Configuration:
578   -h, --help              display this help and exit
579       --help=short        display options specific to this package
580       --help=recursive    display the short help of all the included packages
581   -V, --version           display version information and exit
582   -q, --quiet, --silent   do not print \`checking...' messages
583       --cache-file=FILE   cache test results in FILE [disabled]
584   -C, --config-cache      alias for \`--cache-file=config.cache'
585   -n, --no-create         do not create output files
586       --srcdir=DIR        find the sources in DIR [configure dir or \`..']
587
588 EOF
589
590   cat <<EOF
591 Installation directories:
592   --prefix=PREFIX         install architecture-independent files in PREFIX
593                           [$ac_default_prefix]
594   --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
595                           [PREFIX]
596
597 By default, \`make install' will install all the files in
598 \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
599 an installation prefix other than \`$ac_default_prefix' using \`--prefix',
600 for instance \`--prefix=\$HOME'.
601
602 For better control, use the options below.
603
604 Fine tuning of the installation directories:
605   --bindir=DIR            user executables [EPREFIX/bin]
606   --sbindir=DIR           system admin executables [EPREFIX/sbin]
607   --libexecdir=DIR        program executables [EPREFIX/libexec]
608   --datadir=DIR           read-only architecture-independent data [PREFIX/share]
609   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
610   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
611   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
612   --libdir=DIR            object code libraries [EPREFIX/lib]
613   --includedir=DIR        C header files [PREFIX/include]
614   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
615   --infodir=DIR           info documentation [PREFIX/info]
616   --mandir=DIR            man documentation [PREFIX/man]
617 EOF
618
619   cat <<\EOF
620
621 Program names:
622   --program-prefix=PREFIX            prepend PREFIX to installed program names
623   --program-suffix=SUFFIX            append SUFFIX to installed program names
624   --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
625
626 X features:
627   --x-includes=DIR    X include files are in DIR
628   --x-libraries=DIR   X library files are in DIR
629
630 System types:
631   --build=BUILD           configure for building on BUILD [guessed]
632   --host=HOST       build programs to run on HOST [BUILD]
633 EOF
634 fi
635
636 if test -n "$ac_init_help"; then
637
638   cat <<\EOF
639
640 Optional Features:
641   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
642   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
643
644 Optional Packages:
645   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
646   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
647
648   --disable-echo          display "compiling" commands
649   --enable-warnings       test: turn on gcc compiler warnings
650   --with-dmalloc          test: use Gray Watson's dmalloc library
651   --with-dbmalloc         test: use Conor Cahill's dbmalloc library
652   --with-valgrind         test: use valgrind
653   --disable-leaks         test: free permanent memory, analyze leaks
654   --disable-widec           disable checks for wide-character functions
655   --with-curses-dir=DIR   directory in which (n)curses is installed
656   --with-ncursesw         use wide ncurses-libraries (installed)
657   --with-ncurses          use ncurses-libraries (installed)
658   --with-pdcurses         compile/link with pdcurses X11 library
659   --with-curses-colr      compile/link with HPUX 10.x color-curses
660   --with-curses-5lib      compile/link with SunOS 5lib curses
661   --with-Xaw3d            link with Xaw 3d library
662   --with-neXtaw           link with neXT Athena library
663   --with-XawPlus          link with Athena-Plus library
664   --with-pkg-config{=path} enable/disable use of pkg-config
665   --with-x                use the X Window System
666   --with-ncurses-wrap-prefix naming-prefix for ncurses wrapped-variables
667   --disable-rpath-hack    don't add rpath options for additional libraries
668
669 Some influential environment variables:
670   CC          C compiler command
671   CFLAGS      C compiler flags
672   LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
673               nonstandard directory <lib dir>
674   CPPFLAGS    C/C++ preprocessor flags, e.g. -I<include dir> if you have
675               headers in a nonstandard directory <include dir>
676   CPP         C preprocessor
677
678 Use these variables to override the choices made by `configure' or to help
679 it to find libraries and programs with nonstandard names/locations.
680
681 EOF
682 fi
683
684 if test "$ac_init_help" = "recursive"; then
685   # If there are subdirs, report their specific --help.
686   ac_popdir=`pwd`
687   for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue
688     cd $ac_subdir
689     # A "../" for each directory in /$ac_subdir.
690     ac_dots=`echo $ac_subdir |
691              sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'`
692
693     case $srcdir in
694     .) # No --srcdir option.  We are building in place.
695       ac_sub_srcdir=$srcdir ;;
696     [\\/]* | ?:[\\/]* ) # Absolute path.
697       ac_sub_srcdir=$srcdir/$ac_subdir ;;
698     *) # Relative path.
699       ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;;
700     esac
701
702     # Check for guested configure; otherwise get Cygnus style configure.
703     if test -f $ac_sub_srcdir/configure.gnu; then
704       echo
705       $SHELL $ac_sub_srcdir/configure.gnu  --help=recursive
706     elif test -f $ac_sub_srcdir/configure; then
707       echo
708       $SHELL $ac_sub_srcdir/configure  --help=recursive
709     elif test -f $ac_sub_srcdir/configure.ac ||
710            test -f $ac_sub_srcdir/configure.in; then
711       echo
712       $ac_configure --help
713     else
714       echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2
715     fi
716     cd $ac_popdir
717   done
718 fi
719
720 test -n "$ac_init_help" && exit 0
721 if $ac_init_version; then
722   cat <<\EOF
723
724 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
725 Free Software Foundation, Inc.
726 This configure script is free software; the Free Software Foundation
727 gives unlimited permission to copy, distribute and modify it.
728 EOF
729   exit 0
730 fi
731 exec 5>config.log
732 cat >&5 <<EOF
733 This file contains any messages produced by compilers while
734 running configure, to aid debugging if configure makes a mistake.
735
736 It was created by $as_me, which was
737 generated by GNU Autoconf 2.52.20101002.  Invocation command line was
738
739   $ $0 $@
740
741 EOF
742 {
743 cat <<_ASUNAME
744 ## ---------- ##
745 ## Platform.  ##
746 ## ---------- ##
747
748 hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
749 uname -m = `(uname -m) 2>/dev/null || echo unknown`
750 uname -r = `(uname -r) 2>/dev/null || echo unknown`
751 uname -s = `(uname -s) 2>/dev/null || echo unknown`
752 uname -v = `(uname -v) 2>/dev/null || echo unknown`
753
754 /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
755 /bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
756
757 /bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
758 /usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
759 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
760 hostinfo               = `(hostinfo) 2>/dev/null               || echo unknown`
761 /bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
762 /usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
763 /bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
764
765 PATH = $PATH
766
767 _ASUNAME
768 } >&5
769
770 cat >&5 <<EOF
771 ## ------------ ##
772 ## Core tests.  ##
773 ## ------------ ##
774
775 EOF
776
777 # Keep a trace of the command line.
778 # Strip out --no-create and --no-recursion so they do not pile up.
779 # Also quote any args containing shell meta-characters.
780 ac_configure_args=
781 ac_sep=
782 for ac_arg
783 do
784   case $ac_arg in
785   -no-create | --no-create | --no-creat | --no-crea | --no-cre \
786   | --no-cr | --no-c) ;;
787   -no-recursion | --no-recursion | --no-recursio | --no-recursi \
788   | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
789   *" "*|*"      "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
790     ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"`
791     ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
792     ac_sep=" " ;;
793   *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg"
794      ac_sep=" " ;;
795   esac
796   # Get rid of the leading space.
797 done
798
799 # When interrupted or exit'd, cleanup temporary files, and complete
800 # config.log.  We remove comments because anyway the quotes in there
801 # would cause problems or look ugly.
802 trap 'exit_status=$?
803   # Save into config.log some information that might help in debugging.
804   echo >&5
805   echo "## ----------------- ##" >&5
806   echo "## Cache variables.  ##" >&5
807   echo "## ----------------- ##" >&5
808   echo >&5
809   # The following way of writing the cache mishandles newlines in values,
810 {
811   (set) 2>&1 |
812     case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
813     *ac_space=\ *)
814       sed -n \
815         "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
816           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
817       ;;
818     *)
819       sed -n \
820         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
821       ;;
822     esac;
823 } >&5
824   sed "/^$/d" confdefs.h >conftest.log
825   if test -s conftest.log; then
826     echo >&5
827     echo "## ------------ ##" >&5
828     echo "## confdefs.h.  ##" >&5
829     echo "## ------------ ##" >&5
830     echo >&5
831     cat conftest.log >&5
832   fi
833   (echo; echo) >&5
834   test "$ac_signal" != 0 &&
835     echo "$as_me: caught signal $ac_signal" >&5
836   echo "$as_me: exit $exit_status" >&5
837   rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files &&
838     exit $exit_status
839      ' 0
840 for ac_signal in 1 2 13 15; do
841   trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
842 done
843 ac_signal=0
844
845 # confdefs.h avoids OS command line length limits that DEFS can exceed.
846 rm -rf conftest* confdefs.h
847 # AIX cpp loses on an empty file, so make sure it contains at least a newline.
848 echo >confdefs.h
849
850 # Let the site file select an alternate cache file if it wants to.
851 # Prefer explicitly selected file to automatically selected ones.
852 if test -z "$CONFIG_SITE"; then
853   if test "x$prefix" != xNONE; then
854     CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
855   else
856     CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
857   fi
858 fi
859 for ac_site_file in $CONFIG_SITE; do
860   if test -r "$ac_site_file"; then
861     { echo "$as_me:861: loading site script $ac_site_file" >&5
862 echo "$as_me: loading site script $ac_site_file" >&6;}
863     cat "$ac_site_file" >&5
864     . "$ac_site_file"
865   fi
866 done
867
868 if test -r "$cache_file"; then
869   # Some versions of bash will fail to source /dev/null (special
870   # files actually), so we avoid doing that.
871   if test -f "$cache_file"; then
872     { echo "$as_me:872: loading cache $cache_file" >&5
873 echo "$as_me: loading cache $cache_file" >&6;}
874     case $cache_file in
875       [\\/]* | ?:[\\/]* ) . $cache_file;;
876       *)                      . ./$cache_file;;
877     esac
878   fi
879 else
880   { echo "$as_me:880: creating cache $cache_file" >&5
881 echo "$as_me: creating cache $cache_file" >&6;}
882   >$cache_file
883 fi
884
885 # Check that the precious variables saved in the cache have kept the same
886 # value.
887 ac_cache_corrupted=false
888 for ac_var in `(set) 2>&1 |
889                sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
890   eval ac_old_set=\$ac_cv_env_${ac_var}_set
891   eval ac_new_set=\$ac_env_${ac_var}_set
892   eval ac_old_val="\$ac_cv_env_${ac_var}_value"
893   eval ac_new_val="\$ac_env_${ac_var}_value"
894   case $ac_old_set,$ac_new_set in
895     set,)
896       { echo "$as_me:896: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
897 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
898       ac_cache_corrupted=: ;;
899     ,set)
900       { echo "$as_me:900: error: \`$ac_var' was not set in the previous run" >&5
901 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
902       ac_cache_corrupted=: ;;
903     ,);;
904     *)
905       if test "x$ac_old_val" != "x$ac_new_val"; then
906         { echo "$as_me:906: error: \`$ac_var' has changed since the previous run:" >&5
907 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
908         { echo "$as_me:908:   former value:  $ac_old_val" >&5
909 echo "$as_me:   former value:  $ac_old_val" >&2;}
910         { echo "$as_me:910:   current value: $ac_new_val" >&5
911 echo "$as_me:   current value: $ac_new_val" >&2;}
912         ac_cache_corrupted=:
913       fi;;
914   esac
915   # Pass precious variables to config.status.  It doesn't matter if
916   # we pass some twice (in addition to the command line arguments).
917   if test "$ac_new_set" = set; then
918     case $ac_new_val in
919     *" "*|*"    "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
920       ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"`
921       ac_configure_args="$ac_configure_args '$ac_arg'"
922       ;;
923     *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val"
924        ;;
925     esac
926   fi
927 done
928 if $ac_cache_corrupted; then
929   { echo "$as_me:929: error: changes in the environment can compromise the build" >&5
930 echo "$as_me: error: changes in the environment can compromise the build" >&2;}
931   { { echo "$as_me:931: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
932 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
933    { (exit 1); exit 1; }; }
934 fi
935
936 ac_ext=c
937 ac_cpp='$CPP $CPPFLAGS'
938 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
939 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
940 ac_compiler_gnu=$ac_cv_c_compiler_gnu
941 ac_main_return=return
942
943 case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
944   *c*,-n*) ECHO_N= ECHO_C='
945 ' ECHO_T='      ' ;;
946   *c*,*  ) ECHO_N=-n ECHO_C= ECHO_T= ;;
947   *)      ECHO_N= ECHO_C='\c' ECHO_T= ;;
948 esac
949 echo "#! $SHELL" >conftest.sh
950 echo  "exit 0"   >>conftest.sh
951 chmod +x conftest.sh
952 if { (echo "$as_me:952: PATH=\".;.\"; conftest.sh") >&5
953   (PATH=".;."; conftest.sh) 2>&5
954   ac_status=$?
955   echo "$as_me:955: \$? = $ac_status" >&5
956   (exit $ac_status); }; then
957   ac_path_separator=';'
958 else
959   ac_path_separator=:
960 fi
961 PATH_SEPARATOR="$ac_path_separator"
962 rm -f conftest.sh
963
964 ac_config_headers="$ac_config_headers ncurses_cfg.h:ncurses_tst.hin"
965
966 test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ )
967
968 test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ )
969
970 ac_aux_dir=
971 for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
972   if test -f $ac_dir/install-sh; then
973     ac_aux_dir=$ac_dir
974     ac_install_sh="$ac_aux_dir/install-sh -c"
975     break
976   elif test -f $ac_dir/install.sh; then
977     ac_aux_dir=$ac_dir
978     ac_install_sh="$ac_aux_dir/install.sh -c"
979     break
980   elif test -f $ac_dir/shtool; then
981     ac_aux_dir=$ac_dir
982     ac_install_sh="$ac_aux_dir/shtool install -c"
983     break
984   fi
985 done
986 if test -z "$ac_aux_dir"; then
987   { { echo "$as_me:987: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
988 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
989    { (exit 1); exit 1; }; }
990 fi
991 ac_config_guess="$SHELL $ac_aux_dir/config.guess"
992 ac_config_sub="$SHELL $ac_aux_dir/config.sub"
993 ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
994
995 # Make sure we can run config.sub.
996 $ac_config_sub sun4 >/dev/null 2>&1 ||
997   { { echo "$as_me:997: error: cannot run $ac_config_sub" >&5
998 echo "$as_me: error: cannot run $ac_config_sub" >&2;}
999    { (exit 1); exit 1; }; }
1000
1001 echo "$as_me:1001: checking build system type" >&5
1002 echo $ECHO_N "checking build system type... $ECHO_C" >&6
1003 if test "${ac_cv_build+set}" = set; then
1004   echo $ECHO_N "(cached) $ECHO_C" >&6
1005 else
1006   ac_cv_build_alias=$build_alias
1007 test -z "$ac_cv_build_alias" &&
1008   ac_cv_build_alias=`$ac_config_guess`
1009 test -z "$ac_cv_build_alias" &&
1010   { { echo "$as_me:1010: error: cannot guess build type; you must specify one" >&5
1011 echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
1012    { (exit 1); exit 1; }; }
1013 ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
1014   { { echo "$as_me:1014: error: $ac_config_sub $ac_cv_build_alias failed." >&5
1015 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;}
1016    { (exit 1); exit 1; }; }
1017
1018 fi
1019 echo "$as_me:1019: result: $ac_cv_build" >&5
1020 echo "${ECHO_T}$ac_cv_build" >&6
1021 build=$ac_cv_build
1022 build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1023 build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1024 build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1025
1026 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1027         echo "$as_me:1027: checking host system type" >&5
1028 echo $ECHO_N "checking host system type... $ECHO_C" >&6
1029 if test "${ac_cv_host+set}" = set; then
1030   echo $ECHO_N "(cached) $ECHO_C" >&6
1031 else
1032   ac_cv_host_alias=$host_alias
1033 test -z "$ac_cv_host_alias" &&
1034   ac_cv_host_alias=$ac_cv_build_alias
1035 ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
1036   { { echo "$as_me:1036: error: $ac_config_sub $ac_cv_host_alias failed" >&5
1037 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
1038    { (exit 1); exit 1; }; }
1039
1040 fi
1041 echo "$as_me:1041: result: $ac_cv_host" >&5
1042 echo "${ECHO_T}$ac_cv_host" >&6
1043 host=$ac_cv_host
1044 host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
1045 host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
1046 host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
1047
1048         system_name="$host_os"
1049 else
1050         system_name="`(uname -s -r) 2>/dev/null`"
1051         if test -z "$system_name" ; then
1052                 system_name="`(hostname) 2>/dev/null`"
1053         fi
1054 fi
1055 test -n "$system_name" && cat >>confdefs.h <<EOF
1056 #define SYSTEM_NAME "$system_name"
1057 EOF
1058
1059 if test "${cf_cv_system_name+set}" = set; then
1060   echo $ECHO_N "(cached) $ECHO_C" >&6
1061 else
1062   cf_cv_system_name="$system_name"
1063 fi
1064
1065 test -z "$system_name" && system_name="$cf_cv_system_name"
1066 test -n "$cf_cv_system_name" && echo "$as_me:1066: result: Configuring for $cf_cv_system_name" >&5
1067 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6
1068
1069 if test ".$system_name" != ".$cf_cv_system_name" ; then
1070         echo "$as_me:1070: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5
1071 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6
1072         { { echo "$as_me:1072: error: \"Please remove config.cache and try again.\"" >&5
1073 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;}
1074    { (exit 1); exit 1; }; }
1075 fi
1076
1077 test "$program_prefix" != NONE &&
1078   program_transform_name="s,^,$program_prefix,;$program_transform_name"
1079 # Use a double $ so make ignores it.
1080 test "$program_suffix" != NONE &&
1081   program_transform_name="s,\$,$program_suffix,;$program_transform_name"
1082 # Double any \ or $.  echo might interpret backslashes.
1083 # By default was `s,x,x', remove it if useless.
1084 cat <<\_ACEOF >conftest.sed
1085 s/[\\$]/&&/g;s/;s,x,x,$//
1086 _ACEOF
1087 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
1088 rm conftest.sed
1089
1090 echo "$as_me:1090: checking whether ${MAKE-make} sets \${MAKE}" >&5
1091 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6
1092 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
1093 if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
1094   echo $ECHO_N "(cached) $ECHO_C" >&6
1095 else
1096   cat >conftest.make <<\EOF
1097 all:
1098         @echo 'ac_maketemp="${MAKE}"'
1099 EOF
1100 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
1101 eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
1102 if test -n "$ac_maketemp"; then
1103   eval ac_cv_prog_make_${ac_make}_set=yes
1104 else
1105   eval ac_cv_prog_make_${ac_make}_set=no
1106 fi
1107 rm -f conftest.make
1108 fi
1109 if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
1110   echo "$as_me:1110: result: yes" >&5
1111 echo "${ECHO_T}yes" >&6
1112   SET_MAKE=
1113 else
1114   echo "$as_me:1114: result: no" >&5
1115 echo "${ECHO_T}no" >&6
1116   SET_MAKE="MAKE=${MAKE-make}"
1117 fi
1118
1119 ac_ext=c
1120 ac_cpp='$CPP $CPPFLAGS'
1121 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1122 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1123 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1124 ac_main_return=return
1125 if test -n "$ac_tool_prefix"; then
1126   # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
1127 set dummy ${ac_tool_prefix}gcc; ac_word=$2
1128 echo "$as_me:1128: checking for $ac_word" >&5
1129 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1130 if test "${ac_cv_prog_CC+set}" = set; then
1131   echo $ECHO_N "(cached) $ECHO_C" >&6
1132 else
1133   if test -n "$CC"; then
1134   ac_cv_prog_CC="$CC" # Let the user override the test.
1135 else
1136   ac_save_IFS=$IFS; IFS=$ac_path_separator
1137 ac_dummy="$PATH"
1138 for ac_dir in $ac_dummy; do
1139   IFS=$ac_save_IFS
1140   test -z "$ac_dir" && ac_dir=.
1141   $as_executable_p "$ac_dir/$ac_word" || continue
1142 ac_cv_prog_CC="${ac_tool_prefix}gcc"
1143 echo "$as_me:1143: found $ac_dir/$ac_word" >&5
1144 break
1145 done
1146
1147 fi
1148 fi
1149 CC=$ac_cv_prog_CC
1150 if test -n "$CC"; then
1151   echo "$as_me:1151: result: $CC" >&5
1152 echo "${ECHO_T}$CC" >&6
1153 else
1154   echo "$as_me:1154: result: no" >&5
1155 echo "${ECHO_T}no" >&6
1156 fi
1157
1158 fi
1159 if test -z "$ac_cv_prog_CC"; then
1160   ac_ct_CC=$CC
1161   # Extract the first word of "gcc", so it can be a program name with args.
1162 set dummy gcc; ac_word=$2
1163 echo "$as_me:1163: checking for $ac_word" >&5
1164 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1165 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1166   echo $ECHO_N "(cached) $ECHO_C" >&6
1167 else
1168   if test -n "$ac_ct_CC"; then
1169   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1170 else
1171   ac_save_IFS=$IFS; IFS=$ac_path_separator
1172 ac_dummy="$PATH"
1173 for ac_dir in $ac_dummy; do
1174   IFS=$ac_save_IFS
1175   test -z "$ac_dir" && ac_dir=.
1176   $as_executable_p "$ac_dir/$ac_word" || continue
1177 ac_cv_prog_ac_ct_CC="gcc"
1178 echo "$as_me:1178: found $ac_dir/$ac_word" >&5
1179 break
1180 done
1181
1182 fi
1183 fi
1184 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1185 if test -n "$ac_ct_CC"; then
1186   echo "$as_me:1186: result: $ac_ct_CC" >&5
1187 echo "${ECHO_T}$ac_ct_CC" >&6
1188 else
1189   echo "$as_me:1189: result: no" >&5
1190 echo "${ECHO_T}no" >&6
1191 fi
1192
1193   CC=$ac_ct_CC
1194 else
1195   CC="$ac_cv_prog_CC"
1196 fi
1197
1198 if test -z "$CC"; then
1199   if test -n "$ac_tool_prefix"; then
1200   # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
1201 set dummy ${ac_tool_prefix}cc; ac_word=$2
1202 echo "$as_me:1202: checking for $ac_word" >&5
1203 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1204 if test "${ac_cv_prog_CC+set}" = set; then
1205   echo $ECHO_N "(cached) $ECHO_C" >&6
1206 else
1207   if test -n "$CC"; then
1208   ac_cv_prog_CC="$CC" # Let the user override the test.
1209 else
1210   ac_save_IFS=$IFS; IFS=$ac_path_separator
1211 ac_dummy="$PATH"
1212 for ac_dir in $ac_dummy; do
1213   IFS=$ac_save_IFS
1214   test -z "$ac_dir" && ac_dir=.
1215   $as_executable_p "$ac_dir/$ac_word" || continue
1216 ac_cv_prog_CC="${ac_tool_prefix}cc"
1217 echo "$as_me:1217: found $ac_dir/$ac_word" >&5
1218 break
1219 done
1220
1221 fi
1222 fi
1223 CC=$ac_cv_prog_CC
1224 if test -n "$CC"; then
1225   echo "$as_me:1225: result: $CC" >&5
1226 echo "${ECHO_T}$CC" >&6
1227 else
1228   echo "$as_me:1228: result: no" >&5
1229 echo "${ECHO_T}no" >&6
1230 fi
1231
1232 fi
1233 if test -z "$ac_cv_prog_CC"; then
1234   ac_ct_CC=$CC
1235   # Extract the first word of "cc", so it can be a program name with args.
1236 set dummy cc; ac_word=$2
1237 echo "$as_me:1237: checking for $ac_word" >&5
1238 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1239 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1240   echo $ECHO_N "(cached) $ECHO_C" >&6
1241 else
1242   if test -n "$ac_ct_CC"; then
1243   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1244 else
1245   ac_save_IFS=$IFS; IFS=$ac_path_separator
1246 ac_dummy="$PATH"
1247 for ac_dir in $ac_dummy; do
1248   IFS=$ac_save_IFS
1249   test -z "$ac_dir" && ac_dir=.
1250   $as_executable_p "$ac_dir/$ac_word" || continue
1251 ac_cv_prog_ac_ct_CC="cc"
1252 echo "$as_me:1252: found $ac_dir/$ac_word" >&5
1253 break
1254 done
1255
1256 fi
1257 fi
1258 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1259 if test -n "$ac_ct_CC"; then
1260   echo "$as_me:1260: result: $ac_ct_CC" >&5
1261 echo "${ECHO_T}$ac_ct_CC" >&6
1262 else
1263   echo "$as_me:1263: result: no" >&5
1264 echo "${ECHO_T}no" >&6
1265 fi
1266
1267   CC=$ac_ct_CC
1268 else
1269   CC="$ac_cv_prog_CC"
1270 fi
1271
1272 fi
1273 if test -z "$CC"; then
1274   # Extract the first word of "cc", so it can be a program name with args.
1275 set dummy cc; ac_word=$2
1276 echo "$as_me:1276: checking for $ac_word" >&5
1277 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1278 if test "${ac_cv_prog_CC+set}" = set; then
1279   echo $ECHO_N "(cached) $ECHO_C" >&6
1280 else
1281   if test -n "$CC"; then
1282   ac_cv_prog_CC="$CC" # Let the user override the test.
1283 else
1284   ac_prog_rejected=no
1285   ac_save_IFS=$IFS; IFS=$ac_path_separator
1286 ac_dummy="$PATH"
1287 for ac_dir in $ac_dummy; do
1288   IFS=$ac_save_IFS
1289   test -z "$ac_dir" && ac_dir=.
1290   $as_executable_p "$ac_dir/$ac_word" || continue
1291 if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
1292   ac_prog_rejected=yes
1293   continue
1294 fi
1295 ac_cv_prog_CC="cc"
1296 echo "$as_me:1296: found $ac_dir/$ac_word" >&5
1297 break
1298 done
1299
1300 if test $ac_prog_rejected = yes; then
1301   # We found a bogon in the path, so make sure we never use it.
1302   set dummy $ac_cv_prog_CC
1303   shift
1304   if test $# != 0; then
1305     # We chose a different compiler from the bogus one.
1306     # However, it has the same basename, so the bogon will be chosen
1307     # first if we set CC to just the basename; use the full file name.
1308     shift
1309     set dummy "$ac_dir/$ac_word" ${1+"$@"}
1310     shift
1311     ac_cv_prog_CC="$@"
1312   fi
1313 fi
1314 fi
1315 fi
1316 CC=$ac_cv_prog_CC
1317 if test -n "$CC"; then
1318   echo "$as_me:1318: result: $CC" >&5
1319 echo "${ECHO_T}$CC" >&6
1320 else
1321   echo "$as_me:1321: result: no" >&5
1322 echo "${ECHO_T}no" >&6
1323 fi
1324
1325 fi
1326 if test -z "$CC"; then
1327   if test -n "$ac_tool_prefix"; then
1328   for ac_prog in cl
1329   do
1330     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
1331 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
1332 echo "$as_me:1332: checking for $ac_word" >&5
1333 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1334 if test "${ac_cv_prog_CC+set}" = set; then
1335   echo $ECHO_N "(cached) $ECHO_C" >&6
1336 else
1337   if test -n "$CC"; then
1338   ac_cv_prog_CC="$CC" # Let the user override the test.
1339 else
1340   ac_save_IFS=$IFS; IFS=$ac_path_separator
1341 ac_dummy="$PATH"
1342 for ac_dir in $ac_dummy; do
1343   IFS=$ac_save_IFS
1344   test -z "$ac_dir" && ac_dir=.
1345   $as_executable_p "$ac_dir/$ac_word" || continue
1346 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
1347 echo "$as_me:1347: found $ac_dir/$ac_word" >&5
1348 break
1349 done
1350
1351 fi
1352 fi
1353 CC=$ac_cv_prog_CC
1354 if test -n "$CC"; then
1355   echo "$as_me:1355: result: $CC" >&5
1356 echo "${ECHO_T}$CC" >&6
1357 else
1358   echo "$as_me:1358: result: no" >&5
1359 echo "${ECHO_T}no" >&6
1360 fi
1361
1362     test -n "$CC" && break
1363   done
1364 fi
1365 if test -z "$CC"; then
1366   ac_ct_CC=$CC
1367   for ac_prog in cl
1368 do
1369   # Extract the first word of "$ac_prog", so it can be a program name with args.
1370 set dummy $ac_prog; ac_word=$2
1371 echo "$as_me:1371: checking for $ac_word" >&5
1372 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
1373 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
1374   echo $ECHO_N "(cached) $ECHO_C" >&6
1375 else
1376   if test -n "$ac_ct_CC"; then
1377   ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
1378 else
1379   ac_save_IFS=$IFS; IFS=$ac_path_separator
1380 ac_dummy="$PATH"
1381 for ac_dir in $ac_dummy; do
1382   IFS=$ac_save_IFS
1383   test -z "$ac_dir" && ac_dir=.
1384   $as_executable_p "$ac_dir/$ac_word" || continue
1385 ac_cv_prog_ac_ct_CC="$ac_prog"
1386 echo "$as_me:1386: found $ac_dir/$ac_word" >&5
1387 break
1388 done
1389
1390 fi
1391 fi
1392 ac_ct_CC=$ac_cv_prog_ac_ct_CC
1393 if test -n "$ac_ct_CC"; then
1394   echo "$as_me:1394: result: $ac_ct_CC" >&5
1395 echo "${ECHO_T}$ac_ct_CC" >&6
1396 else
1397   echo "$as_me:1397: result: no" >&5
1398 echo "${ECHO_T}no" >&6
1399 fi
1400
1401   test -n "$ac_ct_CC" && break
1402 done
1403
1404   CC=$ac_ct_CC
1405 fi
1406
1407 fi
1408
1409 test -z "$CC" && { { echo "$as_me:1409: error: no acceptable cc found in \$PATH" >&5
1410 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;}
1411    { (exit 1); exit 1; }; }
1412
1413 # Provide some information about the compiler.
1414 echo "$as_me:1414:" \
1415      "checking for C compiler version" >&5
1416 ac_compiler=`set X $ac_compile; echo $2`
1417 { (eval echo "$as_me:1417: \"$ac_compiler --version </dev/null >&5\"") >&5
1418   (eval $ac_compiler --version </dev/null >&5) 2>&5
1419   ac_status=$?
1420   echo "$as_me:1420: \$? = $ac_status" >&5
1421   (exit $ac_status); }
1422 { (eval echo "$as_me:1422: \"$ac_compiler -v </dev/null >&5\"") >&5
1423   (eval $ac_compiler -v </dev/null >&5) 2>&5
1424   ac_status=$?
1425   echo "$as_me:1425: \$? = $ac_status" >&5
1426   (exit $ac_status); }
1427 { (eval echo "$as_me:1427: \"$ac_compiler -V </dev/null >&5\"") >&5
1428   (eval $ac_compiler -V </dev/null >&5) 2>&5
1429   ac_status=$?
1430   echo "$as_me:1430: \$? = $ac_status" >&5
1431   (exit $ac_status); }
1432
1433 cat >conftest.$ac_ext <<_ACEOF
1434 #line 1434 "configure"
1435 #include "confdefs.h"
1436
1437 int
1438 main ()
1439 {
1440
1441   ;
1442   return 0;
1443 }
1444 _ACEOF
1445 ac_clean_files_save=$ac_clean_files
1446 ac_clean_files="$ac_clean_files a.out a.exe"
1447 # Try to create an executable without -o first, disregard a.out.
1448 # It will help us diagnose broken compilers, and finding out an intuition
1449 # of exeext.
1450 echo "$as_me:1450: checking for C compiler default output" >&5
1451 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
1452 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
1453 if { (eval echo "$as_me:1453: \"$ac_link_default\"") >&5
1454   (eval $ac_link_default) 2>&5
1455   ac_status=$?
1456   echo "$as_me:1456: \$? = $ac_status" >&5
1457   (exit $ac_status); }; then
1458   # Find the output, starting from the most likely.  This scheme is
1459 # not robust to junk in `.', hence go to wildcards (a.*) only as a last
1460 # resort.
1461 for ac_file in `ls a.exe conftest.exe 2>/dev/null;
1462                 ls a.out conftest 2>/dev/null;
1463                 ls a.* conftest.* 2>/dev/null`; do
1464   case $ac_file in
1465     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1466     a.out ) # We found the default executable, but exeext='' is most
1467             # certainly right.
1468             break;;
1469     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1470           # FIXME: I believe we export ac_cv_exeext for Libtool --akim.
1471           export ac_cv_exeext
1472           break;;
1473     * ) break;;
1474   esac
1475 done
1476 else
1477   echo "$as_me: failed program was:" >&5
1478 cat conftest.$ac_ext >&5
1479 { { echo "$as_me:1479: error: C compiler cannot create executables" >&5
1480 echo "$as_me: error: C compiler cannot create executables" >&2;}
1481    { (exit 77); exit 77; }; }
1482 fi
1483
1484 ac_exeext=$ac_cv_exeext
1485 echo "$as_me:1485: result: $ac_file" >&5
1486 echo "${ECHO_T}$ac_file" >&6
1487
1488 # Check the compiler produces executables we can run.  If not, either
1489 # the compiler is broken, or we cross compile.
1490 echo "$as_me:1490: checking whether the C compiler works" >&5
1491 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
1492 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
1493 # If not cross compiling, check that we can run a simple program.
1494 if test "$cross_compiling" != yes; then
1495   if { ac_try='./$ac_file'
1496   { (eval echo "$as_me:1496: \"$ac_try\"") >&5
1497   (eval $ac_try) 2>&5
1498   ac_status=$?
1499   echo "$as_me:1499: \$? = $ac_status" >&5
1500   (exit $ac_status); }; }; then
1501     cross_compiling=no
1502   else
1503     if test "$cross_compiling" = maybe; then
1504         cross_compiling=yes
1505     else
1506         { { echo "$as_me:1506: error: cannot run C compiled programs.
1507 If you meant to cross compile, use \`--host'." >&5
1508 echo "$as_me: error: cannot run C compiled programs.
1509 If you meant to cross compile, use \`--host'." >&2;}
1510    { (exit 1); exit 1; }; }
1511     fi
1512   fi
1513 fi
1514 echo "$as_me:1514: result: yes" >&5
1515 echo "${ECHO_T}yes" >&6
1516
1517 rm -f a.out a.exe conftest$ac_cv_exeext
1518 ac_clean_files=$ac_clean_files_save
1519 # Check the compiler produces executables we can run.  If not, either
1520 # the compiler is broken, or we cross compile.
1521 echo "$as_me:1521: checking whether we are cross compiling" >&5
1522 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
1523 echo "$as_me:1523: result: $cross_compiling" >&5
1524 echo "${ECHO_T}$cross_compiling" >&6
1525
1526 echo "$as_me:1526: checking for executable suffix" >&5
1527 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6
1528 if { (eval echo "$as_me:1528: \"$ac_link\"") >&5
1529   (eval $ac_link) 2>&5
1530   ac_status=$?
1531   echo "$as_me:1531: \$? = $ac_status" >&5
1532   (exit $ac_status); }; then
1533   # If both `conftest.exe' and `conftest' are `present' (well, observable)
1534 # catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
1535 # work properly (i.e., refer to `conftest.exe'), while it won't with
1536 # `rm'.
1537 for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do
1538   case $ac_file in
1539     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
1540     *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
1541           export ac_cv_exeext
1542           break;;
1543     * ) break;;
1544   esac
1545 done
1546 else
1547   { { echo "$as_me:1547: error: cannot compute EXEEXT: cannot compile and link" >&5
1548 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;}
1549    { (exit 1); exit 1; }; }
1550 fi
1551
1552 rm -f conftest$ac_cv_exeext
1553 echo "$as_me:1553: result: $ac_cv_exeext" >&5
1554 echo "${ECHO_T}$ac_cv_exeext" >&6
1555
1556 rm -f conftest.$ac_ext
1557 EXEEXT=$ac_cv_exeext
1558 ac_exeext=$EXEEXT
1559 echo "$as_me:1559: checking for object suffix" >&5
1560 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6
1561 if test "${ac_cv_objext+set}" = set; then
1562   echo $ECHO_N "(cached) $ECHO_C" >&6
1563 else
1564   cat >conftest.$ac_ext <<_ACEOF
1565 #line 1565 "configure"
1566 #include "confdefs.h"
1567
1568 int
1569 main ()
1570 {
1571
1572   ;
1573   return 0;
1574 }
1575 _ACEOF
1576 rm -f conftest.o conftest.obj
1577 if { (eval echo "$as_me:1577: \"$ac_compile\"") >&5
1578   (eval $ac_compile) 2>&5
1579   ac_status=$?
1580   echo "$as_me:1580: \$? = $ac_status" >&5
1581   (exit $ac_status); }; then
1582   for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
1583   case $ac_file in
1584     *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;;
1585     *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
1586        break;;
1587   esac
1588 done
1589 else
1590   echo "$as_me: failed program was:" >&5
1591 cat conftest.$ac_ext >&5
1592 { { echo "$as_me:1592: error: cannot compute OBJEXT: cannot compile" >&5
1593 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;}
1594    { (exit 1); exit 1; }; }
1595 fi
1596
1597 rm -f conftest.$ac_cv_objext conftest.$ac_ext
1598 fi
1599 echo "$as_me:1599: result: $ac_cv_objext" >&5
1600 echo "${ECHO_T}$ac_cv_objext" >&6
1601 OBJEXT=$ac_cv_objext
1602 ac_objext=$OBJEXT
1603 echo "$as_me:1603: checking whether we are using the GNU C compiler" >&5
1604 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
1605 if test "${ac_cv_c_compiler_gnu+set}" = set; then
1606   echo $ECHO_N "(cached) $ECHO_C" >&6
1607 else
1608   cat >conftest.$ac_ext <<_ACEOF
1609 #line 1609 "configure"
1610 #include "confdefs.h"
1611
1612 int
1613 main ()
1614 {
1615 #ifndef __GNUC__
1616        choke me
1617 #endif
1618
1619   ;
1620   return 0;
1621 }
1622 _ACEOF
1623 rm -f conftest.$ac_objext
1624 if { (eval echo "$as_me:1624: \"$ac_compile\"") >&5
1625   (eval $ac_compile) 2>&5
1626   ac_status=$?
1627   echo "$as_me:1627: \$? = $ac_status" >&5
1628   (exit $ac_status); } &&
1629          { ac_try='test -s conftest.$ac_objext'
1630   { (eval echo "$as_me:1630: \"$ac_try\"") >&5
1631   (eval $ac_try) 2>&5
1632   ac_status=$?
1633   echo "$as_me:1633: \$? = $ac_status" >&5
1634   (exit $ac_status); }; }; then
1635   ac_compiler_gnu=yes
1636 else
1637   echo "$as_me: failed program was:" >&5
1638 cat conftest.$ac_ext >&5
1639 ac_compiler_gnu=no
1640 fi
1641 rm -f conftest.$ac_objext conftest.$ac_ext
1642 ac_cv_c_compiler_gnu=$ac_compiler_gnu
1643
1644 fi
1645 echo "$as_me:1645: result: $ac_cv_c_compiler_gnu" >&5
1646 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
1647 GCC=`test $ac_compiler_gnu = yes && echo yes`
1648 ac_test_CFLAGS=${CFLAGS+set}
1649 ac_save_CFLAGS=$CFLAGS
1650 CFLAGS="-g"
1651 echo "$as_me:1651: checking whether $CC accepts -g" >&5
1652 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
1653 if test "${ac_cv_prog_cc_g+set}" = set; then
1654   echo $ECHO_N "(cached) $ECHO_C" >&6
1655 else
1656   cat >conftest.$ac_ext <<_ACEOF
1657 #line 1657 "configure"
1658 #include "confdefs.h"
1659
1660 int
1661 main ()
1662 {
1663
1664   ;
1665   return 0;
1666 }
1667 _ACEOF
1668 rm -f conftest.$ac_objext
1669 if { (eval echo "$as_me:1669: \"$ac_compile\"") >&5
1670   (eval $ac_compile) 2>&5
1671   ac_status=$?
1672   echo "$as_me:1672: \$? = $ac_status" >&5
1673   (exit $ac_status); } &&
1674          { ac_try='test -s conftest.$ac_objext'
1675   { (eval echo "$as_me:1675: \"$ac_try\"") >&5
1676   (eval $ac_try) 2>&5
1677   ac_status=$?
1678   echo "$as_me:1678: \$? = $ac_status" >&5
1679   (exit $ac_status); }; }; then
1680   ac_cv_prog_cc_g=yes
1681 else
1682   echo "$as_me: failed program was:" >&5
1683 cat conftest.$ac_ext >&5
1684 ac_cv_prog_cc_g=no
1685 fi
1686 rm -f conftest.$ac_objext conftest.$ac_ext
1687 fi
1688 echo "$as_me:1688: result: $ac_cv_prog_cc_g" >&5
1689 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
1690 if test "$ac_test_CFLAGS" = set; then
1691   CFLAGS=$ac_save_CFLAGS
1692 elif test $ac_cv_prog_cc_g = yes; then
1693   if test "$GCC" = yes; then
1694     CFLAGS="-g -O2"
1695   else
1696     CFLAGS="-g"
1697   fi
1698 else
1699   if test "$GCC" = yes; then
1700     CFLAGS="-O2"
1701   else
1702     CFLAGS=
1703   fi
1704 fi
1705 # Some people use a C++ compiler to compile C.  Since we use `exit',
1706 # in C++ we need to declare it.  In case someone uses the same compiler
1707 # for both compiling C and C++ we need to have the C++ compiler decide
1708 # the declaration of exit, since it's the most demanding environment.
1709 cat >conftest.$ac_ext <<_ACEOF
1710 #ifndef __cplusplus
1711   choke me
1712 #endif
1713 _ACEOF
1714 rm -f conftest.$ac_objext
1715 if { (eval echo "$as_me:1715: \"$ac_compile\"") >&5
1716   (eval $ac_compile) 2>&5
1717   ac_status=$?
1718   echo "$as_me:1718: \$? = $ac_status" >&5
1719   (exit $ac_status); } &&
1720          { ac_try='test -s conftest.$ac_objext'
1721   { (eval echo "$as_me:1721: \"$ac_try\"") >&5
1722   (eval $ac_try) 2>&5
1723   ac_status=$?
1724   echo "$as_me:1724: \$? = $ac_status" >&5
1725   (exit $ac_status); }; }; then
1726   for ac_declaration in \
1727    ''\
1728    '#include <stdlib.h>' \
1729    'extern "C" void std::exit (int) throw (); using std::exit;' \
1730    'extern "C" void std::exit (int); using std::exit;' \
1731    'extern "C" void exit (int) throw ();' \
1732    'extern "C" void exit (int);' \
1733    'void exit (int);'
1734 do
1735   cat >conftest.$ac_ext <<_ACEOF
1736 #line 1736 "configure"
1737 #include "confdefs.h"
1738 #include <stdlib.h>
1739 $ac_declaration
1740 int
1741 main ()
1742 {
1743 exit (42);
1744   ;
1745   return 0;
1746 }
1747 _ACEOF
1748 rm -f conftest.$ac_objext
1749 if { (eval echo "$as_me:1749: \"$ac_compile\"") >&5
1750   (eval $ac_compile) 2>&5
1751   ac_status=$?
1752   echo "$as_me:1752: \$? = $ac_status" >&5
1753   (exit $ac_status); } &&
1754          { ac_try='test -s conftest.$ac_objext'
1755   { (eval echo "$as_me:1755: \"$ac_try\"") >&5
1756   (eval $ac_try) 2>&5
1757   ac_status=$?
1758   echo "$as_me:1758: \$? = $ac_status" >&5
1759   (exit $ac_status); }; }; then
1760   :
1761 else
1762   echo "$as_me: failed program was:" >&5
1763 cat conftest.$ac_ext >&5
1764 continue
1765 fi
1766 rm -f conftest.$ac_objext conftest.$ac_ext
1767   cat >conftest.$ac_ext <<_ACEOF
1768 #line 1768 "configure"
1769 #include "confdefs.h"
1770 $ac_declaration
1771 int
1772 main ()
1773 {
1774 exit (42);
1775   ;
1776   return 0;
1777 }
1778 _ACEOF
1779 rm -f conftest.$ac_objext
1780 if { (eval echo "$as_me:1780: \"$ac_compile\"") >&5
1781   (eval $ac_compile) 2>&5
1782   ac_status=$?
1783   echo "$as_me:1783: \$? = $ac_status" >&5
1784   (exit $ac_status); } &&
1785          { ac_try='test -s conftest.$ac_objext'
1786   { (eval echo "$as_me:1786: \"$ac_try\"") >&5
1787   (eval $ac_try) 2>&5
1788   ac_status=$?
1789   echo "$as_me:1789: \$? = $ac_status" >&5
1790   (exit $ac_status); }; }; then
1791   break
1792 else
1793   echo "$as_me: failed program was:" >&5
1794 cat conftest.$ac_ext >&5
1795 fi
1796 rm -f conftest.$ac_objext conftest.$ac_ext
1797 done
1798 rm -rf conftest*
1799 if test -n "$ac_declaration"; then
1800   echo '#ifdef __cplusplus' >>confdefs.h
1801   echo $ac_declaration      >>confdefs.h
1802   echo '#endif'             >>confdefs.h
1803 fi
1804
1805 else
1806   echo "$as_me: failed program was:" >&5
1807 cat conftest.$ac_ext >&5
1808 fi
1809 rm -f conftest.$ac_objext conftest.$ac_ext
1810 ac_ext=c
1811 ac_cpp='$CPP $CPPFLAGS'
1812 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1813 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1814 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1815 ac_main_return=return
1816
1817 ac_ext=c
1818 ac_cpp='$CPP $CPPFLAGS'
1819 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
1820 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
1821 ac_compiler_gnu=$ac_cv_c_compiler_gnu
1822 ac_main_return=return
1823 echo "$as_me:1823: checking how to run the C preprocessor" >&5
1824 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
1825 # On Suns, sometimes $CPP names a directory.
1826 if test -n "$CPP" && test -d "$CPP"; then
1827   CPP=
1828 fi
1829 if test -z "$CPP"; then
1830   if test "${ac_cv_prog_CPP+set}" = set; then
1831   echo $ECHO_N "(cached) $ECHO_C" >&6
1832 else
1833       # Double quotes because CPP needs to be expanded
1834     for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
1835     do
1836       ac_preproc_ok=false
1837 for ac_c_preproc_warn_flag in '' yes
1838 do
1839   # Use a header file that comes with gcc, so configuring glibc
1840   # with a fresh cross-compiler works.
1841   # On the NeXT, cc -E runs the code through the compiler's parser,
1842   # not just through cpp. "Syntax error" is here to catch this case.
1843   cat >conftest.$ac_ext <<_ACEOF
1844 #line 1844 "configure"
1845 #include "confdefs.h"
1846 #include <assert.h>
1847                      Syntax error
1848 _ACEOF
1849 if { (eval echo "$as_me:1849: \"$ac_cpp conftest.$ac_ext\"") >&5
1850   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1851   ac_status=$?
1852   egrep -v '^ *\+' conftest.er1 >conftest.err
1853   rm -f conftest.er1
1854   cat conftest.err >&5
1855   echo "$as_me:1855: \$? = $ac_status" >&5
1856   (exit $ac_status); } >/dev/null; then
1857   if test -s conftest.err; then
1858     ac_cpp_err=$ac_c_preproc_warn_flag
1859   else
1860     ac_cpp_err=
1861   fi
1862 else
1863   ac_cpp_err=yes
1864 fi
1865 if test -z "$ac_cpp_err"; then
1866   :
1867 else
1868   echo "$as_me: failed program was:" >&5
1869   cat conftest.$ac_ext >&5
1870   # Broken: fails on valid input.
1871 continue
1872 fi
1873 rm -f conftest.err conftest.$ac_ext
1874
1875   # OK, works on sane cases.  Now check whether non-existent headers
1876   # can be detected and how.
1877   cat >conftest.$ac_ext <<_ACEOF
1878 #line 1878 "configure"
1879 #include "confdefs.h"
1880 #include <ac_nonexistent.h>
1881 _ACEOF
1882 if { (eval echo "$as_me:1882: \"$ac_cpp conftest.$ac_ext\"") >&5
1883   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1884   ac_status=$?
1885   egrep -v '^ *\+' conftest.er1 >conftest.err
1886   rm -f conftest.er1
1887   cat conftest.err >&5
1888   echo "$as_me:1888: \$? = $ac_status" >&5
1889   (exit $ac_status); } >/dev/null; then
1890   if test -s conftest.err; then
1891     ac_cpp_err=$ac_c_preproc_warn_flag
1892   else
1893     ac_cpp_err=
1894   fi
1895 else
1896   ac_cpp_err=yes
1897 fi
1898 if test -z "$ac_cpp_err"; then
1899   # Broken: success on invalid input.
1900 continue
1901 else
1902   echo "$as_me: failed program was:" >&5
1903   cat conftest.$ac_ext >&5
1904   # Passes both tests.
1905 ac_preproc_ok=:
1906 break
1907 fi
1908 rm -f conftest.err conftest.$ac_ext
1909
1910 done
1911 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
1912 rm -f conftest.err conftest.$ac_ext
1913 if $ac_preproc_ok; then
1914   break
1915 fi
1916
1917     done
1918     ac_cv_prog_CPP=$CPP
1919
1920 fi
1921   CPP=$ac_cv_prog_CPP
1922 else
1923   ac_cv_prog_CPP=$CPP
1924 fi
1925 echo "$as_me:1925: result: $CPP" >&5
1926 echo "${ECHO_T}$CPP" >&6
1927 ac_preproc_ok=false
1928 for ac_c_preproc_warn_flag in '' yes
1929 do
1930   # Use a header file that comes with gcc, so configuring glibc
1931   # with a fresh cross-compiler works.
1932   # On the NeXT, cc -E runs the code through the compiler's parser,
1933   # not just through cpp. "Syntax error" is here to catch this case.
1934   cat >conftest.$ac_ext <<_ACEOF
1935 #line 1935 "configure"
1936 #include "confdefs.h"
1937 #include <assert.h>
1938                      Syntax error
1939 _ACEOF
1940 if { (eval echo "$as_me:1940: \"$ac_cpp conftest.$ac_ext\"") >&5
1941   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1942   ac_status=$?
1943   egrep -v '^ *\+' conftest.er1 >conftest.err
1944   rm -f conftest.er1
1945   cat conftest.err >&5
1946   echo "$as_me:1946: \$? = $ac_status" >&5
1947   (exit $ac_status); } >/dev/null; then
1948   if test -s conftest.err; then
1949     ac_cpp_err=$ac_c_preproc_warn_flag
1950   else
1951     ac_cpp_err=
1952   fi
1953 else
1954   ac_cpp_err=yes
1955 fi
1956 if test -z "$ac_cpp_err"; then
1957   :
1958 else
1959   echo "$as_me: failed program was:" >&5
1960   cat conftest.$ac_ext >&5
1961   # Broken: fails on valid input.
1962 continue
1963 fi
1964 rm -f conftest.err conftest.$ac_ext
1965
1966   # OK, works on sane cases.  Now check whether non-existent headers
1967   # can be detected and how.
1968   cat >conftest.$ac_ext <<_ACEOF
1969 #line 1969 "configure"
1970 #include "confdefs.h"
1971 #include <ac_nonexistent.h>
1972 _ACEOF
1973 if { (eval echo "$as_me:1973: \"$ac_cpp conftest.$ac_ext\"") >&5
1974   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
1975   ac_status=$?
1976   egrep -v '^ *\+' conftest.er1 >conftest.err
1977   rm -f conftest.er1
1978   cat conftest.err >&5
1979   echo "$as_me:1979: \$? = $ac_status" >&5
1980   (exit $ac_status); } >/dev/null; then
1981   if test -s conftest.err; then
1982     ac_cpp_err=$ac_c_preproc_warn_flag
1983   else
1984     ac_cpp_err=
1985   fi
1986 else
1987   ac_cpp_err=yes
1988 fi
1989 if test -z "$ac_cpp_err"; then
1990   # Broken: success on invalid input.
1991 continue
1992 else
1993   echo "$as_me: failed program was:" >&5
1994   cat conftest.$ac_ext >&5
1995   # Passes both tests.
1996 ac_preproc_ok=:
1997 break
1998 fi
1999 rm -f conftest.err conftest.$ac_ext
2000
2001 done
2002 # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
2003 rm -f conftest.err conftest.$ac_ext
2004 if $ac_preproc_ok; then
2005   :
2006 else
2007   { { echo "$as_me:2007: error: C preprocessor \"$CPP\" fails sanity check" >&5
2008 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;}
2009    { (exit 1); exit 1; }; }
2010 fi
2011
2012 ac_ext=c
2013 ac_cpp='$CPP $CPPFLAGS'
2014 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
2015 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
2016 ac_compiler_gnu=$ac_cv_c_compiler_gnu
2017 ac_main_return=return
2018
2019 for ac_prog in mawk gawk nawk awk
2020 do
2021   # Extract the first word of "$ac_prog", so it can be a program name with args.
2022 set dummy $ac_prog; ac_word=$2
2023 echo "$as_me:2023: checking for $ac_word" >&5
2024 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2025 if test "${ac_cv_prog_AWK+set}" = set; then
2026   echo $ECHO_N "(cached) $ECHO_C" >&6
2027 else
2028   if test -n "$AWK"; then
2029   ac_cv_prog_AWK="$AWK" # Let the user override the test.
2030 else
2031   ac_save_IFS=$IFS; IFS=$ac_path_separator
2032 ac_dummy="$PATH"
2033 for ac_dir in $ac_dummy; do
2034   IFS=$ac_save_IFS
2035   test -z "$ac_dir" && ac_dir=.
2036   $as_executable_p "$ac_dir/$ac_word" || continue
2037 ac_cv_prog_AWK="$ac_prog"
2038 echo "$as_me:2038: found $ac_dir/$ac_word" >&5
2039 break
2040 done
2041
2042 fi
2043 fi
2044 AWK=$ac_cv_prog_AWK
2045 if test -n "$AWK"; then
2046   echo "$as_me:2046: result: $AWK" >&5
2047 echo "${ECHO_T}$AWK" >&6
2048 else
2049   echo "$as_me:2049: result: no" >&5
2050 echo "${ECHO_T}no" >&6
2051 fi
2052
2053   test -n "$AWK" && break
2054 done
2055
2056 # Find a good install program.  We prefer a C program (faster),
2057 # so one script is as good as another.  But avoid the broken or
2058 # incompatible versions:
2059 # SysV /etc/install, /usr/sbin/install
2060 # SunOS /usr/etc/install
2061 # IRIX /sbin/install
2062 # AIX /bin/install
2063 # AmigaOS /C/install, which installs bootblocks on floppy discs
2064 # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
2065 # AFS /usr/afsws/bin/install, which mishandles nonexistent args
2066 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
2067 # ./install, which can be erroneously created by make from ./install.sh.
2068 echo "$as_me:2068: checking for a BSD compatible install" >&5
2069 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6
2070 if test -z "$INSTALL"; then
2071 if test "${ac_cv_path_install+set}" = set; then
2072   echo $ECHO_N "(cached) $ECHO_C" >&6
2073 else
2074     ac_save_IFS=$IFS; IFS=$ac_path_separator
2075   for ac_dir in $PATH; do
2076     IFS=$ac_save_IFS
2077     # Account for people who put trailing slashes in PATH elements.
2078     case $ac_dir/ in
2079     / | ./ | .// | /cC/* \
2080     | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \
2081     | /usr/ucb/* ) ;;
2082     *)
2083       # OSF1 and SCO ODT 3.0 have their own names for install.
2084       # Don't use installbsd from OSF since it installs stuff as root
2085       # by default.
2086       for ac_prog in ginstall scoinst install; do
2087         if $as_executable_p "$ac_dir/$ac_prog"; then
2088           if test $ac_prog = install &&
2089             grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2090             # AIX install.  It has an incompatible calling convention.
2091             :
2092           elif test $ac_prog = install &&
2093             grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then
2094             # program-specific install script used by HP pwplus--don't use.
2095             :
2096           else
2097             ac_cv_path_install="$ac_dir/$ac_prog -c"
2098             break 2
2099           fi
2100         fi
2101       done
2102       ;;
2103     esac
2104   done
2105
2106 fi
2107   if test "${ac_cv_path_install+set}" = set; then
2108     INSTALL=$ac_cv_path_install
2109   else
2110     # As a last resort, use the slow shell script.  We don't cache a
2111     # path for INSTALL within a source directory, because that will
2112     # break other packages using the cache if that directory is
2113     # removed, or if the path is relative.
2114     INSTALL=$ac_install_sh
2115   fi
2116 fi
2117 echo "$as_me:2117: result: $INSTALL" >&5
2118 echo "${ECHO_T}$INSTALL" >&6
2119
2120 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
2121 # It thinks the first close brace ends the variable substitution.
2122 test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
2123
2124 test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
2125
2126 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
2127
2128 case $INSTALL in
2129 /*)
2130   ;;
2131 *)
2132   cf_dir=`echo $INSTALL | sed -e 's%/[^/]*$%%'`
2133   test -z "$cf_dir" && cf_dir=.
2134   INSTALL=`cd $cf_dir && pwd`/`echo $INSTALL | sed -e 's%^.*/%%'`
2135   ;;
2136 esac
2137
2138 for ac_prog in tdlint lint alint splint lclint
2139 do
2140   # Extract the first word of "$ac_prog", so it can be a program name with args.
2141 set dummy $ac_prog; ac_word=$2
2142 echo "$as_me:2142: checking for $ac_word" >&5
2143 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2144 if test "${ac_cv_prog_LINT+set}" = set; then
2145   echo $ECHO_N "(cached) $ECHO_C" >&6
2146 else
2147   if test -n "$LINT"; then
2148   ac_cv_prog_LINT="$LINT" # Let the user override the test.
2149 else
2150   ac_save_IFS=$IFS; IFS=$ac_path_separator
2151 ac_dummy="$PATH"
2152 for ac_dir in $ac_dummy; do
2153   IFS=$ac_save_IFS
2154   test -z "$ac_dir" && ac_dir=.
2155   $as_executable_p "$ac_dir/$ac_word" || continue
2156 ac_cv_prog_LINT="$ac_prog"
2157 echo "$as_me:2157: found $ac_dir/$ac_word" >&5
2158 break
2159 done
2160
2161 fi
2162 fi
2163 LINT=$ac_cv_prog_LINT
2164 if test -n "$LINT"; then
2165   echo "$as_me:2165: result: $LINT" >&5
2166 echo "${ECHO_T}$LINT" >&6
2167 else
2168   echo "$as_me:2168: result: no" >&5
2169 echo "${ECHO_T}no" >&6
2170 fi
2171
2172   test -n "$LINT" && break
2173 done
2174
2175 echo "$as_me:2175: checking if filesystem supports mixed-case filenames" >&5
2176 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6
2177 if test "${cf_cv_mixedcase+set}" = set; then
2178   echo $ECHO_N "(cached) $ECHO_C" >&6
2179 else
2180
2181 if test "$cross_compiling" = yes ; then
2182         case $target_alias in #(vi
2183         *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi
2184                 cf_cv_mixedcase=no
2185                 ;;
2186         *)
2187                 cf_cv_mixedcase=yes
2188                 ;;
2189         esac
2190 else
2191         rm -f conftest CONFTEST
2192         echo test >conftest
2193         if test -f CONFTEST ; then
2194                 cf_cv_mixedcase=no
2195         else
2196                 cf_cv_mixedcase=yes
2197         fi
2198         rm -f conftest CONFTEST
2199 fi
2200
2201 fi
2202 echo "$as_me:2202: result: $cf_cv_mixedcase" >&5
2203 echo "${ECHO_T}$cf_cv_mixedcase" >&6
2204 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF
2205 #define MIXEDCASE_FILENAMES 1
2206 EOF
2207
2208 for ac_prog in exctags ctags
2209 do
2210   # Extract the first word of "$ac_prog", so it can be a program name with args.
2211 set dummy $ac_prog; ac_word=$2
2212 echo "$as_me:2212: checking for $ac_word" >&5
2213 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2214 if test "${ac_cv_prog_CTAGS+set}" = set; then
2215   echo $ECHO_N "(cached) $ECHO_C" >&6
2216 else
2217   if test -n "$CTAGS"; then
2218   ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test.
2219 else
2220   ac_save_IFS=$IFS; IFS=$ac_path_separator
2221 ac_dummy="$PATH"
2222 for ac_dir in $ac_dummy; do
2223   IFS=$ac_save_IFS
2224   test -z "$ac_dir" && ac_dir=.
2225   $as_executable_p "$ac_dir/$ac_word" || continue
2226 ac_cv_prog_CTAGS="$ac_prog"
2227 echo "$as_me:2227: found $ac_dir/$ac_word" >&5
2228 break
2229 done
2230
2231 fi
2232 fi
2233 CTAGS=$ac_cv_prog_CTAGS
2234 if test -n "$CTAGS"; then
2235   echo "$as_me:2235: result: $CTAGS" >&5
2236 echo "${ECHO_T}$CTAGS" >&6
2237 else
2238   echo "$as_me:2238: result: no" >&5
2239 echo "${ECHO_T}no" >&6
2240 fi
2241
2242   test -n "$CTAGS" && break
2243 done
2244
2245 for ac_prog in exetags etags
2246 do
2247   # Extract the first word of "$ac_prog", so it can be a program name with args.
2248 set dummy $ac_prog; ac_word=$2
2249 echo "$as_me:2249: checking for $ac_word" >&5
2250 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2251 if test "${ac_cv_prog_ETAGS+set}" = set; then
2252   echo $ECHO_N "(cached) $ECHO_C" >&6
2253 else
2254   if test -n "$ETAGS"; then
2255   ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test.
2256 else
2257   ac_save_IFS=$IFS; IFS=$ac_path_separator
2258 ac_dummy="$PATH"
2259 for ac_dir in $ac_dummy; do
2260   IFS=$ac_save_IFS
2261   test -z "$ac_dir" && ac_dir=.
2262   $as_executable_p "$ac_dir/$ac_word" || continue
2263 ac_cv_prog_ETAGS="$ac_prog"
2264 echo "$as_me:2264: found $ac_dir/$ac_word" >&5
2265 break
2266 done
2267
2268 fi
2269 fi
2270 ETAGS=$ac_cv_prog_ETAGS
2271 if test -n "$ETAGS"; then
2272   echo "$as_me:2272: result: $ETAGS" >&5
2273 echo "${ECHO_T}$ETAGS" >&6
2274 else
2275   echo "$as_me:2275: result: no" >&5
2276 echo "${ECHO_T}no" >&6
2277 fi
2278
2279   test -n "$ETAGS" && break
2280 done
2281
2282 # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args.
2283 set dummy ${CTAGS:-ctags}; ac_word=$2
2284 echo "$as_me:2284: checking for $ac_word" >&5
2285 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2286 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then
2287   echo $ECHO_N "(cached) $ECHO_C" >&6
2288 else
2289   if test -n "$MAKE_LOWER_TAGS"; then
2290   ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test.
2291 else
2292   ac_save_IFS=$IFS; IFS=$ac_path_separator
2293 ac_dummy="$PATH"
2294 for ac_dir in $ac_dummy; do
2295   IFS=$ac_save_IFS
2296   test -z "$ac_dir" && ac_dir=.
2297   $as_executable_p "$ac_dir/$ac_word" || continue
2298 ac_cv_prog_MAKE_LOWER_TAGS="yes"
2299 echo "$as_me:2299: found $ac_dir/$ac_word" >&5
2300 break
2301 done
2302
2303   test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no"
2304 fi
2305 fi
2306 MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS
2307 if test -n "$MAKE_LOWER_TAGS"; then
2308   echo "$as_me:2308: result: $MAKE_LOWER_TAGS" >&5
2309 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6
2310 else
2311   echo "$as_me:2311: result: no" >&5
2312 echo "${ECHO_T}no" >&6
2313 fi
2314
2315 if test "$cf_cv_mixedcase" = yes ; then
2316         # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args.
2317 set dummy ${ETAGS:-etags}; ac_word=$2
2318 echo "$as_me:2318: checking for $ac_word" >&5
2319 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2320 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then
2321   echo $ECHO_N "(cached) $ECHO_C" >&6
2322 else
2323   if test -n "$MAKE_UPPER_TAGS"; then
2324   ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test.
2325 else
2326   ac_save_IFS=$IFS; IFS=$ac_path_separator
2327 ac_dummy="$PATH"
2328 for ac_dir in $ac_dummy; do
2329   IFS=$ac_save_IFS
2330   test -z "$ac_dir" && ac_dir=.
2331   $as_executable_p "$ac_dir/$ac_word" || continue
2332 ac_cv_prog_MAKE_UPPER_TAGS="yes"
2333 echo "$as_me:2333: found $ac_dir/$ac_word" >&5
2334 break
2335 done
2336
2337   test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no"
2338 fi
2339 fi
2340 MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS
2341 if test -n "$MAKE_UPPER_TAGS"; then
2342   echo "$as_me:2342: result: $MAKE_UPPER_TAGS" >&5
2343 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6
2344 else
2345   echo "$as_me:2345: result: no" >&5
2346 echo "${ECHO_T}no" >&6
2347 fi
2348
2349 else
2350         MAKE_UPPER_TAGS=no
2351 fi
2352
2353 if test "$MAKE_UPPER_TAGS" = yes ; then
2354         MAKE_UPPER_TAGS=
2355 else
2356         MAKE_UPPER_TAGS="#"
2357 fi
2358
2359 if test "$MAKE_LOWER_TAGS" = yes ; then
2360         MAKE_LOWER_TAGS=
2361 else
2362         MAKE_LOWER_TAGS="#"
2363 fi
2364
2365 echo "$as_me:2365: checking if -lm needed for math functions" >&5
2366 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6
2367 if test "${cf_cv_need_libm+set}" = set; then
2368   echo $ECHO_N "(cached) $ECHO_C" >&6
2369 else
2370
2371         cat >conftest.$ac_ext <<_ACEOF
2372 #line 2372 "configure"
2373 #include "confdefs.h"
2374
2375         #include <stdio.h>
2376         #include <math.h>
2377
2378 int
2379 main ()
2380 {
2381 double x = rand(); printf("result = %g\n", sin(x))
2382   ;
2383   return 0;
2384 }
2385 _ACEOF
2386 rm -f conftest.$ac_objext conftest$ac_exeext
2387 if { (eval echo "$as_me:2387: \"$ac_link\"") >&5
2388   (eval $ac_link) 2>&5
2389   ac_status=$?
2390   echo "$as_me:2390: \$? = $ac_status" >&5
2391   (exit $ac_status); } &&
2392          { ac_try='test -s conftest$ac_exeext'
2393   { (eval echo "$as_me:2393: \"$ac_try\"") >&5
2394   (eval $ac_try) 2>&5
2395   ac_status=$?
2396   echo "$as_me:2396: \$? = $ac_status" >&5
2397   (exit $ac_status); }; }; then
2398   cf_cv_need_libm=no
2399 else
2400   echo "$as_me: failed program was:" >&5
2401 cat conftest.$ac_ext >&5
2402 cf_cv_need_libm=yes
2403 fi
2404 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2405 fi
2406 echo "$as_me:2406: result: $cf_cv_need_libm" >&5
2407 echo "${ECHO_T}$cf_cv_need_libm" >&6
2408 if test "$cf_cv_need_libm" = yes
2409 then
2410 MATH_LIB=-lm
2411 fi
2412
2413 top_builddir=`pwd`
2414
2415 CC_G_OPT="-g"
2416 CC_SHARED_OPTS=unknown
2417 CPPFLAGS="$CPPFLAGS"
2418 DFT_DEP_SUFFIX=""
2419 DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'`
2420 DFT_UPR_MODEL="NORMAL"
2421 LD="ld"
2422 LDFLAGS_SHARED=""
2423 LDFLAGS_STATIC=""
2424 LD_MODEL=""
2425 LD_SHARED_OPTS=""
2426 LIBTOOL=""
2427 LIB_CLEAN=""
2428 LIB_COMPILE=""
2429 LIB_LINK='${CC}'
2430 LINK_TESTS=""
2431 LOCAL_LDFLAGS=""
2432 PTHREAD="-lm"
2433 TEST_ARGS=""
2434 TEST_DEPS=""
2435 TEST_LIBS=""
2436 TINFO_LDFLAGS=''
2437 TINFO_LIBS='$(LIBS_CURSES)'
2438 cf_cv_abi_version=""
2439 cf_cv_rel_version=""
2440
2441 cf_cv_screen=curses
2442 cf_cv_libtype=
2443
2444 # This should have been defined by AC_PROG_CC
2445 : ${CC:=cc}
2446
2447 # Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
2448 # into CC.  This will not help with broken scripts that wrap the compiler with
2449 # options, but eliminates a more common category of user confusion.
2450 echo "$as_me:2450: checking \$CC variable" >&5
2451 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6
2452 case "$CC" in #(vi
2453 *[\ \   ]-[IUD]*)
2454         echo "$as_me:2454: result: broken" >&5
2455 echo "${ECHO_T}broken" >&6
2456         { echo "$as_me:2456: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&5
2457 echo "$as_me: WARNING: your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;}
2458         # humor him...
2459         cf_flags=`echo "$CC" | sed -e 's/^[^    ]*[     ]//'`
2460         CC=`echo "$CC" | sed -e 's/[    ].*//'`
2461
2462 cf_fix_cppflags=no
2463 cf_new_cflags=
2464 cf_new_cppflags=
2465 cf_new_extra_cppflags=
2466
2467 for cf_add_cflags in $cf_flags
2468 do
2469 case $cf_fix_cppflags in
2470 no)
2471         case $cf_add_cflags in #(vi
2472         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2473                 case $cf_add_cflags in
2474                 -D*)
2475                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2476
2477                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2478                                 && test -z "${cf_tst_cflags}" \
2479                                 && cf_fix_cppflags=yes
2480
2481                         if test $cf_fix_cppflags = yes ; then
2482                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2483                                 continue
2484                         elif test "${cf_tst_cflags}" = "\"'" ; then
2485                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2486                                 continue
2487                         fi
2488                         ;;
2489                 esac
2490                 case "$CPPFLAGS" in
2491                 *$cf_add_cflags) #(vi
2492                         ;;
2493                 *) #(vi
2494                         case $cf_add_cflags in #(vi
2495                         -D*)
2496                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2497
2498 CPPFLAGS=`echo "$CPPFLAGS" | \
2499         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2500                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2501
2502                                 ;;
2503                         esac
2504                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2505                         ;;
2506                 esac
2507                 ;;
2508         *)
2509                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2510                 ;;
2511         esac
2512         ;;
2513 yes)
2514         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2515
2516         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2517
2518         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2519                 && test -z "${cf_tst_cflags}" \
2520                 && cf_fix_cppflags=no
2521         ;;
2522 esac
2523 done
2524
2525 if test -n "$cf_new_cflags" ; then
2526
2527         CFLAGS="$CFLAGS $cf_new_cflags"
2528 fi
2529
2530 if test -n "$cf_new_cppflags" ; then
2531
2532         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2533 fi
2534
2535 if test -n "$cf_new_extra_cppflags" ; then
2536
2537         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2538 fi
2539
2540         ;;
2541 *)
2542         echo "$as_me:2542: result: ok" >&5
2543 echo "${ECHO_T}ok" >&6
2544         ;;
2545 esac
2546
2547 echo "$as_me:2547: checking for ${CC:-cc} option to accept ANSI C" >&5
2548 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6
2549 if test "${cf_cv_ansi_cc+set}" = set; then
2550   echo $ECHO_N "(cached) $ECHO_C" >&6
2551 else
2552
2553 cf_cv_ansi_cc=no
2554 cf_save_CFLAGS="$CFLAGS"
2555 cf_save_CPPFLAGS="$CPPFLAGS"
2556 # Don't try gcc -ansi; that turns off useful extensions and
2557 # breaks some systems' header files.
2558 # AIX                   -qlanglvl=ansi
2559 # Ultrix and OSF/1      -std1
2560 # HP-UX                 -Aa -D_HPUX_SOURCE
2561 # SVR4                  -Xc
2562 # UnixWare 1.2          (cannot use -Xc, since ANSI/POSIX clashes)
2563 for cf_arg in "-DCC_HAS_PROTOS" \
2564         "" \
2565         -qlanglvl=ansi \
2566         -std1 \
2567         -Ae \
2568         "-Aa -D_HPUX_SOURCE" \
2569         -Xc
2570 do
2571
2572 cf_fix_cppflags=no
2573 cf_new_cflags=
2574 cf_new_cppflags=
2575 cf_new_extra_cppflags=
2576
2577 for cf_add_cflags in $cf_arg
2578 do
2579 case $cf_fix_cppflags in
2580 no)
2581         case $cf_add_cflags in #(vi
2582         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2583                 case $cf_add_cflags in
2584                 -D*)
2585                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2586
2587                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2588                                 && test -z "${cf_tst_cflags}" \
2589                                 && cf_fix_cppflags=yes
2590
2591                         if test $cf_fix_cppflags = yes ; then
2592                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2593                                 continue
2594                         elif test "${cf_tst_cflags}" = "\"'" ; then
2595                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2596                                 continue
2597                         fi
2598                         ;;
2599                 esac
2600                 case "$CPPFLAGS" in
2601                 *$cf_add_cflags) #(vi
2602                         ;;
2603                 *) #(vi
2604                         case $cf_add_cflags in #(vi
2605                         -D*)
2606                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2607
2608 CPPFLAGS=`echo "$CPPFLAGS" | \
2609         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2610                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2611
2612                                 ;;
2613                         esac
2614                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2615                         ;;
2616                 esac
2617                 ;;
2618         *)
2619                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2620                 ;;
2621         esac
2622         ;;
2623 yes)
2624         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2625
2626         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2627
2628         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2629                 && test -z "${cf_tst_cflags}" \
2630                 && cf_fix_cppflags=no
2631         ;;
2632 esac
2633 done
2634
2635 if test -n "$cf_new_cflags" ; then
2636
2637         CFLAGS="$CFLAGS $cf_new_cflags"
2638 fi
2639
2640 if test -n "$cf_new_cppflags" ; then
2641
2642         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2643 fi
2644
2645 if test -n "$cf_new_extra_cppflags" ; then
2646
2647         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2648 fi
2649
2650         cat >conftest.$ac_ext <<_ACEOF
2651 #line 2651 "configure"
2652 #include "confdefs.h"
2653
2654 #ifndef CC_HAS_PROTOS
2655 #if !defined(__STDC__) || (__STDC__ != 1)
2656 choke me
2657 #endif
2658 #endif
2659
2660 int
2661 main ()
2662 {
2663
2664         int test (int i, double x);
2665         struct s1 {int (*f) (int a);};
2666         struct s2 {int (*f) (double a);};
2667   ;
2668   return 0;
2669 }
2670 _ACEOF
2671 rm -f conftest.$ac_objext
2672 if { (eval echo "$as_me:2672: \"$ac_compile\"") >&5
2673   (eval $ac_compile) 2>&5
2674   ac_status=$?
2675   echo "$as_me:2675: \$? = $ac_status" >&5
2676   (exit $ac_status); } &&
2677          { ac_try='test -s conftest.$ac_objext'
2678   { (eval echo "$as_me:2678: \"$ac_try\"") >&5
2679   (eval $ac_try) 2>&5
2680   ac_status=$?
2681   echo "$as_me:2681: \$? = $ac_status" >&5
2682   (exit $ac_status); }; }; then
2683   cf_cv_ansi_cc="$cf_arg"; break
2684 else
2685   echo "$as_me: failed program was:" >&5
2686 cat conftest.$ac_ext >&5
2687 fi
2688 rm -f conftest.$ac_objext conftest.$ac_ext
2689 done
2690 CFLAGS="$cf_save_CFLAGS"
2691 CPPFLAGS="$cf_save_CPPFLAGS"
2692
2693 fi
2694 echo "$as_me:2694: result: $cf_cv_ansi_cc" >&5
2695 echo "${ECHO_T}$cf_cv_ansi_cc" >&6
2696
2697 if test "$cf_cv_ansi_cc" != "no"; then
2698 if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
2699
2700 cf_fix_cppflags=no
2701 cf_new_cflags=
2702 cf_new_cppflags=
2703 cf_new_extra_cppflags=
2704
2705 for cf_add_cflags in $cf_cv_ansi_cc
2706 do
2707 case $cf_fix_cppflags in
2708 no)
2709         case $cf_add_cflags in #(vi
2710         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
2711                 case $cf_add_cflags in
2712                 -D*)
2713                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
2714
2715                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2716                                 && test -z "${cf_tst_cflags}" \
2717                                 && cf_fix_cppflags=yes
2718
2719                         if test $cf_fix_cppflags = yes ; then
2720                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2721                                 continue
2722                         elif test "${cf_tst_cflags}" = "\"'" ; then
2723                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2724                                 continue
2725                         fi
2726                         ;;
2727                 esac
2728                 case "$CPPFLAGS" in
2729                 *$cf_add_cflags) #(vi
2730                         ;;
2731                 *) #(vi
2732                         case $cf_add_cflags in #(vi
2733                         -D*)
2734                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
2735
2736 CPPFLAGS=`echo "$CPPFLAGS" | \
2737         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
2738                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
2739
2740                                 ;;
2741                         esac
2742                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
2743                         ;;
2744                 esac
2745                 ;;
2746         *)
2747                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
2748                 ;;
2749         esac
2750         ;;
2751 yes)
2752         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
2753
2754         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
2755
2756         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
2757                 && test -z "${cf_tst_cflags}" \
2758                 && cf_fix_cppflags=no
2759         ;;
2760 esac
2761 done
2762
2763 if test -n "$cf_new_cflags" ; then
2764
2765         CFLAGS="$CFLAGS $cf_new_cflags"
2766 fi
2767
2768 if test -n "$cf_new_cppflags" ; then
2769
2770         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
2771 fi
2772
2773 if test -n "$cf_new_extra_cppflags" ; then
2774
2775         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
2776 fi
2777
2778 else
2779         cat >>confdefs.h <<\EOF
2780 #define CC_HAS_PROTOS 1
2781 EOF
2782
2783 fi
2784 fi
2785
2786 if test "$cf_cv_ansi_cc" = "no"; then
2787         { { echo "$as_me:2787: error: Your compiler does not appear to recognize prototypes.
2788 You have the following choices:
2789         a. adjust your compiler options
2790         b. get an up-to-date compiler
2791         c. use a wrapper such as unproto" >&5
2792 echo "$as_me: error: Your compiler does not appear to recognize prototypes.
2793 You have the following choices:
2794         a. adjust your compiler options
2795         b. get an up-to-date compiler
2796         c. use a wrapper such as unproto" >&2;}
2797    { (exit 1); exit 1; }; }
2798 fi
2799
2800 if test "$GCC" = yes
2801 then
2802 cat > conftest.i <<EOF
2803 #ifndef GCC_PRINTF
2804 #define GCC_PRINTF 0
2805 #endif
2806 #ifndef GCC_SCANF
2807 #define GCC_SCANF 0
2808 #endif
2809 #ifndef GCC_NORETURN
2810 #define GCC_NORETURN /* nothing */
2811 #endif
2812 #ifndef GCC_UNUSED
2813 #define GCC_UNUSED /* nothing */
2814 #endif
2815 EOF
2816 if test "$GCC" = yes
2817 then
2818         { echo "$as_me:2818: checking for $CC __attribute__ directives..." >&5
2819 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
2820 cat > conftest.$ac_ext <<EOF
2821 #line 2821 "${as_me:-configure}"
2822 #include "confdefs.h"
2823 #include "conftest.h"
2824 #include "conftest.i"
2825 #if     GCC_PRINTF
2826 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2827 #else
2828 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2829 #endif
2830 #if     GCC_SCANF
2831 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2832 #else
2833 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
2834 #endif
2835 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2836 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2837 extern void foo(void) GCC_NORETURN;
2838 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
2839 EOF
2840         cf_printf_attribute=no
2841         cf_scanf_attribute=no
2842         for cf_attribute in scanf printf unused noreturn
2843         do
2844
2845 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
2846
2847                 cf_directive="__attribute__(($cf_attribute))"
2848                 echo "checking for $CC $cf_directive" 1>&5
2849
2850                 case $cf_attribute in #(vi
2851                 printf) #(vi
2852                         cf_printf_attribute=yes
2853                         cat >conftest.h <<EOF
2854 #define GCC_$cf_ATTRIBUTE 1
2855 EOF
2856                         ;;
2857                 scanf) #(vi
2858                         cf_scanf_attribute=yes
2859                         cat >conftest.h <<EOF
2860 #define GCC_$cf_ATTRIBUTE 1
2861 EOF
2862                         ;;
2863                 *) #(vi
2864                         cat >conftest.h <<EOF
2865 #define GCC_$cf_ATTRIBUTE $cf_directive
2866 EOF
2867                         ;;
2868                 esac
2869
2870                 if { (eval echo "$as_me:2870: \"$ac_compile\"") >&5
2871   (eval $ac_compile) 2>&5
2872   ac_status=$?
2873   echo "$as_me:2873: \$? = $ac_status" >&5
2874   (exit $ac_status); }; then
2875                         test -n "$verbose" && echo "$as_me:2875: result: ... $cf_attribute" >&5
2876 echo "${ECHO_T}... $cf_attribute" >&6
2877                         cat conftest.h >>confdefs.h
2878                         case $cf_attribute in #(vi
2879                         printf) #(vi
2880                                 if test "$cf_printf_attribute" = no ; then
2881                                         cat >>confdefs.h <<EOF
2882 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
2883 EOF
2884                                 else
2885                                         cat >>confdefs.h <<EOF
2886 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2887 EOF
2888                                 fi
2889                                 ;;
2890                         scanf) #(vi
2891                                 if test "$cf_scanf_attribute" = no ; then
2892                                         cat >>confdefs.h <<EOF
2893 #define GCC_SCANFLIKE(fmt,var) /* nothing */
2894 EOF
2895                                 else
2896                                         cat >>confdefs.h <<EOF
2897 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
2898 EOF
2899                                 fi
2900                                 ;;
2901                         esac
2902                 fi
2903         done
2904 else
2905         fgrep define conftest.i >>confdefs.h
2906 fi
2907 rm -rf conftest*
2908 fi
2909
2910 cf_XOPEN_SOURCE=500
2911 cf_POSIX_C_SOURCE=199506L
2912 cf_xopen_source=
2913
2914 case $host_os in #(vi
2915 aix[4-7]*) #(vi
2916         cf_xopen_source="-D_ALL_SOURCE"
2917         ;;
2918 cygwin) #(vi
2919         cf_XOPEN_SOURCE=600
2920         ;;
2921 darwin[0-8].*) #(vi
2922         cf_xopen_source="-D_APPLE_C_SOURCE"
2923         ;;
2924 darwin*) #(vi
2925         cf_xopen_source="-D_DARWIN_C_SOURCE"
2926         ;;
2927 freebsd*|dragonfly*) #(vi
2928         # 5.x headers associate
2929         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2930         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2931         cf_POSIX_C_SOURCE=200112L
2932         cf_XOPEN_SOURCE=600
2933         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2934         ;;
2935 hpux11*) #(vi
2936         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2937         ;;
2938 hpux*) #(vi
2939         cf_xopen_source="-D_HPUX_SOURCE"
2940         ;;
2941 irix[56].*) #(vi
2942         cf_xopen_source="-D_SGI_SOURCE"
2943         ;;
2944 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2945
2946 echo "$as_me:2946: checking if we must define _GNU_SOURCE" >&5
2947 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2948 if test "${cf_cv_gnu_source+set}" = set; then
2949   echo $ECHO_N "(cached) $ECHO_C" >&6
2950 else
2951
2952 cat >conftest.$ac_ext <<_ACEOF
2953 #line 2953 "configure"
2954 #include "confdefs.h"
2955 #include <sys/types.h>
2956 int
2957 main ()
2958 {
2959
2960 #ifndef _XOPEN_SOURCE
2961 make an error
2962 #endif
2963   ;
2964   return 0;
2965 }
2966 _ACEOF
2967 rm -f conftest.$ac_objext
2968 if { (eval echo "$as_me:2968: \"$ac_compile\"") >&5
2969   (eval $ac_compile) 2>&5
2970   ac_status=$?
2971   echo "$as_me:2971: \$? = $ac_status" >&5
2972   (exit $ac_status); } &&
2973          { ac_try='test -s conftest.$ac_objext'
2974   { (eval echo "$as_me:2974: \"$ac_try\"") >&5
2975   (eval $ac_try) 2>&5
2976   ac_status=$?
2977   echo "$as_me:2977: \$? = $ac_status" >&5
2978   (exit $ac_status); }; }; then
2979   cf_cv_gnu_source=no
2980 else
2981   echo "$as_me: failed program was:" >&5
2982 cat conftest.$ac_ext >&5
2983 cf_save="$CPPFLAGS"
2984          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2985          cat >conftest.$ac_ext <<_ACEOF
2986 #line 2986 "configure"
2987 #include "confdefs.h"
2988 #include <sys/types.h>
2989 int
2990 main ()
2991 {
2992
2993 #ifdef _XOPEN_SOURCE
2994 make an error
2995 #endif
2996   ;
2997   return 0;
2998 }
2999 _ACEOF
3000 rm -f conftest.$ac_objext
3001 if { (eval echo "$as_me:3001: \"$ac_compile\"") >&5
3002   (eval $ac_compile) 2>&5
3003   ac_status=$?
3004   echo "$as_me:3004: \$? = $ac_status" >&5
3005   (exit $ac_status); } &&
3006          { ac_try='test -s conftest.$ac_objext'
3007   { (eval echo "$as_me:3007: \"$ac_try\"") >&5
3008   (eval $ac_try) 2>&5
3009   ac_status=$?
3010   echo "$as_me:3010: \$? = $ac_status" >&5
3011   (exit $ac_status); }; }; then
3012   cf_cv_gnu_source=no
3013 else
3014   echo "$as_me: failed program was:" >&5
3015 cat conftest.$ac_ext >&5
3016 cf_cv_gnu_source=yes
3017 fi
3018 rm -f conftest.$ac_objext conftest.$ac_ext
3019         CPPFLAGS="$cf_save"
3020
3021 fi
3022 rm -f conftest.$ac_objext conftest.$ac_ext
3023
3024 fi
3025 echo "$as_me:3025: result: $cf_cv_gnu_source" >&5
3026 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3027 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3028
3029         ;;
3030 mirbsd*) #(vi
3031         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3032         cf_XOPEN_SOURCE=
3033
3034 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3035
3036 cf_save_CFLAGS="$CFLAGS"
3037 cf_save_CPPFLAGS="$CPPFLAGS"
3038
3039 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3040         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3041                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3042
3043 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3044         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3045                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3046
3047 echo "$as_me:3047: checking if we should define _POSIX_C_SOURCE" >&5
3048 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3049 if test "${cf_cv_posix_c_source+set}" = set; then
3050   echo $ECHO_N "(cached) $ECHO_C" >&6
3051 else
3052
3053 echo "${as_me:-configure}:3053: testing if the symbol is already defined go no further ..." 1>&5
3054
3055         cat >conftest.$ac_ext <<_ACEOF
3056 #line 3056 "configure"
3057 #include "confdefs.h"
3058 #include <sys/types.h>
3059 int
3060 main ()
3061 {
3062
3063 #ifndef _POSIX_C_SOURCE
3064 make an error
3065 #endif
3066   ;
3067   return 0;
3068 }
3069 _ACEOF
3070 rm -f conftest.$ac_objext
3071 if { (eval echo "$as_me:3071: \"$ac_compile\"") >&5
3072   (eval $ac_compile) 2>&5
3073   ac_status=$?
3074   echo "$as_me:3074: \$? = $ac_status" >&5
3075   (exit $ac_status); } &&
3076          { ac_try='test -s conftest.$ac_objext'
3077   { (eval echo "$as_me:3077: \"$ac_try\"") >&5
3078   (eval $ac_try) 2>&5
3079   ac_status=$?
3080   echo "$as_me:3080: \$? = $ac_status" >&5
3081   (exit $ac_status); }; }; then
3082   cf_cv_posix_c_source=no
3083 else
3084   echo "$as_me: failed program was:" >&5
3085 cat conftest.$ac_ext >&5
3086 cf_want_posix_source=no
3087          case .$cf_POSIX_C_SOURCE in #(vi
3088          .[12]??*) #(vi
3089                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3090                 ;;
3091          .2) #(vi
3092                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3093                 cf_want_posix_source=yes
3094                 ;;
3095          .*)
3096                 cf_want_posix_source=yes
3097                 ;;
3098          esac
3099          if test "$cf_want_posix_source" = yes ; then
3100                 cat >conftest.$ac_ext <<_ACEOF
3101 #line 3101 "configure"
3102 #include "confdefs.h"
3103 #include <sys/types.h>
3104 int
3105 main ()
3106 {
3107
3108 #ifdef _POSIX_SOURCE
3109 make an error
3110 #endif
3111   ;
3112   return 0;
3113 }
3114 _ACEOF
3115 rm -f conftest.$ac_objext
3116 if { (eval echo "$as_me:3116: \"$ac_compile\"") >&5
3117   (eval $ac_compile) 2>&5
3118   ac_status=$?
3119   echo "$as_me:3119: \$? = $ac_status" >&5
3120   (exit $ac_status); } &&
3121          { ac_try='test -s conftest.$ac_objext'
3122   { (eval echo "$as_me:3122: \"$ac_try\"") >&5
3123   (eval $ac_try) 2>&5
3124   ac_status=$?
3125   echo "$as_me:3125: \$? = $ac_status" >&5
3126   (exit $ac_status); }; }; then
3127   :
3128 else
3129   echo "$as_me: failed program was:" >&5
3130 cat conftest.$ac_ext >&5
3131 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3132 fi
3133 rm -f conftest.$ac_objext conftest.$ac_ext
3134          fi
3135
3136 echo "${as_me:-configure}:3136: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3137
3138          CFLAGS="$cf_trim_CFLAGS"
3139          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3140
3141 echo "${as_me:-configure}:3141: testing if the second compile does not leave our definition intact error ..." 1>&5
3142
3143          cat >conftest.$ac_ext <<_ACEOF
3144 #line 3144 "configure"
3145 #include "confdefs.h"
3146 #include <sys/types.h>
3147 int
3148 main ()
3149 {
3150
3151 #ifndef _POSIX_C_SOURCE
3152 make an error
3153 #endif
3154   ;
3155   return 0;
3156 }
3157 _ACEOF
3158 rm -f conftest.$ac_objext
3159 if { (eval echo "$as_me:3159: \"$ac_compile\"") >&5
3160   (eval $ac_compile) 2>&5
3161   ac_status=$?
3162   echo "$as_me:3162: \$? = $ac_status" >&5
3163   (exit $ac_status); } &&
3164          { ac_try='test -s conftest.$ac_objext'
3165   { (eval echo "$as_me:3165: \"$ac_try\"") >&5
3166   (eval $ac_try) 2>&5
3167   ac_status=$?
3168   echo "$as_me:3168: \$? = $ac_status" >&5
3169   (exit $ac_status); }; }; then
3170   :
3171 else
3172   echo "$as_me: failed program was:" >&5
3173 cat conftest.$ac_ext >&5
3174 cf_cv_posix_c_source=no
3175 fi
3176 rm -f conftest.$ac_objext conftest.$ac_ext
3177          CFLAGS="$cf_save_CFLAGS"
3178          CPPFLAGS="$cf_save_CPPFLAGS"
3179
3180 fi
3181 rm -f conftest.$ac_objext conftest.$ac_ext
3182
3183 fi
3184 echo "$as_me:3184: result: $cf_cv_posix_c_source" >&5
3185 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3186
3187 if test "$cf_cv_posix_c_source" != no ; then
3188         CFLAGS="$cf_trim_CFLAGS"
3189         CPPFLAGS="$cf_trim_CPPFLAGS"
3190
3191 cf_fix_cppflags=no
3192 cf_new_cflags=
3193 cf_new_cppflags=
3194 cf_new_extra_cppflags=
3195
3196 for cf_add_cflags in $cf_cv_posix_c_source
3197 do
3198 case $cf_fix_cppflags in
3199 no)
3200         case $cf_add_cflags in #(vi
3201         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3202                 case $cf_add_cflags in
3203                 -D*)
3204                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3205
3206                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3207                                 && test -z "${cf_tst_cflags}" \
3208                                 && cf_fix_cppflags=yes
3209
3210                         if test $cf_fix_cppflags = yes ; then
3211                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3212                                 continue
3213                         elif test "${cf_tst_cflags}" = "\"'" ; then
3214                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3215                                 continue
3216                         fi
3217                         ;;
3218                 esac
3219                 case "$CPPFLAGS" in
3220                 *$cf_add_cflags) #(vi
3221                         ;;
3222                 *) #(vi
3223                         case $cf_add_cflags in #(vi
3224                         -D*)
3225                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3226
3227 CPPFLAGS=`echo "$CPPFLAGS" | \
3228         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3229                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3230
3231                                 ;;
3232                         esac
3233                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3234                         ;;
3235                 esac
3236                 ;;
3237         *)
3238                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3239                 ;;
3240         esac
3241         ;;
3242 yes)
3243         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3244
3245         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3246
3247         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3248                 && test -z "${cf_tst_cflags}" \
3249                 && cf_fix_cppflags=no
3250         ;;
3251 esac
3252 done
3253
3254 if test -n "$cf_new_cflags" ; then
3255
3256         CFLAGS="$CFLAGS $cf_new_cflags"
3257 fi
3258
3259 if test -n "$cf_new_cppflags" ; then
3260
3261         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3262 fi
3263
3264 if test -n "$cf_new_extra_cppflags" ; then
3265
3266         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3267 fi
3268
3269 fi
3270
3271         ;;
3272 netbsd*) #(vi
3273         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3274         ;;
3275 openbsd[4-9]*) #(vi
3276         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3277         cf_XOPEN_SOURCE=600
3278         ;;
3279 openbsd*) #(vi
3280         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3281         ;;
3282 osf[45]*) #(vi
3283         cf_xopen_source="-D_OSF_SOURCE"
3284         ;;
3285 nto-qnx*) #(vi
3286         cf_xopen_source="-D_QNX_SOURCE"
3287         ;;
3288 sco*) #(vi
3289         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3290         ;;
3291 solaris2.*) #(vi
3292         cf_xopen_source="-D__EXTENSIONS__"
3293         ;;
3294 *)
3295
3296 echo "$as_me:3296: checking if we should define _XOPEN_SOURCE" >&5
3297 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3298 if test "${cf_cv_xopen_source+set}" = set; then
3299   echo $ECHO_N "(cached) $ECHO_C" >&6
3300 else
3301
3302         cat >conftest.$ac_ext <<_ACEOF
3303 #line 3303 "configure"
3304 #include "confdefs.h"
3305
3306 #include <stdlib.h>
3307 #include <string.h>
3308 #include <sys/types.h>
3309
3310 int
3311 main ()
3312 {
3313
3314 #ifndef _XOPEN_SOURCE
3315 make an error
3316 #endif
3317   ;
3318   return 0;
3319 }
3320 _ACEOF
3321 rm -f conftest.$ac_objext
3322 if { (eval echo "$as_me:3322: \"$ac_compile\"") >&5
3323   (eval $ac_compile) 2>&5
3324   ac_status=$?
3325   echo "$as_me:3325: \$? = $ac_status" >&5
3326   (exit $ac_status); } &&
3327          { ac_try='test -s conftest.$ac_objext'
3328   { (eval echo "$as_me:3328: \"$ac_try\"") >&5
3329   (eval $ac_try) 2>&5
3330   ac_status=$?
3331   echo "$as_me:3331: \$? = $ac_status" >&5
3332   (exit $ac_status); }; }; then
3333   cf_cv_xopen_source=no
3334 else
3335   echo "$as_me: failed program was:" >&5
3336 cat conftest.$ac_ext >&5
3337 cf_save="$CPPFLAGS"
3338          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3339          cat >conftest.$ac_ext <<_ACEOF
3340 #line 3340 "configure"
3341 #include "confdefs.h"
3342
3343 #include <stdlib.h>
3344 #include <string.h>
3345 #include <sys/types.h>
3346
3347 int
3348 main ()
3349 {
3350
3351 #ifdef _XOPEN_SOURCE
3352 make an error
3353 #endif
3354   ;
3355   return 0;
3356 }
3357 _ACEOF
3358 rm -f conftest.$ac_objext
3359 if { (eval echo "$as_me:3359: \"$ac_compile\"") >&5
3360   (eval $ac_compile) 2>&5
3361   ac_status=$?
3362   echo "$as_me:3362: \$? = $ac_status" >&5
3363   (exit $ac_status); } &&
3364          { ac_try='test -s conftest.$ac_objext'
3365   { (eval echo "$as_me:3365: \"$ac_try\"") >&5
3366   (eval $ac_try) 2>&5
3367   ac_status=$?
3368   echo "$as_me:3368: \$? = $ac_status" >&5
3369   (exit $ac_status); }; }; then
3370   cf_cv_xopen_source=no
3371 else
3372   echo "$as_me: failed program was:" >&5
3373 cat conftest.$ac_ext >&5
3374 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3375 fi
3376 rm -f conftest.$ac_objext conftest.$ac_ext
3377         CPPFLAGS="$cf_save"
3378
3379 fi
3380 rm -f conftest.$ac_objext conftest.$ac_ext
3381
3382 fi
3383 echo "$as_me:3383: result: $cf_cv_xopen_source" >&5
3384 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3385
3386 if test "$cf_cv_xopen_source" != no ; then
3387
3388 CFLAGS=`echo "$CFLAGS" | \
3389         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3390                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3391
3392 CPPFLAGS=`echo "$CPPFLAGS" | \
3393         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3394                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3395
3396         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3397
3398 cf_fix_cppflags=no
3399 cf_new_cflags=
3400 cf_new_cppflags=
3401 cf_new_extra_cppflags=
3402
3403 for cf_add_cflags in $cf_temp_xopen_source
3404 do
3405 case $cf_fix_cppflags in
3406 no)
3407         case $cf_add_cflags in #(vi
3408         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3409                 case $cf_add_cflags in
3410                 -D*)
3411                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3412
3413                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3414                                 && test -z "${cf_tst_cflags}" \
3415                                 && cf_fix_cppflags=yes
3416
3417                         if test $cf_fix_cppflags = yes ; then
3418                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3419                                 continue
3420                         elif test "${cf_tst_cflags}" = "\"'" ; then
3421                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3422                                 continue
3423                         fi
3424                         ;;
3425                 esac
3426                 case "$CPPFLAGS" in
3427                 *$cf_add_cflags) #(vi
3428                         ;;
3429                 *) #(vi
3430                         case $cf_add_cflags in #(vi
3431                         -D*)
3432                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3433
3434 CPPFLAGS=`echo "$CPPFLAGS" | \
3435         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3436                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3437
3438                                 ;;
3439                         esac
3440                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3441                         ;;
3442                 esac
3443                 ;;
3444         *)
3445                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3446                 ;;
3447         esac
3448         ;;
3449 yes)
3450         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3451
3452         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3453
3454         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3455                 && test -z "${cf_tst_cflags}" \
3456                 && cf_fix_cppflags=no
3457         ;;
3458 esac
3459 done
3460
3461 if test -n "$cf_new_cflags" ; then
3462
3463         CFLAGS="$CFLAGS $cf_new_cflags"
3464 fi
3465
3466 if test -n "$cf_new_cppflags" ; then
3467
3468         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3469 fi
3470
3471 if test -n "$cf_new_extra_cppflags" ; then
3472
3473         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3474 fi
3475
3476 fi
3477
3478 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3479
3480 cf_save_CFLAGS="$CFLAGS"
3481 cf_save_CPPFLAGS="$CPPFLAGS"
3482
3483 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3484         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3485                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3486
3487 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3488         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3489                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3490
3491 echo "$as_me:3491: checking if we should define _POSIX_C_SOURCE" >&5
3492 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3493 if test "${cf_cv_posix_c_source+set}" = set; then
3494   echo $ECHO_N "(cached) $ECHO_C" >&6
3495 else
3496
3497 echo "${as_me:-configure}:3497: testing if the symbol is already defined go no further ..." 1>&5
3498
3499         cat >conftest.$ac_ext <<_ACEOF
3500 #line 3500 "configure"
3501 #include "confdefs.h"
3502 #include <sys/types.h>
3503 int
3504 main ()
3505 {
3506
3507 #ifndef _POSIX_C_SOURCE
3508 make an error
3509 #endif
3510   ;
3511   return 0;
3512 }
3513 _ACEOF
3514 rm -f conftest.$ac_objext
3515 if { (eval echo "$as_me:3515: \"$ac_compile\"") >&5
3516   (eval $ac_compile) 2>&5
3517   ac_status=$?
3518   echo "$as_me:3518: \$? = $ac_status" >&5
3519   (exit $ac_status); } &&
3520          { ac_try='test -s conftest.$ac_objext'
3521   { (eval echo "$as_me:3521: \"$ac_try\"") >&5
3522   (eval $ac_try) 2>&5
3523   ac_status=$?
3524   echo "$as_me:3524: \$? = $ac_status" >&5
3525   (exit $ac_status); }; }; then
3526   cf_cv_posix_c_source=no
3527 else
3528   echo "$as_me: failed program was:" >&5
3529 cat conftest.$ac_ext >&5
3530 cf_want_posix_source=no
3531          case .$cf_POSIX_C_SOURCE in #(vi
3532          .[12]??*) #(vi
3533                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3534                 ;;
3535          .2) #(vi
3536                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3537                 cf_want_posix_source=yes
3538                 ;;
3539          .*)
3540                 cf_want_posix_source=yes
3541                 ;;
3542          esac
3543          if test "$cf_want_posix_source" = yes ; then
3544                 cat >conftest.$ac_ext <<_ACEOF
3545 #line 3545 "configure"
3546 #include "confdefs.h"
3547 #include <sys/types.h>
3548 int
3549 main ()
3550 {
3551
3552 #ifdef _POSIX_SOURCE
3553 make an error
3554 #endif
3555   ;
3556   return 0;
3557 }
3558 _ACEOF
3559 rm -f conftest.$ac_objext
3560 if { (eval echo "$as_me:3560: \"$ac_compile\"") >&5
3561   (eval $ac_compile) 2>&5
3562   ac_status=$?
3563   echo "$as_me:3563: \$? = $ac_status" >&5
3564   (exit $ac_status); } &&
3565          { ac_try='test -s conftest.$ac_objext'
3566   { (eval echo "$as_me:3566: \"$ac_try\"") >&5
3567   (eval $ac_try) 2>&5
3568   ac_status=$?
3569   echo "$as_me:3569: \$? = $ac_status" >&5
3570   (exit $ac_status); }; }; then
3571   :
3572 else
3573   echo "$as_me: failed program was:" >&5
3574 cat conftest.$ac_ext >&5
3575 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3576 fi
3577 rm -f conftest.$ac_objext conftest.$ac_ext
3578          fi
3579
3580 echo "${as_me:-configure}:3580: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3581
3582          CFLAGS="$cf_trim_CFLAGS"
3583          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3584
3585 echo "${as_me:-configure}:3585: testing if the second compile does not leave our definition intact error ..." 1>&5
3586
3587          cat >conftest.$ac_ext <<_ACEOF
3588 #line 3588 "configure"
3589 #include "confdefs.h"
3590 #include <sys/types.h>
3591 int
3592 main ()
3593 {
3594
3595 #ifndef _POSIX_C_SOURCE
3596 make an error
3597 #endif
3598   ;
3599   return 0;
3600 }
3601 _ACEOF
3602 rm -f conftest.$ac_objext
3603 if { (eval echo "$as_me:3603: \"$ac_compile\"") >&5
3604   (eval $ac_compile) 2>&5
3605   ac_status=$?
3606   echo "$as_me:3606: \$? = $ac_status" >&5
3607   (exit $ac_status); } &&
3608          { ac_try='test -s conftest.$ac_objext'
3609   { (eval echo "$as_me:3609: \"$ac_try\"") >&5
3610   (eval $ac_try) 2>&5
3611   ac_status=$?
3612   echo "$as_me:3612: \$? = $ac_status" >&5
3613   (exit $ac_status); }; }; then
3614   :
3615 else
3616   echo "$as_me: failed program was:" >&5
3617 cat conftest.$ac_ext >&5
3618 cf_cv_posix_c_source=no
3619 fi
3620 rm -f conftest.$ac_objext conftest.$ac_ext
3621          CFLAGS="$cf_save_CFLAGS"
3622          CPPFLAGS="$cf_save_CPPFLAGS"
3623
3624 fi
3625 rm -f conftest.$ac_objext conftest.$ac_ext
3626
3627 fi
3628 echo "$as_me:3628: result: $cf_cv_posix_c_source" >&5
3629 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3630
3631 if test "$cf_cv_posix_c_source" != no ; then
3632         CFLAGS="$cf_trim_CFLAGS"
3633         CPPFLAGS="$cf_trim_CPPFLAGS"
3634
3635 cf_fix_cppflags=no
3636 cf_new_cflags=
3637 cf_new_cppflags=
3638 cf_new_extra_cppflags=
3639
3640 for cf_add_cflags in $cf_cv_posix_c_source
3641 do
3642 case $cf_fix_cppflags in
3643 no)
3644         case $cf_add_cflags in #(vi
3645         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3646                 case $cf_add_cflags in
3647                 -D*)
3648                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3649
3650                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3651                                 && test -z "${cf_tst_cflags}" \
3652                                 && cf_fix_cppflags=yes
3653
3654                         if test $cf_fix_cppflags = yes ; then
3655                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3656                                 continue
3657                         elif test "${cf_tst_cflags}" = "\"'" ; then
3658                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3659                                 continue
3660                         fi
3661                         ;;
3662                 esac
3663                 case "$CPPFLAGS" in
3664                 *$cf_add_cflags) #(vi
3665                         ;;
3666                 *) #(vi
3667                         case $cf_add_cflags in #(vi
3668                         -D*)
3669                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3670
3671 CPPFLAGS=`echo "$CPPFLAGS" | \
3672         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3673                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3674
3675                                 ;;
3676                         esac
3677                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3678                         ;;
3679                 esac
3680                 ;;
3681         *)
3682                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3683                 ;;
3684         esac
3685         ;;
3686 yes)
3687         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3688
3689         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3690
3691         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3692                 && test -z "${cf_tst_cflags}" \
3693                 && cf_fix_cppflags=no
3694         ;;
3695 esac
3696 done
3697
3698 if test -n "$cf_new_cflags" ; then
3699
3700         CFLAGS="$CFLAGS $cf_new_cflags"
3701 fi
3702
3703 if test -n "$cf_new_cppflags" ; then
3704
3705         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3706 fi
3707
3708 if test -n "$cf_new_extra_cppflags" ; then
3709
3710         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3711 fi
3712
3713 fi
3714
3715         ;;
3716 esac
3717
3718 if test -n "$cf_xopen_source" ; then
3719
3720 cf_fix_cppflags=no
3721 cf_new_cflags=
3722 cf_new_cppflags=
3723 cf_new_extra_cppflags=
3724
3725 for cf_add_cflags in $cf_xopen_source
3726 do
3727 case $cf_fix_cppflags in
3728 no)
3729         case $cf_add_cflags in #(vi
3730         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3731                 case $cf_add_cflags in
3732                 -D*)
3733                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3734
3735                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3736                                 && test -z "${cf_tst_cflags}" \
3737                                 && cf_fix_cppflags=yes
3738
3739                         if test $cf_fix_cppflags = yes ; then
3740                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3741                                 continue
3742                         elif test "${cf_tst_cflags}" = "\"'" ; then
3743                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3744                                 continue
3745                         fi
3746                         ;;
3747                 esac
3748                 case "$CPPFLAGS" in
3749                 *$cf_add_cflags) #(vi
3750                         ;;
3751                 *) #(vi
3752                         case $cf_add_cflags in #(vi
3753                         -D*)
3754                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3755
3756 CPPFLAGS=`echo "$CPPFLAGS" | \
3757         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3758                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3759
3760                                 ;;
3761                         esac
3762                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3763                         ;;
3764                 esac
3765                 ;;
3766         *)
3767                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3768                 ;;
3769         esac
3770         ;;
3771 yes)
3772         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3773
3774         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3775
3776         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3777                 && test -z "${cf_tst_cflags}" \
3778                 && cf_fix_cppflags=no
3779         ;;
3780 esac
3781 done
3782
3783 if test -n "$cf_new_cflags" ; then
3784
3785         CFLAGS="$CFLAGS $cf_new_cflags"
3786 fi
3787
3788 if test -n "$cf_new_cppflags" ; then
3789
3790         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3791 fi
3792
3793 if test -n "$cf_new_extra_cppflags" ; then
3794
3795         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3796 fi
3797
3798 fi
3799
3800 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3801         echo "$as_me:3801: checking if _XOPEN_SOURCE really is set" >&5
3802 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3803         cat >conftest.$ac_ext <<_ACEOF
3804 #line 3804 "configure"
3805 #include "confdefs.h"
3806 #include <stdlib.h>
3807 int
3808 main ()
3809 {
3810
3811 #ifndef _XOPEN_SOURCE
3812 make an error
3813 #endif
3814   ;
3815   return 0;
3816 }
3817 _ACEOF
3818 rm -f conftest.$ac_objext
3819 if { (eval echo "$as_me:3819: \"$ac_compile\"") >&5
3820   (eval $ac_compile) 2>&5
3821   ac_status=$?
3822   echo "$as_me:3822: \$? = $ac_status" >&5
3823   (exit $ac_status); } &&
3824          { ac_try='test -s conftest.$ac_objext'
3825   { (eval echo "$as_me:3825: \"$ac_try\"") >&5
3826   (eval $ac_try) 2>&5
3827   ac_status=$?
3828   echo "$as_me:3828: \$? = $ac_status" >&5
3829   (exit $ac_status); }; }; then
3830   cf_XOPEN_SOURCE_set=yes
3831 else
3832   echo "$as_me: failed program was:" >&5
3833 cat conftest.$ac_ext >&5
3834 cf_XOPEN_SOURCE_set=no
3835 fi
3836 rm -f conftest.$ac_objext conftest.$ac_ext
3837         echo "$as_me:3837: result: $cf_XOPEN_SOURCE_set" >&5
3838 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3839         if test $cf_XOPEN_SOURCE_set = yes
3840         then
3841                 cat >conftest.$ac_ext <<_ACEOF
3842 #line 3842 "configure"
3843 #include "confdefs.h"
3844 #include <stdlib.h>
3845 int
3846 main ()
3847 {
3848
3849 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3850 make an error
3851 #endif
3852   ;
3853   return 0;
3854 }
3855 _ACEOF
3856 rm -f conftest.$ac_objext
3857 if { (eval echo "$as_me:3857: \"$ac_compile\"") >&5
3858   (eval $ac_compile) 2>&5
3859   ac_status=$?
3860   echo "$as_me:3860: \$? = $ac_status" >&5
3861   (exit $ac_status); } &&
3862          { ac_try='test -s conftest.$ac_objext'
3863   { (eval echo "$as_me:3863: \"$ac_try\"") >&5
3864   (eval $ac_try) 2>&5
3865   ac_status=$?
3866   echo "$as_me:3866: \$? = $ac_status" >&5
3867   (exit $ac_status); }; }; then
3868   cf_XOPEN_SOURCE_set_ok=yes
3869 else
3870   echo "$as_me: failed program was:" >&5
3871 cat conftest.$ac_ext >&5
3872 cf_XOPEN_SOURCE_set_ok=no
3873 fi
3874 rm -f conftest.$ac_objext conftest.$ac_ext
3875                 if test $cf_XOPEN_SOURCE_set_ok = no
3876                 then
3877                         { echo "$as_me:3877: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3878 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3879                 fi
3880         else
3881
3882 echo "$as_me:3882: checking if we should define _XOPEN_SOURCE" >&5
3883 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3884 if test "${cf_cv_xopen_source+set}" = set; then
3885   echo $ECHO_N "(cached) $ECHO_C" >&6
3886 else
3887
3888         cat >conftest.$ac_ext <<_ACEOF
3889 #line 3889 "configure"
3890 #include "confdefs.h"
3891
3892 #include <stdlib.h>
3893 #include <string.h>
3894 #include <sys/types.h>
3895
3896 int
3897 main ()
3898 {
3899
3900 #ifndef _XOPEN_SOURCE
3901 make an error
3902 #endif
3903   ;
3904   return 0;
3905 }
3906 _ACEOF
3907 rm -f conftest.$ac_objext
3908 if { (eval echo "$as_me:3908: \"$ac_compile\"") >&5
3909   (eval $ac_compile) 2>&5
3910   ac_status=$?
3911   echo "$as_me:3911: \$? = $ac_status" >&5
3912   (exit $ac_status); } &&
3913          { ac_try='test -s conftest.$ac_objext'
3914   { (eval echo "$as_me:3914: \"$ac_try\"") >&5
3915   (eval $ac_try) 2>&5
3916   ac_status=$?
3917   echo "$as_me:3917: \$? = $ac_status" >&5
3918   (exit $ac_status); }; }; then
3919   cf_cv_xopen_source=no
3920 else
3921   echo "$as_me: failed program was:" >&5
3922 cat conftest.$ac_ext >&5
3923 cf_save="$CPPFLAGS"
3924          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3925          cat >conftest.$ac_ext <<_ACEOF
3926 #line 3926 "configure"
3927 #include "confdefs.h"
3928
3929 #include <stdlib.h>
3930 #include <string.h>
3931 #include <sys/types.h>
3932
3933 int
3934 main ()
3935 {
3936
3937 #ifdef _XOPEN_SOURCE
3938 make an error
3939 #endif
3940   ;
3941   return 0;
3942 }
3943 _ACEOF
3944 rm -f conftest.$ac_objext
3945 if { (eval echo "$as_me:3945: \"$ac_compile\"") >&5
3946   (eval $ac_compile) 2>&5
3947   ac_status=$?
3948   echo "$as_me:3948: \$? = $ac_status" >&5
3949   (exit $ac_status); } &&
3950          { ac_try='test -s conftest.$ac_objext'
3951   { (eval echo "$as_me:3951: \"$ac_try\"") >&5
3952   (eval $ac_try) 2>&5
3953   ac_status=$?
3954   echo "$as_me:3954: \$? = $ac_status" >&5
3955   (exit $ac_status); }; }; then
3956   cf_cv_xopen_source=no
3957 else
3958   echo "$as_me: failed program was:" >&5
3959 cat conftest.$ac_ext >&5
3960 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3961 fi
3962 rm -f conftest.$ac_objext conftest.$ac_ext
3963         CPPFLAGS="$cf_save"
3964
3965 fi
3966 rm -f conftest.$ac_objext conftest.$ac_ext
3967
3968 fi
3969 echo "$as_me:3969: result: $cf_cv_xopen_source" >&5
3970 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3971
3972 if test "$cf_cv_xopen_source" != no ; then
3973
3974 CFLAGS=`echo "$CFLAGS" | \
3975         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3976                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3977
3978 CPPFLAGS=`echo "$CPPFLAGS" | \
3979         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3980                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3981
3982         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3983
3984 cf_fix_cppflags=no
3985 cf_new_cflags=
3986 cf_new_cppflags=
3987 cf_new_extra_cppflags=
3988
3989 for cf_add_cflags in $cf_temp_xopen_source
3990 do
3991 case $cf_fix_cppflags in
3992 no)
3993         case $cf_add_cflags in #(vi
3994         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3995                 case $cf_add_cflags in
3996                 -D*)
3997                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3998
3999                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4000                                 && test -z "${cf_tst_cflags}" \
4001                                 && cf_fix_cppflags=yes
4002
4003                         if test $cf_fix_cppflags = yes ; then
4004                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4005                                 continue
4006                         elif test "${cf_tst_cflags}" = "\"'" ; then
4007                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4008                                 continue
4009                         fi
4010                         ;;
4011                 esac
4012                 case "$CPPFLAGS" in
4013                 *$cf_add_cflags) #(vi
4014                         ;;
4015                 *) #(vi
4016                         case $cf_add_cflags in #(vi
4017                         -D*)
4018                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4019
4020 CPPFLAGS=`echo "$CPPFLAGS" | \
4021         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4022                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4023
4024                                 ;;
4025                         esac
4026                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4027                         ;;
4028                 esac
4029                 ;;
4030         *)
4031                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4032                 ;;
4033         esac
4034         ;;
4035 yes)
4036         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4037
4038         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4039
4040         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4041                 && test -z "${cf_tst_cflags}" \
4042                 && cf_fix_cppflags=no
4043         ;;
4044 esac
4045 done
4046
4047 if test -n "$cf_new_cflags" ; then
4048
4049         CFLAGS="$CFLAGS $cf_new_cflags"
4050 fi
4051
4052 if test -n "$cf_new_cppflags" ; then
4053
4054         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4055 fi
4056
4057 if test -n "$cf_new_extra_cppflags" ; then
4058
4059         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4060 fi
4061
4062 fi
4063
4064         fi
4065 fi
4066
4067 echo "$as_me:4067: checking for $CC option to accept ANSI C" >&5
4068 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
4069 if test "${ac_cv_prog_cc_stdc+set}" = set; then
4070   echo $ECHO_N "(cached) $ECHO_C" >&6
4071 else
4072   ac_cv_prog_cc_stdc=no
4073 ac_save_CC=$CC
4074 cat >conftest.$ac_ext <<_ACEOF
4075 #line 4075 "configure"
4076 #include "confdefs.h"
4077 #include <stdarg.h>
4078 #include <stdio.h>
4079 #include <sys/types.h>
4080 #include <sys/stat.h>
4081 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4082 struct buf { int x; };
4083 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4084 static char *e (p, i)
4085      char **p;
4086      int i;
4087 {
4088   return p[i];
4089 }
4090 static char *f (char * (*g) (char **, int), char **p, ...)
4091 {
4092   char *s;
4093   va_list v;
4094   va_start (v,p);
4095   s = g (p, va_arg (v,int));
4096   va_end (v);
4097   return s;
4098 }
4099 int test (int i, double x);
4100 struct s1 {int (*f) (int a);};
4101 struct s2 {int (*f) (double a);};
4102 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4103 int argc;
4104 char **argv;
4105 int
4106 main ()
4107 {
4108 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4109   ;
4110   return 0;
4111 }
4112 _ACEOF
4113 # Don't try gcc -ansi; that turns off useful extensions and
4114 # breaks some systems' header files.
4115 # AIX                   -qlanglvl=ansi
4116 # Ultrix and OSF/1      -std1
4117 # HP-UX 10.20 and later -Ae
4118 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4119 # SVR4                  -Xc -D__EXTENSIONS__
4120 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4121 do
4122   CC="$ac_save_CC $ac_arg"
4123   rm -f conftest.$ac_objext
4124 if { (eval echo "$as_me:4124: \"$ac_compile\"") >&5
4125   (eval $ac_compile) 2>&5
4126   ac_status=$?
4127   echo "$as_me:4127: \$? = $ac_status" >&5
4128   (exit $ac_status); } &&
4129          { ac_try='test -s conftest.$ac_objext'
4130   { (eval echo "$as_me:4130: \"$ac_try\"") >&5
4131   (eval $ac_try) 2>&5
4132   ac_status=$?
4133   echo "$as_me:4133: \$? = $ac_status" >&5
4134   (exit $ac_status); }; }; then
4135   ac_cv_prog_cc_stdc=$ac_arg
4136 break
4137 else
4138   echo "$as_me: failed program was:" >&5
4139 cat conftest.$ac_ext >&5
4140 fi
4141 rm -f conftest.$ac_objext
4142 done
4143 rm -f conftest.$ac_ext conftest.$ac_objext
4144 CC=$ac_save_CC
4145
4146 fi
4147
4148 case "x$ac_cv_prog_cc_stdc" in
4149   x|xno)
4150     echo "$as_me:4150: result: none needed" >&5
4151 echo "${ECHO_T}none needed" >&6 ;;
4152   *)
4153     echo "$as_me:4153: result: $ac_cv_prog_cc_stdc" >&5
4154 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
4155     CC="$CC $ac_cv_prog_cc_stdc" ;;
4156 esac
4157
4158 echo "$as_me:4158: checking for an ANSI C-conforming const" >&5
4159 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
4160 if test "${ac_cv_c_const+set}" = set; then
4161   echo $ECHO_N "(cached) $ECHO_C" >&6
4162 else
4163   cat >conftest.$ac_ext <<_ACEOF
4164 #line 4164 "configure"
4165 #include "confdefs.h"
4166
4167 int
4168 main ()
4169 {
4170 /* FIXME: Include the comments suggested by Paul. */
4171 #ifndef __cplusplus
4172   /* Ultrix mips cc rejects this.  */
4173   typedef int charset[2];
4174   const charset x;
4175   /* SunOS 4.1.1 cc rejects this.  */
4176   char const *const *ccp;
4177   char **p;
4178   /* NEC SVR4.0.2 mips cc rejects this.  */
4179   struct point {int x, y;};
4180   static struct point const zero = {0,0};
4181   /* AIX XL C 1.02.0.0 rejects this.
4182      It does not let you subtract one const X* pointer from another in
4183      an arm of an if-expression whose if-part is not a constant
4184      expression */
4185   const char *g = "string";
4186   ccp = &g + (g ? g-g : 0);
4187   /* HPUX 7.0 cc rejects these. */
4188   ++ccp;
4189   p = (char**) ccp;
4190   ccp = (char const *const *) p;
4191   { /* SCO 3.2v4 cc rejects this.  */
4192     char *t;
4193     char const *s = 0 ? (char *) 0 : (char const *) 0;
4194
4195     *t++ = 0;
4196   }
4197   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4198     int x[] = {25, 17};
4199     const int *foo = &x[0];
4200     ++foo;
4201   }
4202   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4203     typedef const int *iptr;
4204     iptr p = 0;
4205     ++p;
4206   }
4207   { /* AIX XL C 1.02.0.0 rejects this saying
4208        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4209     struct s { int j; const int *ap[3]; };
4210     struct s *b; b->j = 5;
4211   }
4212   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4213     const int foo = 10;
4214   }
4215 #endif
4216
4217   ;
4218   return 0;
4219 }
4220 _ACEOF
4221 rm -f conftest.$ac_objext
4222 if { (eval echo "$as_me:4222: \"$ac_compile\"") >&5
4223   (eval $ac_compile) 2>&5
4224   ac_status=$?
4225   echo "$as_me:4225: \$? = $ac_status" >&5
4226   (exit $ac_status); } &&
4227          { ac_try='test -s conftest.$ac_objext'
4228   { (eval echo "$as_me:4228: \"$ac_try\"") >&5
4229   (eval $ac_try) 2>&5
4230   ac_status=$?
4231   echo "$as_me:4231: \$? = $ac_status" >&5
4232   (exit $ac_status); }; }; then
4233   ac_cv_c_const=yes
4234 else
4235   echo "$as_me: failed program was:" >&5
4236 cat conftest.$ac_ext >&5
4237 ac_cv_c_const=no
4238 fi
4239 rm -f conftest.$ac_objext conftest.$ac_ext
4240 fi
4241 echo "$as_me:4241: result: $ac_cv_c_const" >&5
4242 echo "${ECHO_T}$ac_cv_c_const" >&6
4243 if test $ac_cv_c_const = no; then
4244
4245 cat >>confdefs.h <<\EOF
4246 #define const
4247 EOF
4248
4249 fi
4250
4251 echo "$as_me:4251: checking for signal global datatype" >&5
4252 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4253 if test "${cf_cv_sig_atomic_t+set}" = set; then
4254   echo $ECHO_N "(cached) $ECHO_C" >&6
4255 else
4256
4257         for cf_type in \
4258                 "volatile sig_atomic_t" \
4259                 "sig_atomic_t" \
4260                 "int"
4261         do
4262         cat >conftest.$ac_ext <<_ACEOF
4263 #line 4263 "configure"
4264 #include "confdefs.h"
4265
4266 #include <sys/types.h>
4267 #include <signal.h>
4268 #include <stdio.h>
4269
4270 extern $cf_type x;
4271 $cf_type x;
4272 static void handler(int sig)
4273 {
4274         x = 5;
4275 }
4276 int
4277 main ()
4278 {
4279 signal(SIGINT, handler);
4280                  x = 1
4281   ;
4282   return 0;
4283 }
4284 _ACEOF
4285 rm -f conftest.$ac_objext
4286 if { (eval echo "$as_me:4286: \"$ac_compile\"") >&5
4287   (eval $ac_compile) 2>&5
4288   ac_status=$?
4289   echo "$as_me:4289: \$? = $ac_status" >&5
4290   (exit $ac_status); } &&
4291          { ac_try='test -s conftest.$ac_objext'
4292   { (eval echo "$as_me:4292: \"$ac_try\"") >&5
4293   (eval $ac_try) 2>&5
4294   ac_status=$?
4295   echo "$as_me:4295: \$? = $ac_status" >&5
4296   (exit $ac_status); }; }; then
4297   cf_cv_sig_atomic_t=$cf_type
4298 else
4299   echo "$as_me: failed program was:" >&5
4300 cat conftest.$ac_ext >&5
4301 cf_cv_sig_atomic_t=no
4302 fi
4303 rm -f conftest.$ac_objext conftest.$ac_ext
4304                 test "$cf_cv_sig_atomic_t" != no && break
4305         done
4306
4307 fi
4308
4309 echo "$as_me:4309: result: $cf_cv_sig_atomic_t" >&5
4310 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4311 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
4312 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4313 EOF
4314
4315 echo "$as_me:4315: checking if you want to see long compiling messages" >&5
4316 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4317
4318 # Check whether --enable-echo or --disable-echo was given.
4319 if test "${enable_echo+set}" = set; then
4320   enableval="$enable_echo"
4321   test "$enableval" != no && enableval=yes
4322   if test "$enableval" != "yes" ; then
4323
4324     ECHO_LT='--silent'
4325     ECHO_LD='@echo linking $@;'
4326     RULE_CC='@echo compiling $<'
4327     SHOW_CC='@echo compiling $@'
4328     ECHO_CC='@'
4329
4330   else
4331
4332     ECHO_LT=''
4333     ECHO_LD=''
4334     RULE_CC=''
4335     SHOW_CC=''
4336     ECHO_CC=''
4337
4338   fi
4339 else
4340   enableval=yes
4341
4342     ECHO_LT=''
4343     ECHO_LD=''
4344     RULE_CC=''
4345     SHOW_CC=''
4346     ECHO_CC=''
4347
4348 fi;
4349 echo "$as_me:4349: result: $enableval" >&5
4350 echo "${ECHO_T}$enableval" >&6
4351
4352 GCC_VERSION=none
4353 if test "$GCC" = yes ; then
4354         echo "$as_me:4354: checking version of $CC" >&5
4355 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
4356         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
4357         test -z "$GCC_VERSION" && GCC_VERSION=unknown
4358         echo "$as_me:4358: result: $GCC_VERSION" >&5
4359 echo "${ECHO_T}$GCC_VERSION" >&6
4360 fi
4361
4362 if ( test "$GCC" = yes || test "$GXX" = yes )
4363 then
4364 echo "$as_me:4364: checking if you want to turn on gcc warnings" >&5
4365 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
4366
4367 # Check whether --enable-warnings or --disable-warnings was given.
4368 if test "${enable_warnings+set}" = set; then
4369   enableval="$enable_warnings"
4370   test "$enableval" != yes && enableval=no
4371   if test "$enableval" != "no" ; then
4372     with_warnings=yes
4373   else
4374     with_warnings=no
4375   fi
4376 else
4377   enableval=no
4378   with_warnings=no
4379
4380 fi;
4381 echo "$as_me:4381: result: $with_warnings" >&5
4382 echo "${ECHO_T}$with_warnings" >&6
4383 if test "$with_warnings" = "yes"
4384 then
4385
4386 if test "$GCC" = yes
4387 then
4388 cat > conftest.i <<EOF
4389 #ifndef GCC_PRINTF
4390 #define GCC_PRINTF 0
4391 #endif
4392 #ifndef GCC_SCANF
4393 #define GCC_SCANF 0
4394 #endif
4395 #ifndef GCC_NORETURN
4396 #define GCC_NORETURN /* nothing */
4397 #endif
4398 #ifndef GCC_UNUSED
4399 #define GCC_UNUSED /* nothing */
4400 #endif
4401 EOF
4402 if test "$GCC" = yes
4403 then
4404         { echo "$as_me:4404: checking for $CC __attribute__ directives..." >&5
4405 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
4406 cat > conftest.$ac_ext <<EOF
4407 #line 4407 "${as_me:-configure}"
4408 #include "confdefs.h"
4409 #include "conftest.h"
4410 #include "conftest.i"
4411 #if     GCC_PRINTF
4412 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4413 #else
4414 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4415 #endif
4416 #if     GCC_SCANF
4417 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4418 #else
4419 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4420 #endif
4421 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4422 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4423 extern void foo(void) GCC_NORETURN;
4424 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4425 EOF
4426         cf_printf_attribute=no
4427         cf_scanf_attribute=no
4428         for cf_attribute in scanf printf unused noreturn
4429         do
4430
4431 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4432
4433                 cf_directive="__attribute__(($cf_attribute))"
4434                 echo "checking for $CC $cf_directive" 1>&5
4435
4436                 case $cf_attribute in #(vi
4437                 printf) #(vi
4438                         cf_printf_attribute=yes
4439                         cat >conftest.h <<EOF
4440 #define GCC_$cf_ATTRIBUTE 1
4441 EOF
4442                         ;;
4443                 scanf) #(vi
4444                         cf_scanf_attribute=yes
4445                         cat >conftest.h <<EOF
4446 #define GCC_$cf_ATTRIBUTE 1
4447 EOF
4448                         ;;
4449                 *) #(vi
4450                         cat >conftest.h <<EOF
4451 #define GCC_$cf_ATTRIBUTE $cf_directive
4452 EOF
4453                         ;;
4454                 esac
4455
4456                 if { (eval echo "$as_me:4456: \"$ac_compile\"") >&5
4457   (eval $ac_compile) 2>&5
4458   ac_status=$?
4459   echo "$as_me:4459: \$? = $ac_status" >&5
4460   (exit $ac_status); }; then
4461                         test -n "$verbose" && echo "$as_me:4461: result: ... $cf_attribute" >&5
4462 echo "${ECHO_T}... $cf_attribute" >&6
4463                         cat conftest.h >>confdefs.h
4464                         case $cf_attribute in #(vi
4465                         printf) #(vi
4466                                 if test "$cf_printf_attribute" = no ; then
4467                                         cat >>confdefs.h <<EOF
4468 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
4469 EOF
4470                                 else
4471                                         cat >>confdefs.h <<EOF
4472 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4473 EOF
4474                                 fi
4475                                 ;;
4476                         scanf) #(vi
4477                                 if test "$cf_scanf_attribute" = no ; then
4478                                         cat >>confdefs.h <<EOF
4479 #define GCC_SCANFLIKE(fmt,var) /* nothing */
4480 EOF
4481                                 else
4482                                         cat >>confdefs.h <<EOF
4483 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4484 EOF
4485                                 fi
4486                                 ;;
4487                         esac
4488                 fi
4489         done
4490 else
4491         fgrep define conftest.i >>confdefs.h
4492 fi
4493 rm -rf conftest*
4494 fi
4495
4496 INTEL_COMPILER=no
4497
4498 if test "$GCC" = yes ; then
4499         case $host_os in
4500         linux*|gnu*)
4501                 echo "$as_me:4501: checking if this is really Intel C compiler" >&5
4502 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
4503                 cf_save_CFLAGS="$CFLAGS"
4504                 CFLAGS="$CFLAGS -no-gcc"
4505                 cat >conftest.$ac_ext <<_ACEOF
4506 #line 4506 "configure"
4507 #include "confdefs.h"
4508
4509 int
4510 main ()
4511 {
4512
4513 #ifdef __INTEL_COMPILER
4514 #else
4515 make an error
4516 #endif
4517
4518   ;
4519   return 0;
4520 }
4521 _ACEOF
4522 rm -f conftest.$ac_objext
4523 if { (eval echo "$as_me:4523: \"$ac_compile\"") >&5
4524   (eval $ac_compile) 2>&5
4525   ac_status=$?
4526   echo "$as_me:4526: \$? = $ac_status" >&5
4527   (exit $ac_status); } &&
4528          { ac_try='test -s conftest.$ac_objext'
4529   { (eval echo "$as_me:4529: \"$ac_try\"") >&5
4530   (eval $ac_try) 2>&5
4531   ac_status=$?
4532   echo "$as_me:4532: \$? = $ac_status" >&5
4533   (exit $ac_status); }; }; then
4534   INTEL_COMPILER=yes
4535 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
4536
4537 else
4538   echo "$as_me: failed program was:" >&5
4539 cat conftest.$ac_ext >&5
4540 fi
4541 rm -f conftest.$ac_objext conftest.$ac_ext
4542                 CFLAGS="$cf_save_CFLAGS"
4543                 echo "$as_me:4543: result: $INTEL_COMPILER" >&5
4544 echo "${ECHO_T}$INTEL_COMPILER" >&6
4545                 ;;
4546         esac
4547 fi
4548
4549 cat > conftest.$ac_ext <<EOF
4550 #line 4550 "${as_me:-configure}"
4551 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4552 EOF
4553
4554 if test "$INTEL_COMPILER" = yes
4555 then
4556 # The "-wdXXX" options suppress warnings:
4557 # remark #1419: external declaration in primary source file
4558 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4559 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4560 # remark #193: zero used for undefined preprocessing identifier
4561 # remark #593: variable "curs_sb_left_arrow" was set but never used
4562 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4563 # remark #869: parameter "tw" was never referenced
4564 # remark #981: operands are evaluated in unspecified order
4565 # warning #279: controlling expression is constant
4566
4567         { echo "$as_me:4567: checking for $CC warning options..." >&5
4568 echo "$as_me: checking for $CC warning options..." >&6;}
4569         cf_save_CFLAGS="$CFLAGS"
4570         EXTRA_CFLAGS="-Wall"
4571         for cf_opt in \
4572                 wd1419 \
4573                 wd1683 \
4574                 wd1684 \
4575                 wd193 \
4576                 wd593 \
4577                 wd279 \
4578                 wd810 \
4579                 wd869 \
4580                 wd981
4581         do
4582                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4583                 if { (eval echo "$as_me:4583: \"$ac_compile\"") >&5
4584   (eval $ac_compile) 2>&5
4585   ac_status=$?
4586   echo "$as_me:4586: \$? = $ac_status" >&5
4587   (exit $ac_status); }; then
4588                         test -n "$verbose" && echo "$as_me:4588: result: ... -$cf_opt" >&5
4589 echo "${ECHO_T}... -$cf_opt" >&6
4590                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4591                 fi
4592         done
4593         CFLAGS="$cf_save_CFLAGS"
4594
4595 elif test "$GCC" = yes
4596 then
4597         { echo "$as_me:4597: checking for $CC warning options..." >&5
4598 echo "$as_me: checking for $CC warning options..." >&6;}
4599         cf_save_CFLAGS="$CFLAGS"
4600         EXTRA_CFLAGS=
4601         cf_warn_CONST=""
4602         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4603         for cf_opt in W Wall \
4604                 Wbad-function-cast \
4605                 Wcast-align \
4606                 Wcast-qual \
4607                 Winline \
4608                 Wmissing-declarations \
4609                 Wmissing-prototypes \
4610                 Wnested-externs \
4611                 Wpointer-arith \
4612                 Wshadow \
4613                 Wstrict-prototypes \
4614                 Wundef $cf_warn_CONST
4615         do
4616                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4617                 if { (eval echo "$as_me:4617: \"$ac_compile\"") >&5
4618   (eval $ac_compile) 2>&5
4619   ac_status=$?
4620   echo "$as_me:4620: \$? = $ac_status" >&5
4621   (exit $ac_status); }; then
4622                         test -n "$verbose" && echo "$as_me:4622: result: ... -$cf_opt" >&5
4623 echo "${ECHO_T}... -$cf_opt" >&6
4624                         case $cf_opt in #(vi
4625                         Wcast-qual) #(vi
4626                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4627                                 ;;
4628                         Winline) #(vi
4629                                 case $GCC_VERSION in
4630                                 [34].*)
4631                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4632
4633 echo "${as_me:-configure}:4633: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4634
4635                                         continue;;
4636                                 esac
4637                                 ;;
4638                         esac
4639                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4640                 fi
4641         done
4642         CFLAGS="$cf_save_CFLAGS"
4643 fi
4644 rm -rf conftest*
4645
4646 fi
4647 fi
4648
4649 echo "$as_me:4649: checking if you want to use dmalloc for testing" >&5
4650 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4651
4652 # Check whether --with-dmalloc or --without-dmalloc was given.
4653 if test "${with_dmalloc+set}" = set; then
4654   withval="$with_dmalloc"
4655   cat >>confdefs.h <<\EOF
4656 #define USE_DMALLOC 1
4657 EOF
4658
4659         : ${with_cflags:=-g}
4660         : ${with_no_leaks:=yes}
4661          with_dmalloc=yes
4662 else
4663   with_dmalloc=
4664 fi;
4665 echo "$as_me:4665: result: ${with_dmalloc:-no}" >&5
4666 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4667
4668 case .$with_cflags in #(vi
4669 .*-g*)
4670         case .$CFLAGS in #(vi
4671         .*-g*) #(vi
4672                 ;;
4673         *)
4674
4675 cf_fix_cppflags=no
4676 cf_new_cflags=
4677 cf_new_cppflags=
4678 cf_new_extra_cppflags=
4679
4680 for cf_add_cflags in -g
4681 do
4682 case $cf_fix_cppflags in
4683 no)
4684         case $cf_add_cflags in #(vi
4685         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4686                 case $cf_add_cflags in
4687                 -D*)
4688                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4689
4690                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4691                                 && test -z "${cf_tst_cflags}" \
4692                                 && cf_fix_cppflags=yes
4693
4694                         if test $cf_fix_cppflags = yes ; then
4695                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4696                                 continue
4697                         elif test "${cf_tst_cflags}" = "\"'" ; then
4698                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4699                                 continue
4700                         fi
4701                         ;;
4702                 esac
4703                 case "$CPPFLAGS" in
4704                 *$cf_add_cflags) #(vi
4705                         ;;
4706                 *) #(vi
4707                         case $cf_add_cflags in #(vi
4708                         -D*)
4709                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4710
4711 CPPFLAGS=`echo "$CPPFLAGS" | \
4712         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4713                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4714
4715                                 ;;
4716                         esac
4717                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4718                         ;;
4719                 esac
4720                 ;;
4721         *)
4722                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4723                 ;;
4724         esac
4725         ;;
4726 yes)
4727         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4728
4729         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4730
4731         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4732                 && test -z "${cf_tst_cflags}" \
4733                 && cf_fix_cppflags=no
4734         ;;
4735 esac
4736 done
4737
4738 if test -n "$cf_new_cflags" ; then
4739
4740         CFLAGS="$CFLAGS $cf_new_cflags"
4741 fi
4742
4743 if test -n "$cf_new_cppflags" ; then
4744
4745         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4746 fi
4747
4748 if test -n "$cf_new_extra_cppflags" ; then
4749
4750         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4751 fi
4752
4753                 ;;
4754         esac
4755         ;;
4756 esac
4757
4758 if test "$with_dmalloc" = yes ; then
4759         echo "$as_me:4759: checking for dmalloc.h" >&5
4760 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4761 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4762   echo $ECHO_N "(cached) $ECHO_C" >&6
4763 else
4764   cat >conftest.$ac_ext <<_ACEOF
4765 #line 4765 "configure"
4766 #include "confdefs.h"
4767 #include <dmalloc.h>
4768 _ACEOF
4769 if { (eval echo "$as_me:4769: \"$ac_cpp conftest.$ac_ext\"") >&5
4770   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4771   ac_status=$?
4772   egrep -v '^ *\+' conftest.er1 >conftest.err
4773   rm -f conftest.er1
4774   cat conftest.err >&5
4775   echo "$as_me:4775: \$? = $ac_status" >&5
4776   (exit $ac_status); } >/dev/null; then
4777   if test -s conftest.err; then
4778     ac_cpp_err=$ac_c_preproc_warn_flag
4779   else
4780     ac_cpp_err=
4781   fi
4782 else
4783   ac_cpp_err=yes
4784 fi
4785 if test -z "$ac_cpp_err"; then
4786   ac_cv_header_dmalloc_h=yes
4787 else
4788   echo "$as_me: failed program was:" >&5
4789   cat conftest.$ac_ext >&5
4790   ac_cv_header_dmalloc_h=no
4791 fi
4792 rm -f conftest.err conftest.$ac_ext
4793 fi
4794 echo "$as_me:4794: result: $ac_cv_header_dmalloc_h" >&5
4795 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4796 if test $ac_cv_header_dmalloc_h = yes; then
4797
4798 echo "$as_me:4798: checking for dmalloc_debug in -ldmalloc" >&5
4799 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4800 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4801   echo $ECHO_N "(cached) $ECHO_C" >&6
4802 else
4803   ac_check_lib_save_LIBS=$LIBS
4804 LIBS="-ldmalloc  $LIBS"
4805 cat >conftest.$ac_ext <<_ACEOF
4806 #line 4806 "configure"
4807 #include "confdefs.h"
4808
4809 /* Override any gcc2 internal prototype to avoid an error.  */
4810 #ifdef __cplusplus
4811 extern "C"
4812 #endif
4813 /* We use char because int might match the return type of a gcc2
4814    builtin and then its argument prototype would still apply.  */
4815 char dmalloc_debug ();
4816 int
4817 main ()
4818 {
4819 dmalloc_debug ();
4820   ;
4821   return 0;
4822 }
4823 _ACEOF
4824 rm -f conftest.$ac_objext conftest$ac_exeext
4825 if { (eval echo "$as_me:4825: \"$ac_link\"") >&5
4826   (eval $ac_link) 2>&5
4827   ac_status=$?
4828   echo "$as_me:4828: \$? = $ac_status" >&5
4829   (exit $ac_status); } &&
4830          { ac_try='test -s conftest$ac_exeext'
4831   { (eval echo "$as_me:4831: \"$ac_try\"") >&5
4832   (eval $ac_try) 2>&5
4833   ac_status=$?
4834   echo "$as_me:4834: \$? = $ac_status" >&5
4835   (exit $ac_status); }; }; then
4836   ac_cv_lib_dmalloc_dmalloc_debug=yes
4837 else
4838   echo "$as_me: failed program was:" >&5
4839 cat conftest.$ac_ext >&5
4840 ac_cv_lib_dmalloc_dmalloc_debug=no
4841 fi
4842 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4843 LIBS=$ac_check_lib_save_LIBS
4844 fi
4845 echo "$as_me:4845: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4846 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4847 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4848   cat >>confdefs.h <<EOF
4849 #define HAVE_LIBDMALLOC 1
4850 EOF
4851
4852   LIBS="-ldmalloc $LIBS"
4853
4854 fi
4855
4856 fi
4857
4858 fi
4859
4860 echo "$as_me:4860: checking if you want to use dbmalloc for testing" >&5
4861 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4862
4863 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4864 if test "${with_dbmalloc+set}" = set; then
4865   withval="$with_dbmalloc"
4866   cat >>confdefs.h <<\EOF
4867 #define USE_DBMALLOC 1
4868 EOF
4869
4870         : ${with_cflags:=-g}
4871         : ${with_no_leaks:=yes}
4872          with_dbmalloc=yes
4873 else
4874   with_dbmalloc=
4875 fi;
4876 echo "$as_me:4876: result: ${with_dbmalloc:-no}" >&5
4877 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4878
4879 case .$with_cflags in #(vi
4880 .*-g*)
4881         case .$CFLAGS in #(vi
4882         .*-g*) #(vi
4883                 ;;
4884         *)
4885
4886 cf_fix_cppflags=no
4887 cf_new_cflags=
4888 cf_new_cppflags=
4889 cf_new_extra_cppflags=
4890
4891 for cf_add_cflags in -g
4892 do
4893 case $cf_fix_cppflags in
4894 no)
4895         case $cf_add_cflags in #(vi
4896         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4897                 case $cf_add_cflags in
4898                 -D*)
4899                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4900
4901                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4902                                 && test -z "${cf_tst_cflags}" \
4903                                 && cf_fix_cppflags=yes
4904
4905                         if test $cf_fix_cppflags = yes ; then
4906                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4907                                 continue
4908                         elif test "${cf_tst_cflags}" = "\"'" ; then
4909                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4910                                 continue
4911                         fi
4912                         ;;
4913                 esac
4914                 case "$CPPFLAGS" in
4915                 *$cf_add_cflags) #(vi
4916                         ;;
4917                 *) #(vi
4918                         case $cf_add_cflags in #(vi
4919                         -D*)
4920                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4921
4922 CPPFLAGS=`echo "$CPPFLAGS" | \
4923         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4924                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4925
4926                                 ;;
4927                         esac
4928                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4929                         ;;
4930                 esac
4931                 ;;
4932         *)
4933                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4934                 ;;
4935         esac
4936         ;;
4937 yes)
4938         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4939
4940         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4941
4942         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4943                 && test -z "${cf_tst_cflags}" \
4944                 && cf_fix_cppflags=no
4945         ;;
4946 esac
4947 done
4948
4949 if test -n "$cf_new_cflags" ; then
4950
4951         CFLAGS="$CFLAGS $cf_new_cflags"
4952 fi
4953
4954 if test -n "$cf_new_cppflags" ; then
4955
4956         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4957 fi
4958
4959 if test -n "$cf_new_extra_cppflags" ; then
4960
4961         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4962 fi
4963
4964                 ;;
4965         esac
4966         ;;
4967 esac
4968
4969 if test "$with_dbmalloc" = yes ; then
4970         echo "$as_me:4970: checking for dbmalloc.h" >&5
4971 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
4972 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
4973   echo $ECHO_N "(cached) $ECHO_C" >&6
4974 else
4975   cat >conftest.$ac_ext <<_ACEOF
4976 #line 4976 "configure"
4977 #include "confdefs.h"
4978 #include <dbmalloc.h>
4979 _ACEOF
4980 if { (eval echo "$as_me:4980: \"$ac_cpp conftest.$ac_ext\"") >&5
4981   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4982   ac_status=$?
4983   egrep -v '^ *\+' conftest.er1 >conftest.err
4984   rm -f conftest.er1
4985   cat conftest.err >&5
4986   echo "$as_me:4986: \$? = $ac_status" >&5
4987   (exit $ac_status); } >/dev/null; then
4988   if test -s conftest.err; then
4989     ac_cpp_err=$ac_c_preproc_warn_flag
4990   else
4991     ac_cpp_err=
4992   fi
4993 else
4994   ac_cpp_err=yes
4995 fi
4996 if test -z "$ac_cpp_err"; then
4997   ac_cv_header_dbmalloc_h=yes
4998 else
4999   echo "$as_me: failed program was:" >&5
5000   cat conftest.$ac_ext >&5
5001   ac_cv_header_dbmalloc_h=no
5002 fi
5003 rm -f conftest.err conftest.$ac_ext
5004 fi
5005 echo "$as_me:5005: result: $ac_cv_header_dbmalloc_h" >&5
5006 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
5007 if test $ac_cv_header_dbmalloc_h = yes; then
5008
5009 echo "$as_me:5009: checking for debug_malloc in -ldbmalloc" >&5
5010 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
5011 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
5012   echo $ECHO_N "(cached) $ECHO_C" >&6
5013 else
5014   ac_check_lib_save_LIBS=$LIBS
5015 LIBS="-ldbmalloc  $LIBS"
5016 cat >conftest.$ac_ext <<_ACEOF
5017 #line 5017 "configure"
5018 #include "confdefs.h"
5019
5020 /* Override any gcc2 internal prototype to avoid an error.  */
5021 #ifdef __cplusplus
5022 extern "C"
5023 #endif
5024 /* We use char because int might match the return type of a gcc2
5025    builtin and then its argument prototype would still apply.  */
5026 char debug_malloc ();
5027 int
5028 main ()
5029 {
5030 debug_malloc ();
5031   ;
5032   return 0;
5033 }
5034 _ACEOF
5035 rm -f conftest.$ac_objext conftest$ac_exeext
5036 if { (eval echo "$as_me:5036: \"$ac_link\"") >&5
5037   (eval $ac_link) 2>&5
5038   ac_status=$?
5039   echo "$as_me:5039: \$? = $ac_status" >&5
5040   (exit $ac_status); } &&
5041          { ac_try='test -s conftest$ac_exeext'
5042   { (eval echo "$as_me:5042: \"$ac_try\"") >&5
5043   (eval $ac_try) 2>&5
5044   ac_status=$?
5045   echo "$as_me:5045: \$? = $ac_status" >&5
5046   (exit $ac_status); }; }; then
5047   ac_cv_lib_dbmalloc_debug_malloc=yes
5048 else
5049   echo "$as_me: failed program was:" >&5
5050 cat conftest.$ac_ext >&5
5051 ac_cv_lib_dbmalloc_debug_malloc=no
5052 fi
5053 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5054 LIBS=$ac_check_lib_save_LIBS
5055 fi
5056 echo "$as_me:5056: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
5057 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
5058 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
5059   cat >>confdefs.h <<EOF
5060 #define HAVE_LIBDBMALLOC 1
5061 EOF
5062
5063   LIBS="-ldbmalloc $LIBS"
5064
5065 fi
5066
5067 fi
5068
5069 fi
5070
5071 echo "$as_me:5071: checking if you want to use valgrind for testing" >&5
5072 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
5073
5074 # Check whether --with-valgrind or --without-valgrind was given.
5075 if test "${with_valgrind+set}" = set; then
5076   withval="$with_valgrind"
5077   cat >>confdefs.h <<\EOF
5078 #define USE_VALGRIND 1
5079 EOF
5080
5081         : ${with_cflags:=-g}
5082         : ${with_no_leaks:=yes}
5083          with_valgrind=yes
5084 else
5085   with_valgrind=
5086 fi;
5087 echo "$as_me:5087: result: ${with_valgrind:-no}" >&5
5088 echo "${ECHO_T}${with_valgrind:-no}" >&6
5089
5090 case .$with_cflags in #(vi
5091 .*-g*)
5092         case .$CFLAGS in #(vi
5093         .*-g*) #(vi
5094                 ;;
5095         *)
5096
5097 cf_fix_cppflags=no
5098 cf_new_cflags=
5099 cf_new_cppflags=
5100 cf_new_extra_cppflags=
5101
5102 for cf_add_cflags in -g
5103 do
5104 case $cf_fix_cppflags in
5105 no)
5106         case $cf_add_cflags in #(vi
5107         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5108                 case $cf_add_cflags in
5109                 -D*)
5110                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5111
5112                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5113                                 && test -z "${cf_tst_cflags}" \
5114                                 && cf_fix_cppflags=yes
5115
5116                         if test $cf_fix_cppflags = yes ; then
5117                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5118                                 continue
5119                         elif test "${cf_tst_cflags}" = "\"'" ; then
5120                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5121                                 continue
5122                         fi
5123                         ;;
5124                 esac
5125                 case "$CPPFLAGS" in
5126                 *$cf_add_cflags) #(vi
5127                         ;;
5128                 *) #(vi
5129                         case $cf_add_cflags in #(vi
5130                         -D*)
5131                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5132
5133 CPPFLAGS=`echo "$CPPFLAGS" | \
5134         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5135                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5136
5137                                 ;;
5138                         esac
5139                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5140                         ;;
5141                 esac
5142                 ;;
5143         *)
5144                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5145                 ;;
5146         esac
5147         ;;
5148 yes)
5149         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5150
5151         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5152
5153         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5154                 && test -z "${cf_tst_cflags}" \
5155                 && cf_fix_cppflags=no
5156         ;;
5157 esac
5158 done
5159
5160 if test -n "$cf_new_cflags" ; then
5161
5162         CFLAGS="$CFLAGS $cf_new_cflags"
5163 fi
5164
5165 if test -n "$cf_new_cppflags" ; then
5166
5167         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5168 fi
5169
5170 if test -n "$cf_new_extra_cppflags" ; then
5171
5172         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5173 fi
5174
5175                 ;;
5176         esac
5177         ;;
5178 esac
5179
5180 echo "$as_me:5180: checking if you want to perform memory-leak testing" >&5
5181 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
5182
5183 # Check whether --enable-leaks or --disable-leaks was given.
5184 if test "${enable_leaks+set}" = set; then
5185   enableval="$enable_leaks"
5186   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
5187 else
5188   : ${with_no_leaks:=no}
5189 fi;
5190 echo "$as_me:5190: result: $with_no_leaks" >&5
5191 echo "${ECHO_T}$with_no_leaks" >&6
5192
5193 if test "$with_no_leaks" = yes ; then
5194         cat >>confdefs.h <<\EOF
5195 #define NO_LEAKS 1
5196 EOF
5197
5198         cat >>confdefs.h <<\EOF
5199 #define YY_NO_LEAKS 1
5200 EOF
5201
5202 fi
5203
5204 echo "$as_me:5204: checking if you want to check for wide-character functions" >&5
5205 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5206
5207 # Check whether --enable-widec or --disable-widec was given.
5208 if test "${enable_widec+set}" = set; then
5209   enableval="$enable_widec"
5210   test "$enableval" != no && enableval=yes
5211   if test "$enableval" != "yes" ; then
5212     cf_enable_widec=no
5213   else
5214     cf_enable_widec=yes
5215   fi
5216 else
5217   enableval=yes
5218   cf_enable_widec=yes
5219
5220 fi;
5221 echo "$as_me:5221: result: $cf_enable_widec" >&5
5222 echo "${ECHO_T}$cf_enable_widec" >&6
5223
5224 echo "$as_me:5224: checking for specific curses-directory" >&5
5225 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5226
5227 # Check whether --with-curses-dir or --without-curses-dir was given.
5228 if test "${with_curses_dir+set}" = set; then
5229   withval="$with_curses_dir"
5230   cf_cv_curses_dir=$withval
5231 else
5232   cf_cv_curses_dir=no
5233 fi;
5234 echo "$as_me:5234: result: $cf_cv_curses_dir" >&5
5235 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5236
5237 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5238 then
5239
5240 if test "x$prefix" != xNONE; then
5241   cf_path_syntax="$prefix"
5242 else
5243   cf_path_syntax="$ac_default_prefix"
5244 fi
5245
5246 case ".$withval" in #(vi
5247 .\$\(*\)*|.\'*\'*) #(vi
5248   ;;
5249 ..|./*|.\\*) #(vi
5250   ;;
5251 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5252   ;;
5253 .\${*prefix}*) #(vi
5254   eval withval="$withval"
5255   case ".$withval" in #(vi
5256   .NONE/*)
5257     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5258     ;;
5259   esac
5260   ;; #(vi
5261 .no|.NONE/*)
5262   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5263   ;;
5264 *)
5265   { { echo "$as_me:5265: error: expected a pathname, not \"$withval\"" >&5
5266 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5267    { (exit 1); exit 1; }; }
5268   ;;
5269 esac
5270
5271         if test -d "$cf_cv_curses_dir"
5272         then
5273
5274 if test -n "$cf_cv_curses_dir/include" ; then
5275   for cf_add_incdir in $cf_cv_curses_dir/include
5276   do
5277         while test $cf_add_incdir != /usr/include
5278         do
5279           if test -d $cf_add_incdir
5280           then
5281                 cf_have_incdir=no
5282                 if test -n "$CFLAGS$CPPFLAGS" ; then
5283                   # a loop is needed to ensure we can add subdirs of existing dirs
5284                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5285                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5286                           cf_have_incdir=yes; break
5287                         fi
5288                   done
5289                 fi
5290
5291                 if test "$cf_have_incdir" = no ; then
5292                   if test "$cf_add_incdir" = /usr/local/include ; then
5293                         if test "$GCC" = yes
5294                         then
5295                           cf_save_CPPFLAGS=$CPPFLAGS
5296                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5297                           cat >conftest.$ac_ext <<_ACEOF
5298 #line 5298 "configure"
5299 #include "confdefs.h"
5300 #include <stdio.h>
5301 int
5302 main ()
5303 {
5304 printf("Hello")
5305   ;
5306   return 0;
5307 }
5308 _ACEOF
5309 rm -f conftest.$ac_objext
5310 if { (eval echo "$as_me:5310: \"$ac_compile\"") >&5
5311   (eval $ac_compile) 2>&5
5312   ac_status=$?
5313   echo "$as_me:5313: \$? = $ac_status" >&5
5314   (exit $ac_status); } &&
5315          { ac_try='test -s conftest.$ac_objext'
5316   { (eval echo "$as_me:5316: \"$ac_try\"") >&5
5317   (eval $ac_try) 2>&5
5318   ac_status=$?
5319   echo "$as_me:5319: \$? = $ac_status" >&5
5320   (exit $ac_status); }; }; then
5321   :
5322 else
5323   echo "$as_me: failed program was:" >&5
5324 cat conftest.$ac_ext >&5
5325 cf_have_incdir=yes
5326 fi
5327 rm -f conftest.$ac_objext conftest.$ac_ext
5328                           CPPFLAGS=$cf_save_CPPFLAGS
5329                         fi
5330                   fi
5331                 fi
5332
5333                 if test "$cf_have_incdir" = no ; then
5334                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5335
5336 echo "${as_me:-configure}:5336: testing adding $cf_add_incdir to include-path ..." 1>&5
5337
5338                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5339
5340                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5341                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5342                   cf_add_incdir="$cf_top_incdir"
5343                 else
5344                   break
5345                 fi
5346           fi
5347         done
5348   done
5349 fi
5350
5351 if test -n "$cf_cv_curses_dir/lib" ; then
5352   for cf_add_libdir in $cf_cv_curses_dir/lib
5353   do
5354     if test $cf_add_libdir = /usr/lib ; then
5355       :
5356     elif test -d $cf_add_libdir
5357     then
5358       cf_have_libdir=no
5359       if test -n "$LDFLAGS$LIBS" ; then
5360         # a loop is needed to ensure we can add subdirs of existing dirs
5361         for cf_test_libdir in $LDFLAGS $LIBS ; do
5362           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5363             cf_have_libdir=yes; break
5364           fi
5365         done
5366       fi
5367       if test "$cf_have_libdir" = no ; then
5368         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5369
5370 echo "${as_me:-configure}:5370: testing adding $cf_add_libdir to library-path ..." 1>&5
5371
5372         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5373       fi
5374     fi
5375   done
5376 fi
5377
5378         fi
5379 fi
5380
5381 echo "$as_me:5381: checking for specified curses library type" >&5
5382 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5383
5384 # Check whether --with-ncursesw or --without-ncursesw was given.
5385 if test "${with_ncursesw+set}" = set; then
5386   withval="$with_ncursesw"
5387   cf_cv_screen=ncursesw
5388 else
5389
5390 # Check whether --with-ncurses or --without-ncurses was given.
5391 if test "${with_ncurses+set}" = set; then
5392   withval="$with_ncurses"
5393   cf_cv_screen=ncurses
5394 else
5395
5396 # Check whether --with-pdcurses or --without-pdcurses was given.
5397 if test "${with_pdcurses+set}" = set; then
5398   withval="$with_pdcurses"
5399   cf_cv_screen=pdcurses
5400 else
5401
5402 # Check whether --with-curses-colr or --without-curses-colr was given.
5403 if test "${with_curses_colr+set}" = set; then
5404   withval="$with_curses_colr"
5405   cf_cv_screen=curses_colr
5406 else
5407
5408 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5409 if test "${with_curses_5lib+set}" = set; then
5410   withval="$with_curses_5lib"
5411   cf_cv_screen=curses_5lib
5412 fi;
5413 fi;
5414 fi;
5415 fi;
5416 fi;
5417
5418 echo "$as_me:5418: result: $cf_cv_screen" >&5
5419 echo "${ECHO_T}$cf_cv_screen" >&6
5420
5421 case $cf_cv_screen in
5422 curses|curses_*)
5423
5424 echo "$as_me:5424: checking for extra include directories" >&5
5425 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5426 if test "${cf_cv_curses_incdir+set}" = set; then
5427   echo $ECHO_N "(cached) $ECHO_C" >&6
5428 else
5429
5430 cf_cv_curses_incdir=no
5431 case $host_os in #(vi
5432 hpux10.*) #(vi
5433         if test "x$cf_cv_screen" = "xcurses_colr"
5434         then
5435                 test -d /usr/include/curses_colr && \
5436                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5437         fi
5438         ;;
5439 sunos3*|sunos4*)
5440         if test "x$cf_cv_screen" = "xcurses_5lib"
5441         then
5442                 test -d /usr/5lib && \
5443                 test -d /usr/5include && \
5444                 cf_cv_curses_incdir="-I/usr/5include"
5445         fi
5446         ;;
5447 esac
5448
5449 fi
5450 echo "$as_me:5450: result: $cf_cv_curses_incdir" >&5
5451 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5452 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5453
5454 echo "$as_me:5454: checking if we have identified curses headers" >&5
5455 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5456 if test "${cf_cv_ncurses_header+set}" = set; then
5457   echo $ECHO_N "(cached) $ECHO_C" >&6
5458 else
5459
5460 cf_cv_ncurses_header=none
5461 for cf_header in  \
5462         ncurses.h \
5463         curses.h ncurses/ncurses.h ncurses/curses.h
5464 do
5465 cat >conftest.$ac_ext <<_ACEOF
5466 #line 5466 "configure"
5467 #include "confdefs.h"
5468 #include <${cf_header}>
5469 int
5470 main ()
5471 {
5472 initscr(); tgoto("?", 0,0)
5473   ;
5474   return 0;
5475 }
5476 _ACEOF
5477 rm -f conftest.$ac_objext
5478 if { (eval echo "$as_me:5478: \"$ac_compile\"") >&5
5479   (eval $ac_compile) 2>&5
5480   ac_status=$?
5481   echo "$as_me:5481: \$? = $ac_status" >&5
5482   (exit $ac_status); } &&
5483          { ac_try='test -s conftest.$ac_objext'
5484   { (eval echo "$as_me:5484: \"$ac_try\"") >&5
5485   (eval $ac_try) 2>&5
5486   ac_status=$?
5487   echo "$as_me:5487: \$? = $ac_status" >&5
5488   (exit $ac_status); }; }; then
5489   cf_cv_ncurses_header=$cf_header; break
5490 else
5491   echo "$as_me: failed program was:" >&5
5492 cat conftest.$ac_ext >&5
5493 fi
5494 rm -f conftest.$ac_objext conftest.$ac_ext
5495 done
5496
5497 fi
5498 echo "$as_me:5498: result: $cf_cv_ncurses_header" >&5
5499 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5500
5501 if test "$cf_cv_ncurses_header" = none ; then
5502         { { echo "$as_me:5502: error: No curses header-files found" >&5
5503 echo "$as_me: error: No curses header-files found" >&2;}
5504    { (exit 1); exit 1; }; }
5505 fi
5506
5507 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5508
5509 for ac_header in $cf_cv_ncurses_header
5510 do
5511 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5512 echo "$as_me:5512: checking for $ac_header" >&5
5513 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5514 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5515   echo $ECHO_N "(cached) $ECHO_C" >&6
5516 else
5517   cat >conftest.$ac_ext <<_ACEOF
5518 #line 5518 "configure"
5519 #include "confdefs.h"
5520 #include <$ac_header>
5521 _ACEOF
5522 if { (eval echo "$as_me:5522: \"$ac_cpp conftest.$ac_ext\"") >&5
5523   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5524   ac_status=$?
5525   egrep -v '^ *\+' conftest.er1 >conftest.err
5526   rm -f conftest.er1
5527   cat conftest.err >&5
5528   echo "$as_me:5528: \$? = $ac_status" >&5
5529   (exit $ac_status); } >/dev/null; then
5530   if test -s conftest.err; then
5531     ac_cpp_err=$ac_c_preproc_warn_flag
5532   else
5533     ac_cpp_err=
5534   fi
5535 else
5536   ac_cpp_err=yes
5537 fi
5538 if test -z "$ac_cpp_err"; then
5539   eval "$as_ac_Header=yes"
5540 else
5541   echo "$as_me: failed program was:" >&5
5542   cat conftest.$ac_ext >&5
5543   eval "$as_ac_Header=no"
5544 fi
5545 rm -f conftest.err conftest.$ac_ext
5546 fi
5547 echo "$as_me:5547: result: `eval echo '${'$as_ac_Header'}'`" >&5
5548 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5549 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5550   cat >>confdefs.h <<EOF
5551 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5552 EOF
5553
5554 fi
5555 done
5556
5557 echo "$as_me:5557: checking for terminfo header" >&5
5558 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5559 if test "${cf_cv_term_header+set}" = set; then
5560   echo $ECHO_N "(cached) $ECHO_C" >&6
5561 else
5562
5563 case ${cf_cv_ncurses_header} in #(vi
5564 */ncurses.h|*/ncursesw.h) #(vi
5565         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5566         ;;
5567 *)
5568         cf_term_header=term.h
5569         ;;
5570 esac
5571
5572 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5573 do
5574 cat >conftest.$ac_ext <<_ACEOF
5575 #line 5575 "configure"
5576 #include "confdefs.h"
5577 #include <stdio.h>
5578 #include <${cf_cv_ncurses_header:-curses.h}>
5579 #include <$cf_test>
5580
5581 int
5582 main ()
5583 {
5584 int x = auto_left_margin
5585   ;
5586   return 0;
5587 }
5588 _ACEOF
5589 rm -f conftest.$ac_objext
5590 if { (eval echo "$as_me:5590: \"$ac_compile\"") >&5
5591   (eval $ac_compile) 2>&5
5592   ac_status=$?
5593   echo "$as_me:5593: \$? = $ac_status" >&5
5594   (exit $ac_status); } &&
5595          { ac_try='test -s conftest.$ac_objext'
5596   { (eval echo "$as_me:5596: \"$ac_try\"") >&5
5597   (eval $ac_try) 2>&5
5598   ac_status=$?
5599   echo "$as_me:5599: \$? = $ac_status" >&5
5600   (exit $ac_status); }; }; then
5601
5602         cf_cv_term_header="$cf_test"
5603 else
5604   echo "$as_me: failed program was:" >&5
5605 cat conftest.$ac_ext >&5
5606
5607         cf_cv_term_header=unknown
5608
5609 fi
5610 rm -f conftest.$ac_objext conftest.$ac_ext
5611         test "$cf_cv_term_header" != unknown && break
5612 done
5613
5614 fi
5615 echo "$as_me:5615: result: $cf_cv_term_header" >&5
5616 echo "${ECHO_T}$cf_cv_term_header" >&6
5617
5618 # Set definitions to allow ifdef'ing to accommodate subdirectories
5619
5620 case $cf_cv_term_header in # (vi
5621 *term.h)
5622         cat >>confdefs.h <<\EOF
5623 #define HAVE_TERM_H 1
5624 EOF
5625
5626         ;;
5627 esac
5628
5629 case $cf_cv_term_header in # (vi
5630 ncurses/term.h) #(vi
5631         cat >>confdefs.h <<\EOF
5632 #define HAVE_NCURSES_TERM_H 1
5633 EOF
5634
5635         ;;
5636 ncursesw/term.h)
5637         cat >>confdefs.h <<\EOF
5638 #define HAVE_NCURSESW_TERM_H 1
5639 EOF
5640
5641         ;;
5642 esac
5643
5644 echo "$as_me:5644: checking for ncurses version" >&5
5645 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5646 if test "${cf_cv_ncurses_version+set}" = set; then
5647   echo $ECHO_N "(cached) $ECHO_C" >&6
5648 else
5649
5650         cf_cv_ncurses_version=no
5651         cf_tempfile=out$$
5652         rm -f $cf_tempfile
5653         if test "$cross_compiling" = yes; then
5654
5655         # This will not work if the preprocessor splits the line after the
5656         # Autoconf token.  The 'unproto' program does that.
5657         cat > conftest.$ac_ext <<EOF
5658 #include <${cf_cv_ncurses_header:-curses.h}>
5659 #undef Autoconf
5660 #ifdef NCURSES_VERSION
5661 Autoconf NCURSES_VERSION
5662 #else
5663 #ifdef __NCURSES_H
5664 Autoconf "old"
5665 #endif
5666 ;
5667 #endif
5668 EOF
5669         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5670         { (eval echo "$as_me:5670: \"$cf_try\"") >&5
5671   (eval $cf_try) 2>&5
5672   ac_status=$?
5673   echo "$as_me:5673: \$? = $ac_status" >&5
5674   (exit $ac_status); }
5675         if test -f conftest.out ; then
5676                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5677                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5678                 rm -f conftest.out
5679         fi
5680
5681 else
5682   cat >conftest.$ac_ext <<_ACEOF
5683 #line 5683 "configure"
5684 #include "confdefs.h"
5685
5686 #include <${cf_cv_ncurses_header:-curses.h}>
5687 #include <stdio.h>
5688 int main()
5689 {
5690         FILE *fp = fopen("$cf_tempfile", "w");
5691 #ifdef NCURSES_VERSION
5692 # ifdef NCURSES_VERSION_PATCH
5693         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5694 # else
5695         fprintf(fp, "%s\n", NCURSES_VERSION);
5696 # endif
5697 #else
5698 # ifdef __NCURSES_H
5699         fprintf(fp, "old\n");
5700 # else
5701         make an error
5702 # endif
5703 #endif
5704         ${cf_cv_main_return:-return}(0);
5705 }
5706 _ACEOF
5707 rm -f conftest$ac_exeext
5708 if { (eval echo "$as_me:5708: \"$ac_link\"") >&5
5709   (eval $ac_link) 2>&5
5710   ac_status=$?
5711   echo "$as_me:5711: \$? = $ac_status" >&5
5712   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5713   { (eval echo "$as_me:5713: \"$ac_try\"") >&5
5714   (eval $ac_try) 2>&5
5715   ac_status=$?
5716   echo "$as_me:5716: \$? = $ac_status" >&5
5717   (exit $ac_status); }; }; then
5718
5719         cf_cv_ncurses_version=`cat $cf_tempfile`
5720 else
5721   echo "$as_me: program exited with status $ac_status" >&5
5722 echo "$as_me: failed program was:" >&5
5723 cat conftest.$ac_ext >&5
5724 fi
5725 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5726 fi
5727         rm -f $cf_tempfile
5728
5729 fi
5730 echo "$as_me:5730: result: $cf_cv_ncurses_version" >&5
5731 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5732 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5733 #define NCURSES 1
5734 EOF
5735
5736 echo "$as_me:5736: checking if we have identified curses libraries" >&5
5737 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5738 cat >conftest.$ac_ext <<_ACEOF
5739 #line 5739 "configure"
5740 #include "confdefs.h"
5741 #include <${cf_cv_ncurses_header:-curses.h}>
5742 int
5743 main ()
5744 {
5745 initscr(); tgoto("?", 0,0)
5746   ;
5747   return 0;
5748 }
5749 _ACEOF
5750 rm -f conftest.$ac_objext conftest$ac_exeext
5751 if { (eval echo "$as_me:5751: \"$ac_link\"") >&5
5752   (eval $ac_link) 2>&5
5753   ac_status=$?
5754   echo "$as_me:5754: \$? = $ac_status" >&5
5755   (exit $ac_status); } &&
5756          { ac_try='test -s conftest$ac_exeext'
5757   { (eval echo "$as_me:5757: \"$ac_try\"") >&5
5758   (eval $ac_try) 2>&5
5759   ac_status=$?
5760   echo "$as_me:5760: \$? = $ac_status" >&5
5761   (exit $ac_status); }; }; then
5762   cf_result=yes
5763 else
5764   echo "$as_me: failed program was:" >&5
5765 cat conftest.$ac_ext >&5
5766 cf_result=no
5767 fi
5768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5769 echo "$as_me:5769: result: $cf_result" >&5
5770 echo "${ECHO_T}$cf_result" >&6
5771
5772 if test "$cf_result" = no ; then
5773 case $host_os in #(vi
5774 freebsd*) #(vi
5775     echo "$as_me:5775: checking for tgoto in -lmytinfo" >&5
5776 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5777 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5778   echo $ECHO_N "(cached) $ECHO_C" >&6
5779 else
5780   ac_check_lib_save_LIBS=$LIBS
5781 LIBS="-lmytinfo  $LIBS"
5782 cat >conftest.$ac_ext <<_ACEOF
5783 #line 5783 "configure"
5784 #include "confdefs.h"
5785
5786 /* Override any gcc2 internal prototype to avoid an error.  */
5787 #ifdef __cplusplus
5788 extern "C"
5789 #endif
5790 /* We use char because int might match the return type of a gcc2
5791    builtin and then its argument prototype would still apply.  */
5792 char tgoto ();
5793 int
5794 main ()
5795 {
5796 tgoto ();
5797   ;
5798   return 0;
5799 }
5800 _ACEOF
5801 rm -f conftest.$ac_objext conftest$ac_exeext
5802 if { (eval echo "$as_me:5802: \"$ac_link\"") >&5
5803   (eval $ac_link) 2>&5
5804   ac_status=$?
5805   echo "$as_me:5805: \$? = $ac_status" >&5
5806   (exit $ac_status); } &&
5807          { ac_try='test -s conftest$ac_exeext'
5808   { (eval echo "$as_me:5808: \"$ac_try\"") >&5
5809   (eval $ac_try) 2>&5
5810   ac_status=$?
5811   echo "$as_me:5811: \$? = $ac_status" >&5
5812   (exit $ac_status); }; }; then
5813   ac_cv_lib_mytinfo_tgoto=yes
5814 else
5815   echo "$as_me: failed program was:" >&5
5816 cat conftest.$ac_ext >&5
5817 ac_cv_lib_mytinfo_tgoto=no
5818 fi
5819 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5820 LIBS=$ac_check_lib_save_LIBS
5821 fi
5822 echo "$as_me:5822: result: $ac_cv_lib_mytinfo_tgoto" >&5
5823 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5824 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5825   LIBS="-lmytinfo $LIBS"
5826 fi
5827
5828     ;;
5829 hpux10.*) #(vi
5830         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5831         # next (1998), and xcurses "newer" (2000).  There is no header file for
5832         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5833         # term.h) for cur_colr
5834         if test "x$cf_cv_screen" = "xcurses_colr"
5835         then
5836                 echo "$as_me:5836: checking for initscr in -lcur_colr" >&5
5837 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5838 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5839   echo $ECHO_N "(cached) $ECHO_C" >&6
5840 else
5841   ac_check_lib_save_LIBS=$LIBS
5842 LIBS="-lcur_colr  $LIBS"
5843 cat >conftest.$ac_ext <<_ACEOF
5844 #line 5844 "configure"
5845 #include "confdefs.h"
5846
5847 /* Override any gcc2 internal prototype to avoid an error.  */
5848 #ifdef __cplusplus
5849 extern "C"
5850 #endif
5851 /* We use char because int might match the return type of a gcc2
5852    builtin and then its argument prototype would still apply.  */
5853 char initscr ();
5854 int
5855 main ()
5856 {
5857 initscr ();
5858   ;
5859   return 0;
5860 }
5861 _ACEOF
5862 rm -f conftest.$ac_objext conftest$ac_exeext
5863 if { (eval echo "$as_me:5863: \"$ac_link\"") >&5
5864   (eval $ac_link) 2>&5
5865   ac_status=$?
5866   echo "$as_me:5866: \$? = $ac_status" >&5
5867   (exit $ac_status); } &&
5868          { ac_try='test -s conftest$ac_exeext'
5869   { (eval echo "$as_me:5869: \"$ac_try\"") >&5
5870   (eval $ac_try) 2>&5
5871   ac_status=$?
5872   echo "$as_me:5872: \$? = $ac_status" >&5
5873   (exit $ac_status); }; }; then
5874   ac_cv_lib_cur_colr_initscr=yes
5875 else
5876   echo "$as_me: failed program was:" >&5
5877 cat conftest.$ac_ext >&5
5878 ac_cv_lib_cur_colr_initscr=no
5879 fi
5880 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5881 LIBS=$ac_check_lib_save_LIBS
5882 fi
5883 echo "$as_me:5883: result: $ac_cv_lib_cur_colr_initscr" >&5
5884 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5885 if test $ac_cv_lib_cur_colr_initscr = yes; then
5886
5887                         LIBS="-lcur_colr $LIBS"
5888                         ac_cv_func_initscr=yes
5889
5890 else
5891
5892                 echo "$as_me:5892: checking for initscr in -lHcurses" >&5
5893 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5894 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5895   echo $ECHO_N "(cached) $ECHO_C" >&6
5896 else
5897   ac_check_lib_save_LIBS=$LIBS
5898 LIBS="-lHcurses  $LIBS"
5899 cat >conftest.$ac_ext <<_ACEOF
5900 #line 5900 "configure"
5901 #include "confdefs.h"
5902
5903 /* Override any gcc2 internal prototype to avoid an error.  */
5904 #ifdef __cplusplus
5905 extern "C"
5906 #endif
5907 /* We use char because int might match the return type of a gcc2
5908    builtin and then its argument prototype would still apply.  */
5909 char initscr ();
5910 int
5911 main ()
5912 {
5913 initscr ();
5914   ;
5915   return 0;
5916 }
5917 _ACEOF
5918 rm -f conftest.$ac_objext conftest$ac_exeext
5919 if { (eval echo "$as_me:5919: \"$ac_link\"") >&5
5920   (eval $ac_link) 2>&5
5921   ac_status=$?
5922   echo "$as_me:5922: \$? = $ac_status" >&5
5923   (exit $ac_status); } &&
5924          { ac_try='test -s conftest$ac_exeext'
5925   { (eval echo "$as_me:5925: \"$ac_try\"") >&5
5926   (eval $ac_try) 2>&5
5927   ac_status=$?
5928   echo "$as_me:5928: \$? = $ac_status" >&5
5929   (exit $ac_status); }; }; then
5930   ac_cv_lib_Hcurses_initscr=yes
5931 else
5932   echo "$as_me: failed program was:" >&5
5933 cat conftest.$ac_ext >&5
5934 ac_cv_lib_Hcurses_initscr=no
5935 fi
5936 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5937 LIBS=$ac_check_lib_save_LIBS
5938 fi
5939 echo "$as_me:5939: result: $ac_cv_lib_Hcurses_initscr" >&5
5940 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5941 if test $ac_cv_lib_Hcurses_initscr = yes; then
5942
5943                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5944                         LIBS="-lHcurses $LIBS"
5945                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5946                         ac_cv_func_initscr=yes
5947
5948 fi
5949
5950 fi
5951
5952         fi
5953     ;;
5954 linux*)
5955         case `arch 2>/dev/null` in
5956         x86_64)
5957                 if test -d /lib64
5958                 then
5959
5960 if test -n "/lib64" ; then
5961   for cf_add_libdir in /lib64
5962   do
5963     if test $cf_add_libdir = /usr/lib ; then
5964       :
5965     elif test -d $cf_add_libdir
5966     then
5967       cf_have_libdir=no
5968       if test -n "$LDFLAGS$LIBS" ; then
5969         # a loop is needed to ensure we can add subdirs of existing dirs
5970         for cf_test_libdir in $LDFLAGS $LIBS ; do
5971           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5972             cf_have_libdir=yes; break
5973           fi
5974         done
5975       fi
5976       if test "$cf_have_libdir" = no ; then
5977         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5978
5979 echo "${as_me:-configure}:5979: testing adding $cf_add_libdir to library-path ..." 1>&5
5980
5981         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5982       fi
5983     fi
5984   done
5985 fi
5986
5987                 else
5988
5989 if test -n "/lib" ; then
5990   for cf_add_libdir in /lib
5991   do
5992     if test $cf_add_libdir = /usr/lib ; then
5993       :
5994     elif test -d $cf_add_libdir
5995     then
5996       cf_have_libdir=no
5997       if test -n "$LDFLAGS$LIBS" ; then
5998         # a loop is needed to ensure we can add subdirs of existing dirs
5999         for cf_test_libdir in $LDFLAGS $LIBS ; do
6000           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6001             cf_have_libdir=yes; break
6002           fi
6003         done
6004       fi
6005       if test "$cf_have_libdir" = no ; then
6006         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6007
6008 echo "${as_me:-configure}:6008: testing adding $cf_add_libdir to library-path ..." 1>&5
6009
6010         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6011       fi
6012     fi
6013   done
6014 fi
6015
6016                 fi
6017                 ;;
6018         *)
6019
6020 if test -n "/lib" ; then
6021   for cf_add_libdir in /lib
6022   do
6023     if test $cf_add_libdir = /usr/lib ; then
6024       :
6025     elif test -d $cf_add_libdir
6026     then
6027       cf_have_libdir=no
6028       if test -n "$LDFLAGS$LIBS" ; then
6029         # a loop is needed to ensure we can add subdirs of existing dirs
6030         for cf_test_libdir in $LDFLAGS $LIBS ; do
6031           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6032             cf_have_libdir=yes; break
6033           fi
6034         done
6035       fi
6036       if test "$cf_have_libdir" = no ; then
6037         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6038
6039 echo "${as_me:-configure}:6039: testing adding $cf_add_libdir to library-path ..." 1>&5
6040
6041         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6042       fi
6043     fi
6044   done
6045 fi
6046
6047                 ;;
6048         esac
6049     ;;
6050 sunos3*|sunos4*)
6051         if test "x$cf_cv_screen" = "xcurses_5lib"
6052         then
6053                 if test -d /usr/5lib ; then
6054
6055 if test -n "/usr/5lib" ; then
6056   for cf_add_libdir in /usr/5lib
6057   do
6058     if test $cf_add_libdir = /usr/lib ; then
6059       :
6060     elif test -d $cf_add_libdir
6061     then
6062       cf_have_libdir=no
6063       if test -n "$LDFLAGS$LIBS" ; then
6064         # a loop is needed to ensure we can add subdirs of existing dirs
6065         for cf_test_libdir in $LDFLAGS $LIBS ; do
6066           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6067             cf_have_libdir=yes; break
6068           fi
6069         done
6070       fi
6071       if test "$cf_have_libdir" = no ; then
6072         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6073
6074 echo "${as_me:-configure}:6074: testing adding $cf_add_libdir to library-path ..." 1>&5
6075
6076         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6077       fi
6078     fi
6079   done
6080 fi
6081
6082                         LIBS="-lcurses -ltermcap $LIBS"
6083                 fi
6084     fi
6085     ac_cv_func_initscr=yes
6086     ;;
6087 esac
6088
6089 if test ".$ac_cv_func_initscr" != .yes ; then
6090     cf_save_LIBS="$LIBS"
6091     cf_term_lib=""
6092     cf_curs_lib=""
6093
6094     if test ".${cf_cv_ncurses_version:-no}" != .no
6095     then
6096         cf_check_list="ncurses curses cursesX"
6097     else
6098         cf_check_list="cursesX curses ncurses"
6099     fi
6100
6101     # Check for library containing tgoto.  Do this before curses library
6102     # because it may be needed to link the test-case for initscr.
6103     echo "$as_me:6103: checking for tgoto" >&5
6104 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6105 if test "${ac_cv_func_tgoto+set}" = set; then
6106   echo $ECHO_N "(cached) $ECHO_C" >&6
6107 else
6108   cat >conftest.$ac_ext <<_ACEOF
6109 #line 6109 "configure"
6110 #include "confdefs.h"
6111 /* System header to define __stub macros and hopefully few prototypes,
6112     which can conflict with char tgoto (); below.  */
6113 #include <assert.h>
6114 /* Override any gcc2 internal prototype to avoid an error.  */
6115 #ifdef __cplusplus
6116 extern "C"
6117 #endif
6118 /* We use char because int might match the return type of a gcc2
6119    builtin and then its argument prototype would still apply.  */
6120 char tgoto ();
6121 char (*f) ();
6122
6123 int
6124 main ()
6125 {
6126 /* The GNU C library defines this for functions which it implements
6127     to always fail with ENOSYS.  Some functions are actually named
6128     something starting with __ and the normal name is an alias.  */
6129 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6130 choke me
6131 #else
6132 f = tgoto;
6133 #endif
6134
6135   ;
6136   return 0;
6137 }
6138 _ACEOF
6139 rm -f conftest.$ac_objext conftest$ac_exeext
6140 if { (eval echo "$as_me:6140: \"$ac_link\"") >&5
6141   (eval $ac_link) 2>&5
6142   ac_status=$?
6143   echo "$as_me:6143: \$? = $ac_status" >&5
6144   (exit $ac_status); } &&
6145          { ac_try='test -s conftest$ac_exeext'
6146   { (eval echo "$as_me:6146: \"$ac_try\"") >&5
6147   (eval $ac_try) 2>&5
6148   ac_status=$?
6149   echo "$as_me:6149: \$? = $ac_status" >&5
6150   (exit $ac_status); }; }; then
6151   ac_cv_func_tgoto=yes
6152 else
6153   echo "$as_me: failed program was:" >&5
6154 cat conftest.$ac_ext >&5
6155 ac_cv_func_tgoto=no
6156 fi
6157 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6158 fi
6159 echo "$as_me:6159: result: $ac_cv_func_tgoto" >&5
6160 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6161 if test $ac_cv_func_tgoto = yes; then
6162   cf_term_lib=predefined
6163 else
6164
6165         for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
6166         do
6167             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6168 echo "$as_me:6168: checking for tgoto in -l$cf_term_lib" >&5
6169 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6170 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6171   echo $ECHO_N "(cached) $ECHO_C" >&6
6172 else
6173   ac_check_lib_save_LIBS=$LIBS
6174 LIBS="-l$cf_term_lib  $LIBS"
6175 cat >conftest.$ac_ext <<_ACEOF
6176 #line 6176 "configure"
6177 #include "confdefs.h"
6178
6179 /* Override any gcc2 internal prototype to avoid an error.  */
6180 #ifdef __cplusplus
6181 extern "C"
6182 #endif
6183 /* We use char because int might match the return type of a gcc2
6184    builtin and then its argument prototype would still apply.  */
6185 char tgoto ();
6186 int
6187 main ()
6188 {
6189 tgoto ();
6190   ;
6191   return 0;
6192 }
6193 _ACEOF
6194 rm -f conftest.$ac_objext conftest$ac_exeext
6195 if { (eval echo "$as_me:6195: \"$ac_link\"") >&5
6196   (eval $ac_link) 2>&5
6197   ac_status=$?
6198   echo "$as_me:6198: \$? = $ac_status" >&5
6199   (exit $ac_status); } &&
6200          { ac_try='test -s conftest$ac_exeext'
6201   { (eval echo "$as_me:6201: \"$ac_try\"") >&5
6202   (eval $ac_try) 2>&5
6203   ac_status=$?
6204   echo "$as_me:6204: \$? = $ac_status" >&5
6205   (exit $ac_status); }; }; then
6206   eval "$as_ac_Lib=yes"
6207 else
6208   echo "$as_me: failed program was:" >&5
6209 cat conftest.$ac_ext >&5
6210 eval "$as_ac_Lib=no"
6211 fi
6212 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6213 LIBS=$ac_check_lib_save_LIBS
6214 fi
6215 echo "$as_me:6215: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6216 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6217 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6218   break
6219 fi
6220
6221         done
6222
6223 fi
6224
6225     # Check for library containing initscr
6226     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6227         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6228     do
6229         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6230 echo "$as_me:6230: checking for initscr in -l$cf_curs_lib" >&5
6231 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6232 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6233   echo $ECHO_N "(cached) $ECHO_C" >&6
6234 else
6235   ac_check_lib_save_LIBS=$LIBS
6236 LIBS="-l$cf_curs_lib  $LIBS"
6237 cat >conftest.$ac_ext <<_ACEOF
6238 #line 6238 "configure"
6239 #include "confdefs.h"
6240
6241 /* Override any gcc2 internal prototype to avoid an error.  */
6242 #ifdef __cplusplus
6243 extern "C"
6244 #endif
6245 /* We use char because int might match the return type of a gcc2
6246    builtin and then its argument prototype would still apply.  */
6247 char initscr ();
6248 int
6249 main ()
6250 {
6251 initscr ();
6252   ;
6253   return 0;
6254 }
6255 _ACEOF
6256 rm -f conftest.$ac_objext conftest$ac_exeext
6257 if { (eval echo "$as_me:6257: \"$ac_link\"") >&5
6258   (eval $ac_link) 2>&5
6259   ac_status=$?
6260   echo "$as_me:6260: \$? = $ac_status" >&5
6261   (exit $ac_status); } &&
6262          { ac_try='test -s conftest$ac_exeext'
6263   { (eval echo "$as_me:6263: \"$ac_try\"") >&5
6264   (eval $ac_try) 2>&5
6265   ac_status=$?
6266   echo "$as_me:6266: \$? = $ac_status" >&5
6267   (exit $ac_status); }; }; then
6268   eval "$as_ac_Lib=yes"
6269 else
6270   echo "$as_me: failed program was:" >&5
6271 cat conftest.$ac_ext >&5
6272 eval "$as_ac_Lib=no"
6273 fi
6274 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6275 LIBS=$ac_check_lib_save_LIBS
6276 fi
6277 echo "$as_me:6277: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6278 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6279 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6280   break
6281 fi
6282
6283     done
6284     test $cf_curs_lib = unknown && { { echo "$as_me:6284: error: no curses library found" >&5
6285 echo "$as_me: error: no curses library found" >&2;}
6286    { (exit 1); exit 1; }; }
6287
6288     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6289     if test "$cf_term_lib" = unknown ; then
6290         echo "$as_me:6290: checking if we can link with $cf_curs_lib library" >&5
6291 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6292         cat >conftest.$ac_ext <<_ACEOF
6293 #line 6293 "configure"
6294 #include "confdefs.h"
6295 #include <${cf_cv_ncurses_header:-curses.h}>
6296 int
6297 main ()
6298 {
6299 initscr()
6300   ;
6301   return 0;
6302 }
6303 _ACEOF
6304 rm -f conftest.$ac_objext conftest$ac_exeext
6305 if { (eval echo "$as_me:6305: \"$ac_link\"") >&5
6306   (eval $ac_link) 2>&5
6307   ac_status=$?
6308   echo "$as_me:6308: \$? = $ac_status" >&5
6309   (exit $ac_status); } &&
6310          { ac_try='test -s conftest$ac_exeext'
6311   { (eval echo "$as_me:6311: \"$ac_try\"") >&5
6312   (eval $ac_try) 2>&5
6313   ac_status=$?
6314   echo "$as_me:6314: \$? = $ac_status" >&5
6315   (exit $ac_status); }; }; then
6316   cf_result=yes
6317 else
6318   echo "$as_me: failed program was:" >&5
6319 cat conftest.$ac_ext >&5
6320 cf_result=no
6321 fi
6322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6323         echo "$as_me:6323: result: $cf_result" >&5
6324 echo "${ECHO_T}$cf_result" >&6
6325         test $cf_result = no && { { echo "$as_me:6325: error: Cannot link curses library" >&5
6326 echo "$as_me: error: Cannot link curses library" >&2;}
6327    { (exit 1); exit 1; }; }
6328     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6329         :
6330     elif test "$cf_term_lib" != predefined ; then
6331         echo "$as_me:6331: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6332 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6333         cat >conftest.$ac_ext <<_ACEOF
6334 #line 6334 "configure"
6335 #include "confdefs.h"
6336 #include <${cf_cv_ncurses_header:-curses.h}>
6337 int
6338 main ()
6339 {
6340 initscr(); tgoto((char *)0, 0, 0);
6341   ;
6342   return 0;
6343 }
6344 _ACEOF
6345 rm -f conftest.$ac_objext conftest$ac_exeext
6346 if { (eval echo "$as_me:6346: \"$ac_link\"") >&5
6347   (eval $ac_link) 2>&5
6348   ac_status=$?
6349   echo "$as_me:6349: \$? = $ac_status" >&5
6350   (exit $ac_status); } &&
6351          { ac_try='test -s conftest$ac_exeext'
6352   { (eval echo "$as_me:6352: \"$ac_try\"") >&5
6353   (eval $ac_try) 2>&5
6354   ac_status=$?
6355   echo "$as_me:6355: \$? = $ac_status" >&5
6356   (exit $ac_status); }; }; then
6357   cf_result=no
6358 else
6359   echo "$as_me: failed program was:" >&5
6360 cat conftest.$ac_ext >&5
6361
6362             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6363             cat >conftest.$ac_ext <<_ACEOF
6364 #line 6364 "configure"
6365 #include "confdefs.h"
6366 #include <${cf_cv_ncurses_header:-curses.h}>
6367 int
6368 main ()
6369 {
6370 initscr()
6371   ;
6372   return 0;
6373 }
6374 _ACEOF
6375 rm -f conftest.$ac_objext conftest$ac_exeext
6376 if { (eval echo "$as_me:6376: \"$ac_link\"") >&5
6377   (eval $ac_link) 2>&5
6378   ac_status=$?
6379   echo "$as_me:6379: \$? = $ac_status" >&5
6380   (exit $ac_status); } &&
6381          { ac_try='test -s conftest$ac_exeext'
6382   { (eval echo "$as_me:6382: \"$ac_try\"") >&5
6383   (eval $ac_try) 2>&5
6384   ac_status=$?
6385   echo "$as_me:6385: \$? = $ac_status" >&5
6386   (exit $ac_status); }; }; then
6387   cf_result=yes
6388 else
6389   echo "$as_me: failed program was:" >&5
6390 cat conftest.$ac_ext >&5
6391 cf_result=error
6392 fi
6393 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6394
6395 fi
6396 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6397         echo "$as_me:6397: result: $cf_result" >&5
6398 echo "${ECHO_T}$cf_result" >&6
6399     fi
6400 fi
6401 fi
6402
6403 echo "$as_me:6403: checking for NetBSD form.h" >&5
6404 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
6405 if test "${cf_cv_netbsd_form_h+set}" = set; then
6406   echo $ECHO_N "(cached) $ECHO_C" >&6
6407 else
6408
6409 cat >conftest.$ac_ext <<_ACEOF
6410 #line 6410 "configure"
6411 #include "confdefs.h"
6412
6413 #include <${cf_cv_ncurses_header:-curses.h}>
6414 #include <form.h>
6415
6416 int
6417 main ()
6418 {
6419
6420         FORM *form;
6421         int y = current_field(form)->cursor_ypos;
6422         int x = current_field(form)->cursor_xpos;
6423
6424   ;
6425   return 0;
6426 }
6427 _ACEOF
6428 rm -f conftest.$ac_objext
6429 if { (eval echo "$as_me:6429: \"$ac_compile\"") >&5
6430   (eval $ac_compile) 2>&5
6431   ac_status=$?
6432   echo "$as_me:6432: \$? = $ac_status" >&5
6433   (exit $ac_status); } &&
6434          { ac_try='test -s conftest.$ac_objext'
6435   { (eval echo "$as_me:6435: \"$ac_try\"") >&5
6436   (eval $ac_try) 2>&5
6437   ac_status=$?
6438   echo "$as_me:6438: \$? = $ac_status" >&5
6439   (exit $ac_status); }; }; then
6440   cf_cv_netbsd_form_h=yes
6441
6442 else
6443   echo "$as_me: failed program was:" >&5
6444 cat conftest.$ac_ext >&5
6445 cf_cv_netbsd_form_h=no
6446 fi
6447 rm -f conftest.$ac_objext conftest.$ac_ext
6448
6449 fi
6450 echo "$as_me:6450: result: $cf_cv_netbsd_form_h" >&5
6451 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
6452
6453 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
6454 #define HAVE_NETBSD_FORM_H 1
6455 EOF
6456
6457 echo "$as_me:6457: checking for NetBSD menu.h" >&5
6458 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
6459 if test "${cf_cv_netbsd_menu_h+set}" = set; then
6460   echo $ECHO_N "(cached) $ECHO_C" >&6
6461 else
6462
6463 cat >conftest.$ac_ext <<_ACEOF
6464 #line 6464 "configure"
6465 #include "confdefs.h"
6466
6467 #include <${cf_cv_ncurses_header:-curses.h}>
6468 #include <menu.h>
6469
6470 int
6471 main ()
6472 {
6473
6474         MENU *menu;
6475         int y = menu->max_item_width;
6476
6477   ;
6478   return 0;
6479 }
6480 _ACEOF
6481 rm -f conftest.$ac_objext
6482 if { (eval echo "$as_me:6482: \"$ac_compile\"") >&5
6483   (eval $ac_compile) 2>&5
6484   ac_status=$?
6485   echo "$as_me:6485: \$? = $ac_status" >&5
6486   (exit $ac_status); } &&
6487          { ac_try='test -s conftest.$ac_objext'
6488   { (eval echo "$as_me:6488: \"$ac_try\"") >&5
6489   (eval $ac_try) 2>&5
6490   ac_status=$?
6491   echo "$as_me:6491: \$? = $ac_status" >&5
6492   (exit $ac_status); }; }; then
6493   cf_cv_netbsd_menu_h=yes
6494
6495 else
6496   echo "$as_me: failed program was:" >&5
6497 cat conftest.$ac_ext >&5
6498 cf_cv_netbsd_menu_h=no
6499 fi
6500 rm -f conftest.$ac_objext conftest.$ac_ext
6501
6502 fi
6503 echo "$as_me:6503: result: $cf_cv_netbsd_menu_h" >&5
6504 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
6505
6506 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
6507 #define HAVE_NETBSD_MENU_H 1
6508 EOF
6509
6510         ;;
6511 ncurses)
6512
6513 cf_ncuconfig_root=ncurses
6514
6515 echo "Looking for ${cf_ncuconfig_root}-config"
6516
6517 if test -n "$ac_tool_prefix"; then
6518   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6519   do
6520     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6521 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6522 echo "$as_me:6522: checking for $ac_word" >&5
6523 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6524 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6525   echo $ECHO_N "(cached) $ECHO_C" >&6
6526 else
6527   if test -n "$NCURSES_CONFIG"; then
6528   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6529 else
6530   ac_save_IFS=$IFS; IFS=$ac_path_separator
6531 ac_dummy="$PATH"
6532 for ac_dir in $ac_dummy; do
6533   IFS=$ac_save_IFS
6534   test -z "$ac_dir" && ac_dir=.
6535   $as_executable_p "$ac_dir/$ac_word" || continue
6536 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6537 echo "$as_me:6537: found $ac_dir/$ac_word" >&5
6538 break
6539 done
6540
6541 fi
6542 fi
6543 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6544 if test -n "$NCURSES_CONFIG"; then
6545   echo "$as_me:6545: result: $NCURSES_CONFIG" >&5
6546 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6547 else
6548   echo "$as_me:6548: result: no" >&5
6549 echo "${ECHO_T}no" >&6
6550 fi
6551
6552     test -n "$NCURSES_CONFIG" && break
6553   done
6554 fi
6555 if test -z "$NCURSES_CONFIG"; then
6556   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6557   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6558 do
6559   # Extract the first word of "$ac_prog", so it can be a program name with args.
6560 set dummy $ac_prog; ac_word=$2
6561 echo "$as_me:6561: checking for $ac_word" >&5
6562 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6563 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6564   echo $ECHO_N "(cached) $ECHO_C" >&6
6565 else
6566   if test -n "$ac_ct_NCURSES_CONFIG"; then
6567   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6568 else
6569   ac_save_IFS=$IFS; IFS=$ac_path_separator
6570 ac_dummy="$PATH"
6571 for ac_dir in $ac_dummy; do
6572   IFS=$ac_save_IFS
6573   test -z "$ac_dir" && ac_dir=.
6574   $as_executable_p "$ac_dir/$ac_word" || continue
6575 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6576 echo "$as_me:6576: found $ac_dir/$ac_word" >&5
6577 break
6578 done
6579
6580 fi
6581 fi
6582 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6583 if test -n "$ac_ct_NCURSES_CONFIG"; then
6584   echo "$as_me:6584: result: $ac_ct_NCURSES_CONFIG" >&5
6585 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6586 else
6587   echo "$as_me:6587: result: no" >&5
6588 echo "${ECHO_T}no" >&6
6589 fi
6590
6591   test -n "$ac_ct_NCURSES_CONFIG" && break
6592 done
6593 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6594
6595   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6596 fi
6597
6598 if test "$NCURSES_CONFIG" != none ; then
6599
6600 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6601 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6602
6603 # even with config script, some packages use no-override for curses.h
6604
6605 echo "$as_me:6605: checking if we have identified curses headers" >&5
6606 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6607 if test "${cf_cv_ncurses_header+set}" = set; then
6608   echo $ECHO_N "(cached) $ECHO_C" >&6
6609 else
6610
6611 cf_cv_ncurses_header=none
6612 for cf_header in  \
6613     ncurses/ncurses.h \
6614         ncurses/curses.h \
6615         ncurses.h \
6616         curses.h
6617 do
6618 cat >conftest.$ac_ext <<_ACEOF
6619 #line 6619 "configure"
6620 #include "confdefs.h"
6621 #include <${cf_header}>
6622 int
6623 main ()
6624 {
6625 initscr(); tgoto("?", 0,0)
6626   ;
6627   return 0;
6628 }
6629 _ACEOF
6630 rm -f conftest.$ac_objext
6631 if { (eval echo "$as_me:6631: \"$ac_compile\"") >&5
6632   (eval $ac_compile) 2>&5
6633   ac_status=$?
6634   echo "$as_me:6634: \$? = $ac_status" >&5
6635   (exit $ac_status); } &&
6636          { ac_try='test -s conftest.$ac_objext'
6637   { (eval echo "$as_me:6637: \"$ac_try\"") >&5
6638   (eval $ac_try) 2>&5
6639   ac_status=$?
6640   echo "$as_me:6640: \$? = $ac_status" >&5
6641   (exit $ac_status); }; }; then
6642   cf_cv_ncurses_header=$cf_header; break
6643 else
6644   echo "$as_me: failed program was:" >&5
6645 cat conftest.$ac_ext >&5
6646 fi
6647 rm -f conftest.$ac_objext conftest.$ac_ext
6648 done
6649
6650 fi
6651 echo "$as_me:6651: result: $cf_cv_ncurses_header" >&5
6652 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6653
6654 if test "$cf_cv_ncurses_header" = none ; then
6655         { { echo "$as_me:6655: error: No curses header-files found" >&5
6656 echo "$as_me: error: No curses header-files found" >&2;}
6657    { (exit 1); exit 1; }; }
6658 fi
6659
6660 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6661
6662 for ac_header in $cf_cv_ncurses_header
6663 do
6664 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6665 echo "$as_me:6665: checking for $ac_header" >&5
6666 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6667 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6668   echo $ECHO_N "(cached) $ECHO_C" >&6
6669 else
6670   cat >conftest.$ac_ext <<_ACEOF
6671 #line 6671 "configure"
6672 #include "confdefs.h"
6673 #include <$ac_header>
6674 _ACEOF
6675 if { (eval echo "$as_me:6675: \"$ac_cpp conftest.$ac_ext\"") >&5
6676   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6677   ac_status=$?
6678   egrep -v '^ *\+' conftest.er1 >conftest.err
6679   rm -f conftest.er1
6680   cat conftest.err >&5
6681   echo "$as_me:6681: \$? = $ac_status" >&5
6682   (exit $ac_status); } >/dev/null; then
6683   if test -s conftest.err; then
6684     ac_cpp_err=$ac_c_preproc_warn_flag
6685   else
6686     ac_cpp_err=
6687   fi
6688 else
6689   ac_cpp_err=yes
6690 fi
6691 if test -z "$ac_cpp_err"; then
6692   eval "$as_ac_Header=yes"
6693 else
6694   echo "$as_me: failed program was:" >&5
6695   cat conftest.$ac_ext >&5
6696   eval "$as_ac_Header=no"
6697 fi
6698 rm -f conftest.err conftest.$ac_ext
6699 fi
6700 echo "$as_me:6700: result: `eval echo '${'$as_ac_Header'}'`" >&5
6701 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6702 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6703   cat >>confdefs.h <<EOF
6704 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6705 EOF
6706
6707 fi
6708 done
6709
6710 cat >>confdefs.h <<\EOF
6711 #define NCURSES 1
6712 EOF
6713
6714 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6715
6716 cat >>confdefs.h <<EOF
6717 #define $cf_nculib_ROOT 1
6718 EOF
6719
6720 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6721
6722 else
6723
6724 cf_ncuhdr_root=ncurses
6725
6726 test -n "$cf_cv_curses_dir" && \
6727 test "$cf_cv_curses_dir" != "no" && { \
6728
6729 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6730   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6731   do
6732         while test $cf_add_incdir != /usr/include
6733         do
6734           if test -d $cf_add_incdir
6735           then
6736                 cf_have_incdir=no
6737                 if test -n "$CFLAGS$CPPFLAGS" ; then
6738                   # a loop is needed to ensure we can add subdirs of existing dirs
6739                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6740                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6741                           cf_have_incdir=yes; break
6742                         fi
6743                   done
6744                 fi
6745
6746                 if test "$cf_have_incdir" = no ; then
6747                   if test "$cf_add_incdir" = /usr/local/include ; then
6748                         if test "$GCC" = yes
6749                         then
6750                           cf_save_CPPFLAGS=$CPPFLAGS
6751                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6752                           cat >conftest.$ac_ext <<_ACEOF
6753 #line 6753 "configure"
6754 #include "confdefs.h"
6755 #include <stdio.h>
6756 int
6757 main ()
6758 {
6759 printf("Hello")
6760   ;
6761   return 0;
6762 }
6763 _ACEOF
6764 rm -f conftest.$ac_objext
6765 if { (eval echo "$as_me:6765: \"$ac_compile\"") >&5
6766   (eval $ac_compile) 2>&5
6767   ac_status=$?
6768   echo "$as_me:6768: \$? = $ac_status" >&5
6769   (exit $ac_status); } &&
6770          { ac_try='test -s conftest.$ac_objext'
6771   { (eval echo "$as_me:6771: \"$ac_try\"") >&5
6772   (eval $ac_try) 2>&5
6773   ac_status=$?
6774   echo "$as_me:6774: \$? = $ac_status" >&5
6775   (exit $ac_status); }; }; then
6776   :
6777 else
6778   echo "$as_me: failed program was:" >&5
6779 cat conftest.$ac_ext >&5
6780 cf_have_incdir=yes
6781 fi
6782 rm -f conftest.$ac_objext conftest.$ac_ext
6783                           CPPFLAGS=$cf_save_CPPFLAGS
6784                         fi
6785                   fi
6786                 fi
6787
6788                 if test "$cf_have_incdir" = no ; then
6789                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6790
6791 echo "${as_me:-configure}:6791: testing adding $cf_add_incdir to include-path ..." 1>&5
6792
6793                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6794
6795                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6796                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6797                   cf_add_incdir="$cf_top_incdir"
6798                 else
6799                   break
6800                 fi
6801           fi
6802         done
6803   done
6804 fi
6805
6806 }
6807
6808 echo "$as_me:6808: checking for $cf_ncuhdr_root header in include-path" >&5
6809 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6810 if test "${cf_cv_ncurses_h+set}" = set; then
6811   echo $ECHO_N "(cached) $ECHO_C" >&6
6812 else
6813
6814         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6815         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6816         for cf_header in $cf_header_list
6817         do
6818
6819         cat >conftest.$ac_ext <<_ACEOF
6820 #line 6820 "configure"
6821 #include "confdefs.h"
6822
6823 #include <$cf_header>
6824 int
6825 main ()
6826 {
6827
6828 #ifdef NCURSES_VERSION
6829
6830 printf("%s\n", NCURSES_VERSION);
6831 #else
6832 #ifdef __NCURSES_H
6833 printf("old\n");
6834 #else
6835         make an error
6836 #endif
6837 #endif
6838
6839   ;
6840   return 0;
6841 }
6842 _ACEOF
6843 rm -f conftest.$ac_objext
6844 if { (eval echo "$as_me:6844: \"$ac_compile\"") >&5
6845   (eval $ac_compile) 2>&5
6846   ac_status=$?
6847   echo "$as_me:6847: \$? = $ac_status" >&5
6848   (exit $ac_status); } &&
6849          { ac_try='test -s conftest.$ac_objext'
6850   { (eval echo "$as_me:6850: \"$ac_try\"") >&5
6851   (eval $ac_try) 2>&5
6852   ac_status=$?
6853   echo "$as_me:6853: \$? = $ac_status" >&5
6854   (exit $ac_status); }; }; then
6855   cf_cv_ncurses_h=$cf_header
6856
6857 else
6858   echo "$as_me: failed program was:" >&5
6859 cat conftest.$ac_ext >&5
6860 cf_cv_ncurses_h=no
6861 fi
6862 rm -f conftest.$ac_objext conftest.$ac_ext
6863
6864                 test "$cf_cv_ncurses_h" != no && break
6865         done
6866
6867 fi
6868 echo "$as_me:6868: result: $cf_cv_ncurses_h" >&5
6869 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6870
6871 if test "$cf_cv_ncurses_h" != no ; then
6872         cf_cv_ncurses_header=$cf_cv_ncurses_h
6873 else
6874
6875 echo "$as_me:6875: checking for $cf_ncuhdr_root include-path" >&5
6876 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6877 if test "${cf_cv_ncurses_h2+set}" = set; then
6878   echo $ECHO_N "(cached) $ECHO_C" >&6
6879 else
6880
6881         test -n "$verbose" && echo
6882
6883 cf_search=
6884
6885 # collect the current set of include-directories from compiler flags
6886 cf_header_path_list=""
6887 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6888         for cf_header_path in $CPPFLAGS $CFLAGS
6889         do
6890                 case $cf_header_path in #(vi
6891                 -I*)
6892                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6893
6894 test "$cf_header_path" != "NONE" && \
6895 test -d "$cf_header_path" && \
6896  {
6897         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6898         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6899         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6900         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6901         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6902         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"
6903 }
6904
6905                         cf_header_path_list="$cf_header_path_list $cf_search"
6906                         ;;
6907                 esac
6908         done
6909 fi
6910
6911 # add the variations for the package we are looking for
6912
6913 cf_search=
6914
6915 test "/usr" != "$prefix" && \
6916 test -d "/usr" && \
6917 (test $prefix = NONE || test "/usr" != "$prefix") && {
6918         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6919         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6920         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6921         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6922         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6923         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6924 }
6925
6926 test "$prefix" != "NONE" && \
6927 test -d "$prefix" && \
6928  {
6929         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6930         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6931         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6932         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6933         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6934         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6935 }
6936
6937 test "/usr/local" != "$prefix" && \
6938 test -d "/usr/local" && \
6939 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6940         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6941         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6942         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6943         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6944         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6945         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6946 }
6947
6948 test "/opt" != "$prefix" && \
6949 test -d "/opt" && \
6950 (test $prefix = NONE || test "/opt" != "$prefix") && {
6951         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6952         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6953         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6954         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6955         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6956         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6957 }
6958
6959 test "$HOME" != "$prefix" && \
6960 test -d "$HOME" && \
6961 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6962         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6963         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6964         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6965         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6966         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6967         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6968 }
6969
6970 test "$includedir" != NONE && \
6971 test "$includedir" != "/usr/include" && \
6972 test -d "$includedir" && {
6973         test -d $includedir &&    cf_search="$cf_search $includedir"
6974         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6975 }
6976
6977 test "$oldincludedir" != NONE && \
6978 test "$oldincludedir" != "/usr/include" && \
6979 test -d "$oldincludedir" && {
6980         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6981         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6982 }
6983
6984 cf_search="$cf_search $cf_header_path_list"
6985
6986         test -n "$verbose" && echo search path $cf_search
6987         cf_save2_CPPFLAGS="$CPPFLAGS"
6988         for cf_incdir in $cf_search
6989         do
6990
6991 if test -n "$cf_incdir" ; then
6992   for cf_add_incdir in $cf_incdir
6993   do
6994         while test $cf_add_incdir != /usr/include
6995         do
6996           if test -d $cf_add_incdir
6997           then
6998                 cf_have_incdir=no
6999                 if test -n "$CFLAGS$CPPFLAGS" ; then
7000                   # a loop is needed to ensure we can add subdirs of existing dirs
7001                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7002                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7003                           cf_have_incdir=yes; break
7004                         fi
7005                   done
7006                 fi
7007
7008                 if test "$cf_have_incdir" = no ; then
7009                   if test "$cf_add_incdir" = /usr/local/include ; then
7010                         if test "$GCC" = yes
7011                         then
7012                           cf_save_CPPFLAGS=$CPPFLAGS
7013                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7014                           cat >conftest.$ac_ext <<_ACEOF
7015 #line 7015 "configure"
7016 #include "confdefs.h"
7017 #include <stdio.h>
7018 int
7019 main ()
7020 {
7021 printf("Hello")
7022   ;
7023   return 0;
7024 }
7025 _ACEOF
7026 rm -f conftest.$ac_objext
7027 if { (eval echo "$as_me:7027: \"$ac_compile\"") >&5
7028   (eval $ac_compile) 2>&5
7029   ac_status=$?
7030   echo "$as_me:7030: \$? = $ac_status" >&5
7031   (exit $ac_status); } &&
7032          { ac_try='test -s conftest.$ac_objext'
7033   { (eval echo "$as_me:7033: \"$ac_try\"") >&5
7034   (eval $ac_try) 2>&5
7035   ac_status=$?
7036   echo "$as_me:7036: \$? = $ac_status" >&5
7037   (exit $ac_status); }; }; then
7038   :
7039 else
7040   echo "$as_me: failed program was:" >&5
7041 cat conftest.$ac_ext >&5
7042 cf_have_incdir=yes
7043 fi
7044 rm -f conftest.$ac_objext conftest.$ac_ext
7045                           CPPFLAGS=$cf_save_CPPFLAGS
7046                         fi
7047                   fi
7048                 fi
7049
7050                 if test "$cf_have_incdir" = no ; then
7051                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7052
7053 echo "${as_me:-configure}:7053: testing adding $cf_add_incdir to include-path ..." 1>&5
7054
7055                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7056
7057                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7058                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7059                   cf_add_incdir="$cf_top_incdir"
7060                 else
7061                   break
7062                 fi
7063           fi
7064         done
7065   done
7066 fi
7067
7068                 for cf_header in \
7069                         ncurses.h \
7070                         curses.h
7071                 do
7072
7073         cat >conftest.$ac_ext <<_ACEOF
7074 #line 7074 "configure"
7075 #include "confdefs.h"
7076
7077 #include <$cf_header>
7078 int
7079 main ()
7080 {
7081
7082 #ifdef NCURSES_VERSION
7083
7084 printf("%s\n", NCURSES_VERSION);
7085 #else
7086 #ifdef __NCURSES_H
7087 printf("old\n");
7088 #else
7089         make an error
7090 #endif
7091 #endif
7092
7093   ;
7094   return 0;
7095 }
7096 _ACEOF
7097 rm -f conftest.$ac_objext
7098 if { (eval echo "$as_me:7098: \"$ac_compile\"") >&5
7099   (eval $ac_compile) 2>&5
7100   ac_status=$?
7101   echo "$as_me:7101: \$? = $ac_status" >&5
7102   (exit $ac_status); } &&
7103          { ac_try='test -s conftest.$ac_objext'
7104   { (eval echo "$as_me:7104: \"$ac_try\"") >&5
7105   (eval $ac_try) 2>&5
7106   ac_status=$?
7107   echo "$as_me:7107: \$? = $ac_status" >&5
7108   (exit $ac_status); }; }; then
7109   cf_cv_ncurses_h2=$cf_header
7110
7111 else
7112   echo "$as_me: failed program was:" >&5
7113 cat conftest.$ac_ext >&5
7114 cf_cv_ncurses_h2=no
7115 fi
7116 rm -f conftest.$ac_objext conftest.$ac_ext
7117
7118                         if test "$cf_cv_ncurses_h2" != no ; then
7119                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7120                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7121                                 break
7122                         fi
7123                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7124                 done
7125                 CPPFLAGS="$cf_save2_CPPFLAGS"
7126                 test "$cf_cv_ncurses_h2" != no && break
7127         done
7128         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7128: error: not found" >&5
7129 echo "$as_me: error: not found" >&2;}
7130    { (exit 1); exit 1; }; }
7131
7132 fi
7133 echo "$as_me:7133: result: $cf_cv_ncurses_h2" >&5
7134 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7135
7136         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7137         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7138         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7139                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7140         fi
7141
7142 if test -n "$cf_1st_incdir" ; then
7143   for cf_add_incdir in $cf_1st_incdir
7144   do
7145         while test $cf_add_incdir != /usr/include
7146         do
7147           if test -d $cf_add_incdir
7148           then
7149                 cf_have_incdir=no
7150                 if test -n "$CFLAGS$CPPFLAGS" ; then
7151                   # a loop is needed to ensure we can add subdirs of existing dirs
7152                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7153                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7154                           cf_have_incdir=yes; break
7155                         fi
7156                   done
7157                 fi
7158
7159                 if test "$cf_have_incdir" = no ; then
7160                   if test "$cf_add_incdir" = /usr/local/include ; then
7161                         if test "$GCC" = yes
7162                         then
7163                           cf_save_CPPFLAGS=$CPPFLAGS
7164                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7165                           cat >conftest.$ac_ext <<_ACEOF
7166 #line 7166 "configure"
7167 #include "confdefs.h"
7168 #include <stdio.h>
7169 int
7170 main ()
7171 {
7172 printf("Hello")
7173   ;
7174   return 0;
7175 }
7176 _ACEOF
7177 rm -f conftest.$ac_objext
7178 if { (eval echo "$as_me:7178: \"$ac_compile\"") >&5
7179   (eval $ac_compile) 2>&5
7180   ac_status=$?
7181   echo "$as_me:7181: \$? = $ac_status" >&5
7182   (exit $ac_status); } &&
7183          { ac_try='test -s conftest.$ac_objext'
7184   { (eval echo "$as_me:7184: \"$ac_try\"") >&5
7185   (eval $ac_try) 2>&5
7186   ac_status=$?
7187   echo "$as_me:7187: \$? = $ac_status" >&5
7188   (exit $ac_status); }; }; then
7189   :
7190 else
7191   echo "$as_me: failed program was:" >&5
7192 cat conftest.$ac_ext >&5
7193 cf_have_incdir=yes
7194 fi
7195 rm -f conftest.$ac_objext conftest.$ac_ext
7196                           CPPFLAGS=$cf_save_CPPFLAGS
7197                         fi
7198                   fi
7199                 fi
7200
7201                 if test "$cf_have_incdir" = no ; then
7202                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7203
7204 echo "${as_me:-configure}:7204: testing adding $cf_add_incdir to include-path ..." 1>&5
7205
7206                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7207
7208                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7209                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7210                   cf_add_incdir="$cf_top_incdir"
7211                 else
7212                   break
7213                 fi
7214           fi
7215         done
7216   done
7217 fi
7218
7219 fi
7220
7221 # Set definitions to allow ifdef'ing for ncurses.h
7222
7223 case $cf_cv_ncurses_header in # (vi
7224 *ncurses.h)
7225         cat >>confdefs.h <<\EOF
7226 #define HAVE_NCURSES_H 1
7227 EOF
7228
7229         ;;
7230 esac
7231
7232 case $cf_cv_ncurses_header in # (vi
7233 ncurses/curses.h|ncurses/ncurses.h)
7234         cat >>confdefs.h <<\EOF
7235 #define HAVE_NCURSES_NCURSES_H 1
7236 EOF
7237
7238         ;;
7239 ncursesw/curses.h|ncursesw/ncurses.h)
7240         cat >>confdefs.h <<\EOF
7241 #define HAVE_NCURSESW_NCURSES_H 1
7242 EOF
7243
7244         ;;
7245 esac
7246
7247 echo "$as_me:7247: checking for terminfo header" >&5
7248 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7249 if test "${cf_cv_term_header+set}" = set; then
7250   echo $ECHO_N "(cached) $ECHO_C" >&6
7251 else
7252
7253 case ${cf_cv_ncurses_header} in #(vi
7254 */ncurses.h|*/ncursesw.h) #(vi
7255         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7256         ;;
7257 *)
7258         cf_term_header=term.h
7259         ;;
7260 esac
7261
7262 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7263 do
7264 cat >conftest.$ac_ext <<_ACEOF
7265 #line 7265 "configure"
7266 #include "confdefs.h"
7267 #include <stdio.h>
7268 #include <${cf_cv_ncurses_header:-curses.h}>
7269 #include <$cf_test>
7270
7271 int
7272 main ()
7273 {
7274 int x = auto_left_margin
7275   ;
7276   return 0;
7277 }
7278 _ACEOF
7279 rm -f conftest.$ac_objext
7280 if { (eval echo "$as_me:7280: \"$ac_compile\"") >&5
7281   (eval $ac_compile) 2>&5
7282   ac_status=$?
7283   echo "$as_me:7283: \$? = $ac_status" >&5
7284   (exit $ac_status); } &&
7285          { ac_try='test -s conftest.$ac_objext'
7286   { (eval echo "$as_me:7286: \"$ac_try\"") >&5
7287   (eval $ac_try) 2>&5
7288   ac_status=$?
7289   echo "$as_me:7289: \$? = $ac_status" >&5
7290   (exit $ac_status); }; }; then
7291
7292         cf_cv_term_header="$cf_test"
7293 else
7294   echo "$as_me: failed program was:" >&5
7295 cat conftest.$ac_ext >&5
7296
7297         cf_cv_term_header=unknown
7298
7299 fi
7300 rm -f conftest.$ac_objext conftest.$ac_ext
7301         test "$cf_cv_term_header" != unknown && break
7302 done
7303
7304 fi
7305 echo "$as_me:7305: result: $cf_cv_term_header" >&5
7306 echo "${ECHO_T}$cf_cv_term_header" >&6
7307
7308 # Set definitions to allow ifdef'ing to accommodate subdirectories
7309
7310 case $cf_cv_term_header in # (vi
7311 *term.h)
7312         cat >>confdefs.h <<\EOF
7313 #define HAVE_TERM_H 1
7314 EOF
7315
7316         ;;
7317 esac
7318
7319 case $cf_cv_term_header in # (vi
7320 ncurses/term.h) #(vi
7321         cat >>confdefs.h <<\EOF
7322 #define HAVE_NCURSES_TERM_H 1
7323 EOF
7324
7325         ;;
7326 ncursesw/term.h)
7327         cat >>confdefs.h <<\EOF
7328 #define HAVE_NCURSESW_TERM_H 1
7329 EOF
7330
7331         ;;
7332 esac
7333
7334 # some applications need this, but should check for NCURSES_VERSION
7335 cat >>confdefs.h <<\EOF
7336 #define NCURSES 1
7337 EOF
7338
7339 echo "$as_me:7339: checking for ncurses version" >&5
7340 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7341 if test "${cf_cv_ncurses_version+set}" = set; then
7342   echo $ECHO_N "(cached) $ECHO_C" >&6
7343 else
7344
7345         cf_cv_ncurses_version=no
7346         cf_tempfile=out$$
7347         rm -f $cf_tempfile
7348         if test "$cross_compiling" = yes; then
7349
7350         # This will not work if the preprocessor splits the line after the
7351         # Autoconf token.  The 'unproto' program does that.
7352         cat > conftest.$ac_ext <<EOF
7353 #include <${cf_cv_ncurses_header:-curses.h}>
7354 #undef Autoconf
7355 #ifdef NCURSES_VERSION
7356 Autoconf NCURSES_VERSION
7357 #else
7358 #ifdef __NCURSES_H
7359 Autoconf "old"
7360 #endif
7361 ;
7362 #endif
7363 EOF
7364         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7365         { (eval echo "$as_me:7365: \"$cf_try\"") >&5
7366   (eval $cf_try) 2>&5
7367   ac_status=$?
7368   echo "$as_me:7368: \$? = $ac_status" >&5
7369   (exit $ac_status); }
7370         if test -f conftest.out ; then
7371                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7372                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7373                 rm -f conftest.out
7374         fi
7375
7376 else
7377   cat >conftest.$ac_ext <<_ACEOF
7378 #line 7378 "configure"
7379 #include "confdefs.h"
7380
7381 #include <${cf_cv_ncurses_header:-curses.h}>
7382 #include <stdio.h>
7383 int main()
7384 {
7385         FILE *fp = fopen("$cf_tempfile", "w");
7386 #ifdef NCURSES_VERSION
7387 # ifdef NCURSES_VERSION_PATCH
7388         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7389 # else
7390         fprintf(fp, "%s\n", NCURSES_VERSION);
7391 # endif
7392 #else
7393 # ifdef __NCURSES_H
7394         fprintf(fp, "old\n");
7395 # else
7396         make an error
7397 # endif
7398 #endif
7399         ${cf_cv_main_return:-return}(0);
7400 }
7401 _ACEOF
7402 rm -f conftest$ac_exeext
7403 if { (eval echo "$as_me:7403: \"$ac_link\"") >&5
7404   (eval $ac_link) 2>&5
7405   ac_status=$?
7406   echo "$as_me:7406: \$? = $ac_status" >&5
7407   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7408   { (eval echo "$as_me:7408: \"$ac_try\"") >&5
7409   (eval $ac_try) 2>&5
7410   ac_status=$?
7411   echo "$as_me:7411: \$? = $ac_status" >&5
7412   (exit $ac_status); }; }; then
7413
7414         cf_cv_ncurses_version=`cat $cf_tempfile`
7415 else
7416   echo "$as_me: program exited with status $ac_status" >&5
7417 echo "$as_me: failed program was:" >&5
7418 cat conftest.$ac_ext >&5
7419 fi
7420 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7421 fi
7422         rm -f $cf_tempfile
7423
7424 fi
7425 echo "$as_me:7425: result: $cf_cv_ncurses_version" >&5
7426 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7427 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7428 #define NCURSES 1
7429 EOF
7430
7431 cf_nculib_root=ncurses
7432         # This works, except for the special case where we find gpm, but
7433         # ncurses is in a nonstandard location via $LIBS, and we really want
7434         # to link gpm.
7435 cf_ncurses_LIBS=""
7436 cf_ncurses_SAVE="$LIBS"
7437 echo "$as_me:7437: checking for Gpm_Open in -lgpm" >&5
7438 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7439 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7440   echo $ECHO_N "(cached) $ECHO_C" >&6
7441 else
7442   ac_check_lib_save_LIBS=$LIBS
7443 LIBS="-lgpm  $LIBS"
7444 cat >conftest.$ac_ext <<_ACEOF
7445 #line 7445 "configure"
7446 #include "confdefs.h"
7447
7448 /* Override any gcc2 internal prototype to avoid an error.  */
7449 #ifdef __cplusplus
7450 extern "C"
7451 #endif
7452 /* We use char because int might match the return type of a gcc2
7453    builtin and then its argument prototype would still apply.  */
7454 char Gpm_Open ();
7455 int
7456 main ()
7457 {
7458 Gpm_Open ();
7459   ;
7460   return 0;
7461 }
7462 _ACEOF
7463 rm -f conftest.$ac_objext conftest$ac_exeext
7464 if { (eval echo "$as_me:7464: \"$ac_link\"") >&5
7465   (eval $ac_link) 2>&5
7466   ac_status=$?
7467   echo "$as_me:7467: \$? = $ac_status" >&5
7468   (exit $ac_status); } &&
7469          { ac_try='test -s conftest$ac_exeext'
7470   { (eval echo "$as_me:7470: \"$ac_try\"") >&5
7471   (eval $ac_try) 2>&5
7472   ac_status=$?
7473   echo "$as_me:7473: \$? = $ac_status" >&5
7474   (exit $ac_status); }; }; then
7475   ac_cv_lib_gpm_Gpm_Open=yes
7476 else
7477   echo "$as_me: failed program was:" >&5
7478 cat conftest.$ac_ext >&5
7479 ac_cv_lib_gpm_Gpm_Open=no
7480 fi
7481 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7482 LIBS=$ac_check_lib_save_LIBS
7483 fi
7484 echo "$as_me:7484: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7485 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7486 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7487   echo "$as_me:7487: checking for initscr in -lgpm" >&5
7488 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7489 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7490   echo $ECHO_N "(cached) $ECHO_C" >&6
7491 else
7492   ac_check_lib_save_LIBS=$LIBS
7493 LIBS="-lgpm  $LIBS"
7494 cat >conftest.$ac_ext <<_ACEOF
7495 #line 7495 "configure"
7496 #include "confdefs.h"
7497
7498 /* Override any gcc2 internal prototype to avoid an error.  */
7499 #ifdef __cplusplus
7500 extern "C"
7501 #endif
7502 /* We use char because int might match the return type of a gcc2
7503    builtin and then its argument prototype would still apply.  */
7504 char initscr ();
7505 int
7506 main ()
7507 {
7508 initscr ();
7509   ;
7510   return 0;
7511 }
7512 _ACEOF
7513 rm -f conftest.$ac_objext conftest$ac_exeext
7514 if { (eval echo "$as_me:7514: \"$ac_link\"") >&5
7515   (eval $ac_link) 2>&5
7516   ac_status=$?
7517   echo "$as_me:7517: \$? = $ac_status" >&5
7518   (exit $ac_status); } &&
7519          { ac_try='test -s conftest$ac_exeext'
7520   { (eval echo "$as_me:7520: \"$ac_try\"") >&5
7521   (eval $ac_try) 2>&5
7522   ac_status=$?
7523   echo "$as_me:7523: \$? = $ac_status" >&5
7524   (exit $ac_status); }; }; then
7525   ac_cv_lib_gpm_initscr=yes
7526 else
7527   echo "$as_me: failed program was:" >&5
7528 cat conftest.$ac_ext >&5
7529 ac_cv_lib_gpm_initscr=no
7530 fi
7531 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7532 LIBS=$ac_check_lib_save_LIBS
7533 fi
7534 echo "$as_me:7534: result: $ac_cv_lib_gpm_initscr" >&5
7535 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7536 if test $ac_cv_lib_gpm_initscr = yes; then
7537   LIBS="$cf_ncurses_SAVE"
7538 else
7539   cf_ncurses_LIBS="-lgpm"
7540 fi
7541
7542 fi
7543
7544 case $host_os in #(vi
7545 freebsd*)
7546         # This is only necessary if you are linking against an obsolete
7547         # version of ncurses (but it should do no harm, since it's static).
7548         if test "$cf_nculib_root" = ncurses ; then
7549                 echo "$as_me:7549: checking for tgoto in -lmytinfo" >&5
7550 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7551 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7552   echo $ECHO_N "(cached) $ECHO_C" >&6
7553 else
7554   ac_check_lib_save_LIBS=$LIBS
7555 LIBS="-lmytinfo  $LIBS"
7556 cat >conftest.$ac_ext <<_ACEOF
7557 #line 7557 "configure"
7558 #include "confdefs.h"
7559
7560 /* Override any gcc2 internal prototype to avoid an error.  */
7561 #ifdef __cplusplus
7562 extern "C"
7563 #endif
7564 /* We use char because int might match the return type of a gcc2
7565    builtin and then its argument prototype would still apply.  */
7566 char tgoto ();
7567 int
7568 main ()
7569 {
7570 tgoto ();
7571   ;
7572   return 0;
7573 }
7574 _ACEOF
7575 rm -f conftest.$ac_objext conftest$ac_exeext
7576 if { (eval echo "$as_me:7576: \"$ac_link\"") >&5
7577   (eval $ac_link) 2>&5
7578   ac_status=$?
7579   echo "$as_me:7579: \$? = $ac_status" >&5
7580   (exit $ac_status); } &&
7581          { ac_try='test -s conftest$ac_exeext'
7582   { (eval echo "$as_me:7582: \"$ac_try\"") >&5
7583   (eval $ac_try) 2>&5
7584   ac_status=$?
7585   echo "$as_me:7585: \$? = $ac_status" >&5
7586   (exit $ac_status); }; }; then
7587   ac_cv_lib_mytinfo_tgoto=yes
7588 else
7589   echo "$as_me: failed program was:" >&5
7590 cat conftest.$ac_ext >&5
7591 ac_cv_lib_mytinfo_tgoto=no
7592 fi
7593 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7594 LIBS=$ac_check_lib_save_LIBS
7595 fi
7596 echo "$as_me:7596: result: $ac_cv_lib_mytinfo_tgoto" >&5
7597 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7598 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7599   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7600 fi
7601
7602         fi
7603         ;;
7604 esac
7605
7606 LIBS="$cf_ncurses_LIBS $LIBS"
7607
7608 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7609 then
7610         LIBS="-l$cf_nculib_root $LIBS"
7611 else
7612
7613         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7614         cf_libdir=""
7615         echo "$as_me:7615: checking for initscr" >&5
7616 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7617 if test "${ac_cv_func_initscr+set}" = set; then
7618   echo $ECHO_N "(cached) $ECHO_C" >&6
7619 else
7620   cat >conftest.$ac_ext <<_ACEOF
7621 #line 7621 "configure"
7622 #include "confdefs.h"
7623 /* System header to define __stub macros and hopefully few prototypes,
7624     which can conflict with char initscr (); below.  */
7625 #include <assert.h>
7626 /* Override any gcc2 internal prototype to avoid an error.  */
7627 #ifdef __cplusplus
7628 extern "C"
7629 #endif
7630 /* We use char because int might match the return type of a gcc2
7631    builtin and then its argument prototype would still apply.  */
7632 char initscr ();
7633 char (*f) ();
7634
7635 int
7636 main ()
7637 {
7638 /* The GNU C library defines this for functions which it implements
7639     to always fail with ENOSYS.  Some functions are actually named
7640     something starting with __ and the normal name is an alias.  */
7641 #if defined (__stub_initscr) || defined (__stub___initscr)
7642 choke me
7643 #else
7644 f = initscr;
7645 #endif
7646
7647   ;
7648   return 0;
7649 }
7650 _ACEOF
7651 rm -f conftest.$ac_objext conftest$ac_exeext
7652 if { (eval echo "$as_me:7652: \"$ac_link\"") >&5
7653   (eval $ac_link) 2>&5
7654   ac_status=$?
7655   echo "$as_me:7655: \$? = $ac_status" >&5
7656   (exit $ac_status); } &&
7657          { ac_try='test -s conftest$ac_exeext'
7658   { (eval echo "$as_me:7658: \"$ac_try\"") >&5
7659   (eval $ac_try) 2>&5
7660   ac_status=$?
7661   echo "$as_me:7661: \$? = $ac_status" >&5
7662   (exit $ac_status); }; }; then
7663   ac_cv_func_initscr=yes
7664 else
7665   echo "$as_me: failed program was:" >&5
7666 cat conftest.$ac_ext >&5
7667 ac_cv_func_initscr=no
7668 fi
7669 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7670 fi
7671 echo "$as_me:7671: result: $ac_cv_func_initscr" >&5
7672 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7673 if test $ac_cv_func_initscr = yes; then
7674   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7675 else
7676
7677                 cf_save_LIBS="$LIBS"
7678                 echo "$as_me:7678: checking for initscr in -l$cf_nculib_root" >&5
7679 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7680                 LIBS="-l$cf_nculib_root $LIBS"
7681                 cat >conftest.$ac_ext <<_ACEOF
7682 #line 7682 "configure"
7683 #include "confdefs.h"
7684 #include <${cf_cv_ncurses_header:-curses.h}>
7685 int
7686 main ()
7687 {
7688 initscr()
7689   ;
7690   return 0;
7691 }
7692 _ACEOF
7693 rm -f conftest.$ac_objext conftest$ac_exeext
7694 if { (eval echo "$as_me:7694: \"$ac_link\"") >&5
7695   (eval $ac_link) 2>&5
7696   ac_status=$?
7697   echo "$as_me:7697: \$? = $ac_status" >&5
7698   (exit $ac_status); } &&
7699          { ac_try='test -s conftest$ac_exeext'
7700   { (eval echo "$as_me:7700: \"$ac_try\"") >&5
7701   (eval $ac_try) 2>&5
7702   ac_status=$?
7703   echo "$as_me:7703: \$? = $ac_status" >&5
7704   (exit $ac_status); }; }; then
7705   echo "$as_me:7705: result: yes" >&5
7706 echo "${ECHO_T}yes" >&6
7707                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7708
7709 else
7710   echo "$as_me: failed program was:" >&5
7711 cat conftest.$ac_ext >&5
7712 echo "$as_me:7712: result: no" >&5
7713 echo "${ECHO_T}no" >&6
7714
7715 cf_search=
7716 cf_library_path_list=""
7717 if test -n "${LDFLAGS}${LIBS}" ; then
7718         for cf_library_path in $LDFLAGS $LIBS
7719         do
7720                 case $cf_library_path in #(vi
7721                 -L*)
7722                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7723
7724 test "$cf_library_path" != "NONE" && \
7725 test -d "$cf_library_path" && \
7726  {
7727         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7728         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7729         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7730         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7731         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7732         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"
7733 }
7734
7735                         cf_library_path_list="$cf_library_path_list $cf_search"
7736                         ;;
7737                 esac
7738         done
7739 fi
7740
7741 cf_search=
7742
7743 test "/usr" != "$prefix" && \
7744 test -d "/usr" && \
7745 (test $prefix = NONE || test "/usr" != "$prefix") && {
7746         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7747         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7748         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7749         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7750         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7751         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7752 }
7753
7754 test "$prefix" != "NONE" && \
7755 test -d "$prefix" && \
7756  {
7757         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7758         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7759         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7760         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7761         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7762         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7763 }
7764
7765 test "/usr/local" != "$prefix" && \
7766 test -d "/usr/local" && \
7767 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7768         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7769         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7770         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7771         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7772         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7773         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7774 }
7775
7776 test "/opt" != "$prefix" && \
7777 test -d "/opt" && \
7778 (test $prefix = NONE || test "/opt" != "$prefix") && {
7779         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7780         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7781         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7782         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7783         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7784         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7785 }
7786
7787 test "$HOME" != "$prefix" && \
7788 test -d "$HOME" && \
7789 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7790         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7791         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7792         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7793         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7794         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7795         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7796 }
7797
7798 cf_search="$cf_library_path_list $cf_search"
7799
7800                         for cf_libdir in $cf_search
7801                         do
7802                                 echo "$as_me:7802: checking for -l$cf_nculib_root in $cf_libdir" >&5
7803 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7804                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7805                                 cat >conftest.$ac_ext <<_ACEOF
7806 #line 7806 "configure"
7807 #include "confdefs.h"
7808 #include <${cf_cv_ncurses_header:-curses.h}>
7809 int
7810 main ()
7811 {
7812 initscr()
7813   ;
7814   return 0;
7815 }
7816 _ACEOF
7817 rm -f conftest.$ac_objext conftest$ac_exeext
7818 if { (eval echo "$as_me:7818: \"$ac_link\"") >&5
7819   (eval $ac_link) 2>&5
7820   ac_status=$?
7821   echo "$as_me:7821: \$? = $ac_status" >&5
7822   (exit $ac_status); } &&
7823          { ac_try='test -s conftest$ac_exeext'
7824   { (eval echo "$as_me:7824: \"$ac_try\"") >&5
7825   (eval $ac_try) 2>&5
7826   ac_status=$?
7827   echo "$as_me:7827: \$? = $ac_status" >&5
7828   (exit $ac_status); }; }; then
7829   echo "$as_me:7829: result: yes" >&5
7830 echo "${ECHO_T}yes" >&6
7831                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7832                                          break
7833 else
7834   echo "$as_me: failed program was:" >&5
7835 cat conftest.$ac_ext >&5
7836 echo "$as_me:7836: result: no" >&5
7837 echo "${ECHO_T}no" >&6
7838                                          LIBS="$cf_save_LIBS"
7839 fi
7840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7841                         done
7842
7843 fi
7844 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7845
7846 fi
7847
7848 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7849
7850 if test $cf_found_library = no ; then
7851         { { echo "$as_me:7851: error: Cannot link $cf_nculib_root library" >&5
7852 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7853    { (exit 1); exit 1; }; }
7854 fi
7855
7856 fi
7857
7858 if test -n "$cf_ncurses_LIBS" ; then
7859         echo "$as_me:7859: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7860 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7861         cf_ncurses_SAVE="$LIBS"
7862         for p in $cf_ncurses_LIBS ; do
7863                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7864                 if test "$q" != "$LIBS" ; then
7865                         LIBS="$q"
7866                 fi
7867         done
7868         cat >conftest.$ac_ext <<_ACEOF
7869 #line 7869 "configure"
7870 #include "confdefs.h"
7871 #include <${cf_cv_ncurses_header:-curses.h}>
7872 int
7873 main ()
7874 {
7875 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7876   ;
7877   return 0;
7878 }
7879 _ACEOF
7880 rm -f conftest.$ac_objext conftest$ac_exeext
7881 if { (eval echo "$as_me:7881: \"$ac_link\"") >&5
7882   (eval $ac_link) 2>&5
7883   ac_status=$?
7884   echo "$as_me:7884: \$? = $ac_status" >&5
7885   (exit $ac_status); } &&
7886          { ac_try='test -s conftest$ac_exeext'
7887   { (eval echo "$as_me:7887: \"$ac_try\"") >&5
7888   (eval $ac_try) 2>&5
7889   ac_status=$?
7890   echo "$as_me:7890: \$? = $ac_status" >&5
7891   (exit $ac_status); }; }; then
7892   echo "$as_me:7892: result: yes" >&5
7893 echo "${ECHO_T}yes" >&6
7894 else
7895   echo "$as_me: failed program was:" >&5
7896 cat conftest.$ac_ext >&5
7897 echo "$as_me:7897: result: no" >&5
7898 echo "${ECHO_T}no" >&6
7899                  LIBS="$cf_ncurses_SAVE"
7900 fi
7901 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7902 fi
7903
7904 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7905
7906 cat >>confdefs.h <<EOF
7907 #define $cf_nculib_ROOT 1
7908 EOF
7909
7910 fi
7911
7912         ;;
7913 ncursesw)
7914         cf_cv_libtype=w
7915
7916 echo "$as_me:7916: checking for multibyte character support" >&5
7917 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7918 if test "${cf_cv_utf8_lib+set}" = set; then
7919   echo $ECHO_N "(cached) $ECHO_C" >&6
7920 else
7921
7922         cf_save_LIBS="$LIBS"
7923         cat >conftest.$ac_ext <<_ACEOF
7924 #line 7924 "configure"
7925 #include "confdefs.h"
7926
7927 #include <stdlib.h>
7928 int
7929 main ()
7930 {
7931 putwc(0,0);
7932   ;
7933   return 0;
7934 }
7935 _ACEOF
7936 rm -f conftest.$ac_objext conftest$ac_exeext
7937 if { (eval echo "$as_me:7937: \"$ac_link\"") >&5
7938   (eval $ac_link) 2>&5
7939   ac_status=$?
7940   echo "$as_me:7940: \$? = $ac_status" >&5
7941   (exit $ac_status); } &&
7942          { ac_try='test -s conftest$ac_exeext'
7943   { (eval echo "$as_me:7943: \"$ac_try\"") >&5
7944   (eval $ac_try) 2>&5
7945   ac_status=$?
7946   echo "$as_me:7946: \$? = $ac_status" >&5
7947   (exit $ac_status); }; }; then
7948   cf_cv_utf8_lib=yes
7949 else
7950   echo "$as_me: failed program was:" >&5
7951 cat conftest.$ac_ext >&5
7952
7953 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7954 # will be set on completion of the AC_TRY_LINK below.
7955 cf_cv_header_path_utf8=
7956 cf_cv_library_path_utf8=
7957
7958 echo "${as_me:-configure}:7958: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7959
7960 cf_save_LIBS="$LIBS"
7961
7962 cat >conftest.$ac_ext <<_ACEOF
7963 #line 7963 "configure"
7964 #include "confdefs.h"
7965
7966 #include <libutf8.h>
7967 int
7968 main ()
7969 {
7970 putwc(0,0);
7971   ;
7972   return 0;
7973 }
7974 _ACEOF
7975 rm -f conftest.$ac_objext conftest$ac_exeext
7976 if { (eval echo "$as_me:7976: \"$ac_link\"") >&5
7977   (eval $ac_link) 2>&5
7978   ac_status=$?
7979   echo "$as_me:7979: \$? = $ac_status" >&5
7980   (exit $ac_status); } &&
7981          { ac_try='test -s conftest$ac_exeext'
7982   { (eval echo "$as_me:7982: \"$ac_try\"") >&5
7983   (eval $ac_try) 2>&5
7984   ac_status=$?
7985   echo "$as_me:7985: \$? = $ac_status" >&5
7986   (exit $ac_status); }; }; then
7987
7988         cf_cv_find_linkage_utf8=yes
7989         cf_cv_header_path_utf8=/usr/include
7990         cf_cv_library_path_utf8=/usr/lib
7991
7992 else
7993   echo "$as_me: failed program was:" >&5
7994 cat conftest.$ac_ext >&5
7995
7996 LIBS="-lutf8  $cf_save_LIBS"
7997
7998 cat >conftest.$ac_ext <<_ACEOF
7999 #line 7999 "configure"
8000 #include "confdefs.h"
8001
8002 #include <libutf8.h>
8003 int
8004 main ()
8005 {
8006 putwc(0,0);
8007   ;
8008   return 0;
8009 }
8010 _ACEOF
8011 rm -f conftest.$ac_objext conftest$ac_exeext
8012 if { (eval echo "$as_me:8012: \"$ac_link\"") >&5
8013   (eval $ac_link) 2>&5
8014   ac_status=$?
8015   echo "$as_me:8015: \$? = $ac_status" >&5
8016   (exit $ac_status); } &&
8017          { ac_try='test -s conftest$ac_exeext'
8018   { (eval echo "$as_me:8018: \"$ac_try\"") >&5
8019   (eval $ac_try) 2>&5
8020   ac_status=$?
8021   echo "$as_me:8021: \$? = $ac_status" >&5
8022   (exit $ac_status); }; }; then
8023
8024         cf_cv_find_linkage_utf8=yes
8025         cf_cv_header_path_utf8=/usr/include
8026         cf_cv_library_path_utf8=/usr/lib
8027         cf_cv_library_file_utf8="-lutf8"
8028
8029 else
8030   echo "$as_me: failed program was:" >&5
8031 cat conftest.$ac_ext >&5
8032
8033         cf_cv_find_linkage_utf8=no
8034         LIBS="$cf_save_LIBS"
8035
8036     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
8037
8038 echo "${as_me:-configure}:8038: testing find linkage for utf8 library ..." 1>&5
8039
8040 echo "${as_me:-configure}:8040: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
8041
8042     cf_save_CPPFLAGS="$CPPFLAGS"
8043     cf_test_CPPFLAGS="$CPPFLAGS"
8044
8045 cf_search=
8046
8047 # collect the current set of include-directories from compiler flags
8048 cf_header_path_list=""
8049 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8050         for cf_header_path in $CPPFLAGS $CFLAGS
8051         do
8052                 case $cf_header_path in #(vi
8053                 -I*)
8054                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8055
8056 test "$cf_header_path" != "NONE" && \
8057 test -d "$cf_header_path" && \
8058  {
8059         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8060         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8061         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
8062         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
8063         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
8064         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
8065 }
8066
8067                         cf_header_path_list="$cf_header_path_list $cf_search"
8068                         ;;
8069                 esac
8070         done
8071 fi
8072
8073 # add the variations for the package we are looking for
8074
8075 cf_search=
8076
8077 test "/usr" != "$prefix" && \
8078 test -d "/usr" && \
8079 (test $prefix = NONE || test "/usr" != "$prefix") && {
8080         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8081         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8082         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
8083         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
8084         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
8085         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
8086 }
8087
8088 test "$prefix" != "NONE" && \
8089 test -d "$prefix" && \
8090  {
8091         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8092         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8093         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
8094         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
8095         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
8096         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8097 }
8098
8099 test "/usr/local" != "$prefix" && \
8100 test -d "/usr/local" && \
8101 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8102         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8103         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8104         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
8105         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
8106         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
8107         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
8108 }
8109
8110 test "/opt" != "$prefix" && \
8111 test -d "/opt" && \
8112 (test $prefix = NONE || test "/opt" != "$prefix") && {
8113         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8114         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8115         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
8116         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
8117         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
8118         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
8119 }
8120
8121 test "$HOME" != "$prefix" && \
8122 test -d "$HOME" && \
8123 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8124         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8125         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8126         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
8127         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
8128         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
8129         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
8130 }
8131
8132 test "$includedir" != NONE && \
8133 test "$includedir" != "/usr/include" && \
8134 test -d "$includedir" && {
8135         test -d $includedir &&    cf_search="$cf_search $includedir"
8136         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
8137 }
8138
8139 test "$oldincludedir" != NONE && \
8140 test "$oldincludedir" != "/usr/include" && \
8141 test -d "$oldincludedir" && {
8142         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8143         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
8144 }
8145
8146 cf_search="$cf_search $cf_header_path_list"
8147
8148     for cf_cv_header_path_utf8 in $cf_search
8149     do
8150       if test -d $cf_cv_header_path_utf8 ; then
8151         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8152
8153 echo "${as_me:-configure}:8153: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8154
8155         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
8156         cat >conftest.$ac_ext <<_ACEOF
8157 #line 8157 "configure"
8158 #include "confdefs.h"
8159
8160 #include <libutf8.h>
8161 int
8162 main ()
8163 {
8164 putwc(0,0);
8165   ;
8166   return 0;
8167 }
8168 _ACEOF
8169 rm -f conftest.$ac_objext
8170 if { (eval echo "$as_me:8170: \"$ac_compile\"") >&5
8171   (eval $ac_compile) 2>&5
8172   ac_status=$?
8173   echo "$as_me:8173: \$? = $ac_status" >&5
8174   (exit $ac_status); } &&
8175          { ac_try='test -s conftest.$ac_objext'
8176   { (eval echo "$as_me:8176: \"$ac_try\"") >&5
8177   (eval $ac_try) 2>&5
8178   ac_status=$?
8179   echo "$as_me:8179: \$? = $ac_status" >&5
8180   (exit $ac_status); }; }; then
8181
8182             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8183
8184 echo "${as_me:-configure}:8184: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8185
8186             cf_cv_find_linkage_utf8=maybe
8187             cf_test_CPPFLAGS="$CPPFLAGS"
8188             break
8189 else
8190   echo "$as_me: failed program was:" >&5
8191 cat conftest.$ac_ext >&5
8192
8193             CPPFLAGS="$cf_save_CPPFLAGS"
8194
8195 fi
8196 rm -f conftest.$ac_objext conftest.$ac_ext
8197       fi
8198     done
8199
8200     if test "$cf_cv_find_linkage_utf8" = maybe ; then
8201
8202 echo "${as_me:-configure}:8202: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8203
8204       cf_save_LIBS="$LIBS"
8205       cf_save_LDFLAGS="$LDFLAGS"
8206
8207       if test "$cf_cv_find_linkage_utf8" != yes ; then
8208
8209 cf_search=
8210 cf_library_path_list=""
8211 if test -n "${LDFLAGS}${LIBS}" ; then
8212         for cf_library_path in $LDFLAGS $LIBS
8213         do
8214                 case $cf_library_path in #(vi
8215                 -L*)
8216                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8217
8218 test "$cf_library_path" != "NONE" && \
8219 test -d "$cf_library_path" && \
8220  {
8221         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8222         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8223         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8224         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8225         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8226         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8227 }
8228
8229                         cf_library_path_list="$cf_library_path_list $cf_search"
8230                         ;;
8231                 esac
8232         done
8233 fi
8234
8235 cf_search=
8236
8237 test "/usr" != "$prefix" && \
8238 test -d "/usr" && \
8239 (test $prefix = NONE || test "/usr" != "$prefix") && {
8240         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8241         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8242         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
8243         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
8244         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
8245         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
8246 }
8247
8248 test "$prefix" != "NONE" && \
8249 test -d "$prefix" && \
8250  {
8251         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8252         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8253         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
8254         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8255         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
8256         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8257 }
8258
8259 test "/usr/local" != "$prefix" && \
8260 test -d "/usr/local" && \
8261 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8262         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8263         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8264         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
8265         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
8266         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
8267         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
8268 }
8269
8270 test "/opt" != "$prefix" && \
8271 test -d "/opt" && \
8272 (test $prefix = NONE || test "/opt" != "$prefix") && {
8273         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8274         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8275         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
8276         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
8277         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
8278         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
8279 }
8280
8281 test "$HOME" != "$prefix" && \
8282 test -d "$HOME" && \
8283 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8284         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8285         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8286         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8287         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8288         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8289         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8290 }
8291
8292 cf_search="$cf_library_path_list $cf_search"
8293
8294         for cf_cv_library_path_utf8 in $cf_search
8295         do
8296           if test -d $cf_cv_library_path_utf8 ; then
8297             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8298
8299 echo "${as_me:-configure}:8299: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8300
8301             CPPFLAGS="$cf_test_CPPFLAGS"
8302             LIBS="-lutf8  $cf_save_LIBS"
8303             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8304             cat >conftest.$ac_ext <<_ACEOF
8305 #line 8305 "configure"
8306 #include "confdefs.h"
8307
8308 #include <libutf8.h>
8309 int
8310 main ()
8311 {
8312 putwc(0,0);
8313   ;
8314   return 0;
8315 }
8316 _ACEOF
8317 rm -f conftest.$ac_objext conftest$ac_exeext
8318 if { (eval echo "$as_me:8318: \"$ac_link\"") >&5
8319   (eval $ac_link) 2>&5
8320   ac_status=$?
8321   echo "$as_me:8321: \$? = $ac_status" >&5
8322   (exit $ac_status); } &&
8323          { ac_try='test -s conftest$ac_exeext'
8324   { (eval echo "$as_me:8324: \"$ac_try\"") >&5
8325   (eval $ac_try) 2>&5
8326   ac_status=$?
8327   echo "$as_me:8327: \$? = $ac_status" >&5
8328   (exit $ac_status); }; }; then
8329
8330                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8331
8332 echo "${as_me:-configure}:8332: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8333
8334                 cf_cv_find_linkage_utf8=yes
8335                 cf_cv_library_file_utf8="-lutf8"
8336                 break
8337 else
8338   echo "$as_me: failed program was:" >&5
8339 cat conftest.$ac_ext >&5
8340
8341                 CPPFLAGS="$cf_save_CPPFLAGS"
8342                 LIBS="$cf_save_LIBS"
8343                 LDFLAGS="$cf_save_LDFLAGS"
8344
8345 fi
8346 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8347           fi
8348         done
8349         CPPFLAGS="$cf_save_CPPFLAGS"
8350         LDFLAGS="$cf_save_LDFLAGS"
8351       fi
8352
8353     else
8354       cf_cv_find_linkage_utf8=no
8355     fi
8356
8357 fi
8358 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8359
8360 fi
8361 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8362
8363 LIBS="$cf_save_LIBS"
8364
8365 if test "$cf_cv_find_linkage_utf8" = yes ; then
8366 cf_cv_utf8_lib=add-on
8367 else
8368 cf_cv_utf8_lib=no
8369 fi
8370
8371 fi
8372 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8373 fi
8374 echo "$as_me:8374: result: $cf_cv_utf8_lib" >&5
8375 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8376
8377 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8378 # ncurses/ncursesw:
8379 if test "$cf_cv_utf8_lib" = "add-on" ; then
8380         cat >>confdefs.h <<\EOF
8381 #define HAVE_LIBUTF8_H 1
8382 EOF
8383
8384 if test -n "$cf_cv_header_path_utf8" ; then
8385   for cf_add_incdir in $cf_cv_header_path_utf8
8386   do
8387         while test $cf_add_incdir != /usr/include
8388         do
8389           if test -d $cf_add_incdir
8390           then
8391                 cf_have_incdir=no
8392                 if test -n "$CFLAGS$CPPFLAGS" ; then
8393                   # a loop is needed to ensure we can add subdirs of existing dirs
8394                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8395                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8396                           cf_have_incdir=yes; break
8397                         fi
8398                   done
8399                 fi
8400
8401                 if test "$cf_have_incdir" = no ; then
8402                   if test "$cf_add_incdir" = /usr/local/include ; then
8403                         if test "$GCC" = yes
8404                         then
8405                           cf_save_CPPFLAGS=$CPPFLAGS
8406                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8407                           cat >conftest.$ac_ext <<_ACEOF
8408 #line 8408 "configure"
8409 #include "confdefs.h"
8410 #include <stdio.h>
8411 int
8412 main ()
8413 {
8414 printf("Hello")
8415   ;
8416   return 0;
8417 }
8418 _ACEOF
8419 rm -f conftest.$ac_objext
8420 if { (eval echo "$as_me:8420: \"$ac_compile\"") >&5
8421   (eval $ac_compile) 2>&5
8422   ac_status=$?
8423   echo "$as_me:8423: \$? = $ac_status" >&5
8424   (exit $ac_status); } &&
8425          { ac_try='test -s conftest.$ac_objext'
8426   { (eval echo "$as_me:8426: \"$ac_try\"") >&5
8427   (eval $ac_try) 2>&5
8428   ac_status=$?
8429   echo "$as_me:8429: \$? = $ac_status" >&5
8430   (exit $ac_status); }; }; then
8431   :
8432 else
8433   echo "$as_me: failed program was:" >&5
8434 cat conftest.$ac_ext >&5
8435 cf_have_incdir=yes
8436 fi
8437 rm -f conftest.$ac_objext conftest.$ac_ext
8438                           CPPFLAGS=$cf_save_CPPFLAGS
8439                         fi
8440                   fi
8441                 fi
8442
8443                 if test "$cf_have_incdir" = no ; then
8444                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8445
8446 echo "${as_me:-configure}:8446: testing adding $cf_add_incdir to include-path ..." 1>&5
8447
8448                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8449
8450                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8451                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8452                   cf_add_incdir="$cf_top_incdir"
8453                 else
8454                   break
8455                 fi
8456           fi
8457         done
8458   done
8459 fi
8460
8461 if test -n "$cf_cv_library_path_utf8" ; then
8462   for cf_add_libdir in $cf_cv_library_path_utf8
8463   do
8464     if test $cf_add_libdir = /usr/lib ; then
8465       :
8466     elif test -d $cf_add_libdir
8467     then
8468       cf_have_libdir=no
8469       if test -n "$LDFLAGS$LIBS" ; then
8470         # a loop is needed to ensure we can add subdirs of existing dirs
8471         for cf_test_libdir in $LDFLAGS $LIBS ; do
8472           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8473             cf_have_libdir=yes; break
8474           fi
8475         done
8476       fi
8477       if test "$cf_have_libdir" = no ; then
8478         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8479
8480 echo "${as_me:-configure}:8480: testing adding $cf_add_libdir to library-path ..." 1>&5
8481
8482         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8483       fi
8484     fi
8485   done
8486 fi
8487
8488         LIBS="$cf_cv_library_file_utf8 $LIBS"
8489 fi
8490
8491 cf_ncuconfig_root=ncursesw
8492
8493 echo "Looking for ${cf_ncuconfig_root}-config"
8494
8495 if test -n "$ac_tool_prefix"; then
8496   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8497   do
8498     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8499 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8500 echo "$as_me:8500: checking for $ac_word" >&5
8501 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8502 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8503   echo $ECHO_N "(cached) $ECHO_C" >&6
8504 else
8505   if test -n "$NCURSES_CONFIG"; then
8506   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8507 else
8508   ac_save_IFS=$IFS; IFS=$ac_path_separator
8509 ac_dummy="$PATH"
8510 for ac_dir in $ac_dummy; do
8511   IFS=$ac_save_IFS
8512   test -z "$ac_dir" && ac_dir=.
8513   $as_executable_p "$ac_dir/$ac_word" || continue
8514 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8515 echo "$as_me:8515: found $ac_dir/$ac_word" >&5
8516 break
8517 done
8518
8519 fi
8520 fi
8521 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8522 if test -n "$NCURSES_CONFIG"; then
8523   echo "$as_me:8523: result: $NCURSES_CONFIG" >&5
8524 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8525 else
8526   echo "$as_me:8526: result: no" >&5
8527 echo "${ECHO_T}no" >&6
8528 fi
8529
8530     test -n "$NCURSES_CONFIG" && break
8531   done
8532 fi
8533 if test -z "$NCURSES_CONFIG"; then
8534   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8535   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8536 do
8537   # Extract the first word of "$ac_prog", so it can be a program name with args.
8538 set dummy $ac_prog; ac_word=$2
8539 echo "$as_me:8539: checking for $ac_word" >&5
8540 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8541 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8542   echo $ECHO_N "(cached) $ECHO_C" >&6
8543 else
8544   if test -n "$ac_ct_NCURSES_CONFIG"; then
8545   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8546 else
8547   ac_save_IFS=$IFS; IFS=$ac_path_separator
8548 ac_dummy="$PATH"
8549 for ac_dir in $ac_dummy; do
8550   IFS=$ac_save_IFS
8551   test -z "$ac_dir" && ac_dir=.
8552   $as_executable_p "$ac_dir/$ac_word" || continue
8553 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8554 echo "$as_me:8554: found $ac_dir/$ac_word" >&5
8555 break
8556 done
8557
8558 fi
8559 fi
8560 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8561 if test -n "$ac_ct_NCURSES_CONFIG"; then
8562   echo "$as_me:8562: result: $ac_ct_NCURSES_CONFIG" >&5
8563 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8564 else
8565   echo "$as_me:8565: result: no" >&5
8566 echo "${ECHO_T}no" >&6
8567 fi
8568
8569   test -n "$ac_ct_NCURSES_CONFIG" && break
8570 done
8571 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8572
8573   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8574 fi
8575
8576 if test "$NCURSES_CONFIG" != none ; then
8577
8578 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8579 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8580
8581 # even with config script, some packages use no-override for curses.h
8582
8583 echo "$as_me:8583: checking if we have identified curses headers" >&5
8584 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8585 if test "${cf_cv_ncurses_header+set}" = set; then
8586   echo $ECHO_N "(cached) $ECHO_C" >&6
8587 else
8588
8589 cf_cv_ncurses_header=none
8590 for cf_header in  \
8591     ncursesw/ncurses.h \
8592         ncursesw/curses.h \
8593         ncurses.h \
8594         curses.h
8595 do
8596 cat >conftest.$ac_ext <<_ACEOF
8597 #line 8597 "configure"
8598 #include "confdefs.h"
8599 #include <${cf_header}>
8600 int
8601 main ()
8602 {
8603 initscr(); tgoto("?", 0,0)
8604   ;
8605   return 0;
8606 }
8607 _ACEOF
8608 rm -f conftest.$ac_objext
8609 if { (eval echo "$as_me:8609: \"$ac_compile\"") >&5
8610   (eval $ac_compile) 2>&5
8611   ac_status=$?
8612   echo "$as_me:8612: \$? = $ac_status" >&5
8613   (exit $ac_status); } &&
8614          { ac_try='test -s conftest.$ac_objext'
8615   { (eval echo "$as_me:8615: \"$ac_try\"") >&5
8616   (eval $ac_try) 2>&5
8617   ac_status=$?
8618   echo "$as_me:8618: \$? = $ac_status" >&5
8619   (exit $ac_status); }; }; then
8620   cf_cv_ncurses_header=$cf_header; break
8621 else
8622   echo "$as_me: failed program was:" >&5
8623 cat conftest.$ac_ext >&5
8624 fi
8625 rm -f conftest.$ac_objext conftest.$ac_ext
8626 done
8627
8628 fi
8629 echo "$as_me:8629: result: $cf_cv_ncurses_header" >&5
8630 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8631
8632 if test "$cf_cv_ncurses_header" = none ; then
8633         { { echo "$as_me:8633: error: No curses header-files found" >&5
8634 echo "$as_me: error: No curses header-files found" >&2;}
8635    { (exit 1); exit 1; }; }
8636 fi
8637
8638 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8639
8640 for ac_header in $cf_cv_ncurses_header
8641 do
8642 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8643 echo "$as_me:8643: checking for $ac_header" >&5
8644 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8645 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8646   echo $ECHO_N "(cached) $ECHO_C" >&6
8647 else
8648   cat >conftest.$ac_ext <<_ACEOF
8649 #line 8649 "configure"
8650 #include "confdefs.h"
8651 #include <$ac_header>
8652 _ACEOF
8653 if { (eval echo "$as_me:8653: \"$ac_cpp conftest.$ac_ext\"") >&5
8654   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8655   ac_status=$?
8656   egrep -v '^ *\+' conftest.er1 >conftest.err
8657   rm -f conftest.er1
8658   cat conftest.err >&5
8659   echo "$as_me:8659: \$? = $ac_status" >&5
8660   (exit $ac_status); } >/dev/null; then
8661   if test -s conftest.err; then
8662     ac_cpp_err=$ac_c_preproc_warn_flag
8663   else
8664     ac_cpp_err=
8665   fi
8666 else
8667   ac_cpp_err=yes
8668 fi
8669 if test -z "$ac_cpp_err"; then
8670   eval "$as_ac_Header=yes"
8671 else
8672   echo "$as_me: failed program was:" >&5
8673   cat conftest.$ac_ext >&5
8674   eval "$as_ac_Header=no"
8675 fi
8676 rm -f conftest.err conftest.$ac_ext
8677 fi
8678 echo "$as_me:8678: result: `eval echo '${'$as_ac_Header'}'`" >&5
8679 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8680 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8681   cat >>confdefs.h <<EOF
8682 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8683 EOF
8684
8685 fi
8686 done
8687
8688 cat >>confdefs.h <<\EOF
8689 #define NCURSES 1
8690 EOF
8691
8692 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8693
8694 cat >>confdefs.h <<EOF
8695 #define $cf_nculib_ROOT 1
8696 EOF
8697
8698 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8699
8700 else
8701
8702 cf_ncuhdr_root=ncursesw
8703
8704 test -n "$cf_cv_curses_dir" && \
8705 test "$cf_cv_curses_dir" != "no" && { \
8706
8707 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8708   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8709   do
8710         while test $cf_add_incdir != /usr/include
8711         do
8712           if test -d $cf_add_incdir
8713           then
8714                 cf_have_incdir=no
8715                 if test -n "$CFLAGS$CPPFLAGS" ; then
8716                   # a loop is needed to ensure we can add subdirs of existing dirs
8717                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8718                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8719                           cf_have_incdir=yes; break
8720                         fi
8721                   done
8722                 fi
8723
8724                 if test "$cf_have_incdir" = no ; then
8725                   if test "$cf_add_incdir" = /usr/local/include ; then
8726                         if test "$GCC" = yes
8727                         then
8728                           cf_save_CPPFLAGS=$CPPFLAGS
8729                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8730                           cat >conftest.$ac_ext <<_ACEOF
8731 #line 8731 "configure"
8732 #include "confdefs.h"
8733 #include <stdio.h>
8734 int
8735 main ()
8736 {
8737 printf("Hello")
8738   ;
8739   return 0;
8740 }
8741 _ACEOF
8742 rm -f conftest.$ac_objext
8743 if { (eval echo "$as_me:8743: \"$ac_compile\"") >&5
8744   (eval $ac_compile) 2>&5
8745   ac_status=$?
8746   echo "$as_me:8746: \$? = $ac_status" >&5
8747   (exit $ac_status); } &&
8748          { ac_try='test -s conftest.$ac_objext'
8749   { (eval echo "$as_me:8749: \"$ac_try\"") >&5
8750   (eval $ac_try) 2>&5
8751   ac_status=$?
8752   echo "$as_me:8752: \$? = $ac_status" >&5
8753   (exit $ac_status); }; }; then
8754   :
8755 else
8756   echo "$as_me: failed program was:" >&5
8757 cat conftest.$ac_ext >&5
8758 cf_have_incdir=yes
8759 fi
8760 rm -f conftest.$ac_objext conftest.$ac_ext
8761                           CPPFLAGS=$cf_save_CPPFLAGS
8762                         fi
8763                   fi
8764                 fi
8765
8766                 if test "$cf_have_incdir" = no ; then
8767                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8768
8769 echo "${as_me:-configure}:8769: testing adding $cf_add_incdir to include-path ..." 1>&5
8770
8771                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8772
8773                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8774                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8775                   cf_add_incdir="$cf_top_incdir"
8776                 else
8777                   break
8778                 fi
8779           fi
8780         done
8781   done
8782 fi
8783
8784 }
8785
8786 echo "$as_me:8786: checking for $cf_ncuhdr_root header in include-path" >&5
8787 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8788 if test "${cf_cv_ncurses_h+set}" = set; then
8789   echo $ECHO_N "(cached) $ECHO_C" >&6
8790 else
8791
8792         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8793         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8794         for cf_header in $cf_header_list
8795         do
8796
8797         cat >conftest.$ac_ext <<_ACEOF
8798 #line 8798 "configure"
8799 #include "confdefs.h"
8800
8801 #define _XOPEN_SOURCE_EXTENDED
8802 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8803 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8804
8805 #include <$cf_header>
8806 int
8807 main ()
8808 {
8809
8810 #ifdef NCURSES_VERSION
8811
8812 #ifndef WACS_BSSB
8813         make an error
8814 #endif
8815
8816 printf("%s\n", NCURSES_VERSION);
8817 #else
8818 #ifdef __NCURSES_H
8819 printf("old\n");
8820 #else
8821         make an error
8822 #endif
8823 #endif
8824
8825   ;
8826   return 0;
8827 }
8828 _ACEOF
8829 rm -f conftest.$ac_objext
8830 if { (eval echo "$as_me:8830: \"$ac_compile\"") >&5
8831   (eval $ac_compile) 2>&5
8832   ac_status=$?
8833   echo "$as_me:8833: \$? = $ac_status" >&5
8834   (exit $ac_status); } &&
8835          { ac_try='test -s conftest.$ac_objext'
8836   { (eval echo "$as_me:8836: \"$ac_try\"") >&5
8837   (eval $ac_try) 2>&5
8838   ac_status=$?
8839   echo "$as_me:8839: \$? = $ac_status" >&5
8840   (exit $ac_status); }; }; then
8841   cf_cv_ncurses_h=$cf_header
8842
8843 else
8844   echo "$as_me: failed program was:" >&5
8845 cat conftest.$ac_ext >&5
8846 cf_cv_ncurses_h=no
8847 fi
8848 rm -f conftest.$ac_objext conftest.$ac_ext
8849
8850                 test "$cf_cv_ncurses_h" != no && break
8851         done
8852
8853 fi
8854 echo "$as_me:8854: result: $cf_cv_ncurses_h" >&5
8855 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8856
8857 if test "$cf_cv_ncurses_h" != no ; then
8858         cf_cv_ncurses_header=$cf_cv_ncurses_h
8859 else
8860
8861 echo "$as_me:8861: checking for $cf_ncuhdr_root include-path" >&5
8862 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8863 if test "${cf_cv_ncurses_h2+set}" = set; then
8864   echo $ECHO_N "(cached) $ECHO_C" >&6
8865 else
8866
8867         test -n "$verbose" && echo
8868
8869 cf_search=
8870
8871 # collect the current set of include-directories from compiler flags
8872 cf_header_path_list=""
8873 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8874         for cf_header_path in $CPPFLAGS $CFLAGS
8875         do
8876                 case $cf_header_path in #(vi
8877                 -I*)
8878                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8879
8880 test "$cf_header_path" != "NONE" && \
8881 test -d "$cf_header_path" && \
8882  {
8883         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8884         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8885         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8886         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8887         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8888         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"
8889 }
8890
8891                         cf_header_path_list="$cf_header_path_list $cf_search"
8892                         ;;
8893                 esac
8894         done
8895 fi
8896
8897 # add the variations for the package we are looking for
8898
8899 cf_search=
8900
8901 test "/usr" != "$prefix" && \
8902 test -d "/usr" && \
8903 (test $prefix = NONE || test "/usr" != "$prefix") && {
8904         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8905         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8906         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8907         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8908         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8909         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8910 }
8911
8912 test "$prefix" != "NONE" && \
8913 test -d "$prefix" && \
8914  {
8915         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8916         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8917         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8918         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8919         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8920         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8921 }
8922
8923 test "/usr/local" != "$prefix" && \
8924 test -d "/usr/local" && \
8925 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8926         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8927         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8928         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8929         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8930         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8931         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8932 }
8933
8934 test "/opt" != "$prefix" && \
8935 test -d "/opt" && \
8936 (test $prefix = NONE || test "/opt" != "$prefix") && {
8937         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8938         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8939         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8940         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8941         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8942         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8943 }
8944
8945 test "$HOME" != "$prefix" && \
8946 test -d "$HOME" && \
8947 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8948         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8949         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8950         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8951         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8952         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8953         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8954 }
8955
8956 test "$includedir" != NONE && \
8957 test "$includedir" != "/usr/include" && \
8958 test -d "$includedir" && {
8959         test -d $includedir &&    cf_search="$cf_search $includedir"
8960         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8961 }
8962
8963 test "$oldincludedir" != NONE && \
8964 test "$oldincludedir" != "/usr/include" && \
8965 test -d "$oldincludedir" && {
8966         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8967         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8968 }
8969
8970 cf_search="$cf_search $cf_header_path_list"
8971
8972         test -n "$verbose" && echo search path $cf_search
8973         cf_save2_CPPFLAGS="$CPPFLAGS"
8974         for cf_incdir in $cf_search
8975         do
8976
8977 if test -n "$cf_incdir" ; then
8978   for cf_add_incdir in $cf_incdir
8979   do
8980         while test $cf_add_incdir != /usr/include
8981         do
8982           if test -d $cf_add_incdir
8983           then
8984                 cf_have_incdir=no
8985                 if test -n "$CFLAGS$CPPFLAGS" ; then
8986                   # a loop is needed to ensure we can add subdirs of existing dirs
8987                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8988                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8989                           cf_have_incdir=yes; break
8990                         fi
8991                   done
8992                 fi
8993
8994                 if test "$cf_have_incdir" = no ; then
8995                   if test "$cf_add_incdir" = /usr/local/include ; then
8996                         if test "$GCC" = yes
8997                         then
8998                           cf_save_CPPFLAGS=$CPPFLAGS
8999                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9000                           cat >conftest.$ac_ext <<_ACEOF
9001 #line 9001 "configure"
9002 #include "confdefs.h"
9003 #include <stdio.h>
9004 int
9005 main ()
9006 {
9007 printf("Hello")
9008   ;
9009   return 0;
9010 }
9011 _ACEOF
9012 rm -f conftest.$ac_objext
9013 if { (eval echo "$as_me:9013: \"$ac_compile\"") >&5
9014   (eval $ac_compile) 2>&5
9015   ac_status=$?
9016   echo "$as_me:9016: \$? = $ac_status" >&5
9017   (exit $ac_status); } &&
9018          { ac_try='test -s conftest.$ac_objext'
9019   { (eval echo "$as_me:9019: \"$ac_try\"") >&5
9020   (eval $ac_try) 2>&5
9021   ac_status=$?
9022   echo "$as_me:9022: \$? = $ac_status" >&5
9023   (exit $ac_status); }; }; then
9024   :
9025 else
9026   echo "$as_me: failed program was:" >&5
9027 cat conftest.$ac_ext >&5
9028 cf_have_incdir=yes
9029 fi
9030 rm -f conftest.$ac_objext conftest.$ac_ext
9031                           CPPFLAGS=$cf_save_CPPFLAGS
9032                         fi
9033                   fi
9034                 fi
9035
9036                 if test "$cf_have_incdir" = no ; then
9037                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9038
9039 echo "${as_me:-configure}:9039: testing adding $cf_add_incdir to include-path ..." 1>&5
9040
9041                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9042
9043                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9044                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9045                   cf_add_incdir="$cf_top_incdir"
9046                 else
9047                   break
9048                 fi
9049           fi
9050         done
9051   done
9052 fi
9053
9054                 for cf_header in \
9055                         ncurses.h \
9056                         curses.h
9057                 do
9058
9059         cat >conftest.$ac_ext <<_ACEOF
9060 #line 9060 "configure"
9061 #include "confdefs.h"
9062
9063 #include <$cf_header>
9064 int
9065 main ()
9066 {
9067
9068 #ifdef NCURSES_VERSION
9069
9070 printf("%s\n", NCURSES_VERSION);
9071 #else
9072 #ifdef __NCURSES_H
9073 printf("old\n");
9074 #else
9075         make an error
9076 #endif
9077 #endif
9078
9079   ;
9080   return 0;
9081 }
9082 _ACEOF
9083 rm -f conftest.$ac_objext
9084 if { (eval echo "$as_me:9084: \"$ac_compile\"") >&5
9085   (eval $ac_compile) 2>&5
9086   ac_status=$?
9087   echo "$as_me:9087: \$? = $ac_status" >&5
9088   (exit $ac_status); } &&
9089          { ac_try='test -s conftest.$ac_objext'
9090   { (eval echo "$as_me:9090: \"$ac_try\"") >&5
9091   (eval $ac_try) 2>&5
9092   ac_status=$?
9093   echo "$as_me:9093: \$? = $ac_status" >&5
9094   (exit $ac_status); }; }; then
9095   cf_cv_ncurses_h2=$cf_header
9096
9097 else
9098   echo "$as_me: failed program was:" >&5
9099 cat conftest.$ac_ext >&5
9100 cf_cv_ncurses_h2=no
9101 fi
9102 rm -f conftest.$ac_objext conftest.$ac_ext
9103
9104                         if test "$cf_cv_ncurses_h2" != no ; then
9105                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9106                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9107                                 break
9108                         fi
9109                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9110                 done
9111                 CPPFLAGS="$cf_save2_CPPFLAGS"
9112                 test "$cf_cv_ncurses_h2" != no && break
9113         done
9114         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9114: error: not found" >&5
9115 echo "$as_me: error: not found" >&2;}
9116    { (exit 1); exit 1; }; }
9117
9118 fi
9119 echo "$as_me:9119: result: $cf_cv_ncurses_h2" >&5
9120 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9121
9122         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9123         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9124         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9125                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9126         fi
9127
9128 if test -n "$cf_1st_incdir" ; then
9129   for cf_add_incdir in $cf_1st_incdir
9130   do
9131         while test $cf_add_incdir != /usr/include
9132         do
9133           if test -d $cf_add_incdir
9134           then
9135                 cf_have_incdir=no
9136                 if test -n "$CFLAGS$CPPFLAGS" ; then
9137                   # a loop is needed to ensure we can add subdirs of existing dirs
9138                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9139                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9140                           cf_have_incdir=yes; break
9141                         fi
9142                   done
9143                 fi
9144
9145                 if test "$cf_have_incdir" = no ; then
9146                   if test "$cf_add_incdir" = /usr/local/include ; then
9147                         if test "$GCC" = yes
9148                         then
9149                           cf_save_CPPFLAGS=$CPPFLAGS
9150                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9151                           cat >conftest.$ac_ext <<_ACEOF
9152 #line 9152 "configure"
9153 #include "confdefs.h"
9154 #include <stdio.h>
9155 int
9156 main ()
9157 {
9158 printf("Hello")
9159   ;
9160   return 0;
9161 }
9162 _ACEOF
9163 rm -f conftest.$ac_objext
9164 if { (eval echo "$as_me:9164: \"$ac_compile\"") >&5
9165   (eval $ac_compile) 2>&5
9166   ac_status=$?
9167   echo "$as_me:9167: \$? = $ac_status" >&5
9168   (exit $ac_status); } &&
9169          { ac_try='test -s conftest.$ac_objext'
9170   { (eval echo "$as_me:9170: \"$ac_try\"") >&5
9171   (eval $ac_try) 2>&5
9172   ac_status=$?
9173   echo "$as_me:9173: \$? = $ac_status" >&5
9174   (exit $ac_status); }; }; then
9175   :
9176 else
9177   echo "$as_me: failed program was:" >&5
9178 cat conftest.$ac_ext >&5
9179 cf_have_incdir=yes
9180 fi
9181 rm -f conftest.$ac_objext conftest.$ac_ext
9182                           CPPFLAGS=$cf_save_CPPFLAGS
9183                         fi
9184                   fi
9185                 fi
9186
9187                 if test "$cf_have_incdir" = no ; then
9188                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9189
9190 echo "${as_me:-configure}:9190: testing adding $cf_add_incdir to include-path ..." 1>&5
9191
9192                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9193
9194                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9195                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9196                   cf_add_incdir="$cf_top_incdir"
9197                 else
9198                   break
9199                 fi
9200           fi
9201         done
9202   done
9203 fi
9204
9205 fi
9206
9207 # Set definitions to allow ifdef'ing for ncurses.h
9208
9209 case $cf_cv_ncurses_header in # (vi
9210 *ncurses.h)
9211         cat >>confdefs.h <<\EOF
9212 #define HAVE_NCURSES_H 1
9213 EOF
9214
9215         ;;
9216 esac
9217
9218 case $cf_cv_ncurses_header in # (vi
9219 ncurses/curses.h|ncurses/ncurses.h)
9220         cat >>confdefs.h <<\EOF
9221 #define HAVE_NCURSES_NCURSES_H 1
9222 EOF
9223
9224         ;;
9225 ncursesw/curses.h|ncursesw/ncurses.h)
9226         cat >>confdefs.h <<\EOF
9227 #define HAVE_NCURSESW_NCURSES_H 1
9228 EOF
9229
9230         ;;
9231 esac
9232
9233 echo "$as_me:9233: checking for terminfo header" >&5
9234 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9235 if test "${cf_cv_term_header+set}" = set; then
9236   echo $ECHO_N "(cached) $ECHO_C" >&6
9237 else
9238
9239 case ${cf_cv_ncurses_header} in #(vi
9240 */ncurses.h|*/ncursesw.h) #(vi
9241         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9242         ;;
9243 *)
9244         cf_term_header=term.h
9245         ;;
9246 esac
9247
9248 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9249 do
9250 cat >conftest.$ac_ext <<_ACEOF
9251 #line 9251 "configure"
9252 #include "confdefs.h"
9253 #include <stdio.h>
9254 #include <${cf_cv_ncurses_header:-curses.h}>
9255 #include <$cf_test>
9256
9257 int
9258 main ()
9259 {
9260 int x = auto_left_margin
9261   ;
9262   return 0;
9263 }
9264 _ACEOF
9265 rm -f conftest.$ac_objext
9266 if { (eval echo "$as_me:9266: \"$ac_compile\"") >&5
9267   (eval $ac_compile) 2>&5
9268   ac_status=$?
9269   echo "$as_me:9269: \$? = $ac_status" >&5
9270   (exit $ac_status); } &&
9271          { ac_try='test -s conftest.$ac_objext'
9272   { (eval echo "$as_me:9272: \"$ac_try\"") >&5
9273   (eval $ac_try) 2>&5
9274   ac_status=$?
9275   echo "$as_me:9275: \$? = $ac_status" >&5
9276   (exit $ac_status); }; }; then
9277
9278         cf_cv_term_header="$cf_test"
9279 else
9280   echo "$as_me: failed program was:" >&5
9281 cat conftest.$ac_ext >&5
9282
9283         cf_cv_term_header=unknown
9284
9285 fi
9286 rm -f conftest.$ac_objext conftest.$ac_ext
9287         test "$cf_cv_term_header" != unknown && break
9288 done
9289
9290 fi
9291 echo "$as_me:9291: result: $cf_cv_term_header" >&5
9292 echo "${ECHO_T}$cf_cv_term_header" >&6
9293
9294 # Set definitions to allow ifdef'ing to accommodate subdirectories
9295
9296 case $cf_cv_term_header in # (vi
9297 *term.h)
9298         cat >>confdefs.h <<\EOF
9299 #define HAVE_TERM_H 1
9300 EOF
9301
9302         ;;
9303 esac
9304
9305 case $cf_cv_term_header in # (vi
9306 ncurses/term.h) #(vi
9307         cat >>confdefs.h <<\EOF
9308 #define HAVE_NCURSES_TERM_H 1
9309 EOF
9310
9311         ;;
9312 ncursesw/term.h)
9313         cat >>confdefs.h <<\EOF
9314 #define HAVE_NCURSESW_TERM_H 1
9315 EOF
9316
9317         ;;
9318 esac
9319
9320 # some applications need this, but should check for NCURSES_VERSION
9321 cat >>confdefs.h <<\EOF
9322 #define NCURSES 1
9323 EOF
9324
9325 echo "$as_me:9325: checking for ncurses version" >&5
9326 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9327 if test "${cf_cv_ncurses_version+set}" = set; then
9328   echo $ECHO_N "(cached) $ECHO_C" >&6
9329 else
9330
9331         cf_cv_ncurses_version=no
9332         cf_tempfile=out$$
9333         rm -f $cf_tempfile
9334         if test "$cross_compiling" = yes; then
9335
9336         # This will not work if the preprocessor splits the line after the
9337         # Autoconf token.  The 'unproto' program does that.
9338         cat > conftest.$ac_ext <<EOF
9339 #include <${cf_cv_ncurses_header:-curses.h}>
9340 #undef Autoconf
9341 #ifdef NCURSES_VERSION
9342 Autoconf NCURSES_VERSION
9343 #else
9344 #ifdef __NCURSES_H
9345 Autoconf "old"
9346 #endif
9347 ;
9348 #endif
9349 EOF
9350         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9351         { (eval echo "$as_me:9351: \"$cf_try\"") >&5
9352   (eval $cf_try) 2>&5
9353   ac_status=$?
9354   echo "$as_me:9354: \$? = $ac_status" >&5
9355   (exit $ac_status); }
9356         if test -f conftest.out ; then
9357                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9358                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9359                 rm -f conftest.out
9360         fi
9361
9362 else
9363   cat >conftest.$ac_ext <<_ACEOF
9364 #line 9364 "configure"
9365 #include "confdefs.h"
9366
9367 #include <${cf_cv_ncurses_header:-curses.h}>
9368 #include <stdio.h>
9369 int main()
9370 {
9371         FILE *fp = fopen("$cf_tempfile", "w");
9372 #ifdef NCURSES_VERSION
9373 # ifdef NCURSES_VERSION_PATCH
9374         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9375 # else
9376         fprintf(fp, "%s\n", NCURSES_VERSION);
9377 # endif
9378 #else
9379 # ifdef __NCURSES_H
9380         fprintf(fp, "old\n");
9381 # else
9382         make an error
9383 # endif
9384 #endif
9385         ${cf_cv_main_return:-return}(0);
9386 }
9387 _ACEOF
9388 rm -f conftest$ac_exeext
9389 if { (eval echo "$as_me:9389: \"$ac_link\"") >&5
9390   (eval $ac_link) 2>&5
9391   ac_status=$?
9392   echo "$as_me:9392: \$? = $ac_status" >&5
9393   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9394   { (eval echo "$as_me:9394: \"$ac_try\"") >&5
9395   (eval $ac_try) 2>&5
9396   ac_status=$?
9397   echo "$as_me:9397: \$? = $ac_status" >&5
9398   (exit $ac_status); }; }; then
9399
9400         cf_cv_ncurses_version=`cat $cf_tempfile`
9401 else
9402   echo "$as_me: program exited with status $ac_status" >&5
9403 echo "$as_me: failed program was:" >&5
9404 cat conftest.$ac_ext >&5
9405 fi
9406 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9407 fi
9408         rm -f $cf_tempfile
9409
9410 fi
9411 echo "$as_me:9411: result: $cf_cv_ncurses_version" >&5
9412 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9413 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9414 #define NCURSES 1
9415 EOF
9416
9417 cf_nculib_root=ncursesw
9418         # This works, except for the special case where we find gpm, but
9419         # ncurses is in a nonstandard location via $LIBS, and we really want
9420         # to link gpm.
9421 cf_ncurses_LIBS=""
9422 cf_ncurses_SAVE="$LIBS"
9423 echo "$as_me:9423: checking for Gpm_Open in -lgpm" >&5
9424 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9425 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9426   echo $ECHO_N "(cached) $ECHO_C" >&6
9427 else
9428   ac_check_lib_save_LIBS=$LIBS
9429 LIBS="-lgpm  $LIBS"
9430 cat >conftest.$ac_ext <<_ACEOF
9431 #line 9431 "configure"
9432 #include "confdefs.h"
9433
9434 /* Override any gcc2 internal prototype to avoid an error.  */
9435 #ifdef __cplusplus
9436 extern "C"
9437 #endif
9438 /* We use char because int might match the return type of a gcc2
9439    builtin and then its argument prototype would still apply.  */
9440 char Gpm_Open ();
9441 int
9442 main ()
9443 {
9444 Gpm_Open ();
9445   ;
9446   return 0;
9447 }
9448 _ACEOF
9449 rm -f conftest.$ac_objext conftest$ac_exeext
9450 if { (eval echo "$as_me:9450: \"$ac_link\"") >&5
9451   (eval $ac_link) 2>&5
9452   ac_status=$?
9453   echo "$as_me:9453: \$? = $ac_status" >&5
9454   (exit $ac_status); } &&
9455          { ac_try='test -s conftest$ac_exeext'
9456   { (eval echo "$as_me:9456: \"$ac_try\"") >&5
9457   (eval $ac_try) 2>&5
9458   ac_status=$?
9459   echo "$as_me:9459: \$? = $ac_status" >&5
9460   (exit $ac_status); }; }; then
9461   ac_cv_lib_gpm_Gpm_Open=yes
9462 else
9463   echo "$as_me: failed program was:" >&5
9464 cat conftest.$ac_ext >&5
9465 ac_cv_lib_gpm_Gpm_Open=no
9466 fi
9467 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9468 LIBS=$ac_check_lib_save_LIBS
9469 fi
9470 echo "$as_me:9470: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9471 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9472 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9473   echo "$as_me:9473: checking for initscr in -lgpm" >&5
9474 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9475 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9476   echo $ECHO_N "(cached) $ECHO_C" >&6
9477 else
9478   ac_check_lib_save_LIBS=$LIBS
9479 LIBS="-lgpm  $LIBS"
9480 cat >conftest.$ac_ext <<_ACEOF
9481 #line 9481 "configure"
9482 #include "confdefs.h"
9483
9484 /* Override any gcc2 internal prototype to avoid an error.  */
9485 #ifdef __cplusplus
9486 extern "C"
9487 #endif
9488 /* We use char because int might match the return type of a gcc2
9489    builtin and then its argument prototype would still apply.  */
9490 char initscr ();
9491 int
9492 main ()
9493 {
9494 initscr ();
9495   ;
9496   return 0;
9497 }
9498 _ACEOF
9499 rm -f conftest.$ac_objext conftest$ac_exeext
9500 if { (eval echo "$as_me:9500: \"$ac_link\"") >&5
9501   (eval $ac_link) 2>&5
9502   ac_status=$?
9503   echo "$as_me:9503: \$? = $ac_status" >&5
9504   (exit $ac_status); } &&
9505          { ac_try='test -s conftest$ac_exeext'
9506   { (eval echo "$as_me:9506: \"$ac_try\"") >&5
9507   (eval $ac_try) 2>&5
9508   ac_status=$?
9509   echo "$as_me:9509: \$? = $ac_status" >&5
9510   (exit $ac_status); }; }; then
9511   ac_cv_lib_gpm_initscr=yes
9512 else
9513   echo "$as_me: failed program was:" >&5
9514 cat conftest.$ac_ext >&5
9515 ac_cv_lib_gpm_initscr=no
9516 fi
9517 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9518 LIBS=$ac_check_lib_save_LIBS
9519 fi
9520 echo "$as_me:9520: result: $ac_cv_lib_gpm_initscr" >&5
9521 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9522 if test $ac_cv_lib_gpm_initscr = yes; then
9523   LIBS="$cf_ncurses_SAVE"
9524 else
9525   cf_ncurses_LIBS="-lgpm"
9526 fi
9527
9528 fi
9529
9530 case $host_os in #(vi
9531 freebsd*)
9532         # This is only necessary if you are linking against an obsolete
9533         # version of ncurses (but it should do no harm, since it's static).
9534         if test "$cf_nculib_root" = ncurses ; then
9535                 echo "$as_me:9535: checking for tgoto in -lmytinfo" >&5
9536 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9537 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9538   echo $ECHO_N "(cached) $ECHO_C" >&6
9539 else
9540   ac_check_lib_save_LIBS=$LIBS
9541 LIBS="-lmytinfo  $LIBS"
9542 cat >conftest.$ac_ext <<_ACEOF
9543 #line 9543 "configure"
9544 #include "confdefs.h"
9545
9546 /* Override any gcc2 internal prototype to avoid an error.  */
9547 #ifdef __cplusplus
9548 extern "C"
9549 #endif
9550 /* We use char because int might match the return type of a gcc2
9551    builtin and then its argument prototype would still apply.  */
9552 char tgoto ();
9553 int
9554 main ()
9555 {
9556 tgoto ();
9557   ;
9558   return 0;
9559 }
9560 _ACEOF
9561 rm -f conftest.$ac_objext conftest$ac_exeext
9562 if { (eval echo "$as_me:9562: \"$ac_link\"") >&5
9563   (eval $ac_link) 2>&5
9564   ac_status=$?
9565   echo "$as_me:9565: \$? = $ac_status" >&5
9566   (exit $ac_status); } &&
9567          { ac_try='test -s conftest$ac_exeext'
9568   { (eval echo "$as_me:9568: \"$ac_try\"") >&5
9569   (eval $ac_try) 2>&5
9570   ac_status=$?
9571   echo "$as_me:9571: \$? = $ac_status" >&5
9572   (exit $ac_status); }; }; then
9573   ac_cv_lib_mytinfo_tgoto=yes
9574 else
9575   echo "$as_me: failed program was:" >&5
9576 cat conftest.$ac_ext >&5
9577 ac_cv_lib_mytinfo_tgoto=no
9578 fi
9579 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9580 LIBS=$ac_check_lib_save_LIBS
9581 fi
9582 echo "$as_me:9582: result: $ac_cv_lib_mytinfo_tgoto" >&5
9583 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9584 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9585   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9586 fi
9587
9588         fi
9589         ;;
9590 esac
9591
9592 LIBS="$cf_ncurses_LIBS $LIBS"
9593
9594 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9595 then
9596         LIBS="-l$cf_nculib_root $LIBS"
9597 else
9598
9599         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9600         cf_libdir=""
9601         echo "$as_me:9601: checking for initscr" >&5
9602 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9603 if test "${ac_cv_func_initscr+set}" = set; then
9604   echo $ECHO_N "(cached) $ECHO_C" >&6
9605 else
9606   cat >conftest.$ac_ext <<_ACEOF
9607 #line 9607 "configure"
9608 #include "confdefs.h"
9609 /* System header to define __stub macros and hopefully few prototypes,
9610     which can conflict with char initscr (); below.  */
9611 #include <assert.h>
9612 /* Override any gcc2 internal prototype to avoid an error.  */
9613 #ifdef __cplusplus
9614 extern "C"
9615 #endif
9616 /* We use char because int might match the return type of a gcc2
9617    builtin and then its argument prototype would still apply.  */
9618 char initscr ();
9619 char (*f) ();
9620
9621 int
9622 main ()
9623 {
9624 /* The GNU C library defines this for functions which it implements
9625     to always fail with ENOSYS.  Some functions are actually named
9626     something starting with __ and the normal name is an alias.  */
9627 #if defined (__stub_initscr) || defined (__stub___initscr)
9628 choke me
9629 #else
9630 f = initscr;
9631 #endif
9632
9633   ;
9634   return 0;
9635 }
9636 _ACEOF
9637 rm -f conftest.$ac_objext conftest$ac_exeext
9638 if { (eval echo "$as_me:9638: \"$ac_link\"") >&5
9639   (eval $ac_link) 2>&5
9640   ac_status=$?
9641   echo "$as_me:9641: \$? = $ac_status" >&5
9642   (exit $ac_status); } &&
9643          { ac_try='test -s conftest$ac_exeext'
9644   { (eval echo "$as_me:9644: \"$ac_try\"") >&5
9645   (eval $ac_try) 2>&5
9646   ac_status=$?
9647   echo "$as_me:9647: \$? = $ac_status" >&5
9648   (exit $ac_status); }; }; then
9649   ac_cv_func_initscr=yes
9650 else
9651   echo "$as_me: failed program was:" >&5
9652 cat conftest.$ac_ext >&5
9653 ac_cv_func_initscr=no
9654 fi
9655 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9656 fi
9657 echo "$as_me:9657: result: $ac_cv_func_initscr" >&5
9658 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9659 if test $ac_cv_func_initscr = yes; then
9660   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9661 else
9662
9663                 cf_save_LIBS="$LIBS"
9664                 echo "$as_me:9664: checking for initscr in -l$cf_nculib_root" >&5
9665 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9666                 LIBS="-l$cf_nculib_root $LIBS"
9667                 cat >conftest.$ac_ext <<_ACEOF
9668 #line 9668 "configure"
9669 #include "confdefs.h"
9670 #include <${cf_cv_ncurses_header:-curses.h}>
9671 int
9672 main ()
9673 {
9674 initscr()
9675   ;
9676   return 0;
9677 }
9678 _ACEOF
9679 rm -f conftest.$ac_objext conftest$ac_exeext
9680 if { (eval echo "$as_me:9680: \"$ac_link\"") >&5
9681   (eval $ac_link) 2>&5
9682   ac_status=$?
9683   echo "$as_me:9683: \$? = $ac_status" >&5
9684   (exit $ac_status); } &&
9685          { ac_try='test -s conftest$ac_exeext'
9686   { (eval echo "$as_me:9686: \"$ac_try\"") >&5
9687   (eval $ac_try) 2>&5
9688   ac_status=$?
9689   echo "$as_me:9689: \$? = $ac_status" >&5
9690   (exit $ac_status); }; }; then
9691   echo "$as_me:9691: result: yes" >&5
9692 echo "${ECHO_T}yes" >&6
9693                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9694
9695 else
9696   echo "$as_me: failed program was:" >&5
9697 cat conftest.$ac_ext >&5
9698 echo "$as_me:9698: result: no" >&5
9699 echo "${ECHO_T}no" >&6
9700
9701 cf_search=
9702 cf_library_path_list=""
9703 if test -n "${LDFLAGS}${LIBS}" ; then
9704         for cf_library_path in $LDFLAGS $LIBS
9705         do
9706                 case $cf_library_path in #(vi
9707                 -L*)
9708                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9709
9710 test "$cf_library_path" != "NONE" && \
9711 test -d "$cf_library_path" && \
9712  {
9713         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9714         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9715         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9716         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9717         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9718         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"
9719 }
9720
9721                         cf_library_path_list="$cf_library_path_list $cf_search"
9722                         ;;
9723                 esac
9724         done
9725 fi
9726
9727 cf_search=
9728
9729 test "/usr" != "$prefix" && \
9730 test -d "/usr" && \
9731 (test $prefix = NONE || test "/usr" != "$prefix") && {
9732         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9733         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9734         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9735         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9736         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9737         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9738 }
9739
9740 test "$prefix" != "NONE" && \
9741 test -d "$prefix" && \
9742  {
9743         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9744         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9745         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9746         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9747         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9748         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9749 }
9750
9751 test "/usr/local" != "$prefix" && \
9752 test -d "/usr/local" && \
9753 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9754         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9755         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9756         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9757         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9758         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9759         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9760 }
9761
9762 test "/opt" != "$prefix" && \
9763 test -d "/opt" && \
9764 (test $prefix = NONE || test "/opt" != "$prefix") && {
9765         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9766         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9767         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9768         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9769         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9770         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9771 }
9772
9773 test "$HOME" != "$prefix" && \
9774 test -d "$HOME" && \
9775 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9776         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9777         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9778         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9779         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9780         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9781         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9782 }
9783
9784 cf_search="$cf_library_path_list $cf_search"
9785
9786                         for cf_libdir in $cf_search
9787                         do
9788                                 echo "$as_me:9788: checking for -l$cf_nculib_root in $cf_libdir" >&5
9789 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9790                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9791                                 cat >conftest.$ac_ext <<_ACEOF
9792 #line 9792 "configure"
9793 #include "confdefs.h"
9794 #include <${cf_cv_ncurses_header:-curses.h}>
9795 int
9796 main ()
9797 {
9798 initscr()
9799   ;
9800   return 0;
9801 }
9802 _ACEOF
9803 rm -f conftest.$ac_objext conftest$ac_exeext
9804 if { (eval echo "$as_me:9804: \"$ac_link\"") >&5
9805   (eval $ac_link) 2>&5
9806   ac_status=$?
9807   echo "$as_me:9807: \$? = $ac_status" >&5
9808   (exit $ac_status); } &&
9809          { ac_try='test -s conftest$ac_exeext'
9810   { (eval echo "$as_me:9810: \"$ac_try\"") >&5
9811   (eval $ac_try) 2>&5
9812   ac_status=$?
9813   echo "$as_me:9813: \$? = $ac_status" >&5
9814   (exit $ac_status); }; }; then
9815   echo "$as_me:9815: result: yes" >&5
9816 echo "${ECHO_T}yes" >&6
9817                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9818                                          break
9819 else
9820   echo "$as_me: failed program was:" >&5
9821 cat conftest.$ac_ext >&5
9822 echo "$as_me:9822: result: no" >&5
9823 echo "${ECHO_T}no" >&6
9824                                          LIBS="$cf_save_LIBS"
9825 fi
9826 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9827                         done
9828
9829 fi
9830 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9831
9832 fi
9833
9834 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9835
9836 if test $cf_found_library = no ; then
9837         { { echo "$as_me:9837: error: Cannot link $cf_nculib_root library" >&5
9838 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9839    { (exit 1); exit 1; }; }
9840 fi
9841
9842 fi
9843
9844 if test -n "$cf_ncurses_LIBS" ; then
9845         echo "$as_me:9845: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9846 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9847         cf_ncurses_SAVE="$LIBS"
9848         for p in $cf_ncurses_LIBS ; do
9849                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9850                 if test "$q" != "$LIBS" ; then
9851                         LIBS="$q"
9852                 fi
9853         done
9854         cat >conftest.$ac_ext <<_ACEOF
9855 #line 9855 "configure"
9856 #include "confdefs.h"
9857 #include <${cf_cv_ncurses_header:-curses.h}>
9858 int
9859 main ()
9860 {
9861 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9862   ;
9863   return 0;
9864 }
9865 _ACEOF
9866 rm -f conftest.$ac_objext conftest$ac_exeext
9867 if { (eval echo "$as_me:9867: \"$ac_link\"") >&5
9868   (eval $ac_link) 2>&5
9869   ac_status=$?
9870   echo "$as_me:9870: \$? = $ac_status" >&5
9871   (exit $ac_status); } &&
9872          { ac_try='test -s conftest$ac_exeext'
9873   { (eval echo "$as_me:9873: \"$ac_try\"") >&5
9874   (eval $ac_try) 2>&5
9875   ac_status=$?
9876   echo "$as_me:9876: \$? = $ac_status" >&5
9877   (exit $ac_status); }; }; then
9878   echo "$as_me:9878: result: yes" >&5
9879 echo "${ECHO_T}yes" >&6
9880 else
9881   echo "$as_me: failed program was:" >&5
9882 cat conftest.$ac_ext >&5
9883 echo "$as_me:9883: result: no" >&5
9884 echo "${ECHO_T}no" >&6
9885                  LIBS="$cf_ncurses_SAVE"
9886 fi
9887 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9888 fi
9889
9890 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9891
9892 cat >>confdefs.h <<EOF
9893 #define $cf_nculib_ROOT 1
9894 EOF
9895
9896 fi
9897
9898         ;;
9899 pdcurses) #(vi
9900
9901 echo "$as_me:9901: checking if you want to use pkg-config" >&5
9902 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9903
9904 # Check whether --with-pkg-config or --without-pkg-config was given.
9905 if test "${with_pkg_config+set}" = set; then
9906   withval="$with_pkg_config"
9907   cf_pkg_config=$withval
9908 else
9909   cf_pkg_config=yes
9910 fi;
9911 echo "$as_me:9911: result: $cf_pkg_config" >&5
9912 echo "${ECHO_T}$cf_pkg_config" >&6
9913
9914 case $cf_pkg_config in #(vi
9915 no) #(vi
9916         PKG_CONFIG=none
9917         ;;
9918 yes) #(vi
9919
9920 if test -n "$ac_tool_prefix"; then
9921   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9922 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9923 echo "$as_me:9923: checking for $ac_word" >&5
9924 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9925 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9926   echo $ECHO_N "(cached) $ECHO_C" >&6
9927 else
9928   case $PKG_CONFIG in
9929   [\\/]* | ?:[\\/]*)
9930   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9931   ;;
9932   *)
9933   ac_save_IFS=$IFS; IFS=$ac_path_separator
9934 ac_dummy="$PATH"
9935 for ac_dir in $ac_dummy; do
9936   IFS=$ac_save_IFS
9937   test -z "$ac_dir" && ac_dir=.
9938   if $as_executable_p "$ac_dir/$ac_word"; then
9939    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9940    echo "$as_me:9940: found $ac_dir/$ac_word" >&5
9941    break
9942 fi
9943 done
9944
9945   ;;
9946 esac
9947 fi
9948 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9949
9950 if test -n "$PKG_CONFIG"; then
9951   echo "$as_me:9951: result: $PKG_CONFIG" >&5
9952 echo "${ECHO_T}$PKG_CONFIG" >&6
9953 else
9954   echo "$as_me:9954: result: no" >&5
9955 echo "${ECHO_T}no" >&6
9956 fi
9957
9958 fi
9959 if test -z "$ac_cv_path_PKG_CONFIG"; then
9960   ac_pt_PKG_CONFIG=$PKG_CONFIG
9961   # Extract the first word of "pkg-config", so it can be a program name with args.
9962 set dummy pkg-config; ac_word=$2
9963 echo "$as_me:9963: checking for $ac_word" >&5
9964 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9965 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9966   echo $ECHO_N "(cached) $ECHO_C" >&6
9967 else
9968   case $ac_pt_PKG_CONFIG in
9969   [\\/]* | ?:[\\/]*)
9970   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9971   ;;
9972   *)
9973   ac_save_IFS=$IFS; IFS=$ac_path_separator
9974 ac_dummy="$PATH"
9975 for ac_dir in $ac_dummy; do
9976   IFS=$ac_save_IFS
9977   test -z "$ac_dir" && ac_dir=.
9978   if $as_executable_p "$ac_dir/$ac_word"; then
9979    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9980    echo "$as_me:9980: found $ac_dir/$ac_word" >&5
9981    break
9982 fi
9983 done
9984
9985   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9986   ;;
9987 esac
9988 fi
9989 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9990
9991 if test -n "$ac_pt_PKG_CONFIG"; then
9992   echo "$as_me:9992: result: $ac_pt_PKG_CONFIG" >&5
9993 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9994 else
9995   echo "$as_me:9995: result: no" >&5
9996 echo "${ECHO_T}no" >&6
9997 fi
9998
9999   PKG_CONFIG=$ac_pt_PKG_CONFIG
10000 else
10001   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
10002 fi
10003
10004         ;;
10005 *)
10006         PKG_CONFIG=$withval
10007         ;;
10008 esac
10009
10010 test -z "$PKG_CONFIG" && PKG_CONFIG=none
10011 if test "$PKG_CONFIG" != none ; then
10012
10013 if test "x$prefix" != xNONE; then
10014   cf_path_syntax="$prefix"
10015 else
10016   cf_path_syntax="$ac_default_prefix"
10017 fi
10018
10019 case ".$PKG_CONFIG" in #(vi
10020 .\$\(*\)*|.\'*\'*) #(vi
10021   ;;
10022 ..|./*|.\\*) #(vi
10023   ;;
10024 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10025   ;;
10026 .\${*prefix}*) #(vi
10027   eval PKG_CONFIG="$PKG_CONFIG"
10028   case ".$PKG_CONFIG" in #(vi
10029   .NONE/*)
10030     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
10031     ;;
10032   esac
10033   ;; #(vi
10034 .no|.NONE/*)
10035   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
10036   ;;
10037 *)
10038   { { echo "$as_me:10038: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
10039 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
10040    { (exit 1); exit 1; }; }
10041   ;;
10042 esac
10043
10044 fi
10045
10046 echo "$as_me:10046: checking for X" >&5
10047 echo $ECHO_N "checking for X... $ECHO_C" >&6
10048
10049 # Check whether --with-x or --without-x was given.
10050 if test "${with_x+set}" = set; then
10051   withval="$with_x"
10052
10053 fi;
10054 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10055 if test "x$with_x" = xno; then
10056   # The user explicitly disabled X.
10057   have_x=disabled
10058 else
10059   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10060     # Both variables are already set.
10061     have_x=yes
10062   else
10063     if test "${ac_cv_have_x+set}" = set; then
10064   echo $ECHO_N "(cached) $ECHO_C" >&6
10065 else
10066   # One or both of the vars are not set, and there is no cached value.
10067 ac_x_includes=no ac_x_libraries=no
10068 rm -fr conftest.dir
10069 if mkdir conftest.dir; then
10070   cd conftest.dir
10071   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10072   cat >Imakefile <<'EOF'
10073 acfindx:
10074         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10075 EOF
10076   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10077     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10078     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10079     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10080     for ac_extension in a so sl dylib dll; do
10081       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10082          test -f $ac_im_libdir/libX11.$ac_extension; then
10083         ac_im_usrlibdir=$ac_im_libdir; break
10084       fi
10085     done
10086     # Screen out bogus values from the imake configuration.  They are
10087     # bogus both because they are the default anyway, and because
10088     # using them would break gcc on systems where it needs fixed includes.
10089     case $ac_im_incroot in
10090         /usr/include) ;;
10091         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10092     esac
10093     case $ac_im_usrlibdir in
10094         /usr/lib | /lib) ;;
10095         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10096     esac
10097   fi
10098   cd ..
10099   rm -fr conftest.dir
10100 fi
10101
10102 # Standard set of common directories for X headers.
10103 # Check X11 before X11Rn because it is often a symlink to the current release.
10104 ac_x_header_dirs='
10105 /usr/X11/include
10106 /usr/X11R6/include
10107 /usr/X11R5/include
10108 /usr/X11R4/include
10109
10110 /usr/include/X11
10111 /usr/include/X11R6
10112 /usr/include/X11R5
10113 /usr/include/X11R4
10114
10115 /usr/local/X11/include
10116 /usr/local/X11R6/include
10117 /usr/local/X11R5/include
10118 /usr/local/X11R4/include
10119
10120 /usr/local/include/X11
10121 /usr/local/include/X11R6
10122 /usr/local/include/X11R5
10123 /usr/local/include/X11R4
10124
10125 /usr/X386/include
10126 /usr/x386/include
10127 /usr/XFree86/include/X11
10128
10129 /usr/include
10130 /usr/local/include
10131 /usr/unsupported/include
10132 /usr/athena/include
10133 /usr/local/x11r5/include
10134 /usr/lpp/Xamples/include
10135
10136 /usr/openwin/include
10137 /usr/openwin/share/include'
10138
10139 if test "$ac_x_includes" = no; then
10140   # Guess where to find include files, by looking for Intrinsic.h.
10141   # First, try using that file with no special directory specified.
10142   cat >conftest.$ac_ext <<_ACEOF
10143 #line 10143 "configure"
10144 #include "confdefs.h"
10145 #include <X11/Intrinsic.h>
10146 _ACEOF
10147 if { (eval echo "$as_me:10147: \"$ac_cpp conftest.$ac_ext\"") >&5
10148   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10149   ac_status=$?
10150   egrep -v '^ *\+' conftest.er1 >conftest.err
10151   rm -f conftest.er1
10152   cat conftest.err >&5
10153   echo "$as_me:10153: \$? = $ac_status" >&5
10154   (exit $ac_status); } >/dev/null; then
10155   if test -s conftest.err; then
10156     ac_cpp_err=$ac_c_preproc_warn_flag
10157   else
10158     ac_cpp_err=
10159   fi
10160 else
10161   ac_cpp_err=yes
10162 fi
10163 if test -z "$ac_cpp_err"; then
10164   # We can compile using X headers with no special include directory.
10165 ac_x_includes=
10166 else
10167   echo "$as_me: failed program was:" >&5
10168   cat conftest.$ac_ext >&5
10169   for ac_dir in $ac_x_header_dirs; do
10170   if test -r "$ac_dir/X11/Intrinsic.h"; then
10171     ac_x_includes=$ac_dir
10172     break
10173   fi
10174 done
10175 fi
10176 rm -f conftest.err conftest.$ac_ext
10177 fi # $ac_x_includes = no
10178
10179 if test "$ac_x_libraries" = no; then
10180   # Check for the libraries.
10181   # See if we find them without any special options.
10182   # Don't add to $LIBS permanently.
10183   ac_save_LIBS=$LIBS
10184   LIBS="-lXt $LIBS"
10185   cat >conftest.$ac_ext <<_ACEOF
10186 #line 10186 "configure"
10187 #include "confdefs.h"
10188 #include <X11/Intrinsic.h>
10189 int
10190 main ()
10191 {
10192 XtMalloc (0)
10193   ;
10194   return 0;
10195 }
10196 _ACEOF
10197 rm -f conftest.$ac_objext conftest$ac_exeext
10198 if { (eval echo "$as_me:10198: \"$ac_link\"") >&5
10199   (eval $ac_link) 2>&5
10200   ac_status=$?
10201   echo "$as_me:10201: \$? = $ac_status" >&5
10202   (exit $ac_status); } &&
10203          { ac_try='test -s conftest$ac_exeext'
10204   { (eval echo "$as_me:10204: \"$ac_try\"") >&5
10205   (eval $ac_try) 2>&5
10206   ac_status=$?
10207   echo "$as_me:10207: \$? = $ac_status" >&5
10208   (exit $ac_status); }; }; then
10209   LIBS=$ac_save_LIBS
10210 # We can link X programs with no special library path.
10211 ac_x_libraries=
10212 else
10213   echo "$as_me: failed program was:" >&5
10214 cat conftest.$ac_ext >&5
10215 LIBS=$ac_save_LIBS
10216 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10217 do
10218   # Don't even attempt the hair of trying to link an X program!
10219   for ac_extension in a so sl dylib dll; do
10220     if test -r $ac_dir/libXt.$ac_extension; then
10221       ac_x_libraries=$ac_dir
10222       break 2
10223     fi
10224   done
10225 done
10226 fi
10227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10228 fi # $ac_x_libraries = no
10229
10230 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10231   # Didn't find X anywhere.  Cache the known absence of X.
10232   ac_cv_have_x="have_x=no"
10233 else
10234   # Record where we found X for the cache.
10235   ac_cv_have_x="have_x=yes \
10236                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10237 fi
10238 fi
10239
10240   fi
10241   eval "$ac_cv_have_x"
10242 fi # $with_x != no
10243
10244 if test "$have_x" != yes; then
10245   echo "$as_me:10245: result: $have_x" >&5
10246 echo "${ECHO_T}$have_x" >&6
10247   no_x=yes
10248 else
10249   # If each of the values was on the command line, it overrides each guess.
10250   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10251   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10252   # Update the cache value to reflect the command line values.
10253   ac_cv_have_x="have_x=yes \
10254                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10255   echo "$as_me:10255: result: libraries $x_libraries, headers $x_includes" >&5
10256 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10257 fi
10258
10259 if test "$no_x" = yes; then
10260   # Not all programs may use this symbol, but it does not hurt to define it.
10261
10262 cat >>confdefs.h <<\EOF
10263 #define X_DISPLAY_MISSING 1
10264 EOF
10265
10266   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10267 else
10268   if test -n "$x_includes"; then
10269     X_CFLAGS="$X_CFLAGS -I$x_includes"
10270   fi
10271
10272   # It would also be nice to do this for all -L options, not just this one.
10273   if test -n "$x_libraries"; then
10274     X_LIBS="$X_LIBS -L$x_libraries"
10275     # For Solaris; some versions of Sun CC require a space after -R and
10276     # others require no space.  Words are not sufficient . . . .
10277     case `(uname -sr) 2>/dev/null` in
10278     "SunOS 5"*)
10279       echo "$as_me:10279: checking whether -R must be followed by a space" >&5
10280 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10281       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10282       cat >conftest.$ac_ext <<_ACEOF
10283 #line 10283 "configure"
10284 #include "confdefs.h"
10285
10286 int
10287 main ()
10288 {
10289
10290   ;
10291   return 0;
10292 }
10293 _ACEOF
10294 rm -f conftest.$ac_objext conftest$ac_exeext
10295 if { (eval echo "$as_me:10295: \"$ac_link\"") >&5
10296   (eval $ac_link) 2>&5
10297   ac_status=$?
10298   echo "$as_me:10298: \$? = $ac_status" >&5
10299   (exit $ac_status); } &&
10300          { ac_try='test -s conftest$ac_exeext'
10301   { (eval echo "$as_me:10301: \"$ac_try\"") >&5
10302   (eval $ac_try) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); }; }; then
10306   ac_R_nospace=yes
10307 else
10308   echo "$as_me: failed program was:" >&5
10309 cat conftest.$ac_ext >&5
10310 ac_R_nospace=no
10311 fi
10312 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10313       if test $ac_R_nospace = yes; then
10314         echo "$as_me:10314: result: no" >&5
10315 echo "${ECHO_T}no" >&6
10316         X_LIBS="$X_LIBS -R$x_libraries"
10317       else
10318         LIBS="$ac_xsave_LIBS -R $x_libraries"
10319         cat >conftest.$ac_ext <<_ACEOF
10320 #line 10320 "configure"
10321 #include "confdefs.h"
10322
10323 int
10324 main ()
10325 {
10326
10327   ;
10328   return 0;
10329 }
10330 _ACEOF
10331 rm -f conftest.$ac_objext conftest$ac_exeext
10332 if { (eval echo "$as_me:10332: \"$ac_link\"") >&5
10333   (eval $ac_link) 2>&5
10334   ac_status=$?
10335   echo "$as_me:10335: \$? = $ac_status" >&5
10336   (exit $ac_status); } &&
10337          { ac_try='test -s 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   ac_R_space=yes
10344 else
10345   echo "$as_me: failed program was:" >&5
10346 cat conftest.$ac_ext >&5
10347 ac_R_space=no
10348 fi
10349 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10350         if test $ac_R_space = yes; then
10351           echo "$as_me:10351: result: yes" >&5
10352 echo "${ECHO_T}yes" >&6
10353           X_LIBS="$X_LIBS -R $x_libraries"
10354         else
10355           echo "$as_me:10355: result: neither works" >&5
10356 echo "${ECHO_T}neither works" >&6
10357         fi
10358       fi
10359       LIBS=$ac_xsave_LIBS
10360     esac
10361   fi
10362
10363   # Check for system-dependent libraries X programs must link with.
10364   # Do this before checking for the system-independent R6 libraries
10365   # (-lICE), since we may need -lsocket or whatever for X linking.
10366
10367   if test "$ISC" = yes; then
10368     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10369   else
10370     # Martyn Johnson says this is needed for Ultrix, if the X
10371     # libraries were built with DECnet support.  And Karl Berry says
10372     # the Alpha needs dnet_stub (dnet does not exist).
10373     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10374     cat >conftest.$ac_ext <<_ACEOF
10375 #line 10375 "configure"
10376 #include "confdefs.h"
10377
10378 /* Override any gcc2 internal prototype to avoid an error.  */
10379 #ifdef __cplusplus
10380 extern "C"
10381 #endif
10382 /* We use char because int might match the return type of a gcc2
10383    builtin and then its argument prototype would still apply.  */
10384 char XOpenDisplay ();
10385 int
10386 main ()
10387 {
10388 XOpenDisplay ();
10389   ;
10390   return 0;
10391 }
10392 _ACEOF
10393 rm -f conftest.$ac_objext conftest$ac_exeext
10394 if { (eval echo "$as_me:10394: \"$ac_link\"") >&5
10395   (eval $ac_link) 2>&5
10396   ac_status=$?
10397   echo "$as_me:10397: \$? = $ac_status" >&5
10398   (exit $ac_status); } &&
10399          { ac_try='test -s conftest$ac_exeext'
10400   { (eval echo "$as_me:10400: \"$ac_try\"") >&5
10401   (eval $ac_try) 2>&5
10402   ac_status=$?
10403   echo "$as_me:10403: \$? = $ac_status" >&5
10404   (exit $ac_status); }; }; then
10405   :
10406 else
10407   echo "$as_me: failed program was:" >&5
10408 cat conftest.$ac_ext >&5
10409 echo "$as_me:10409: checking for dnet_ntoa in -ldnet" >&5
10410 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10411 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10412   echo $ECHO_N "(cached) $ECHO_C" >&6
10413 else
10414   ac_check_lib_save_LIBS=$LIBS
10415 LIBS="-ldnet  $LIBS"
10416 cat >conftest.$ac_ext <<_ACEOF
10417 #line 10417 "configure"
10418 #include "confdefs.h"
10419
10420 /* Override any gcc2 internal prototype to avoid an error.  */
10421 #ifdef __cplusplus
10422 extern "C"
10423 #endif
10424 /* We use char because int might match the return type of a gcc2
10425    builtin and then its argument prototype would still apply.  */
10426 char dnet_ntoa ();
10427 int
10428 main ()
10429 {
10430 dnet_ntoa ();
10431   ;
10432   return 0;
10433 }
10434 _ACEOF
10435 rm -f conftest.$ac_objext conftest$ac_exeext
10436 if { (eval echo "$as_me:10436: \"$ac_link\"") >&5
10437   (eval $ac_link) 2>&5
10438   ac_status=$?
10439   echo "$as_me:10439: \$? = $ac_status" >&5
10440   (exit $ac_status); } &&
10441          { ac_try='test -s conftest$ac_exeext'
10442   { (eval echo "$as_me:10442: \"$ac_try\"") >&5
10443   (eval $ac_try) 2>&5
10444   ac_status=$?
10445   echo "$as_me:10445: \$? = $ac_status" >&5
10446   (exit $ac_status); }; }; then
10447   ac_cv_lib_dnet_dnet_ntoa=yes
10448 else
10449   echo "$as_me: failed program was:" >&5
10450 cat conftest.$ac_ext >&5
10451 ac_cv_lib_dnet_dnet_ntoa=no
10452 fi
10453 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10454 LIBS=$ac_check_lib_save_LIBS
10455 fi
10456 echo "$as_me:10456: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10457 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10458 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10459   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10460 fi
10461
10462     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10463       echo "$as_me:10463: checking for dnet_ntoa in -ldnet_stub" >&5
10464 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10465 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10466   echo $ECHO_N "(cached) $ECHO_C" >&6
10467 else
10468   ac_check_lib_save_LIBS=$LIBS
10469 LIBS="-ldnet_stub  $LIBS"
10470 cat >conftest.$ac_ext <<_ACEOF
10471 #line 10471 "configure"
10472 #include "confdefs.h"
10473
10474 /* Override any gcc2 internal prototype to avoid an error.  */
10475 #ifdef __cplusplus
10476 extern "C"
10477 #endif
10478 /* We use char because int might match the return type of a gcc2
10479    builtin and then its argument prototype would still apply.  */
10480 char dnet_ntoa ();
10481 int
10482 main ()
10483 {
10484 dnet_ntoa ();
10485   ;
10486   return 0;
10487 }
10488 _ACEOF
10489 rm -f conftest.$ac_objext conftest$ac_exeext
10490 if { (eval echo "$as_me:10490: \"$ac_link\"") >&5
10491   (eval $ac_link) 2>&5
10492   ac_status=$?
10493   echo "$as_me:10493: \$? = $ac_status" >&5
10494   (exit $ac_status); } &&
10495          { ac_try='test -s conftest$ac_exeext'
10496   { (eval echo "$as_me:10496: \"$ac_try\"") >&5
10497   (eval $ac_try) 2>&5
10498   ac_status=$?
10499   echo "$as_me:10499: \$? = $ac_status" >&5
10500   (exit $ac_status); }; }; then
10501   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10502 else
10503   echo "$as_me: failed program was:" >&5
10504 cat conftest.$ac_ext >&5
10505 ac_cv_lib_dnet_stub_dnet_ntoa=no
10506 fi
10507 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10508 LIBS=$ac_check_lib_save_LIBS
10509 fi
10510 echo "$as_me:10510: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10511 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10512 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10513   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10514 fi
10515
10516     fi
10517 fi
10518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10519     LIBS="$ac_xsave_LIBS"
10520
10521     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10522     # to get the SysV transport functions.
10523     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10524     # needs -lnsl.
10525     # The nsl library prevents programs from opening the X display
10526     # on Irix 5.2, according to T.E. Dickey.
10527     # The functions gethostbyname, getservbyname, and inet_addr are
10528     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10529     echo "$as_me:10529: checking for gethostbyname" >&5
10530 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10531 if test "${ac_cv_func_gethostbyname+set}" = set; then
10532   echo $ECHO_N "(cached) $ECHO_C" >&6
10533 else
10534   cat >conftest.$ac_ext <<_ACEOF
10535 #line 10535 "configure"
10536 #include "confdefs.h"
10537 /* System header to define __stub macros and hopefully few prototypes,
10538     which can conflict with char gethostbyname (); below.  */
10539 #include <assert.h>
10540 /* Override any gcc2 internal prototype to avoid an error.  */
10541 #ifdef __cplusplus
10542 extern "C"
10543 #endif
10544 /* We use char because int might match the return type of a gcc2
10545    builtin and then its argument prototype would still apply.  */
10546 char gethostbyname ();
10547 char (*f) ();
10548
10549 int
10550 main ()
10551 {
10552 /* The GNU C library defines this for functions which it implements
10553     to always fail with ENOSYS.  Some functions are actually named
10554     something starting with __ and the normal name is an alias.  */
10555 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10556 choke me
10557 #else
10558 f = gethostbyname;
10559 #endif
10560
10561   ;
10562   return 0;
10563 }
10564 _ACEOF
10565 rm -f conftest.$ac_objext conftest$ac_exeext
10566 if { (eval echo "$as_me:10566: \"$ac_link\"") >&5
10567   (eval $ac_link) 2>&5
10568   ac_status=$?
10569   echo "$as_me:10569: \$? = $ac_status" >&5
10570   (exit $ac_status); } &&
10571          { ac_try='test -s conftest$ac_exeext'
10572   { (eval echo "$as_me:10572: \"$ac_try\"") >&5
10573   (eval $ac_try) 2>&5
10574   ac_status=$?
10575   echo "$as_me:10575: \$? = $ac_status" >&5
10576   (exit $ac_status); }; }; then
10577   ac_cv_func_gethostbyname=yes
10578 else
10579   echo "$as_me: failed program was:" >&5
10580 cat conftest.$ac_ext >&5
10581 ac_cv_func_gethostbyname=no
10582 fi
10583 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10584 fi
10585 echo "$as_me:10585: result: $ac_cv_func_gethostbyname" >&5
10586 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10587
10588     if test $ac_cv_func_gethostbyname = no; then
10589       echo "$as_me:10589: checking for gethostbyname in -lnsl" >&5
10590 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10591 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10592   echo $ECHO_N "(cached) $ECHO_C" >&6
10593 else
10594   ac_check_lib_save_LIBS=$LIBS
10595 LIBS="-lnsl  $LIBS"
10596 cat >conftest.$ac_ext <<_ACEOF
10597 #line 10597 "configure"
10598 #include "confdefs.h"
10599
10600 /* Override any gcc2 internal prototype to avoid an error.  */
10601 #ifdef __cplusplus
10602 extern "C"
10603 #endif
10604 /* We use char because int might match the return type of a gcc2
10605    builtin and then its argument prototype would still apply.  */
10606 char gethostbyname ();
10607 int
10608 main ()
10609 {
10610 gethostbyname ();
10611   ;
10612   return 0;
10613 }
10614 _ACEOF
10615 rm -f conftest.$ac_objext conftest$ac_exeext
10616 if { (eval echo "$as_me:10616: \"$ac_link\"") >&5
10617   (eval $ac_link) 2>&5
10618   ac_status=$?
10619   echo "$as_me:10619: \$? = $ac_status" >&5
10620   (exit $ac_status); } &&
10621          { ac_try='test -s conftest$ac_exeext'
10622   { (eval echo "$as_me:10622: \"$ac_try\"") >&5
10623   (eval $ac_try) 2>&5
10624   ac_status=$?
10625   echo "$as_me:10625: \$? = $ac_status" >&5
10626   (exit $ac_status); }; }; then
10627   ac_cv_lib_nsl_gethostbyname=yes
10628 else
10629   echo "$as_me: failed program was:" >&5
10630 cat conftest.$ac_ext >&5
10631 ac_cv_lib_nsl_gethostbyname=no
10632 fi
10633 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10634 LIBS=$ac_check_lib_save_LIBS
10635 fi
10636 echo "$as_me:10636: result: $ac_cv_lib_nsl_gethostbyname" >&5
10637 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10638 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10639   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10640 fi
10641
10642       if test $ac_cv_lib_nsl_gethostbyname = no; then
10643         echo "$as_me:10643: checking for gethostbyname in -lbsd" >&5
10644 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10645 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10646   echo $ECHO_N "(cached) $ECHO_C" >&6
10647 else
10648   ac_check_lib_save_LIBS=$LIBS
10649 LIBS="-lbsd  $LIBS"
10650 cat >conftest.$ac_ext <<_ACEOF
10651 #line 10651 "configure"
10652 #include "confdefs.h"
10653
10654 /* Override any gcc2 internal prototype to avoid an error.  */
10655 #ifdef __cplusplus
10656 extern "C"
10657 #endif
10658 /* We use char because int might match the return type of a gcc2
10659    builtin and then its argument prototype would still apply.  */
10660 char gethostbyname ();
10661 int
10662 main ()
10663 {
10664 gethostbyname ();
10665   ;
10666   return 0;
10667 }
10668 _ACEOF
10669 rm -f conftest.$ac_objext conftest$ac_exeext
10670 if { (eval echo "$as_me:10670: \"$ac_link\"") >&5
10671   (eval $ac_link) 2>&5
10672   ac_status=$?
10673   echo "$as_me:10673: \$? = $ac_status" >&5
10674   (exit $ac_status); } &&
10675          { ac_try='test -s conftest$ac_exeext'
10676   { (eval echo "$as_me:10676: \"$ac_try\"") >&5
10677   (eval $ac_try) 2>&5
10678   ac_status=$?
10679   echo "$as_me:10679: \$? = $ac_status" >&5
10680   (exit $ac_status); }; }; then
10681   ac_cv_lib_bsd_gethostbyname=yes
10682 else
10683   echo "$as_me: failed program was:" >&5
10684 cat conftest.$ac_ext >&5
10685 ac_cv_lib_bsd_gethostbyname=no
10686 fi
10687 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10688 LIBS=$ac_check_lib_save_LIBS
10689 fi
10690 echo "$as_me:10690: result: $ac_cv_lib_bsd_gethostbyname" >&5
10691 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10692 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10693   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10694 fi
10695
10696       fi
10697     fi
10698
10699     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10700     # socket/setsockopt and other routines are undefined under SCO ODT
10701     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10702     # on later versions), says Simon Leinen: it contains gethostby*
10703     # variants that don't use the nameserver (or something).  -lsocket
10704     # must be given before -lnsl if both are needed.  We assume that
10705     # if connect needs -lnsl, so does gethostbyname.
10706     echo "$as_me:10706: checking for connect" >&5
10707 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10708 if test "${ac_cv_func_connect+set}" = set; then
10709   echo $ECHO_N "(cached) $ECHO_C" >&6
10710 else
10711   cat >conftest.$ac_ext <<_ACEOF
10712 #line 10712 "configure"
10713 #include "confdefs.h"
10714 /* System header to define __stub macros and hopefully few prototypes,
10715     which can conflict with char connect (); below.  */
10716 #include <assert.h>
10717 /* Override any gcc2 internal prototype to avoid an error.  */
10718 #ifdef __cplusplus
10719 extern "C"
10720 #endif
10721 /* We use char because int might match the return type of a gcc2
10722    builtin and then its argument prototype would still apply.  */
10723 char connect ();
10724 char (*f) ();
10725
10726 int
10727 main ()
10728 {
10729 /* The GNU C library defines this for functions which it implements
10730     to always fail with ENOSYS.  Some functions are actually named
10731     something starting with __ and the normal name is an alias.  */
10732 #if defined (__stub_connect) || defined (__stub___connect)
10733 choke me
10734 #else
10735 f = connect;
10736 #endif
10737
10738   ;
10739   return 0;
10740 }
10741 _ACEOF
10742 rm -f conftest.$ac_objext conftest$ac_exeext
10743 if { (eval echo "$as_me:10743: \"$ac_link\"") >&5
10744   (eval $ac_link) 2>&5
10745   ac_status=$?
10746   echo "$as_me:10746: \$? = $ac_status" >&5
10747   (exit $ac_status); } &&
10748          { ac_try='test -s conftest$ac_exeext'
10749   { (eval echo "$as_me:10749: \"$ac_try\"") >&5
10750   (eval $ac_try) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit $ac_status); }; }; then
10754   ac_cv_func_connect=yes
10755 else
10756   echo "$as_me: failed program was:" >&5
10757 cat conftest.$ac_ext >&5
10758 ac_cv_func_connect=no
10759 fi
10760 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10761 fi
10762 echo "$as_me:10762: result: $ac_cv_func_connect" >&5
10763 echo "${ECHO_T}$ac_cv_func_connect" >&6
10764
10765     if test $ac_cv_func_connect = no; then
10766       echo "$as_me:10766: checking for connect in -lsocket" >&5
10767 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10768 if test "${ac_cv_lib_socket_connect+set}" = set; then
10769   echo $ECHO_N "(cached) $ECHO_C" >&6
10770 else
10771   ac_check_lib_save_LIBS=$LIBS
10772 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10773 cat >conftest.$ac_ext <<_ACEOF
10774 #line 10774 "configure"
10775 #include "confdefs.h"
10776
10777 /* Override any gcc2 internal prototype to avoid an error.  */
10778 #ifdef __cplusplus
10779 extern "C"
10780 #endif
10781 /* We use char because int might match the return type of a gcc2
10782    builtin and then its argument prototype would still apply.  */
10783 char connect ();
10784 int
10785 main ()
10786 {
10787 connect ();
10788   ;
10789   return 0;
10790 }
10791 _ACEOF
10792 rm -f conftest.$ac_objext conftest$ac_exeext
10793 if { (eval echo "$as_me:10793: \"$ac_link\"") >&5
10794   (eval $ac_link) 2>&5
10795   ac_status=$?
10796   echo "$as_me:10796: \$? = $ac_status" >&5
10797   (exit $ac_status); } &&
10798          { ac_try='test -s conftest$ac_exeext'
10799   { (eval echo "$as_me:10799: \"$ac_try\"") >&5
10800   (eval $ac_try) 2>&5
10801   ac_status=$?
10802   echo "$as_me:10802: \$? = $ac_status" >&5
10803   (exit $ac_status); }; }; then
10804   ac_cv_lib_socket_connect=yes
10805 else
10806   echo "$as_me: failed program was:" >&5
10807 cat conftest.$ac_ext >&5
10808 ac_cv_lib_socket_connect=no
10809 fi
10810 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10811 LIBS=$ac_check_lib_save_LIBS
10812 fi
10813 echo "$as_me:10813: result: $ac_cv_lib_socket_connect" >&5
10814 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10815 if test $ac_cv_lib_socket_connect = yes; then
10816   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10817 fi
10818
10819     fi
10820
10821     # Guillermo Gomez says -lposix is necessary on A/UX.
10822     echo "$as_me:10822: checking for remove" >&5
10823 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10824 if test "${ac_cv_func_remove+set}" = set; then
10825   echo $ECHO_N "(cached) $ECHO_C" >&6
10826 else
10827   cat >conftest.$ac_ext <<_ACEOF
10828 #line 10828 "configure"
10829 #include "confdefs.h"
10830 /* System header to define __stub macros and hopefully few prototypes,
10831     which can conflict with char remove (); below.  */
10832 #include <assert.h>
10833 /* Override any gcc2 internal prototype to avoid an error.  */
10834 #ifdef __cplusplus
10835 extern "C"
10836 #endif
10837 /* We use char because int might match the return type of a gcc2
10838    builtin and then its argument prototype would still apply.  */
10839 char remove ();
10840 char (*f) ();
10841
10842 int
10843 main ()
10844 {
10845 /* The GNU C library defines this for functions which it implements
10846     to always fail with ENOSYS.  Some functions are actually named
10847     something starting with __ and the normal name is an alias.  */
10848 #if defined (__stub_remove) || defined (__stub___remove)
10849 choke me
10850 #else
10851 f = remove;
10852 #endif
10853
10854   ;
10855   return 0;
10856 }
10857 _ACEOF
10858 rm -f conftest.$ac_objext conftest$ac_exeext
10859 if { (eval echo "$as_me:10859: \"$ac_link\"") >&5
10860   (eval $ac_link) 2>&5
10861   ac_status=$?
10862   echo "$as_me:10862: \$? = $ac_status" >&5
10863   (exit $ac_status); } &&
10864          { ac_try='test -s conftest$ac_exeext'
10865   { (eval echo "$as_me:10865: \"$ac_try\"") >&5
10866   (eval $ac_try) 2>&5
10867   ac_status=$?
10868   echo "$as_me:10868: \$? = $ac_status" >&5
10869   (exit $ac_status); }; }; then
10870   ac_cv_func_remove=yes
10871 else
10872   echo "$as_me: failed program was:" >&5
10873 cat conftest.$ac_ext >&5
10874 ac_cv_func_remove=no
10875 fi
10876 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10877 fi
10878 echo "$as_me:10878: result: $ac_cv_func_remove" >&5
10879 echo "${ECHO_T}$ac_cv_func_remove" >&6
10880
10881     if test $ac_cv_func_remove = no; then
10882       echo "$as_me:10882: checking for remove in -lposix" >&5
10883 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10884 if test "${ac_cv_lib_posix_remove+set}" = set; then
10885   echo $ECHO_N "(cached) $ECHO_C" >&6
10886 else
10887   ac_check_lib_save_LIBS=$LIBS
10888 LIBS="-lposix  $LIBS"
10889 cat >conftest.$ac_ext <<_ACEOF
10890 #line 10890 "configure"
10891 #include "confdefs.h"
10892
10893 /* Override any gcc2 internal prototype to avoid an error.  */
10894 #ifdef __cplusplus
10895 extern "C"
10896 #endif
10897 /* We use char because int might match the return type of a gcc2
10898    builtin and then its argument prototype would still apply.  */
10899 char remove ();
10900 int
10901 main ()
10902 {
10903 remove ();
10904   ;
10905   return 0;
10906 }
10907 _ACEOF
10908 rm -f conftest.$ac_objext conftest$ac_exeext
10909 if { (eval echo "$as_me:10909: \"$ac_link\"") >&5
10910   (eval $ac_link) 2>&5
10911   ac_status=$?
10912   echo "$as_me:10912: \$? = $ac_status" >&5
10913   (exit $ac_status); } &&
10914          { ac_try='test -s conftest$ac_exeext'
10915   { (eval echo "$as_me:10915: \"$ac_try\"") >&5
10916   (eval $ac_try) 2>&5
10917   ac_status=$?
10918   echo "$as_me:10918: \$? = $ac_status" >&5
10919   (exit $ac_status); }; }; then
10920   ac_cv_lib_posix_remove=yes
10921 else
10922   echo "$as_me: failed program was:" >&5
10923 cat conftest.$ac_ext >&5
10924 ac_cv_lib_posix_remove=no
10925 fi
10926 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10927 LIBS=$ac_check_lib_save_LIBS
10928 fi
10929 echo "$as_me:10929: result: $ac_cv_lib_posix_remove" >&5
10930 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10931 if test $ac_cv_lib_posix_remove = yes; then
10932   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10933 fi
10934
10935     fi
10936
10937     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10938     echo "$as_me:10938: checking for shmat" >&5
10939 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10940 if test "${ac_cv_func_shmat+set}" = set; then
10941   echo $ECHO_N "(cached) $ECHO_C" >&6
10942 else
10943   cat >conftest.$ac_ext <<_ACEOF
10944 #line 10944 "configure"
10945 #include "confdefs.h"
10946 /* System header to define __stub macros and hopefully few prototypes,
10947     which can conflict with char shmat (); below.  */
10948 #include <assert.h>
10949 /* Override any gcc2 internal prototype to avoid an error.  */
10950 #ifdef __cplusplus
10951 extern "C"
10952 #endif
10953 /* We use char because int might match the return type of a gcc2
10954    builtin and then its argument prototype would still apply.  */
10955 char shmat ();
10956 char (*f) ();
10957
10958 int
10959 main ()
10960 {
10961 /* The GNU C library defines this for functions which it implements
10962     to always fail with ENOSYS.  Some functions are actually named
10963     something starting with __ and the normal name is an alias.  */
10964 #if defined (__stub_shmat) || defined (__stub___shmat)
10965 choke me
10966 #else
10967 f = shmat;
10968 #endif
10969
10970   ;
10971   return 0;
10972 }
10973 _ACEOF
10974 rm -f conftest.$ac_objext conftest$ac_exeext
10975 if { (eval echo "$as_me:10975: \"$ac_link\"") >&5
10976   (eval $ac_link) 2>&5
10977   ac_status=$?
10978   echo "$as_me:10978: \$? = $ac_status" >&5
10979   (exit $ac_status); } &&
10980          { ac_try='test -s conftest$ac_exeext'
10981   { (eval echo "$as_me:10981: \"$ac_try\"") >&5
10982   (eval $ac_try) 2>&5
10983   ac_status=$?
10984   echo "$as_me:10984: \$? = $ac_status" >&5
10985   (exit $ac_status); }; }; then
10986   ac_cv_func_shmat=yes
10987 else
10988   echo "$as_me: failed program was:" >&5
10989 cat conftest.$ac_ext >&5
10990 ac_cv_func_shmat=no
10991 fi
10992 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10993 fi
10994 echo "$as_me:10994: result: $ac_cv_func_shmat" >&5
10995 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10996
10997     if test $ac_cv_func_shmat = no; then
10998       echo "$as_me:10998: checking for shmat in -lipc" >&5
10999 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11000 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11001   echo $ECHO_N "(cached) $ECHO_C" >&6
11002 else
11003   ac_check_lib_save_LIBS=$LIBS
11004 LIBS="-lipc  $LIBS"
11005 cat >conftest.$ac_ext <<_ACEOF
11006 #line 11006 "configure"
11007 #include "confdefs.h"
11008
11009 /* Override any gcc2 internal prototype to avoid an error.  */
11010 #ifdef __cplusplus
11011 extern "C"
11012 #endif
11013 /* We use char because int might match the return type of a gcc2
11014    builtin and then its argument prototype would still apply.  */
11015 char shmat ();
11016 int
11017 main ()
11018 {
11019 shmat ();
11020   ;
11021   return 0;
11022 }
11023 _ACEOF
11024 rm -f conftest.$ac_objext conftest$ac_exeext
11025 if { (eval echo "$as_me:11025: \"$ac_link\"") >&5
11026   (eval $ac_link) 2>&5
11027   ac_status=$?
11028   echo "$as_me:11028: \$? = $ac_status" >&5
11029   (exit $ac_status); } &&
11030          { ac_try='test -s conftest$ac_exeext'
11031   { (eval echo "$as_me:11031: \"$ac_try\"") >&5
11032   (eval $ac_try) 2>&5
11033   ac_status=$?
11034   echo "$as_me:11034: \$? = $ac_status" >&5
11035   (exit $ac_status); }; }; then
11036   ac_cv_lib_ipc_shmat=yes
11037 else
11038   echo "$as_me: failed program was:" >&5
11039 cat conftest.$ac_ext >&5
11040 ac_cv_lib_ipc_shmat=no
11041 fi
11042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11043 LIBS=$ac_check_lib_save_LIBS
11044 fi
11045 echo "$as_me:11045: result: $ac_cv_lib_ipc_shmat" >&5
11046 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11047 if test $ac_cv_lib_ipc_shmat = yes; then
11048   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11049 fi
11050
11051     fi
11052   fi
11053
11054   # Check for libraries that X11R6 Xt/Xaw programs need.
11055   ac_save_LDFLAGS=$LDFLAGS
11056   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11057   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11058   # check for ICE first), but we must link in the order -lSM -lICE or
11059   # we get undefined symbols.  So assume we have SM if we have ICE.
11060   # These have to be linked with before -lX11, unlike the other
11061   # libraries we check for below, so use a different variable.
11062   # John Interrante, Karl Berry
11063   echo "$as_me:11063: checking for IceConnectionNumber in -lICE" >&5
11064 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11065 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11066   echo $ECHO_N "(cached) $ECHO_C" >&6
11067 else
11068   ac_check_lib_save_LIBS=$LIBS
11069 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11070 cat >conftest.$ac_ext <<_ACEOF
11071 #line 11071 "configure"
11072 #include "confdefs.h"
11073
11074 /* Override any gcc2 internal prototype to avoid an error.  */
11075 #ifdef __cplusplus
11076 extern "C"
11077 #endif
11078 /* We use char because int might match the return type of a gcc2
11079    builtin and then its argument prototype would still apply.  */
11080 char IceConnectionNumber ();
11081 int
11082 main ()
11083 {
11084 IceConnectionNumber ();
11085   ;
11086   return 0;
11087 }
11088 _ACEOF
11089 rm -f conftest.$ac_objext conftest$ac_exeext
11090 if { (eval echo "$as_me:11090: \"$ac_link\"") >&5
11091   (eval $ac_link) 2>&5
11092   ac_status=$?
11093   echo "$as_me:11093: \$? = $ac_status" >&5
11094   (exit $ac_status); } &&
11095          { ac_try='test -s conftest$ac_exeext'
11096   { (eval echo "$as_me:11096: \"$ac_try\"") >&5
11097   (eval $ac_try) 2>&5
11098   ac_status=$?
11099   echo "$as_me:11099: \$? = $ac_status" >&5
11100   (exit $ac_status); }; }; then
11101   ac_cv_lib_ICE_IceConnectionNumber=yes
11102 else
11103   echo "$as_me: failed program was:" >&5
11104 cat conftest.$ac_ext >&5
11105 ac_cv_lib_ICE_IceConnectionNumber=no
11106 fi
11107 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11108 LIBS=$ac_check_lib_save_LIBS
11109 fi
11110 echo "$as_me:11110: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11111 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11112 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11113   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11114 fi
11115
11116   LDFLAGS=$ac_save_LDFLAGS
11117
11118 fi
11119
11120 cf_x_athena=${cf_x_athena:-Xaw}
11121
11122 echo "$as_me:11122: checking if you want to link with Xaw 3d library" >&5
11123 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11124 withval=
11125
11126 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11127 if test "${with_Xaw3d+set}" = set; then
11128   withval="$with_Xaw3d"
11129
11130 fi;
11131 if test "$withval" = yes ; then
11132         cf_x_athena=Xaw3d
11133         echo "$as_me:11133: result: yes" >&5
11134 echo "${ECHO_T}yes" >&6
11135 else
11136         echo "$as_me:11136: result: no" >&5
11137 echo "${ECHO_T}no" >&6
11138 fi
11139
11140 echo "$as_me:11140: checking if you want to link with neXT Athena library" >&5
11141 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11142 withval=
11143
11144 # Check whether --with-neXtaw or --without-neXtaw was given.
11145 if test "${with_neXtaw+set}" = set; then
11146   withval="$with_neXtaw"
11147
11148 fi;
11149 if test "$withval" = yes ; then
11150         cf_x_athena=neXtaw
11151         echo "$as_me:11151: result: yes" >&5
11152 echo "${ECHO_T}yes" >&6
11153 else
11154         echo "$as_me:11154: result: no" >&5
11155 echo "${ECHO_T}no" >&6
11156 fi
11157
11158 echo "$as_me:11158: checking if you want to link with Athena-Plus library" >&5
11159 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11160 withval=
11161
11162 # Check whether --with-XawPlus or --without-XawPlus was given.
11163 if test "${with_XawPlus+set}" = set; then
11164   withval="$with_XawPlus"
11165
11166 fi;
11167 if test "$withval" = yes ; then
11168         cf_x_athena=XawPlus
11169         echo "$as_me:11169: result: yes" >&5
11170 echo "${ECHO_T}yes" >&6
11171 else
11172         echo "$as_me:11172: result: no" >&5
11173 echo "${ECHO_T}no" >&6
11174 fi
11175
11176 cf_x_athena_lib=""
11177
11178 if test "$PKG_CONFIG" != none ; then
11179         cf_athena_list=
11180         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11181         for cf_athena_pkg in \
11182                 $cf_athena_list \
11183                 ${cf_x_athena} \
11184                 ${cf_x_athena}-devel \
11185                 lib${cf_x_athena} \
11186                 lib${cf_x_athena}-devel
11187         do
11188
11189 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11190         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11191
11192 echo "${as_me:-configure}:11192: testing found package $cf_athena_pkg ..." 1>&5
11193
11194         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11195         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11196         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11197
11198 echo "${as_me:-configure}:11198: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11199
11200         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11201
11202 echo "${as_me:-configure}:11202: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11203
11204 cf_fix_cppflags=no
11205 cf_new_cflags=
11206 cf_new_cppflags=
11207 cf_new_extra_cppflags=
11208
11209 for cf_add_cflags in $cf_pkgconfig_incs
11210 do
11211 case $cf_fix_cppflags in
11212 no)
11213         case $cf_add_cflags in #(vi
11214         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11215                 case $cf_add_cflags in
11216                 -D*)
11217                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11218
11219                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11220                                 && test -z "${cf_tst_cflags}" \
11221                                 && cf_fix_cppflags=yes
11222
11223                         if test $cf_fix_cppflags = yes ; then
11224                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11225                                 continue
11226                         elif test "${cf_tst_cflags}" = "\"'" ; then
11227                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11228                                 continue
11229                         fi
11230                         ;;
11231                 esac
11232                 case "$CPPFLAGS" in
11233                 *$cf_add_cflags) #(vi
11234                         ;;
11235                 *) #(vi
11236                         case $cf_add_cflags in #(vi
11237                         -D*)
11238                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11239
11240 CPPFLAGS=`echo "$CPPFLAGS" | \
11241         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11242                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11243
11244                                 ;;
11245                         esac
11246                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11247                         ;;
11248                 esac
11249                 ;;
11250         *)
11251                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11252                 ;;
11253         esac
11254         ;;
11255 yes)
11256         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11257
11258         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11259
11260         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11261                 && test -z "${cf_tst_cflags}" \
11262                 && cf_fix_cppflags=no
11263         ;;
11264 esac
11265 done
11266
11267 if test -n "$cf_new_cflags" ; then
11268
11269         CFLAGS="$CFLAGS $cf_new_cflags"
11270 fi
11271
11272 if test -n "$cf_new_cppflags" ; then
11273
11274         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11275 fi
11276
11277 if test -n "$cf_new_extra_cppflags" ; then
11278
11279         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11280 fi
11281
11282         LIBS="$cf_pkgconfig_libs $LIBS"
11283
11284                         cf_x_athena_lib="$cf_pkgconfig_libs"
11285
11286 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11287
11288                         cat >>confdefs.h <<EOF
11289 #define $cf_x_athena_LIBS 1
11290 EOF
11291
11292 echo "$as_me:11292: checking for usable $cf_x_athena/Xmu package" >&5
11293 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11294 if test "${cf_cv_xaw_compat+set}" = set; then
11295   echo $ECHO_N "(cached) $ECHO_C" >&6
11296 else
11297
11298 cat >conftest.$ac_ext <<_ACEOF
11299 #line 11299 "configure"
11300 #include "confdefs.h"
11301
11302 #include <X11/Xmu/CharSet.h>
11303
11304 int
11305 main ()
11306 {
11307
11308 int check = XmuCompareISOLatin1("big", "small")
11309
11310   ;
11311   return 0;
11312 }
11313 _ACEOF
11314 rm -f conftest.$ac_objext conftest$ac_exeext
11315 if { (eval echo "$as_me:11315: \"$ac_link\"") >&5
11316   (eval $ac_link) 2>&5
11317   ac_status=$?
11318   echo "$as_me:11318: \$? = $ac_status" >&5
11319   (exit $ac_status); } &&
11320          { ac_try='test -s conftest$ac_exeext'
11321   { (eval echo "$as_me:11321: \"$ac_try\"") >&5
11322   (eval $ac_try) 2>&5
11323   ac_status=$?
11324   echo "$as_me:11324: \$? = $ac_status" >&5
11325   (exit $ac_status); }; }; then
11326   cf_cv_xaw_compat=yes
11327 else
11328   echo "$as_me: failed program was:" >&5
11329 cat conftest.$ac_ext >&5
11330 cf_cv_xaw_compat=no
11331 fi
11332 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11333 fi
11334 echo "$as_me:11334: result: $cf_cv_xaw_compat" >&5
11335 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11336
11337                         if test "$cf_cv_xaw_compat" = no
11338                         then
11339                                 # workaround for broken ".pc" files...
11340                                 case "$cf_x_athena_lib" in #(vi
11341                                 *-lXmu*) #(vi
11342                                         ;;
11343                                 *)
11344                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11345
11346 echo "${as_me:-configure}:11346: testing work around broken package ..." 1>&5
11347
11348 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11349         test -n "$verbose" && echo "    found package xmu" 1>&6
11350
11351 echo "${as_me:-configure}:11351: testing found package xmu ..." 1>&5
11352
11353         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11354         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11355         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11356
11357 echo "${as_me:-configure}:11357: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11358
11359         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11360
11361 echo "${as_me:-configure}:11361: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11362
11363 cf_fix_cppflags=no
11364 cf_new_cflags=
11365 cf_new_cppflags=
11366 cf_new_extra_cppflags=
11367
11368 for cf_add_cflags in $cf_pkgconfig_incs
11369 do
11370 case $cf_fix_cppflags in
11371 no)
11372         case $cf_add_cflags in #(vi
11373         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11374                 case $cf_add_cflags in
11375                 -D*)
11376                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11377
11378                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11379                                 && test -z "${cf_tst_cflags}" \
11380                                 && cf_fix_cppflags=yes
11381
11382                         if test $cf_fix_cppflags = yes ; then
11383                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11384                                 continue
11385                         elif test "${cf_tst_cflags}" = "\"'" ; then
11386                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11387                                 continue
11388                         fi
11389                         ;;
11390                 esac
11391                 case "$CPPFLAGS" in
11392                 *$cf_add_cflags) #(vi
11393                         ;;
11394                 *) #(vi
11395                         case $cf_add_cflags in #(vi
11396                         -D*)
11397                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11398
11399 CPPFLAGS=`echo "$CPPFLAGS" | \
11400         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11401                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11402
11403                                 ;;
11404                         esac
11405                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11406                         ;;
11407                 esac
11408                 ;;
11409         *)
11410                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11411                 ;;
11412         esac
11413         ;;
11414 yes)
11415         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11416
11417         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11418
11419         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11420                 && test -z "${cf_tst_cflags}" \
11421                 && cf_fix_cppflags=no
11422         ;;
11423 esac
11424 done
11425
11426 if test -n "$cf_new_cflags" ; then
11427
11428         CFLAGS="$CFLAGS $cf_new_cflags"
11429 fi
11430
11431 if test -n "$cf_new_cppflags" ; then
11432
11433         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11434 fi
11435
11436 if test -n "$cf_new_extra_cppflags" ; then
11437
11438         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11439 fi
11440
11441         LIBS="$cf_pkgconfig_libs $LIBS"
11442         :
11443 else
11444
11445 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11446
11447 echo "${as_me:-configure}:11447: testing ...before $LIBS ..." 1>&5
11448
11449 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11450 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11451
11452 echo "${as_me:-configure}:11452: testing ...after  $LIBS ..." 1>&5
11453
11454 fi
11455
11456                                         ;;
11457                                 esac
11458                         fi
11459
11460                         break
11461 else
11462         :
11463 fi
11464
11465         done
11466 fi
11467
11468 if test -z "$cf_x_athena_lib" ; then
11469
11470 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11471         test -n "$verbose" && echo "    found package Xext" 1>&6
11472
11473 echo "${as_me:-configure}:11473: testing found package Xext ..." 1>&5
11474
11475         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11476         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11477         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11478
11479 echo "${as_me:-configure}:11479: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11480
11481         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11482
11483 echo "${as_me:-configure}:11483: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11484
11485 cf_fix_cppflags=no
11486 cf_new_cflags=
11487 cf_new_cppflags=
11488 cf_new_extra_cppflags=
11489
11490 for cf_add_cflags in $cf_pkgconfig_incs
11491 do
11492 case $cf_fix_cppflags in
11493 no)
11494         case $cf_add_cflags in #(vi
11495         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11496                 case $cf_add_cflags in
11497                 -D*)
11498                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11499
11500                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11501                                 && test -z "${cf_tst_cflags}" \
11502                                 && cf_fix_cppflags=yes
11503
11504                         if test $cf_fix_cppflags = yes ; then
11505                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11506                                 continue
11507                         elif test "${cf_tst_cflags}" = "\"'" ; then
11508                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11509                                 continue
11510                         fi
11511                         ;;
11512                 esac
11513                 case "$CPPFLAGS" in
11514                 *$cf_add_cflags) #(vi
11515                         ;;
11516                 *) #(vi
11517                         case $cf_add_cflags in #(vi
11518                         -D*)
11519                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11520
11521 CPPFLAGS=`echo "$CPPFLAGS" | \
11522         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11523                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11524
11525                                 ;;
11526                         esac
11527                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11528                         ;;
11529                 esac
11530                 ;;
11531         *)
11532                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11533                 ;;
11534         esac
11535         ;;
11536 yes)
11537         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11538
11539         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11540
11541         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11542                 && test -z "${cf_tst_cflags}" \
11543                 && cf_fix_cppflags=no
11544         ;;
11545 esac
11546 done
11547
11548 if test -n "$cf_new_cflags" ; then
11549
11550         CFLAGS="$CFLAGS $cf_new_cflags"
11551 fi
11552
11553 if test -n "$cf_new_cppflags" ; then
11554
11555         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11556 fi
11557
11558 if test -n "$cf_new_extra_cppflags" ; then
11559
11560         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11561 fi
11562
11563         LIBS="$cf_pkgconfig_libs $LIBS"
11564         :
11565 else
11566
11567         echo "$as_me:11567: checking for XextCreateExtension in -lXext" >&5
11568 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11569 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11570   echo $ECHO_N "(cached) $ECHO_C" >&6
11571 else
11572   ac_check_lib_save_LIBS=$LIBS
11573 LIBS="-lXext  $LIBS"
11574 cat >conftest.$ac_ext <<_ACEOF
11575 #line 11575 "configure"
11576 #include "confdefs.h"
11577
11578 /* Override any gcc2 internal prototype to avoid an error.  */
11579 #ifdef __cplusplus
11580 extern "C"
11581 #endif
11582 /* We use char because int might match the return type of a gcc2
11583    builtin and then its argument prototype would still apply.  */
11584 char XextCreateExtension ();
11585 int
11586 main ()
11587 {
11588 XextCreateExtension ();
11589   ;
11590   return 0;
11591 }
11592 _ACEOF
11593 rm -f conftest.$ac_objext conftest$ac_exeext
11594 if { (eval echo "$as_me:11594: \"$ac_link\"") >&5
11595   (eval $ac_link) 2>&5
11596   ac_status=$?
11597   echo "$as_me:11597: \$? = $ac_status" >&5
11598   (exit $ac_status); } &&
11599          { ac_try='test -s conftest$ac_exeext'
11600   { (eval echo "$as_me:11600: \"$ac_try\"") >&5
11601   (eval $ac_try) 2>&5
11602   ac_status=$?
11603   echo "$as_me:11603: \$? = $ac_status" >&5
11604   (exit $ac_status); }; }; then
11605   ac_cv_lib_Xext_XextCreateExtension=yes
11606 else
11607   echo "$as_me: failed program was:" >&5
11608 cat conftest.$ac_ext >&5
11609 ac_cv_lib_Xext_XextCreateExtension=no
11610 fi
11611 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11612 LIBS=$ac_check_lib_save_LIBS
11613 fi
11614 echo "$as_me:11614: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11615 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11616 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11617   LIBS="-lXext $LIBS"
11618 fi
11619
11620 fi
11621
11622 cf_have_X_LIBS=no
11623
11624 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11625         test -n "$verbose" && echo "    found package xt" 1>&6
11626
11627 echo "${as_me:-configure}:11627: testing found package xt ..." 1>&5
11628
11629         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11630         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11631         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11632
11633 echo "${as_me:-configure}:11633: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11634
11635         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11636
11637 echo "${as_me:-configure}:11637: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11638
11639 cf_fix_cppflags=no
11640 cf_new_cflags=
11641 cf_new_cppflags=
11642 cf_new_extra_cppflags=
11643
11644 for cf_add_cflags in $cf_pkgconfig_incs
11645 do
11646 case $cf_fix_cppflags in
11647 no)
11648         case $cf_add_cflags in #(vi
11649         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11650                 case $cf_add_cflags in
11651                 -D*)
11652                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11653
11654                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11655                                 && test -z "${cf_tst_cflags}" \
11656                                 && cf_fix_cppflags=yes
11657
11658                         if test $cf_fix_cppflags = yes ; then
11659                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11660                                 continue
11661                         elif test "${cf_tst_cflags}" = "\"'" ; then
11662                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11663                                 continue
11664                         fi
11665                         ;;
11666                 esac
11667                 case "$CPPFLAGS" in
11668                 *$cf_add_cflags) #(vi
11669                         ;;
11670                 *) #(vi
11671                         case $cf_add_cflags in #(vi
11672                         -D*)
11673                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11674
11675 CPPFLAGS=`echo "$CPPFLAGS" | \
11676         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11677                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11678
11679                                 ;;
11680                         esac
11681                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11682                         ;;
11683                 esac
11684                 ;;
11685         *)
11686                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11687                 ;;
11688         esac
11689         ;;
11690 yes)
11691         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11692
11693         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11694
11695         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11696                 && test -z "${cf_tst_cflags}" \
11697                 && cf_fix_cppflags=no
11698         ;;
11699 esac
11700 done
11701
11702 if test -n "$cf_new_cflags" ; then
11703
11704         CFLAGS="$CFLAGS $cf_new_cflags"
11705 fi
11706
11707 if test -n "$cf_new_cppflags" ; then
11708
11709         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11710 fi
11711
11712 if test -n "$cf_new_extra_cppflags" ; then
11713
11714         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11715 fi
11716
11717         LIBS="$cf_pkgconfig_libs $LIBS"
11718
11719         case "x$LIBS" in #(vi
11720         *-lX11*) #(vi
11721                 ;;
11722         *)
11723 # we have an "xt" package, but it may omit Xt's dependency on X11
11724 echo "$as_me:11724: checking for usable X dependency" >&5
11725 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11726 if test "${cf_cv_xt_x11_compat+set}" = set; then
11727   echo $ECHO_N "(cached) $ECHO_C" >&6
11728 else
11729
11730 cat >conftest.$ac_ext <<_ACEOF
11731 #line 11731 "configure"
11732 #include "confdefs.h"
11733
11734 #include <X11/Xlib.h>
11735
11736 int
11737 main ()
11738 {
11739
11740         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11741         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11742         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11743         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11744
11745   ;
11746   return 0;
11747 }
11748 _ACEOF
11749 rm -f conftest.$ac_objext conftest$ac_exeext
11750 if { (eval echo "$as_me:11750: \"$ac_link\"") >&5
11751   (eval $ac_link) 2>&5
11752   ac_status=$?
11753   echo "$as_me:11753: \$? = $ac_status" >&5
11754   (exit $ac_status); } &&
11755          { ac_try='test -s conftest$ac_exeext'
11756   { (eval echo "$as_me:11756: \"$ac_try\"") >&5
11757   (eval $ac_try) 2>&5
11758   ac_status=$?
11759   echo "$as_me:11759: \$? = $ac_status" >&5
11760   (exit $ac_status); }; }; then
11761   cf_cv_xt_x11_compat=yes
11762 else
11763   echo "$as_me: failed program was:" >&5
11764 cat conftest.$ac_ext >&5
11765 cf_cv_xt_x11_compat=no
11766 fi
11767 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11768 fi
11769 echo "$as_me:11769: result: $cf_cv_xt_x11_compat" >&5
11770 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11771                 if test "$cf_cv_xt_x11_compat" = no
11772                 then
11773                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11774
11775 echo "${as_me:-configure}:11775: testing work around broken X11 dependency ..." 1>&5
11776
11777                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11778
11779 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11780         test -n "$verbose" && echo "    found package x11" 1>&6
11781
11782 echo "${as_me:-configure}:11782: testing found package x11 ..." 1>&5
11783
11784         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11785         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11786         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11787
11788 echo "${as_me:-configure}:11788: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11789
11790         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11791
11792 echo "${as_me:-configure}:11792: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11793
11794 cf_fix_cppflags=no
11795 cf_new_cflags=
11796 cf_new_cppflags=
11797 cf_new_extra_cppflags=
11798
11799 for cf_add_cflags in $cf_pkgconfig_incs
11800 do
11801 case $cf_fix_cppflags in
11802 no)
11803         case $cf_add_cflags in #(vi
11804         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11805                 case $cf_add_cflags in
11806                 -D*)
11807                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11808
11809                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11810                                 && test -z "${cf_tst_cflags}" \
11811                                 && cf_fix_cppflags=yes
11812
11813                         if test $cf_fix_cppflags = yes ; then
11814                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11815                                 continue
11816                         elif test "${cf_tst_cflags}" = "\"'" ; then
11817                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11818                                 continue
11819                         fi
11820                         ;;
11821                 esac
11822                 case "$CPPFLAGS" in
11823                 *$cf_add_cflags) #(vi
11824                         ;;
11825                 *) #(vi
11826                         case $cf_add_cflags in #(vi
11827                         -D*)
11828                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11829
11830 CPPFLAGS=`echo "$CPPFLAGS" | \
11831         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11832                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11833
11834                                 ;;
11835                         esac
11836                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11837                         ;;
11838                 esac
11839                 ;;
11840         *)
11841                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11842                 ;;
11843         esac
11844         ;;
11845 yes)
11846         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11847
11848         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11849
11850         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11851                 && test -z "${cf_tst_cflags}" \
11852                 && cf_fix_cppflags=no
11853         ;;
11854 esac
11855 done
11856
11857 if test -n "$cf_new_cflags" ; then
11858
11859         CFLAGS="$CFLAGS $cf_new_cflags"
11860 fi
11861
11862 if test -n "$cf_new_cppflags" ; then
11863
11864         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11865 fi
11866
11867 if test -n "$cf_new_extra_cppflags" ; then
11868
11869         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11870 fi
11871
11872         LIBS="$cf_pkgconfig_libs $LIBS"
11873         :
11874 else
11875
11876 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11877
11878 echo "${as_me:-configure}:11878: testing ...before $LIBS ..." 1>&5
11879
11880 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11881 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11882
11883 echo "${as_me:-configure}:11883: testing ...after  $LIBS ..." 1>&5
11884
11885 fi
11886
11887                 fi
11888                 ;;
11889         esac
11890
11891 echo "$as_me:11891: checking for usable X Toolkit package" >&5
11892 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11893 if test "${cf_cv_xt_ice_compat+set}" = set; then
11894   echo $ECHO_N "(cached) $ECHO_C" >&6
11895 else
11896
11897 cat >conftest.$ac_ext <<_ACEOF
11898 #line 11898 "configure"
11899 #include "confdefs.h"
11900
11901 #include <X11/Shell.h>
11902
11903 int
11904 main ()
11905 {
11906 int num = IceConnectionNumber(0)
11907
11908   ;
11909   return 0;
11910 }
11911 _ACEOF
11912 rm -f conftest.$ac_objext conftest$ac_exeext
11913 if { (eval echo "$as_me:11913: \"$ac_link\"") >&5
11914   (eval $ac_link) 2>&5
11915   ac_status=$?
11916   echo "$as_me:11916: \$? = $ac_status" >&5
11917   (exit $ac_status); } &&
11918          { ac_try='test -s conftest$ac_exeext'
11919   { (eval echo "$as_me:11919: \"$ac_try\"") >&5
11920   (eval $ac_try) 2>&5
11921   ac_status=$?
11922   echo "$as_me:11922: \$? = $ac_status" >&5
11923   (exit $ac_status); }; }; then
11924   cf_cv_xt_ice_compat=yes
11925 else
11926   echo "$as_me: failed program was:" >&5
11927 cat conftest.$ac_ext >&5
11928 cf_cv_xt_ice_compat=no
11929 fi
11930 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11931 fi
11932 echo "$as_me:11932: result: $cf_cv_xt_ice_compat" >&5
11933 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11934
11935         if test "$cf_cv_xt_ice_compat" = no
11936         then
11937                 # workaround for broken ".pc" files used for X Toolkit.
11938                 case "x$X_PRE_LIBS" in #(vi
11939                 *-lICE*)
11940                         case "x$LIBS" in #(vi
11941                         *-lICE*) #(vi
11942                                 ;;
11943                         *)
11944                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11945
11946 echo "${as_me:-configure}:11946: testing work around broken ICE dependency ..." 1>&5
11947
11948 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11949         test -n "$verbose" && echo "    found package ice" 1>&6
11950
11951 echo "${as_me:-configure}:11951: testing found package ice ..." 1>&5
11952
11953         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11954         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11955         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11956
11957 echo "${as_me:-configure}:11957: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11958
11959         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11960
11961 echo "${as_me:-configure}:11961: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11962
11963 cf_fix_cppflags=no
11964 cf_new_cflags=
11965 cf_new_cppflags=
11966 cf_new_extra_cppflags=
11967
11968 for cf_add_cflags in $cf_pkgconfig_incs
11969 do
11970 case $cf_fix_cppflags in
11971 no)
11972         case $cf_add_cflags in #(vi
11973         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11974                 case $cf_add_cflags in
11975                 -D*)
11976                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11977
11978                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11979                                 && test -z "${cf_tst_cflags}" \
11980                                 && cf_fix_cppflags=yes
11981
11982                         if test $cf_fix_cppflags = yes ; then
11983                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11984                                 continue
11985                         elif test "${cf_tst_cflags}" = "\"'" ; then
11986                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11987                                 continue
11988                         fi
11989                         ;;
11990                 esac
11991                 case "$CPPFLAGS" in
11992                 *$cf_add_cflags) #(vi
11993                         ;;
11994                 *) #(vi
11995                         case $cf_add_cflags in #(vi
11996                         -D*)
11997                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11998
11999 CPPFLAGS=`echo "$CPPFLAGS" | \
12000         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12001                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12002
12003                                 ;;
12004                         esac
12005                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12006                         ;;
12007                 esac
12008                 ;;
12009         *)
12010                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12011                 ;;
12012         esac
12013         ;;
12014 yes)
12015         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12016
12017         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12018
12019         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12020                 && test -z "${cf_tst_cflags}" \
12021                 && cf_fix_cppflags=no
12022         ;;
12023 esac
12024 done
12025
12026 if test -n "$cf_new_cflags" ; then
12027
12028         CFLAGS="$CFLAGS $cf_new_cflags"
12029 fi
12030
12031 if test -n "$cf_new_cppflags" ; then
12032
12033         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12034 fi
12035
12036 if test -n "$cf_new_extra_cppflags" ; then
12037
12038         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12039 fi
12040
12041         LIBS="$cf_pkgconfig_libs $LIBS"
12042
12043 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12044         test -n "$verbose" && echo "    found package sm" 1>&6
12045
12046 echo "${as_me:-configure}:12046: testing found package sm ..." 1>&5
12047
12048         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12049         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12050         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12051
12052 echo "${as_me:-configure}:12052: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12053
12054         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12055
12056 echo "${as_me:-configure}:12056: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12057
12058 cf_fix_cppflags=no
12059 cf_new_cflags=
12060 cf_new_cppflags=
12061 cf_new_extra_cppflags=
12062
12063 for cf_add_cflags in $cf_pkgconfig_incs
12064 do
12065 case $cf_fix_cppflags in
12066 no)
12067         case $cf_add_cflags in #(vi
12068         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12069                 case $cf_add_cflags in
12070                 -D*)
12071                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12072
12073                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12074                                 && test -z "${cf_tst_cflags}" \
12075                                 && cf_fix_cppflags=yes
12076
12077                         if test $cf_fix_cppflags = yes ; then
12078                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12079                                 continue
12080                         elif test "${cf_tst_cflags}" = "\"'" ; then
12081                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12082                                 continue
12083                         fi
12084                         ;;
12085                 esac
12086                 case "$CPPFLAGS" in
12087                 *$cf_add_cflags) #(vi
12088                         ;;
12089                 *) #(vi
12090                         case $cf_add_cflags in #(vi
12091                         -D*)
12092                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12093
12094 CPPFLAGS=`echo "$CPPFLAGS" | \
12095         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12096                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12097
12098                                 ;;
12099                         esac
12100                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12101                         ;;
12102                 esac
12103                 ;;
12104         *)
12105                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12106                 ;;
12107         esac
12108         ;;
12109 yes)
12110         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12111
12112         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12113
12114         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12115                 && test -z "${cf_tst_cflags}" \
12116                 && cf_fix_cppflags=no
12117         ;;
12118 esac
12119 done
12120
12121 if test -n "$cf_new_cflags" ; then
12122
12123         CFLAGS="$CFLAGS $cf_new_cflags"
12124 fi
12125
12126 if test -n "$cf_new_cppflags" ; then
12127
12128         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12129 fi
12130
12131 if test -n "$cf_new_extra_cppflags" ; then
12132
12133         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12134 fi
12135
12136         LIBS="$cf_pkgconfig_libs $LIBS"
12137         :
12138 else
12139         :
12140 fi
12141
12142 else
12143
12144 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12145
12146 echo "${as_me:-configure}:12146: testing ...before $LIBS ..." 1>&5
12147
12148 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
12149 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12150
12151 echo "${as_me:-configure}:12151: testing ...after  $LIBS ..." 1>&5
12152
12153 fi
12154
12155                                 ;;
12156                         esac
12157                         ;;
12158                 esac
12159         fi
12160
12161         cf_have_X_LIBS=yes
12162
12163 else
12164
12165         LDFLAGS="$X_LIBS $LDFLAGS"
12166
12167 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12168
12169 echo "${as_me:-configure}:12169: testing checking additions to CFLAGS ..." 1>&5
12170
12171 cf_check_cflags="$CFLAGS"
12172 cf_check_cppflags="$CPPFLAGS"
12173
12174 cf_fix_cppflags=no
12175 cf_new_cflags=
12176 cf_new_cppflags=
12177 cf_new_extra_cppflags=
12178
12179 for cf_add_cflags in $X_CFLAGS
12180 do
12181 case $cf_fix_cppflags in
12182 no)
12183         case $cf_add_cflags in #(vi
12184         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12185                 case $cf_add_cflags in
12186                 -D*)
12187                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12188
12189                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12190                                 && test -z "${cf_tst_cflags}" \
12191                                 && cf_fix_cppflags=yes
12192
12193                         if test $cf_fix_cppflags = yes ; then
12194                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12195                                 continue
12196                         elif test "${cf_tst_cflags}" = "\"'" ; then
12197                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12198                                 continue
12199                         fi
12200                         ;;
12201                 esac
12202                 case "$CPPFLAGS" in
12203                 *$cf_add_cflags) #(vi
12204                         ;;
12205                 *) #(vi
12206                         case $cf_add_cflags in #(vi
12207                         -D*)
12208                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12209
12210 CPPFLAGS=`echo "$CPPFLAGS" | \
12211         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12212                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12213
12214                                 ;;
12215                         esac
12216                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12217                         ;;
12218                 esac
12219                 ;;
12220         *)
12221                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12222                 ;;
12223         esac
12224         ;;
12225 yes)
12226         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12227
12228         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12229
12230         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12231                 && test -z "${cf_tst_cflags}" \
12232                 && cf_fix_cppflags=no
12233         ;;
12234 esac
12235 done
12236
12237 if test -n "$cf_new_cflags" ; then
12238         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12239
12240 echo "${as_me:-configure}:12240: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12241
12242         CFLAGS="$CFLAGS $cf_new_cflags"
12243 fi
12244
12245 if test -n "$cf_new_cppflags" ; then
12246         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12247
12248 echo "${as_me:-configure}:12248: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12249
12250         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12251 fi
12252
12253 if test -n "$cf_new_extra_cppflags" ; then
12254         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12255
12256 echo "${as_me:-configure}:12256: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12257
12258         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12259 fi
12260
12261 if test "$cf_check_cflags" != "$CFLAGS" ; then
12262 cat >conftest.$ac_ext <<_ACEOF
12263 #line 12263 "configure"
12264 #include "confdefs.h"
12265 #include <stdio.h>
12266 int
12267 main ()
12268 {
12269 printf("Hello world");
12270   ;
12271   return 0;
12272 }
12273 _ACEOF
12274 rm -f conftest.$ac_objext conftest$ac_exeext
12275 if { (eval echo "$as_me:12275: \"$ac_link\"") >&5
12276   (eval $ac_link) 2>&5
12277   ac_status=$?
12278   echo "$as_me:12278: \$? = $ac_status" >&5
12279   (exit $ac_status); } &&
12280          { ac_try='test -s conftest$ac_exeext'
12281   { (eval echo "$as_me:12281: \"$ac_try\"") >&5
12282   (eval $ac_try) 2>&5
12283   ac_status=$?
12284   echo "$as_me:12284: \$? = $ac_status" >&5
12285   (exit $ac_status); }; }; then
12286   :
12287 else
12288   echo "$as_me: failed program was:" >&5
12289 cat conftest.$ac_ext >&5
12290 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12291
12292 echo "${as_me:-configure}:12292: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12293
12294          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12295                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12296
12297 echo "${as_me:-configure}:12297: testing but keeping change to \$CPPFLAGS ..." 1>&5
12298
12299          fi
12300          CFLAGS="$cf_check_flags"
12301 fi
12302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12303 fi
12304
12305         echo "$as_me:12305: checking for XOpenDisplay" >&5
12306 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12307 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12308   echo $ECHO_N "(cached) $ECHO_C" >&6
12309 else
12310   cat >conftest.$ac_ext <<_ACEOF
12311 #line 12311 "configure"
12312 #include "confdefs.h"
12313 /* System header to define __stub macros and hopefully few prototypes,
12314     which can conflict with char XOpenDisplay (); below.  */
12315 #include <assert.h>
12316 /* Override any gcc2 internal prototype to avoid an error.  */
12317 #ifdef __cplusplus
12318 extern "C"
12319 #endif
12320 /* We use char because int might match the return type of a gcc2
12321    builtin and then its argument prototype would still apply.  */
12322 char XOpenDisplay ();
12323 char (*f) ();
12324
12325 int
12326 main ()
12327 {
12328 /* The GNU C library defines this for functions which it implements
12329     to always fail with ENOSYS.  Some functions are actually named
12330     something starting with __ and the normal name is an alias.  */
12331 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12332 choke me
12333 #else
12334 f = XOpenDisplay;
12335 #endif
12336
12337   ;
12338   return 0;
12339 }
12340 _ACEOF
12341 rm -f conftest.$ac_objext conftest$ac_exeext
12342 if { (eval echo "$as_me:12342: \"$ac_link\"") >&5
12343   (eval $ac_link) 2>&5
12344   ac_status=$?
12345   echo "$as_me:12345: \$? = $ac_status" >&5
12346   (exit $ac_status); } &&
12347          { ac_try='test -s conftest$ac_exeext'
12348   { (eval echo "$as_me:12348: \"$ac_try\"") >&5
12349   (eval $ac_try) 2>&5
12350   ac_status=$?
12351   echo "$as_me:12351: \$? = $ac_status" >&5
12352   (exit $ac_status); }; }; then
12353   ac_cv_func_XOpenDisplay=yes
12354 else
12355   echo "$as_me: failed program was:" >&5
12356 cat conftest.$ac_ext >&5
12357 ac_cv_func_XOpenDisplay=no
12358 fi
12359 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12360 fi
12361 echo "$as_me:12361: result: $ac_cv_func_XOpenDisplay" >&5
12362 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12363 if test $ac_cv_func_XOpenDisplay = yes; then
12364   :
12365 else
12366
12367         echo "$as_me:12367: checking for XOpenDisplay in -lX11" >&5
12368 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12369 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12370   echo $ECHO_N "(cached) $ECHO_C" >&6
12371 else
12372   ac_check_lib_save_LIBS=$LIBS
12373 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12374 cat >conftest.$ac_ext <<_ACEOF
12375 #line 12375 "configure"
12376 #include "confdefs.h"
12377
12378 /* Override any gcc2 internal prototype to avoid an error.  */
12379 #ifdef __cplusplus
12380 extern "C"
12381 #endif
12382 /* We use char because int might match the return type of a gcc2
12383    builtin and then its argument prototype would still apply.  */
12384 char XOpenDisplay ();
12385 int
12386 main ()
12387 {
12388 XOpenDisplay ();
12389   ;
12390   return 0;
12391 }
12392 _ACEOF
12393 rm -f conftest.$ac_objext conftest$ac_exeext
12394 if { (eval echo "$as_me:12394: \"$ac_link\"") >&5
12395   (eval $ac_link) 2>&5
12396   ac_status=$?
12397   echo "$as_me:12397: \$? = $ac_status" >&5
12398   (exit $ac_status); } &&
12399          { ac_try='test -s conftest$ac_exeext'
12400   { (eval echo "$as_me:12400: \"$ac_try\"") >&5
12401   (eval $ac_try) 2>&5
12402   ac_status=$?
12403   echo "$as_me:12403: \$? = $ac_status" >&5
12404   (exit $ac_status); }; }; then
12405   ac_cv_lib_X11_XOpenDisplay=yes
12406 else
12407   echo "$as_me: failed program was:" >&5
12408 cat conftest.$ac_ext >&5
12409 ac_cv_lib_X11_XOpenDisplay=no
12410 fi
12411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12412 LIBS=$ac_check_lib_save_LIBS
12413 fi
12414 echo "$as_me:12414: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12415 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12416 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12417   LIBS="-lX11 $LIBS"
12418 fi
12419
12420 fi
12421
12422         echo "$as_me:12422: checking for XtAppInitialize" >&5
12423 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12424 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12425   echo $ECHO_N "(cached) $ECHO_C" >&6
12426 else
12427   cat >conftest.$ac_ext <<_ACEOF
12428 #line 12428 "configure"
12429 #include "confdefs.h"
12430 /* System header to define __stub macros and hopefully few prototypes,
12431     which can conflict with char XtAppInitialize (); below.  */
12432 #include <assert.h>
12433 /* Override any gcc2 internal prototype to avoid an error.  */
12434 #ifdef __cplusplus
12435 extern "C"
12436 #endif
12437 /* We use char because int might match the return type of a gcc2
12438    builtin and then its argument prototype would still apply.  */
12439 char XtAppInitialize ();
12440 char (*f) ();
12441
12442 int
12443 main ()
12444 {
12445 /* The GNU C library defines this for functions which it implements
12446     to always fail with ENOSYS.  Some functions are actually named
12447     something starting with __ and the normal name is an alias.  */
12448 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12449 choke me
12450 #else
12451 f = XtAppInitialize;
12452 #endif
12453
12454   ;
12455   return 0;
12456 }
12457 _ACEOF
12458 rm -f conftest.$ac_objext conftest$ac_exeext
12459 if { (eval echo "$as_me:12459: \"$ac_link\"") >&5
12460   (eval $ac_link) 2>&5
12461   ac_status=$?
12462   echo "$as_me:12462: \$? = $ac_status" >&5
12463   (exit $ac_status); } &&
12464          { ac_try='test -s conftest$ac_exeext'
12465   { (eval echo "$as_me:12465: \"$ac_try\"") >&5
12466   (eval $ac_try) 2>&5
12467   ac_status=$?
12468   echo "$as_me:12468: \$? = $ac_status" >&5
12469   (exit $ac_status); }; }; then
12470   ac_cv_func_XtAppInitialize=yes
12471 else
12472   echo "$as_me: failed program was:" >&5
12473 cat conftest.$ac_ext >&5
12474 ac_cv_func_XtAppInitialize=no
12475 fi
12476 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12477 fi
12478 echo "$as_me:12478: result: $ac_cv_func_XtAppInitialize" >&5
12479 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12480 if test $ac_cv_func_XtAppInitialize = yes; then
12481   :
12482 else
12483
12484         echo "$as_me:12484: checking for XtAppInitialize in -lXt" >&5
12485 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12486 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12487   echo $ECHO_N "(cached) $ECHO_C" >&6
12488 else
12489   ac_check_lib_save_LIBS=$LIBS
12490 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12491 cat >conftest.$ac_ext <<_ACEOF
12492 #line 12492 "configure"
12493 #include "confdefs.h"
12494
12495 /* Override any gcc2 internal prototype to avoid an error.  */
12496 #ifdef __cplusplus
12497 extern "C"
12498 #endif
12499 /* We use char because int might match the return type of a gcc2
12500    builtin and then its argument prototype would still apply.  */
12501 char XtAppInitialize ();
12502 int
12503 main ()
12504 {
12505 XtAppInitialize ();
12506   ;
12507   return 0;
12508 }
12509 _ACEOF
12510 rm -f conftest.$ac_objext conftest$ac_exeext
12511 if { (eval echo "$as_me:12511: \"$ac_link\"") >&5
12512   (eval $ac_link) 2>&5
12513   ac_status=$?
12514   echo "$as_me:12514: \$? = $ac_status" >&5
12515   (exit $ac_status); } &&
12516          { ac_try='test -s conftest$ac_exeext'
12517   { (eval echo "$as_me:12517: \"$ac_try\"") >&5
12518   (eval $ac_try) 2>&5
12519   ac_status=$?
12520   echo "$as_me:12520: \$? = $ac_status" >&5
12521   (exit $ac_status); }; }; then
12522   ac_cv_lib_Xt_XtAppInitialize=yes
12523 else
12524   echo "$as_me: failed program was:" >&5
12525 cat conftest.$ac_ext >&5
12526 ac_cv_lib_Xt_XtAppInitialize=no
12527 fi
12528 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12529 LIBS=$ac_check_lib_save_LIBS
12530 fi
12531 echo "$as_me:12531: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12532 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12533 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12534   cat >>confdefs.h <<\EOF
12535 #define HAVE_LIBXT 1
12536 EOF
12537
12538                  cf_have_X_LIBS=Xt
12539                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12540 fi
12541
12542 fi
12543
12544 fi
12545
12546 if test $cf_have_X_LIBS = no ; then
12547         { echo "$as_me:12547: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12548 test program.  You will have to check and add the proper libraries by hand
12549 to makefile." >&5
12550 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12551 test program.  You will have to check and add the proper libraries by hand
12552 to makefile." >&2;}
12553 fi
12554
12555 cf_x_athena_root=$cf_x_athena
12556 cf_x_athena_inc=""
12557
12558 for cf_path in default \
12559         /usr/contrib/X11R6 \
12560         /usr/contrib/X11R5 \
12561         /usr/lib/X11R5 \
12562         /usr/local
12563 do
12564         if test -z "$cf_x_athena_inc" ; then
12565                 cf_save="$CPPFLAGS"
12566                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12567                 if test $cf_path != default ; then
12568                         CPPFLAGS="$cf_save -I$cf_path/include"
12569                         echo "$as_me:12569: checking for $cf_test in $cf_path" >&5
12570 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12571                 else
12572                         echo "$as_me:12572: checking for $cf_test" >&5
12573 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12574                 fi
12575                 cat >conftest.$ac_ext <<_ACEOF
12576 #line 12576 "configure"
12577 #include "confdefs.h"
12578
12579 #include <X11/Intrinsic.h>
12580 #include <$cf_test>
12581 int
12582 main ()
12583 {
12584
12585   ;
12586   return 0;
12587 }
12588 _ACEOF
12589 rm -f conftest.$ac_objext
12590 if { (eval echo "$as_me:12590: \"$ac_compile\"") >&5
12591   (eval $ac_compile) 2>&5
12592   ac_status=$?
12593   echo "$as_me:12593: \$? = $ac_status" >&5
12594   (exit $ac_status); } &&
12595          { ac_try='test -s conftest.$ac_objext'
12596   { (eval echo "$as_me:12596: \"$ac_try\"") >&5
12597   (eval $ac_try) 2>&5
12598   ac_status=$?
12599   echo "$as_me:12599: \$? = $ac_status" >&5
12600   (exit $ac_status); }; }; then
12601   cf_result=yes
12602 else
12603   echo "$as_me: failed program was:" >&5
12604 cat conftest.$ac_ext >&5
12605 cf_result=no
12606 fi
12607 rm -f conftest.$ac_objext conftest.$ac_ext
12608                 echo "$as_me:12608: result: $cf_result" >&5
12609 echo "${ECHO_T}$cf_result" >&6
12610                 if test "$cf_result" = yes ; then
12611                         cf_x_athena_inc=$cf_path
12612                         break
12613                 else
12614                         CPPFLAGS="$cf_save"
12615                 fi
12616         fi
12617 done
12618
12619 if test -z "$cf_x_athena_inc" ; then
12620         { echo "$as_me:12620: WARNING: Unable to successfully find Athena header files with test program" >&5
12621 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12622 elif test "$cf_x_athena_inc" != default ; then
12623         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12624 fi
12625
12626 cf_x_athena_root=$cf_x_athena
12627 cf_x_athena_lib=""
12628
12629 for cf_path in default \
12630         /usr/contrib/X11R6 \
12631         /usr/contrib/X11R5 \
12632         /usr/lib/X11R5 \
12633         /usr/local
12634 do
12635         for cf_lib in \
12636                 ${cf_x_athena_root} \
12637                 ${cf_x_athena_root}7 \
12638                 ${cf_x_athena_root}6
12639         do
12640         for cf_libs in \
12641                 "-l$cf_lib -lXmu" \
12642                 "-l$cf_lib -lXpm -lXmu" \
12643                 "-l${cf_lib}_s -lXmu_s"
12644         do
12645                 if test -z "$cf_x_athena_lib" ; then
12646                         cf_save="$LIBS"
12647                         cf_test=XawSimpleMenuAddGlobalActions
12648                         if test $cf_path != default ; then
12649                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12650                                 echo "$as_me:12650: checking for $cf_libs in $cf_path" >&5
12651 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12652                         else
12653                                 LIBS="$cf_libs $LIBS"
12654                                 echo "$as_me:12654: checking for $cf_test in $cf_libs" >&5
12655 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12656                         fi
12657                         cat >conftest.$ac_ext <<_ACEOF
12658 #line 12658 "configure"
12659 #include "confdefs.h"
12660
12661 #include <X11/Intrinsic.h>
12662 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12663
12664 int
12665 main ()
12666 {
12667
12668 $cf_test((XtAppContext) 0)
12669   ;
12670   return 0;
12671 }
12672 _ACEOF
12673 rm -f conftest.$ac_objext conftest$ac_exeext
12674 if { (eval echo "$as_me:12674: \"$ac_link\"") >&5
12675   (eval $ac_link) 2>&5
12676   ac_status=$?
12677   echo "$as_me:12677: \$? = $ac_status" >&5
12678   (exit $ac_status); } &&
12679          { ac_try='test -s conftest$ac_exeext'
12680   { (eval echo "$as_me:12680: \"$ac_try\"") >&5
12681   (eval $ac_try) 2>&5
12682   ac_status=$?
12683   echo "$as_me:12683: \$? = $ac_status" >&5
12684   (exit $ac_status); }; }; then
12685   cf_result=yes
12686 else
12687   echo "$as_me: failed program was:" >&5
12688 cat conftest.$ac_ext >&5
12689 cf_result=no
12690 fi
12691 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12692                         echo "$as_me:12692: result: $cf_result" >&5
12693 echo "${ECHO_T}$cf_result" >&6
12694                         if test "$cf_result" = yes ; then
12695                                 cf_x_athena_lib="$cf_libs"
12696                                 break
12697                         fi
12698                         LIBS="$cf_save"
12699                 fi
12700         done # cf_libs
12701                 test -n "$cf_x_athena_lib" && break
12702         done # cf_lib
12703 done
12704
12705 if test -z "$cf_x_athena_lib" ; then
12706         { { echo "$as_me:12706: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12707 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12708    { (exit 1); exit 1; }; }
12709 fi
12710
12711 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12712
12713 cat >>confdefs.h <<EOF
12714 #define $cf_x_athena_LIBS 1
12715 EOF
12716
12717 fi
12718
12719 if test -n "$ac_tool_prefix"; then
12720   for ac_prog in xcurses-config
12721   do
12722     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12723 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12724 echo "$as_me:12724: checking for $ac_word" >&5
12725 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12726 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12727   echo $ECHO_N "(cached) $ECHO_C" >&6
12728 else
12729   if test -n "$XCURSES_CONFIG"; then
12730   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12731 else
12732   ac_save_IFS=$IFS; IFS=$ac_path_separator
12733 ac_dummy="$PATH"
12734 for ac_dir in $ac_dummy; do
12735   IFS=$ac_save_IFS
12736   test -z "$ac_dir" && ac_dir=.
12737   $as_executable_p "$ac_dir/$ac_word" || continue
12738 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12739 echo "$as_me:12739: found $ac_dir/$ac_word" >&5
12740 break
12741 done
12742
12743 fi
12744 fi
12745 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12746 if test -n "$XCURSES_CONFIG"; then
12747   echo "$as_me:12747: result: $XCURSES_CONFIG" >&5
12748 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12749 else
12750   echo "$as_me:12750: result: no" >&5
12751 echo "${ECHO_T}no" >&6
12752 fi
12753
12754     test -n "$XCURSES_CONFIG" && break
12755   done
12756 fi
12757 if test -z "$XCURSES_CONFIG"; then
12758   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12759   for ac_prog in xcurses-config
12760 do
12761   # Extract the first word of "$ac_prog", so it can be a program name with args.
12762 set dummy $ac_prog; ac_word=$2
12763 echo "$as_me:12763: checking for $ac_word" >&5
12764 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12765 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12766   echo $ECHO_N "(cached) $ECHO_C" >&6
12767 else
12768   if test -n "$ac_ct_XCURSES_CONFIG"; then
12769   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12770 else
12771   ac_save_IFS=$IFS; IFS=$ac_path_separator
12772 ac_dummy="$PATH"
12773 for ac_dir in $ac_dummy; do
12774   IFS=$ac_save_IFS
12775   test -z "$ac_dir" && ac_dir=.
12776   $as_executable_p "$ac_dir/$ac_word" || continue
12777 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12778 echo "$as_me:12778: found $ac_dir/$ac_word" >&5
12779 break
12780 done
12781
12782 fi
12783 fi
12784 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12785 if test -n "$ac_ct_XCURSES_CONFIG"; then
12786   echo "$as_me:12786: result: $ac_ct_XCURSES_CONFIG" >&5
12787 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12788 else
12789   echo "$as_me:12789: result: no" >&5
12790 echo "${ECHO_T}no" >&6
12791 fi
12792
12793   test -n "$ac_ct_XCURSES_CONFIG" && break
12794 done
12795 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12796
12797   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12798 fi
12799
12800 if test "$XCURSES_CONFIG" != none ; then
12801
12802 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12803 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12804
12805 cf_cv_lib_XCurses=yes
12806
12807 else
12808
12809 LDFLAGS="$LDFLAGS $X_LIBS"
12810
12811 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12812
12813 echo "${as_me:-configure}:12813: testing checking additions to CFLAGS ..." 1>&5
12814
12815 cf_check_cflags="$CFLAGS"
12816 cf_check_cppflags="$CPPFLAGS"
12817
12818 cf_fix_cppflags=no
12819 cf_new_cflags=
12820 cf_new_cppflags=
12821 cf_new_extra_cppflags=
12822
12823 for cf_add_cflags in $X_CFLAGS
12824 do
12825 case $cf_fix_cppflags in
12826 no)
12827         case $cf_add_cflags in #(vi
12828         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12829                 case $cf_add_cflags in
12830                 -D*)
12831                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12832
12833                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12834                                 && test -z "${cf_tst_cflags}" \
12835                                 && cf_fix_cppflags=yes
12836
12837                         if test $cf_fix_cppflags = yes ; then
12838                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12839                                 continue
12840                         elif test "${cf_tst_cflags}" = "\"'" ; then
12841                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12842                                 continue
12843                         fi
12844                         ;;
12845                 esac
12846                 case "$CPPFLAGS" in
12847                 *$cf_add_cflags) #(vi
12848                         ;;
12849                 *) #(vi
12850                         case $cf_add_cflags in #(vi
12851                         -D*)
12852                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12853
12854 CPPFLAGS=`echo "$CPPFLAGS" | \
12855         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12856                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12857
12858                                 ;;
12859                         esac
12860                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12861                         ;;
12862                 esac
12863                 ;;
12864         *)
12865                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12866                 ;;
12867         esac
12868         ;;
12869 yes)
12870         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12871
12872         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12873
12874         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12875                 && test -z "${cf_tst_cflags}" \
12876                 && cf_fix_cppflags=no
12877         ;;
12878 esac
12879 done
12880
12881 if test -n "$cf_new_cflags" ; then
12882         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12883
12884 echo "${as_me:-configure}:12884: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12885
12886         CFLAGS="$CFLAGS $cf_new_cflags"
12887 fi
12888
12889 if test -n "$cf_new_cppflags" ; then
12890         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12891
12892 echo "${as_me:-configure}:12892: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12893
12894         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12895 fi
12896
12897 if test -n "$cf_new_extra_cppflags" ; then
12898         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12899
12900 echo "${as_me:-configure}:12900: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12901
12902         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12903 fi
12904
12905 if test "$cf_check_cflags" != "$CFLAGS" ; then
12906 cat >conftest.$ac_ext <<_ACEOF
12907 #line 12907 "configure"
12908 #include "confdefs.h"
12909 #include <stdio.h>
12910 int
12911 main ()
12912 {
12913 printf("Hello world");
12914   ;
12915   return 0;
12916 }
12917 _ACEOF
12918 rm -f conftest.$ac_objext conftest$ac_exeext
12919 if { (eval echo "$as_me:12919: \"$ac_link\"") >&5
12920   (eval $ac_link) 2>&5
12921   ac_status=$?
12922   echo "$as_me:12922: \$? = $ac_status" >&5
12923   (exit $ac_status); } &&
12924          { ac_try='test -s conftest$ac_exeext'
12925   { (eval echo "$as_me:12925: \"$ac_try\"") >&5
12926   (eval $ac_try) 2>&5
12927   ac_status=$?
12928   echo "$as_me:12928: \$? = $ac_status" >&5
12929   (exit $ac_status); }; }; then
12930   :
12931 else
12932   echo "$as_me: failed program was:" >&5
12933 cat conftest.$ac_ext >&5
12934 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12935
12936 echo "${as_me:-configure}:12936: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12937
12938          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12939                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12940
12941 echo "${as_me:-configure}:12941: testing but keeping change to \$CPPFLAGS ..." 1>&5
12942
12943          fi
12944          CFLAGS="$cf_check_flags"
12945 fi
12946 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12947 fi
12948
12949 echo "$as_me:12949: checking for XOpenDisplay in -lX11" >&5
12950 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12951 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12952   echo $ECHO_N "(cached) $ECHO_C" >&6
12953 else
12954   ac_check_lib_save_LIBS=$LIBS
12955 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12956 cat >conftest.$ac_ext <<_ACEOF
12957 #line 12957 "configure"
12958 #include "confdefs.h"
12959
12960 /* Override any gcc2 internal prototype to avoid an error.  */
12961 #ifdef __cplusplus
12962 extern "C"
12963 #endif
12964 /* We use char because int might match the return type of a gcc2
12965    builtin and then its argument prototype would still apply.  */
12966 char XOpenDisplay ();
12967 int
12968 main ()
12969 {
12970 XOpenDisplay ();
12971   ;
12972   return 0;
12973 }
12974 _ACEOF
12975 rm -f conftest.$ac_objext conftest$ac_exeext
12976 if { (eval echo "$as_me:12976: \"$ac_link\"") >&5
12977   (eval $ac_link) 2>&5
12978   ac_status=$?
12979   echo "$as_me:12979: \$? = $ac_status" >&5
12980   (exit $ac_status); } &&
12981          { ac_try='test -s conftest$ac_exeext'
12982   { (eval echo "$as_me:12982: \"$ac_try\"") >&5
12983   (eval $ac_try) 2>&5
12984   ac_status=$?
12985   echo "$as_me:12985: \$? = $ac_status" >&5
12986   (exit $ac_status); }; }; then
12987   ac_cv_lib_X11_XOpenDisplay=yes
12988 else
12989   echo "$as_me: failed program was:" >&5
12990 cat conftest.$ac_ext >&5
12991 ac_cv_lib_X11_XOpenDisplay=no
12992 fi
12993 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12994 LIBS=$ac_check_lib_save_LIBS
12995 fi
12996 echo "$as_me:12996: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12997 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12998 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12999   LIBS="-lX11 $LIBS"
13000 fi
13001
13002 echo "$as_me:13002: checking for XCurses library" >&5
13003 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13004 if test "${cf_cv_lib_XCurses+set}" = set; then
13005   echo $ECHO_N "(cached) $ECHO_C" >&6
13006 else
13007
13008 LIBS="-lXCurses $LIBS"
13009 cat >conftest.$ac_ext <<_ACEOF
13010 #line 13010 "configure"
13011 #include "confdefs.h"
13012
13013 #include <xcurses.h>
13014 char *XCursesProgramName = "test";
13015
13016 int
13017 main ()
13018 {
13019 XCursesExit();
13020   ;
13021   return 0;
13022 }
13023 _ACEOF
13024 rm -f conftest.$ac_objext conftest$ac_exeext
13025 if { (eval echo "$as_me:13025: \"$ac_link\"") >&5
13026   (eval $ac_link) 2>&5
13027   ac_status=$?
13028   echo "$as_me:13028: \$? = $ac_status" >&5
13029   (exit $ac_status); } &&
13030          { ac_try='test -s conftest$ac_exeext'
13031   { (eval echo "$as_me:13031: \"$ac_try\"") >&5
13032   (eval $ac_try) 2>&5
13033   ac_status=$?
13034   echo "$as_me:13034: \$? = $ac_status" >&5
13035   (exit $ac_status); }; }; then
13036   cf_cv_lib_XCurses=yes
13037 else
13038   echo "$as_me: failed program was:" >&5
13039 cat conftest.$ac_ext >&5
13040 cf_cv_lib_XCurses=no
13041 fi
13042 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13043
13044 fi
13045 echo "$as_me:13045: result: $cf_cv_lib_XCurses" >&5
13046 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13047
13048 fi
13049
13050 if test $cf_cv_lib_XCurses = yes ; then
13051         cat >>confdefs.h <<\EOF
13052 #define UNIX 1
13053 EOF
13054
13055         cat >>confdefs.h <<\EOF
13056 #define XCURSES 1
13057 EOF
13058
13059         echo "$as_me:13059: checking for xcurses.h" >&5
13060 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13061 if test "${ac_cv_header_xcurses_h+set}" = set; then
13062   echo $ECHO_N "(cached) $ECHO_C" >&6
13063 else
13064   cat >conftest.$ac_ext <<_ACEOF
13065 #line 13065 "configure"
13066 #include "confdefs.h"
13067 #include <xcurses.h>
13068 _ACEOF
13069 if { (eval echo "$as_me:13069: \"$ac_cpp conftest.$ac_ext\"") >&5
13070   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13071   ac_status=$?
13072   egrep -v '^ *\+' conftest.er1 >conftest.err
13073   rm -f conftest.er1
13074   cat conftest.err >&5
13075   echo "$as_me:13075: \$? = $ac_status" >&5
13076   (exit $ac_status); } >/dev/null; then
13077   if test -s conftest.err; then
13078     ac_cpp_err=$ac_c_preproc_warn_flag
13079   else
13080     ac_cpp_err=
13081   fi
13082 else
13083   ac_cpp_err=yes
13084 fi
13085 if test -z "$ac_cpp_err"; then
13086   ac_cv_header_xcurses_h=yes
13087 else
13088   echo "$as_me: failed program was:" >&5
13089   cat conftest.$ac_ext >&5
13090   ac_cv_header_xcurses_h=no
13091 fi
13092 rm -f conftest.err conftest.$ac_ext
13093 fi
13094 echo "$as_me:13094: result: $ac_cv_header_xcurses_h" >&5
13095 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13096 if test $ac_cv_header_xcurses_h = yes; then
13097   cat >>confdefs.h <<\EOF
13098 #define HAVE_XCURSES 1
13099 EOF
13100
13101 fi
13102
13103 else
13104         { { echo "$as_me:13104: error: Cannot link with XCurses" >&5
13105 echo "$as_me: error: Cannot link with XCurses" >&2;}
13106    { (exit 1); exit 1; }; }
13107 fi
13108
13109         ;;
13110 esac
13111
13112 case $cf_cv_screen in #(vi
13113 pdcurses) #(vi
13114         ;;
13115 *)
13116         # look for curses-related libraries
13117
13118 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13119 echo "$as_me:13119: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13120 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13121 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13122   echo $ECHO_N "(cached) $ECHO_C" >&6
13123 else
13124   ac_check_lib_save_LIBS=$LIBS
13125 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13126 cat >conftest.$ac_ext <<_ACEOF
13127 #line 13127 "configure"
13128 #include "confdefs.h"
13129
13130 /* Override any gcc2 internal prototype to avoid an error.  */
13131 #ifdef __cplusplus
13132 extern "C"
13133 #endif
13134 /* We use char because int might match the return type of a gcc2
13135    builtin and then its argument prototype would still apply.  */
13136 char new_panel ();
13137 int
13138 main ()
13139 {
13140 new_panel ();
13141   ;
13142   return 0;
13143 }
13144 _ACEOF
13145 rm -f conftest.$ac_objext conftest$ac_exeext
13146 if { (eval echo "$as_me:13146: \"$ac_link\"") >&5
13147   (eval $ac_link) 2>&5
13148   ac_status=$?
13149   echo "$as_me:13149: \$? = $ac_status" >&5
13150   (exit $ac_status); } &&
13151          { ac_try='test -s conftest$ac_exeext'
13152   { (eval echo "$as_me:13152: \"$ac_try\"") >&5
13153   (eval $ac_try) 2>&5
13154   ac_status=$?
13155   echo "$as_me:13155: \$? = $ac_status" >&5
13156   (exit $ac_status); }; }; then
13157   eval "$as_ac_Lib=yes"
13158 else
13159   echo "$as_me: failed program was:" >&5
13160 cat conftest.$ac_ext >&5
13161 eval "$as_ac_Lib=no"
13162 fi
13163 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13164 LIBS=$ac_check_lib_save_LIBS
13165 fi
13166 echo "$as_me:13166: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13167 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13168 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13169   cat >>confdefs.h <<EOF
13170 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
13171 EOF
13172
13173   LIBS="-lpanel$cf_cv_libtype $LIBS"
13174
13175 fi
13176
13177 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13178 echo "$as_me:13178: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13179 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13180 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13181   echo $ECHO_N "(cached) $ECHO_C" >&6
13182 else
13183   ac_check_lib_save_LIBS=$LIBS
13184 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13185 cat >conftest.$ac_ext <<_ACEOF
13186 #line 13186 "configure"
13187 #include "confdefs.h"
13188
13189 /* Override any gcc2 internal prototype to avoid an error.  */
13190 #ifdef __cplusplus
13191 extern "C"
13192 #endif
13193 /* We use char because int might match the return type of a gcc2
13194    builtin and then its argument prototype would still apply.  */
13195 char menu_driver ();
13196 int
13197 main ()
13198 {
13199 menu_driver ();
13200   ;
13201   return 0;
13202 }
13203 _ACEOF
13204 rm -f conftest.$ac_objext conftest$ac_exeext
13205 if { (eval echo "$as_me:13205: \"$ac_link\"") >&5
13206   (eval $ac_link) 2>&5
13207   ac_status=$?
13208   echo "$as_me:13208: \$? = $ac_status" >&5
13209   (exit $ac_status); } &&
13210          { ac_try='test -s conftest$ac_exeext'
13211   { (eval echo "$as_me:13211: \"$ac_try\"") >&5
13212   (eval $ac_try) 2>&5
13213   ac_status=$?
13214   echo "$as_me:13214: \$? = $ac_status" >&5
13215   (exit $ac_status); }; }; then
13216   eval "$as_ac_Lib=yes"
13217 else
13218   echo "$as_me: failed program was:" >&5
13219 cat conftest.$ac_ext >&5
13220 eval "$as_ac_Lib=no"
13221 fi
13222 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13223 LIBS=$ac_check_lib_save_LIBS
13224 fi
13225 echo "$as_me:13225: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13226 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13227 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13228   cat >>confdefs.h <<EOF
13229 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
13230 EOF
13231
13232   LIBS="-lmenu$cf_cv_libtype $LIBS"
13233
13234 fi
13235
13236 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13237 echo "$as_me:13237: checking for form_driver in -lform$cf_cv_libtype" >&5
13238 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13239 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13240   echo $ECHO_N "(cached) $ECHO_C" >&6
13241 else
13242   ac_check_lib_save_LIBS=$LIBS
13243 LIBS="-lform$cf_cv_libtype  $LIBS"
13244 cat >conftest.$ac_ext <<_ACEOF
13245 #line 13245 "configure"
13246 #include "confdefs.h"
13247
13248 /* Override any gcc2 internal prototype to avoid an error.  */
13249 #ifdef __cplusplus
13250 extern "C"
13251 #endif
13252 /* We use char because int might match the return type of a gcc2
13253    builtin and then its argument prototype would still apply.  */
13254 char form_driver ();
13255 int
13256 main ()
13257 {
13258 form_driver ();
13259   ;
13260   return 0;
13261 }
13262 _ACEOF
13263 rm -f conftest.$ac_objext conftest$ac_exeext
13264 if { (eval echo "$as_me:13264: \"$ac_link\"") >&5
13265   (eval $ac_link) 2>&5
13266   ac_status=$?
13267   echo "$as_me:13267: \$? = $ac_status" >&5
13268   (exit $ac_status); } &&
13269          { ac_try='test -s conftest$ac_exeext'
13270   { (eval echo "$as_me:13270: \"$ac_try\"") >&5
13271   (eval $ac_try) 2>&5
13272   ac_status=$?
13273   echo "$as_me:13273: \$? = $ac_status" >&5
13274   (exit $ac_status); }; }; then
13275   eval "$as_ac_Lib=yes"
13276 else
13277   echo "$as_me: failed program was:" >&5
13278 cat conftest.$ac_ext >&5
13279 eval "$as_ac_Lib=no"
13280 fi
13281 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13282 LIBS=$ac_check_lib_save_LIBS
13283 fi
13284 echo "$as_me:13284: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13285 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13286 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13287   cat >>confdefs.h <<EOF
13288 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
13289 EOF
13290
13291   LIBS="-lform$cf_cv_libtype $LIBS"
13292
13293 fi
13294
13295         # look for curses-related headers
13296
13297 for ac_header in \
13298                 nc_alloc.h \
13299                 nomacros.h \
13300                 form.h \
13301                 menu.h \
13302                 panel.h \
13303                 term_entry.h \
13304
13305 do
13306 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13307 echo "$as_me:13307: checking for $ac_header" >&5
13308 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13309 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13310   echo $ECHO_N "(cached) $ECHO_C" >&6
13311 else
13312   cat >conftest.$ac_ext <<_ACEOF
13313 #line 13313 "configure"
13314 #include "confdefs.h"
13315 #include <$ac_header>
13316 _ACEOF
13317 if { (eval echo "$as_me:13317: \"$ac_cpp conftest.$ac_ext\"") >&5
13318   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13319   ac_status=$?
13320   egrep -v '^ *\+' conftest.er1 >conftest.err
13321   rm -f conftest.er1
13322   cat conftest.err >&5
13323   echo "$as_me:13323: \$? = $ac_status" >&5
13324   (exit $ac_status); } >/dev/null; then
13325   if test -s conftest.err; then
13326     ac_cpp_err=$ac_c_preproc_warn_flag
13327   else
13328     ac_cpp_err=
13329   fi
13330 else
13331   ac_cpp_err=yes
13332 fi
13333 if test -z "$ac_cpp_err"; then
13334   eval "$as_ac_Header=yes"
13335 else
13336   echo "$as_me: failed program was:" >&5
13337   cat conftest.$ac_ext >&5
13338   eval "$as_ac_Header=no"
13339 fi
13340 rm -f conftest.err conftest.$ac_ext
13341 fi
13342 echo "$as_me:13342: result: `eval echo '${'$as_ac_Header'}'`" >&5
13343 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13344 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13345   cat >>confdefs.h <<EOF
13346 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13347 EOF
13348
13349 fi
13350 done
13351
13352         ;;
13353 esac
13354
13355 echo "$as_me:13355: checking return type of signal handlers" >&5
13356 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
13357 if test "${ac_cv_type_signal+set}" = set; then
13358   echo $ECHO_N "(cached) $ECHO_C" >&6
13359 else
13360   cat >conftest.$ac_ext <<_ACEOF
13361 #line 13361 "configure"
13362 #include "confdefs.h"
13363 #include <sys/types.h>
13364 #include <signal.h>
13365 #ifdef signal
13366 # undef signal
13367 #endif
13368 #ifdef __cplusplus
13369 extern "C" void (*signal (int, void (*)(int)))(int);
13370 #else
13371 void (*signal ()) ();
13372 #endif
13373
13374 int
13375 main ()
13376 {
13377 int i;
13378   ;
13379   return 0;
13380 }
13381 _ACEOF
13382 rm -f conftest.$ac_objext
13383 if { (eval echo "$as_me:13383: \"$ac_compile\"") >&5
13384   (eval $ac_compile) 2>&5
13385   ac_status=$?
13386   echo "$as_me:13386: \$? = $ac_status" >&5
13387   (exit $ac_status); } &&
13388          { ac_try='test -s conftest.$ac_objext'
13389   { (eval echo "$as_me:13389: \"$ac_try\"") >&5
13390   (eval $ac_try) 2>&5
13391   ac_status=$?
13392   echo "$as_me:13392: \$? = $ac_status" >&5
13393   (exit $ac_status); }; }; then
13394   ac_cv_type_signal=void
13395 else
13396   echo "$as_me: failed program was:" >&5
13397 cat conftest.$ac_ext >&5
13398 ac_cv_type_signal=int
13399 fi
13400 rm -f conftest.$ac_objext conftest.$ac_ext
13401 fi
13402 echo "$as_me:13402: result: $ac_cv_type_signal" >&5
13403 echo "${ECHO_T}$ac_cv_type_signal" >&6
13404
13405 cat >>confdefs.h <<EOF
13406 #define RETSIGTYPE $ac_cv_type_signal
13407 EOF
13408
13409 echo "$as_me:13409: checking for ANSI C header files" >&5
13410 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13411 if test "${ac_cv_header_stdc+set}" = set; then
13412   echo $ECHO_N "(cached) $ECHO_C" >&6
13413 else
13414   cat >conftest.$ac_ext <<_ACEOF
13415 #line 13415 "configure"
13416 #include "confdefs.h"
13417 #include <stdlib.h>
13418 #include <stdarg.h>
13419 #include <string.h>
13420 #include <float.h>
13421
13422 _ACEOF
13423 if { (eval echo "$as_me:13423: \"$ac_cpp conftest.$ac_ext\"") >&5
13424   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13425   ac_status=$?
13426   egrep -v '^ *\+' conftest.er1 >conftest.err
13427   rm -f conftest.er1
13428   cat conftest.err >&5
13429   echo "$as_me:13429: \$? = $ac_status" >&5
13430   (exit $ac_status); } >/dev/null; then
13431   if test -s conftest.err; then
13432     ac_cpp_err=$ac_c_preproc_warn_flag
13433   else
13434     ac_cpp_err=
13435   fi
13436 else
13437   ac_cpp_err=yes
13438 fi
13439 if test -z "$ac_cpp_err"; then
13440   ac_cv_header_stdc=yes
13441 else
13442   echo "$as_me: failed program was:" >&5
13443   cat conftest.$ac_ext >&5
13444   ac_cv_header_stdc=no
13445 fi
13446 rm -f conftest.err conftest.$ac_ext
13447
13448 if test $ac_cv_header_stdc = yes; then
13449   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13450   cat >conftest.$ac_ext <<_ACEOF
13451 #line 13451 "configure"
13452 #include "confdefs.h"
13453 #include <string.h>
13454
13455 _ACEOF
13456 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13457   egrep "memchr" >/dev/null 2>&1; then
13458   :
13459 else
13460   ac_cv_header_stdc=no
13461 fi
13462 rm -rf conftest*
13463
13464 fi
13465
13466 if test $ac_cv_header_stdc = yes; then
13467   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13468   cat >conftest.$ac_ext <<_ACEOF
13469 #line 13469 "configure"
13470 #include "confdefs.h"
13471 #include <stdlib.h>
13472
13473 _ACEOF
13474 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13475   egrep "free" >/dev/null 2>&1; then
13476   :
13477 else
13478   ac_cv_header_stdc=no
13479 fi
13480 rm -rf conftest*
13481
13482 fi
13483
13484 if test $ac_cv_header_stdc = yes; then
13485   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13486   if test "$cross_compiling" = yes; then
13487   :
13488 else
13489   cat >conftest.$ac_ext <<_ACEOF
13490 #line 13490 "configure"
13491 #include "confdefs.h"
13492 #include <ctype.h>
13493 #if ((' ' & 0x0FF) == 0x020)
13494 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13495 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13496 #else
13497 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13498                      || ('j' <= (c) && (c) <= 'r') \
13499                      || ('s' <= (c) && (c) <= 'z'))
13500 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13501 #endif
13502
13503 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13504 int
13505 main ()
13506 {
13507   int i;
13508   for (i = 0; i < 256; i++)
13509     if (XOR (islower (i), ISLOWER (i))
13510         || toupper (i) != TOUPPER (i))
13511       $ac_main_return(2);
13512   $ac_main_return (0);
13513 }
13514 _ACEOF
13515 rm -f conftest$ac_exeext
13516 if { (eval echo "$as_me:13516: \"$ac_link\"") >&5
13517   (eval $ac_link) 2>&5
13518   ac_status=$?
13519   echo "$as_me:13519: \$? = $ac_status" >&5
13520   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13521   { (eval echo "$as_me:13521: \"$ac_try\"") >&5
13522   (eval $ac_try) 2>&5
13523   ac_status=$?
13524   echo "$as_me:13524: \$? = $ac_status" >&5
13525   (exit $ac_status); }; }; then
13526   :
13527 else
13528   echo "$as_me: program exited with status $ac_status" >&5
13529 echo "$as_me: failed program was:" >&5
13530 cat conftest.$ac_ext >&5
13531 ac_cv_header_stdc=no
13532 fi
13533 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13534 fi
13535 fi
13536 fi
13537 echo "$as_me:13537: result: $ac_cv_header_stdc" >&5
13538 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13539 if test $ac_cv_header_stdc = yes; then
13540
13541 cat >>confdefs.h <<\EOF
13542 #define STDC_HEADERS 1
13543 EOF
13544
13545 fi
13546
13547 echo "$as_me:13547: checking whether time.h and sys/time.h may both be included" >&5
13548 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13549 if test "${ac_cv_header_time+set}" = set; then
13550   echo $ECHO_N "(cached) $ECHO_C" >&6
13551 else
13552   cat >conftest.$ac_ext <<_ACEOF
13553 #line 13553 "configure"
13554 #include "confdefs.h"
13555 #include <sys/types.h>
13556 #include <sys/time.h>
13557 #include <time.h>
13558
13559 int
13560 main ()
13561 {
13562 if ((struct tm *) 0)
13563 return 0;
13564   ;
13565   return 0;
13566 }
13567 _ACEOF
13568 rm -f conftest.$ac_objext
13569 if { (eval echo "$as_me:13569: \"$ac_compile\"") >&5
13570   (eval $ac_compile) 2>&5
13571   ac_status=$?
13572   echo "$as_me:13572: \$? = $ac_status" >&5
13573   (exit $ac_status); } &&
13574          { ac_try='test -s conftest.$ac_objext'
13575   { (eval echo "$as_me:13575: \"$ac_try\"") >&5
13576   (eval $ac_try) 2>&5
13577   ac_status=$?
13578   echo "$as_me:13578: \$? = $ac_status" >&5
13579   (exit $ac_status); }; }; then
13580   ac_cv_header_time=yes
13581 else
13582   echo "$as_me: failed program was:" >&5
13583 cat conftest.$ac_ext >&5
13584 ac_cv_header_time=no
13585 fi
13586 rm -f conftest.$ac_objext conftest.$ac_ext
13587 fi
13588 echo "$as_me:13588: result: $ac_cv_header_time" >&5
13589 echo "${ECHO_T}$ac_cv_header_time" >&6
13590 if test $ac_cv_header_time = yes; then
13591
13592 cat >>confdefs.h <<\EOF
13593 #define TIME_WITH_SYS_TIME 1
13594 EOF
13595
13596 fi
13597
13598 for ac_header in \
13599 getopt.h \
13600 locale.h \
13601 math.h \
13602 stdarg.h \
13603 sys/ioctl.h \
13604 sys/select.h \
13605 sys/time.h \
13606 termios.h \
13607 unistd.h \
13608
13609 do
13610 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13611 echo "$as_me:13611: checking for $ac_header" >&5
13612 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13613 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13614   echo $ECHO_N "(cached) $ECHO_C" >&6
13615 else
13616   cat >conftest.$ac_ext <<_ACEOF
13617 #line 13617 "configure"
13618 #include "confdefs.h"
13619 #include <$ac_header>
13620 _ACEOF
13621 if { (eval echo "$as_me:13621: \"$ac_cpp conftest.$ac_ext\"") >&5
13622   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13623   ac_status=$?
13624   egrep -v '^ *\+' conftest.er1 >conftest.err
13625   rm -f conftest.er1
13626   cat conftest.err >&5
13627   echo "$as_me:13627: \$? = $ac_status" >&5
13628   (exit $ac_status); } >/dev/null; then
13629   if test -s conftest.err; then
13630     ac_cpp_err=$ac_c_preproc_warn_flag
13631   else
13632     ac_cpp_err=
13633   fi
13634 else
13635   ac_cpp_err=yes
13636 fi
13637 if test -z "$ac_cpp_err"; then
13638   eval "$as_ac_Header=yes"
13639 else
13640   echo "$as_me: failed program was:" >&5
13641   cat conftest.$ac_ext >&5
13642   eval "$as_ac_Header=no"
13643 fi
13644 rm -f conftest.err conftest.$ac_ext
13645 fi
13646 echo "$as_me:13646: result: `eval echo '${'$as_ac_Header'}'`" >&5
13647 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13648 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13649   cat >>confdefs.h <<EOF
13650 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13651 EOF
13652
13653 fi
13654 done
13655
13656 for ac_header in unistd.h getopt.h
13657 do
13658 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13659 echo "$as_me:13659: checking for $ac_header" >&5
13660 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13661 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13662   echo $ECHO_N "(cached) $ECHO_C" >&6
13663 else
13664   cat >conftest.$ac_ext <<_ACEOF
13665 #line 13665 "configure"
13666 #include "confdefs.h"
13667 #include <$ac_header>
13668 _ACEOF
13669 if { (eval echo "$as_me:13669: \"$ac_cpp conftest.$ac_ext\"") >&5
13670   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13671   ac_status=$?
13672   egrep -v '^ *\+' conftest.er1 >conftest.err
13673   rm -f conftest.er1
13674   cat conftest.err >&5
13675   echo "$as_me:13675: \$? = $ac_status" >&5
13676   (exit $ac_status); } >/dev/null; then
13677   if test -s conftest.err; then
13678     ac_cpp_err=$ac_c_preproc_warn_flag
13679   else
13680     ac_cpp_err=
13681   fi
13682 else
13683   ac_cpp_err=yes
13684 fi
13685 if test -z "$ac_cpp_err"; then
13686   eval "$as_ac_Header=yes"
13687 else
13688   echo "$as_me: failed program was:" >&5
13689   cat conftest.$ac_ext >&5
13690   eval "$as_ac_Header=no"
13691 fi
13692 rm -f conftest.err conftest.$ac_ext
13693 fi
13694 echo "$as_me:13694: result: `eval echo '${'$as_ac_Header'}'`" >&5
13695 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13696 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13697   cat >>confdefs.h <<EOF
13698 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13699 EOF
13700
13701 fi
13702 done
13703
13704 echo "$as_me:13704: checking for header declaring getopt variables" >&5
13705 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13706 if test "${cf_cv_getopt_header+set}" = set; then
13707   echo $ECHO_N "(cached) $ECHO_C" >&6
13708 else
13709
13710 cf_cv_getopt_header=none
13711 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13712 do
13713 cat >conftest.$ac_ext <<_ACEOF
13714 #line 13714 "configure"
13715 #include "confdefs.h"
13716
13717 #include <$cf_header>
13718 int
13719 main ()
13720 {
13721 int x = optind; char *y = optarg
13722   ;
13723   return 0;
13724 }
13725 _ACEOF
13726 rm -f conftest.$ac_objext
13727 if { (eval echo "$as_me:13727: \"$ac_compile\"") >&5
13728   (eval $ac_compile) 2>&5
13729   ac_status=$?
13730   echo "$as_me:13730: \$? = $ac_status" >&5
13731   (exit $ac_status); } &&
13732          { ac_try='test -s conftest.$ac_objext'
13733   { (eval echo "$as_me:13733: \"$ac_try\"") >&5
13734   (eval $ac_try) 2>&5
13735   ac_status=$?
13736   echo "$as_me:13736: \$? = $ac_status" >&5
13737   (exit $ac_status); }; }; then
13738   cf_cv_getopt_header=$cf_header
13739  break
13740 else
13741   echo "$as_me: failed program was:" >&5
13742 cat conftest.$ac_ext >&5
13743 fi
13744 rm -f conftest.$ac_objext conftest.$ac_ext
13745 done
13746
13747 fi
13748 echo "$as_me:13748: result: $cf_cv_getopt_header" >&5
13749 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13750 if test $cf_cv_getopt_header != none ; then
13751         cat >>confdefs.h <<\EOF
13752 #define HAVE_GETOPT_HEADER 1
13753 EOF
13754
13755 fi
13756
13757 for ac_func in \
13758 gettimeofday \
13759 strdup \
13760
13761 do
13762 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13763 echo "$as_me:13763: checking for $ac_func" >&5
13764 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13765 if eval "test \"\${$as_ac_var+set}\" = set"; then
13766   echo $ECHO_N "(cached) $ECHO_C" >&6
13767 else
13768   cat >conftest.$ac_ext <<_ACEOF
13769 #line 13769 "configure"
13770 #include "confdefs.h"
13771 /* System header to define __stub macros and hopefully few prototypes,
13772     which can conflict with char $ac_func (); below.  */
13773 #include <assert.h>
13774 /* Override any gcc2 internal prototype to avoid an error.  */
13775 #ifdef __cplusplus
13776 extern "C"
13777 #endif
13778 /* We use char because int might match the return type of a gcc2
13779    builtin and then its argument prototype would still apply.  */
13780 char $ac_func ();
13781 char (*f) ();
13782
13783 int
13784 main ()
13785 {
13786 /* The GNU C library defines this for functions which it implements
13787     to always fail with ENOSYS.  Some functions are actually named
13788     something starting with __ and the normal name is an alias.  */
13789 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13790 choke me
13791 #else
13792 f = $ac_func;
13793 #endif
13794
13795   ;
13796   return 0;
13797 }
13798 _ACEOF
13799 rm -f conftest.$ac_objext conftest$ac_exeext
13800 if { (eval echo "$as_me:13800: \"$ac_link\"") >&5
13801   (eval $ac_link) 2>&5
13802   ac_status=$?
13803   echo "$as_me:13803: \$? = $ac_status" >&5
13804   (exit $ac_status); } &&
13805          { ac_try='test -s conftest$ac_exeext'
13806   { (eval echo "$as_me:13806: \"$ac_try\"") >&5
13807   (eval $ac_try) 2>&5
13808   ac_status=$?
13809   echo "$as_me:13809: \$? = $ac_status" >&5
13810   (exit $ac_status); }; }; then
13811   eval "$as_ac_var=yes"
13812 else
13813   echo "$as_me: failed program was:" >&5
13814 cat conftest.$ac_ext >&5
13815 eval "$as_ac_var=no"
13816 fi
13817 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13818 fi
13819 echo "$as_me:13819: result: `eval echo '${'$as_ac_var'}'`" >&5
13820 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13821 if test `eval echo '${'$as_ac_var'}'` = yes; then
13822   cat >>confdefs.h <<EOF
13823 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13824 EOF
13825
13826 fi
13827 done
13828
13829 if test "$cf_enable_widec" = yes; then
13830
13831 for ac_func in \
13832 mblen \
13833 mbrlen \
13834 mbrtowc \
13835 mbsrtowcs \
13836 mbstowcs \
13837 mbtowc \
13838 wcsrtombs \
13839 wcstombs \
13840
13841 do
13842 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13843 echo "$as_me:13843: checking for $ac_func" >&5
13844 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13845 if eval "test \"\${$as_ac_var+set}\" = set"; then
13846   echo $ECHO_N "(cached) $ECHO_C" >&6
13847 else
13848   cat >conftest.$ac_ext <<_ACEOF
13849 #line 13849 "configure"
13850 #include "confdefs.h"
13851 /* System header to define __stub macros and hopefully few prototypes,
13852     which can conflict with char $ac_func (); below.  */
13853 #include <assert.h>
13854 /* Override any gcc2 internal prototype to avoid an error.  */
13855 #ifdef __cplusplus
13856 extern "C"
13857 #endif
13858 /* We use char because int might match the return type of a gcc2
13859    builtin and then its argument prototype would still apply.  */
13860 char $ac_func ();
13861 char (*f) ();
13862
13863 int
13864 main ()
13865 {
13866 /* The GNU C library defines this for functions which it implements
13867     to always fail with ENOSYS.  Some functions are actually named
13868     something starting with __ and the normal name is an alias.  */
13869 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13870 choke me
13871 #else
13872 f = $ac_func;
13873 #endif
13874
13875   ;
13876   return 0;
13877 }
13878 _ACEOF
13879 rm -f conftest.$ac_objext conftest$ac_exeext
13880 if { (eval echo "$as_me:13880: \"$ac_link\"") >&5
13881   (eval $ac_link) 2>&5
13882   ac_status=$?
13883   echo "$as_me:13883: \$? = $ac_status" >&5
13884   (exit $ac_status); } &&
13885          { ac_try='test -s conftest$ac_exeext'
13886   { (eval echo "$as_me:13886: \"$ac_try\"") >&5
13887   (eval $ac_try) 2>&5
13888   ac_status=$?
13889   echo "$as_me:13889: \$? = $ac_status" >&5
13890   (exit $ac_status); }; }; then
13891   eval "$as_ac_var=yes"
13892 else
13893   echo "$as_me: failed program was:" >&5
13894 cat conftest.$ac_ext >&5
13895 eval "$as_ac_var=no"
13896 fi
13897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13898 fi
13899 echo "$as_me:13899: result: `eval echo '${'$as_ac_var'}'`" >&5
13900 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13901 if test `eval echo '${'$as_ac_var'}'` = yes; then
13902   cat >>confdefs.h <<EOF
13903 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13904 EOF
13905
13906 fi
13907 done
13908
13909 fi
13910
13911 echo "$as_me:13911: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13912 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13913 if test "${cf_cv_need_xopen_extension+set}" = set; then
13914   echo $ECHO_N "(cached) $ECHO_C" >&6
13915 else
13916
13917 cat >conftest.$ac_ext <<_ACEOF
13918 #line 13918 "configure"
13919 #include "confdefs.h"
13920
13921 #include <stdlib.h>
13922 #include <${cf_cv_ncurses_header:-curses.h}>
13923 int
13924 main ()
13925 {
13926
13927 #if defined(NCURSES_VERSION_PATCH)
13928 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13929         make an error
13930 #endif
13931 #endif
13932         long x = winnstr(stdscr, "", 0);
13933         int x1, y1;
13934         getbegyx(stdscr, y1, x1)
13935   ;
13936   return 0;
13937 }
13938 _ACEOF
13939 rm -f conftest.$ac_objext conftest$ac_exeext
13940 if { (eval echo "$as_me:13940: \"$ac_link\"") >&5
13941   (eval $ac_link) 2>&5
13942   ac_status=$?
13943   echo "$as_me:13943: \$? = $ac_status" >&5
13944   (exit $ac_status); } &&
13945          { ac_try='test -s conftest$ac_exeext'
13946   { (eval echo "$as_me:13946: \"$ac_try\"") >&5
13947   (eval $ac_try) 2>&5
13948   ac_status=$?
13949   echo "$as_me:13949: \$? = $ac_status" >&5
13950   (exit $ac_status); }; }; then
13951   cf_cv_need_xopen_extension=no
13952 else
13953   echo "$as_me: failed program was:" >&5
13954 cat conftest.$ac_ext >&5
13955 cat >conftest.$ac_ext <<_ACEOF
13956 #line 13956 "configure"
13957 #include "confdefs.h"
13958
13959 #define _XOPEN_SOURCE_EXTENDED
13960 #include <stdlib.h>
13961 #include <${cf_cv_ncurses_header:-curses.h}>
13962 int
13963 main ()
13964 {
13965
13966 #ifdef NCURSES_VERSION
13967         cchar_t check;
13968         int check2 = curs_set((int)sizeof(check));
13969 #endif
13970         long x = winnstr(stdscr, "", 0);
13971         int x1, y1;
13972         getbegyx(stdscr, y1, x1)
13973   ;
13974   return 0;
13975 }
13976 _ACEOF
13977 rm -f conftest.$ac_objext conftest$ac_exeext
13978 if { (eval echo "$as_me:13978: \"$ac_link\"") >&5
13979   (eval $ac_link) 2>&5
13980   ac_status=$?
13981   echo "$as_me:13981: \$? = $ac_status" >&5
13982   (exit $ac_status); } &&
13983          { ac_try='test -s conftest$ac_exeext'
13984   { (eval echo "$as_me:13984: \"$ac_try\"") >&5
13985   (eval $ac_try) 2>&5
13986   ac_status=$?
13987   echo "$as_me:13987: \$? = $ac_status" >&5
13988   (exit $ac_status); }; }; then
13989   cf_cv_need_xopen_extension=yes
13990 else
13991   echo "$as_me: failed program was:" >&5
13992 cat conftest.$ac_ext >&5
13993 cf_cv_need_xopen_extension=unknown
13994 fi
13995 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13996 fi
13997 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13998 fi
13999 echo "$as_me:13999: result: $cf_cv_need_xopen_extension" >&5
14000 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14001 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14002
14003 echo "$as_me:14003: checking for term.h" >&5
14004 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14005 if test "${cf_cv_term_header+set}" = set; then
14006   echo $ECHO_N "(cached) $ECHO_C" >&6
14007 else
14008
14009 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14010 # for <term.h> if we do not find the variant.
14011
14012 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14013
14014 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14015 */*)
14016         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14017         cf_header_list="$cf_header_item $cf_header_list"
14018         ;;
14019 esac
14020
14021 for cf_header in $cf_header_list
14022 do
14023         cat >conftest.$ac_ext <<_ACEOF
14024 #line 14024 "configure"
14025 #include "confdefs.h"
14026
14027 #include <${cf_cv_ncurses_header:-curses.h}>
14028 #include <${cf_header}>
14029 int
14030 main ()
14031 {
14032 WINDOW *x
14033   ;
14034   return 0;
14035 }
14036 _ACEOF
14037 rm -f conftest.$ac_objext
14038 if { (eval echo "$as_me:14038: \"$ac_compile\"") >&5
14039   (eval $ac_compile) 2>&5
14040   ac_status=$?
14041   echo "$as_me:14041: \$? = $ac_status" >&5
14042   (exit $ac_status); } &&
14043          { ac_try='test -s conftest.$ac_objext'
14044   { (eval echo "$as_me:14044: \"$ac_try\"") >&5
14045   (eval $ac_try) 2>&5
14046   ac_status=$?
14047   echo "$as_me:14047: \$? = $ac_status" >&5
14048   (exit $ac_status); }; }; then
14049   cf_cv_term_header=$cf_header
14050          break
14051 else
14052   echo "$as_me: failed program was:" >&5
14053 cat conftest.$ac_ext >&5
14054 cf_cv_term_header=no
14055 fi
14056 rm -f conftest.$ac_objext conftest.$ac_ext
14057 done
14058
14059 case $cf_cv_term_header in #(vi
14060 no)
14061         # If curses is ncurses, some packagers still mess it up by trying to make
14062         # us use GNU termcap.  This handles the most common case.
14063         for cf_header in ncurses/term.h ncursesw/term.h
14064         do
14065                 cat >conftest.$ac_ext <<_ACEOF
14066 #line 14066 "configure"
14067 #include "confdefs.h"
14068
14069 #include <${cf_cv_ncurses_header:-curses.h}>
14070 #ifdef NCURSES_VERSION
14071 #include <${cf_header}>
14072 #else
14073 make an error
14074 #endif
14075 int
14076 main ()
14077 {
14078 WINDOW *x
14079   ;
14080   return 0;
14081 }
14082 _ACEOF
14083 rm -f conftest.$ac_objext
14084 if { (eval echo "$as_me:14084: \"$ac_compile\"") >&5
14085   (eval $ac_compile) 2>&5
14086   ac_status=$?
14087   echo "$as_me:14087: \$? = $ac_status" >&5
14088   (exit $ac_status); } &&
14089          { ac_try='test -s conftest.$ac_objext'
14090   { (eval echo "$as_me:14090: \"$ac_try\"") >&5
14091   (eval $ac_try) 2>&5
14092   ac_status=$?
14093   echo "$as_me:14093: \$? = $ac_status" >&5
14094   (exit $ac_status); }; }; then
14095   cf_cv_term_header=$cf_header
14096                          break
14097 else
14098   echo "$as_me: failed program was:" >&5
14099 cat conftest.$ac_ext >&5
14100 cf_cv_term_header=no
14101 fi
14102 rm -f conftest.$ac_objext conftest.$ac_ext
14103         done
14104         ;;
14105 esac
14106
14107 fi
14108 echo "$as_me:14108: result: $cf_cv_term_header" >&5
14109 echo "${ECHO_T}$cf_cv_term_header" >&6
14110
14111 case $cf_cv_term_header in #(vi
14112 term.h) #(vi
14113         cat >>confdefs.h <<\EOF
14114 #define HAVE_TERM_H 1
14115 EOF
14116
14117         ;;
14118 ncurses/term.h) #(vi
14119         cat >>confdefs.h <<\EOF
14120 #define HAVE_NCURSES_TERM_H 1
14121 EOF
14122
14123         ;;
14124 ncursesw/term.h)
14125         cat >>confdefs.h <<\EOF
14126 #define HAVE_NCURSESW_TERM_H 1
14127 EOF
14128
14129         ;;
14130 esac
14131
14132 echo "$as_me:14132: checking for unctrl.h" >&5
14133 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14134 if test "${cf_cv_unctrl_header+set}" = set; then
14135   echo $ECHO_N "(cached) $ECHO_C" >&6
14136 else
14137
14138 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14139 # for <unctrl.h> if we do not find the variant.
14140
14141 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14142
14143 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14144 */*)
14145         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14146         cf_header_list="$cf_header_item $cf_header_list"
14147         ;;
14148 esac
14149
14150 for cf_header in $cf_header_list
14151 do
14152         cat >conftest.$ac_ext <<_ACEOF
14153 #line 14153 "configure"
14154 #include "confdefs.h"
14155
14156 #include <${cf_cv_ncurses_header:-curses.h}>
14157 #include <${cf_header}>
14158 int
14159 main ()
14160 {
14161 WINDOW *x
14162   ;
14163   return 0;
14164 }
14165 _ACEOF
14166 rm -f conftest.$ac_objext
14167 if { (eval echo "$as_me:14167: \"$ac_compile\"") >&5
14168   (eval $ac_compile) 2>&5
14169   ac_status=$?
14170   echo "$as_me:14170: \$? = $ac_status" >&5
14171   (exit $ac_status); } &&
14172          { ac_try='test -s conftest.$ac_objext'
14173   { (eval echo "$as_me:14173: \"$ac_try\"") >&5
14174   (eval $ac_try) 2>&5
14175   ac_status=$?
14176   echo "$as_me:14176: \$? = $ac_status" >&5
14177   (exit $ac_status); }; }; then
14178   cf_cv_unctrl_header=$cf_header
14179          break
14180 else
14181   echo "$as_me: failed program was:" >&5
14182 cat conftest.$ac_ext >&5
14183 cf_cv_unctrl_header=no
14184 fi
14185 rm -f conftest.$ac_objext conftest.$ac_ext
14186 done
14187
14188 case $cf_cv_unctrl_header in #(vi
14189 no)
14190         { echo "$as_me:14190: WARNING: unctrl.h header not found" >&5
14191 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14192         ;;
14193 esac
14194
14195 fi
14196 echo "$as_me:14196: result: $cf_cv_unctrl_header" >&5
14197 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14198
14199 case $cf_cv_unctrl_header in #(vi
14200 unctrl.h) #(vi
14201         cat >>confdefs.h <<\EOF
14202 #define HAVE_UNCTRL_H 1
14203 EOF
14204
14205         ;;
14206 ncurses/unctrl.h) #(vi
14207         cat >>confdefs.h <<\EOF
14208 #define HAVE_NCURSES_UNCTRL_H 1
14209 EOF
14210
14211         ;;
14212 ncursesw/unctrl.h)
14213         cat >>confdefs.h <<\EOF
14214 #define HAVE_NCURSESW_UNCTRL_H 1
14215 EOF
14216
14217         ;;
14218 esac
14219
14220 for cf_func in \
14221 assume_default_colors \
14222 chgat \
14223 color_set \
14224 filter \
14225 getbegx \
14226 getcurx \
14227 getmaxx \
14228 getnstr \
14229 getparx \
14230 getwin \
14231 mvvline \
14232 mvwvline \
14233 napms \
14234 putwin \
14235 resize_term \
14236 resizeterm \
14237 ripoffline \
14238 scr_dump \
14239 setupterm \
14240 slk_color \
14241 slk_init \
14242 termattrs \
14243 tgetent \
14244 tigetnum \
14245 tigetstr \
14246 typeahead \
14247 use_default_colors \
14248 use_screen \
14249 use_window \
14250 vsscanf \
14251 vw_printw \
14252 wchgat \
14253 winsstr \
14254 wresize \
14255 wsyncdown \
14256
14257 do
14258
14259 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14260
14261         echo "$as_me:14261: checking for ${cf_func}" >&5
14262 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14263
14264 echo "${as_me:-configure}:14264: testing ${cf_func} ..." 1>&5
14265
14266         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14267   echo $ECHO_N "(cached) $ECHO_C" >&6
14268 else
14269
14270                 eval cf_result='$ac_cv_func_'$cf_func
14271                 if test ".$cf_result" != ".no"; then
14272                         cat >conftest.$ac_ext <<_ACEOF
14273 #line 14273 "configure"
14274 #include "confdefs.h"
14275
14276 #ifdef HAVE_XCURSES
14277 #include <xcurses.h>
14278 char * XCursesProgramName = "test";
14279 #else
14280 #include <${cf_cv_ncurses_header:-curses.h}>
14281 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14282 #include <ncursesw/term.h>
14283 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14284 #include <ncurses/term.h>
14285 #elif defined(HAVE_TERM_H)
14286 #include <term.h>
14287 #endif
14288 #endif
14289
14290 int
14291 main ()
14292 {
14293
14294 #ifndef ${cf_func}
14295 long foo = (long)(&${cf_func});
14296 if (foo + 1234 > 5678)
14297         ${cf_cv_main_return:-return}(foo);
14298 #endif
14299
14300   ;
14301   return 0;
14302 }
14303 _ACEOF
14304 rm -f conftest.$ac_objext conftest$ac_exeext
14305 if { (eval echo "$as_me:14305: \"$ac_link\"") >&5
14306   (eval $ac_link) 2>&5
14307   ac_status=$?
14308   echo "$as_me:14308: \$? = $ac_status" >&5
14309   (exit $ac_status); } &&
14310          { ac_try='test -s conftest$ac_exeext'
14311   { (eval echo "$as_me:14311: \"$ac_try\"") >&5
14312   (eval $ac_try) 2>&5
14313   ac_status=$?
14314   echo "$as_me:14314: \$? = $ac_status" >&5
14315   (exit $ac_status); }; }; then
14316   cf_result=yes
14317 else
14318   echo "$as_me: failed program was:" >&5
14319 cat conftest.$ac_ext >&5
14320 cf_result=no
14321 fi
14322 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14323                 fi
14324                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14325
14326 fi
14327
14328         # use the computed/retrieved cache-value:
14329         eval 'cf_result=$cf_cv_func_'$cf_func
14330         echo "$as_me:14330: result: $cf_result" >&5
14331 echo "${ECHO_T}$cf_result" >&6
14332         if test $cf_result != no; then
14333                 cat >>confdefs.h <<EOF
14334 #define HAVE_${cf_tr_func} 1
14335 EOF
14336
14337         fi
14338 done
14339
14340 for cf_func in tputs
14341 do
14342
14343 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14344
14345         echo "$as_me:14345: checking for ${cf_func}" >&5
14346 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14347
14348 echo "${as_me:-configure}:14348: testing ${cf_func} ..." 1>&5
14349
14350         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14351   echo $ECHO_N "(cached) $ECHO_C" >&6
14352 else
14353
14354                 eval cf_result='$ac_cv_func_'$cf_func
14355                 if test ".$cf_result" != ".no"; then
14356                         cat >conftest.$ac_ext <<_ACEOF
14357 #line 14357 "configure"
14358 #include "confdefs.h"
14359
14360 #ifdef HAVE_XCURSES
14361 #include <xcurses.h>
14362 char * XCursesProgramName = "test";
14363 #else
14364 #include <${cf_cv_ncurses_header:-curses.h}>
14365 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14366 #include <ncursesw/term.h>
14367 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14368 #include <ncurses/term.h>
14369 #elif defined(HAVE_TERM_H)
14370 #include <term.h>
14371 #endif
14372 #endif
14373
14374 int
14375 main ()
14376 {
14377
14378 #ifndef ${cf_func}
14379 long foo = (long)(&${cf_func});
14380 if (foo + 1234 > 5678)
14381         ${cf_cv_main_return:-return}(foo);
14382 #endif
14383
14384   ;
14385   return 0;
14386 }
14387 _ACEOF
14388 rm -f conftest.$ac_objext conftest$ac_exeext
14389 if { (eval echo "$as_me:14389: \"$ac_link\"") >&5
14390   (eval $ac_link) 2>&5
14391   ac_status=$?
14392   echo "$as_me:14392: \$? = $ac_status" >&5
14393   (exit $ac_status); } &&
14394          { ac_try='test -s conftest$ac_exeext'
14395   { (eval echo "$as_me:14395: \"$ac_try\"") >&5
14396   (eval $ac_try) 2>&5
14397   ac_status=$?
14398   echo "$as_me:14398: \$? = $ac_status" >&5
14399   (exit $ac_status); }; }; then
14400   cf_result=yes
14401 else
14402   echo "$as_me: failed program was:" >&5
14403 cat conftest.$ac_ext >&5
14404 cf_result=no
14405 fi
14406 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14407                 fi
14408                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14409
14410 fi
14411
14412         # use the computed/retrieved cache-value:
14413         eval 'cf_result=$cf_cv_func_'$cf_func
14414         echo "$as_me:14414: result: $cf_result" >&5
14415 echo "${ECHO_T}$cf_result" >&6
14416         if test $cf_result != no; then
14417                 cat >>confdefs.h <<EOF
14418 #define HAVE_${cf_tr_func} 1
14419 EOF
14420
14421         fi
14422 done
14423
14424 if test x$cf_cv_func_tputs = xyes
14425 then
14426         cf_done=no
14427         for cf_arg in int char
14428         do
14429                 for cf_ret in int void
14430                 do
14431                         if test $cf_ret = void
14432                         then
14433                                 cf_return="/* nothing */"
14434                         else
14435                                 cf_return="return value"
14436                         fi
14437                         cat >conftest.$ac_ext <<_ACEOF
14438 #line 14438 "configure"
14439 #include "confdefs.h"
14440
14441 #include <${cf_cv_ncurses_header:-curses.h}>
14442 #include <$cf_cv_term_header>
14443
14444 static $cf_ret outc($cf_arg value) { $cf_return; }
14445
14446 int
14447 main ()
14448 {
14449
14450         tputs("hello", 0, outc);
14451         ${cf_cv_main_return:-return}(0);
14452
14453   ;
14454   return 0;
14455 }
14456 _ACEOF
14457 rm -f conftest.$ac_objext
14458 if { (eval echo "$as_me:14458: \"$ac_compile\"") >&5
14459   (eval $ac_compile) 2>&5
14460   ac_status=$?
14461   echo "$as_me:14461: \$? = $ac_status" >&5
14462   (exit $ac_status); } &&
14463          { ac_try='test -s conftest.$ac_objext'
14464   { (eval echo "$as_me:14464: \"$ac_try\"") >&5
14465   (eval $ac_try) 2>&5
14466   ac_status=$?
14467   echo "$as_me:14467: \$? = $ac_status" >&5
14468   (exit $ac_status); }; }; then
14469
14470                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14471
14472 echo "${as_me:-configure}:14472: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14473
14474                 cat >>confdefs.h <<EOF
14475 #define TPUTS_ARG               $cf_arg
14476 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14477 #define TPUTS_RETURN(value)     $cf_return
14478 EOF
14479                 cf_done=yes
14480                 break
14481
14482 else
14483   echo "$as_me: failed program was:" >&5
14484 cat conftest.$ac_ext >&5
14485 fi
14486 rm -f conftest.$ac_objext conftest.$ac_ext
14487                 done
14488                 test $cf_done = yes && break
14489         done
14490 fi
14491
14492 echo "$as_me:14492: checking for ncurses extended functions" >&5
14493 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14494 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14495   echo $ECHO_N "(cached) $ECHO_C" >&6
14496 else
14497
14498 cat >conftest.$ac_ext <<_ACEOF
14499 #line 14499 "configure"
14500 #include "confdefs.h"
14501
14502 #include <${cf_cv_ncurses_header:-curses.h}>
14503 int
14504 main ()
14505 {
14506
14507 int x = NCURSES_EXT_FUNCS
14508
14509   ;
14510   return 0;
14511 }
14512 _ACEOF
14513 rm -f conftest.$ac_objext
14514 if { (eval echo "$as_me:14514: \"$ac_compile\"") >&5
14515   (eval $ac_compile) 2>&5
14516   ac_status=$?
14517   echo "$as_me:14517: \$? = $ac_status" >&5
14518   (exit $ac_status); } &&
14519          { ac_try='test -s conftest.$ac_objext'
14520   { (eval echo "$as_me:14520: \"$ac_try\"") >&5
14521   (eval $ac_try) 2>&5
14522   ac_status=$?
14523   echo "$as_me:14523: \$? = $ac_status" >&5
14524   (exit $ac_status); }; }; then
14525   cf_cv_ncurses_ext_funcs=defined
14526 else
14527   echo "$as_me: failed program was:" >&5
14528 cat conftest.$ac_ext >&5
14529
14530 cat >conftest.$ac_ext <<_ACEOF
14531 #line 14531 "configure"
14532 #include "confdefs.h"
14533
14534 #include <${cf_cv_ncurses_header:-curses.h}>
14535 int
14536 main ()
14537 {
14538
14539         (void) assume_default_colors (0, 0);
14540         (void) curses_version ();
14541         (void) define_key (0, 0);
14542         (void) is_term_resized (0, 0);
14543         (void) key_defined (0);
14544         (void) keybound (0, 0);
14545         (void) keyok (0, 0);
14546         (void) resize_term (0, 0);
14547         (void) resizeterm (0, 0);
14548         (void) use_default_colors ();
14549         (void) use_extended_names (0);
14550         (void) wresize (0, 0, 0);
14551   ;
14552   return 0;
14553 }
14554 _ACEOF
14555 rm -f conftest.$ac_objext conftest$ac_exeext
14556 if { (eval echo "$as_me:14556: \"$ac_link\"") >&5
14557   (eval $ac_link) 2>&5
14558   ac_status=$?
14559   echo "$as_me:14559: \$? = $ac_status" >&5
14560   (exit $ac_status); } &&
14561          { ac_try='test -s conftest$ac_exeext'
14562   { (eval echo "$as_me:14562: \"$ac_try\"") >&5
14563   (eval $ac_try) 2>&5
14564   ac_status=$?
14565   echo "$as_me:14565: \$? = $ac_status" >&5
14566   (exit $ac_status); }; }; then
14567   cf_cv_ncurses_ext_funcs=yes
14568 else
14569   echo "$as_me: failed program was:" >&5
14570 cat conftest.$ac_ext >&5
14571 cf_cv_ncurses_ext_funcs=no
14572 fi
14573 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14574
14575 fi
14576 rm -f conftest.$ac_objext conftest.$ac_ext
14577
14578 fi
14579 echo "$as_me:14579: result: $cf_cv_ncurses_ext_funcs" >&5
14580 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14581 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14582 #define NCURSES_EXT_FUNCS 1
14583 EOF
14584
14585 if test "$cf_enable_widec" = yes
14586 then
14587         # workaround for systems with ncurses before 20111029, due to change of
14588         # feature test macro from _XPG5 to _XOPEN_SOURCE
14589         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14590         then
14591                 cf_define_xpg5=no
14592                 echo "$as_me:14592: checking if _XPG5 should be defined to enable wide-characters" >&5
14593 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14594
14595                 cat >conftest.$ac_ext <<_ACEOF
14596 #line 14596 "configure"
14597 #include "confdefs.h"
14598
14599 #include <${cf_cv_ncurses_header:-curses.h}>
14600 int
14601 main ()
14602 {
14603 int x = _XPG5
14604   ;
14605   return 0;
14606 }
14607 _ACEOF
14608 rm -f conftest.$ac_objext
14609 if { (eval echo "$as_me:14609: \"$ac_compile\"") >&5
14610   (eval $ac_compile) 2>&5
14611   ac_status=$?
14612   echo "$as_me:14612: \$? = $ac_status" >&5
14613   (exit $ac_status); } &&
14614          { ac_try='test -s conftest.$ac_objext'
14615   { (eval echo "$as_me:14615: \"$ac_try\"") >&5
14616   (eval $ac_try) 2>&5
14617   ac_status=$?
14618   echo "$as_me:14618: \$? = $ac_status" >&5
14619   (exit $ac_status); }; }; then
14620   :
14621 else
14622   echo "$as_me: failed program was:" >&5
14623 cat conftest.$ac_ext >&5
14624 cf_save_cppflags="$CPPFLAGS"
14625                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14626                          cat >conftest.$ac_ext <<_ACEOF
14627 #line 14627 "configure"
14628 #include "confdefs.h"
14629
14630 #include <${cf_cv_ncurses_header:-curses.h}>
14631 int
14632 main ()
14633 {
14634 int x = _XPG5
14635   ;
14636   return 0;
14637 }
14638 _ACEOF
14639 rm -f conftest.$ac_objext
14640 if { (eval echo "$as_me:14640: \"$ac_compile\"") >&5
14641   (eval $ac_compile) 2>&5
14642   ac_status=$?
14643   echo "$as_me:14643: \$? = $ac_status" >&5
14644   (exit $ac_status); } &&
14645          { ac_try='test -s conftest.$ac_objext'
14646   { (eval echo "$as_me:14646: \"$ac_try\"") >&5
14647   (eval $ac_try) 2>&5
14648   ac_status=$?
14649   echo "$as_me:14649: \$? = $ac_status" >&5
14650   (exit $ac_status); }; }; then
14651   cf_define_xpg5=yes
14652 else
14653   echo "$as_me: failed program was:" >&5
14654 cat conftest.$ac_ext >&5
14655 fi
14656 rm -f conftest.$ac_objext conftest.$ac_ext
14657                          CPPFLAGS="$cf_save_cppflags"
14658 fi
14659 rm -f conftest.$ac_objext conftest.$ac_ext
14660                 echo "$as_me:14660: result: $cf_define_xpg5" >&5
14661 echo "${ECHO_T}$cf_define_xpg5" >&6
14662
14663                 if test "$cf_define_xpg5" = yes
14664                 then
14665                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14666                 fi
14667         fi
14668
14669         echo "$as_me:14669: checking for wide-character functions" >&5
14670 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14671 if test "${cf_cv_widechar_funcs+set}" = set; then
14672   echo $ECHO_N "(cached) $ECHO_C" >&6
14673 else
14674
14675         cat >conftest.$ac_ext <<_ACEOF
14676 #line 14676 "configure"
14677 #include "confdefs.h"
14678
14679 #include <${cf_cv_ncurses_header:-curses.h}>
14680 int
14681 main ()
14682 {
14683
14684                 static wchar_t src_wchar[2];
14685                 static cchar_t dst_cchar;
14686                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14687
14688   ;
14689   return 0;
14690 }
14691 _ACEOF
14692 rm -f conftest.$ac_objext conftest$ac_exeext
14693 if { (eval echo "$as_me:14693: \"$ac_link\"") >&5
14694   (eval $ac_link) 2>&5
14695   ac_status=$?
14696   echo "$as_me:14696: \$? = $ac_status" >&5
14697   (exit $ac_status); } &&
14698          { ac_try='test -s conftest$ac_exeext'
14699   { (eval echo "$as_me:14699: \"$ac_try\"") >&5
14700   (eval $ac_try) 2>&5
14701   ac_status=$?
14702   echo "$as_me:14702: \$? = $ac_status" >&5
14703   (exit $ac_status); }; }; then
14704   cf_cv_widechar_funcs=yes
14705 else
14706   echo "$as_me: failed program was:" >&5
14707 cat conftest.$ac_ext >&5
14708 cf_cv_widechar_funcs=no
14709 fi
14710 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14711
14712 fi
14713 echo "$as_me:14713: result: $cf_cv_widechar_funcs" >&5
14714 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14715         if test "$cf_cv_widechar_funcs" != no ; then
14716                 cat >>confdefs.h <<\EOF
14717 #define USE_WIDEC_SUPPORT 1
14718 EOF
14719
14720         else
14721                 cat >>confdefs.h <<\EOF
14722 #define USE_WIDEC_SUPPORT 0
14723 EOF
14724
14725         fi
14726 else
14727         cat >>confdefs.h <<\EOF
14728 #define USE_WIDEC_SUPPORT 0
14729 EOF
14730
14731 fi
14732
14733 echo "$as_me:14733: checking if sys/time.h works with sys/select.h" >&5
14734 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14735 if test "${cf_cv_sys_time_select+set}" = set; then
14736   echo $ECHO_N "(cached) $ECHO_C" >&6
14737 else
14738
14739 cat >conftest.$ac_ext <<_ACEOF
14740 #line 14740 "configure"
14741 #include "confdefs.h"
14742
14743 #include <sys/types.h>
14744 #ifdef HAVE_SYS_TIME_H
14745 #include <sys/time.h>
14746 #endif
14747 #ifdef HAVE_SYS_SELECT_H
14748 #include <sys/select.h>
14749 #endif
14750
14751 int
14752 main ()
14753 {
14754
14755   ;
14756   return 0;
14757 }
14758 _ACEOF
14759 rm -f conftest.$ac_objext
14760 if { (eval echo "$as_me:14760: \"$ac_compile\"") >&5
14761   (eval $ac_compile) 2>&5
14762   ac_status=$?
14763   echo "$as_me:14763: \$? = $ac_status" >&5
14764   (exit $ac_status); } &&
14765          { ac_try='test -s conftest.$ac_objext'
14766   { (eval echo "$as_me:14766: \"$ac_try\"") >&5
14767   (eval $ac_try) 2>&5
14768   ac_status=$?
14769   echo "$as_me:14769: \$? = $ac_status" >&5
14770   (exit $ac_status); }; }; then
14771   cf_cv_sys_time_select=yes
14772 else
14773   echo "$as_me: failed program was:" >&5
14774 cat conftest.$ac_ext >&5
14775 cf_cv_sys_time_select=no
14776 fi
14777 rm -f conftest.$ac_objext conftest.$ac_ext
14778
14779 fi
14780
14781 echo "$as_me:14781: result: $cf_cv_sys_time_select" >&5
14782 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14783 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14784 #define HAVE_SYS_TIME_SELECT 1
14785 EOF
14786
14787 echo "$as_me:14787: checking for function curses_version" >&5
14788 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14789 if test "${cf_cv_func_curses_version+set}" = set; then
14790   echo $ECHO_N "(cached) $ECHO_C" >&6
14791 else
14792
14793 if test "$cross_compiling" = yes; then
14794   cf_cv_func_curses_version=unknown
14795 else
14796   cat >conftest.$ac_ext <<_ACEOF
14797 #line 14797 "configure"
14798 #include "confdefs.h"
14799
14800 #include <${cf_cv_ncurses_header:-curses.h}>
14801 int main()
14802 {
14803         char temp[1024];
14804         sprintf(temp, "%s\n", curses_version());
14805         ${cf_cv_main_return:-return}(0);
14806 }
14807
14808 _ACEOF
14809 rm -f conftest$ac_exeext
14810 if { (eval echo "$as_me:14810: \"$ac_link\"") >&5
14811   (eval $ac_link) 2>&5
14812   ac_status=$?
14813   echo "$as_me:14813: \$? = $ac_status" >&5
14814   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14815   { (eval echo "$as_me:14815: \"$ac_try\"") >&5
14816   (eval $ac_try) 2>&5
14817   ac_status=$?
14818   echo "$as_me:14818: \$? = $ac_status" >&5
14819   (exit $ac_status); }; }; then
14820   cf_cv_func_curses_version=yes
14821
14822 else
14823   echo "$as_me: program exited with status $ac_status" >&5
14824 echo "$as_me: failed program was:" >&5
14825 cat conftest.$ac_ext >&5
14826 cf_cv_func_curses_version=no
14827
14828 fi
14829 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14830 fi
14831 rm -f core
14832 fi
14833 echo "$as_me:14833: result: $cf_cv_func_curses_version" >&5
14834 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14835 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14836 #define HAVE_CURSES_VERSION 1
14837 EOF
14838
14839 echo "$as_me:14839: checking for ncurses wrap-prefix" >&5
14840 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14841
14842 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14843 if test "${with_ncurses_wrap_prefix+set}" = set; then
14844   withval="$with_ncurses_wrap_prefix"
14845   NCURSES_WRAP_PREFIX=$withval
14846 else
14847   NCURSES_WRAP_PREFIX=_nc_
14848 fi;
14849 echo "$as_me:14849: result: $NCURSES_WRAP_PREFIX" >&5
14850 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14851
14852 echo "$as_me:14852: checking for alternate character set array" >&5
14853 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14854 if test "${cf_cv_curses_acs_map+set}" = set; then
14855   echo $ECHO_N "(cached) $ECHO_C" >&6
14856 else
14857
14858 cf_cv_curses_acs_map=unknown
14859 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14860 do
14861 cat >conftest.$ac_ext <<_ACEOF
14862 #line 14862 "configure"
14863 #include "confdefs.h"
14864
14865 #include <${cf_cv_ncurses_header:-curses.h}>
14866
14867 int
14868 main ()
14869 {
14870
14871 $name['k'] = ACS_PLUS
14872
14873   ;
14874   return 0;
14875 }
14876 _ACEOF
14877 rm -f conftest.$ac_objext conftest$ac_exeext
14878 if { (eval echo "$as_me:14878: \"$ac_link\"") >&5
14879   (eval $ac_link) 2>&5
14880   ac_status=$?
14881   echo "$as_me:14881: \$? = $ac_status" >&5
14882   (exit $ac_status); } &&
14883          { ac_try='test -s conftest$ac_exeext'
14884   { (eval echo "$as_me:14884: \"$ac_try\"") >&5
14885   (eval $ac_try) 2>&5
14886   ac_status=$?
14887   echo "$as_me:14887: \$? = $ac_status" >&5
14888   (exit $ac_status); }; }; then
14889   cf_cv_curses_acs_map=$name; break
14890 else
14891   echo "$as_me: failed program was:" >&5
14892 cat conftest.$ac_ext >&5
14893 fi
14894 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14895 done
14896
14897 fi
14898 echo "$as_me:14898: result: $cf_cv_curses_acs_map" >&5
14899 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14900
14901 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14902 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14903 EOF
14904
14905 if test "$cf_enable_widec" = yes; then
14906
14907 echo "$as_me:14907: checking for wide alternate character set array" >&5
14908 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14909 if test "${cf_cv_curses_wacs_map+set}" = set; then
14910   echo $ECHO_N "(cached) $ECHO_C" >&6
14911 else
14912
14913         cf_cv_curses_wacs_map=unknown
14914         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14915         do
14916         cat >conftest.$ac_ext <<_ACEOF
14917 #line 14917 "configure"
14918 #include "confdefs.h"
14919
14920 #ifndef _XOPEN_SOURCE_EXTENDED
14921 #define _XOPEN_SOURCE_EXTENDED
14922 #endif
14923 #include <${cf_cv_ncurses_header:-curses.h}>
14924 int
14925 main ()
14926 {
14927 void *foo = &($name['k'])
14928   ;
14929   return 0;
14930 }
14931 _ACEOF
14932 rm -f conftest.$ac_objext conftest$ac_exeext
14933 if { (eval echo "$as_me:14933: \"$ac_link\"") >&5
14934   (eval $ac_link) 2>&5
14935   ac_status=$?
14936   echo "$as_me:14936: \$? = $ac_status" >&5
14937   (exit $ac_status); } &&
14938          { ac_try='test -s conftest$ac_exeext'
14939   { (eval echo "$as_me:14939: \"$ac_try\"") >&5
14940   (eval $ac_try) 2>&5
14941   ac_status=$?
14942   echo "$as_me:14942: \$? = $ac_status" >&5
14943   (exit $ac_status); }; }; then
14944   cf_cv_curses_wacs_map=$name
14945          break
14946 else
14947   echo "$as_me: failed program was:" >&5
14948 cat conftest.$ac_ext >&5
14949 fi
14950 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14951         done
14952 fi
14953 echo "$as_me:14953: result: $cf_cv_curses_wacs_map" >&5
14954 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14955
14956 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
14957 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14958 EOF
14959
14960 echo "$as_me:14960: checking for wide alternate character constants" >&5
14961 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14962 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14963   echo $ECHO_N "(cached) $ECHO_C" >&6
14964 else
14965
14966 cf_cv_curses_wacs_symbols=no
14967 if test "$cf_cv_curses_wacs_map" != unknown
14968 then
14969         cat >conftest.$ac_ext <<_ACEOF
14970 #line 14970 "configure"
14971 #include "confdefs.h"
14972
14973 #ifndef _XOPEN_SOURCE_EXTENDED
14974 #define _XOPEN_SOURCE_EXTENDED
14975 #endif
14976 #include <${cf_cv_ncurses_header:-curses.h}>
14977 int
14978 main ()
14979 {
14980 cchar_t *foo = WACS_PLUS;
14981          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14982   ;
14983   return 0;
14984 }
14985 _ACEOF
14986 rm -f conftest.$ac_objext conftest$ac_exeext
14987 if { (eval echo "$as_me:14987: \"$ac_link\"") >&5
14988   (eval $ac_link) 2>&5
14989   ac_status=$?
14990   echo "$as_me:14990: \$? = $ac_status" >&5
14991   (exit $ac_status); } &&
14992          { ac_try='test -s conftest$ac_exeext'
14993   { (eval echo "$as_me:14993: \"$ac_try\"") >&5
14994   (eval $ac_try) 2>&5
14995   ac_status=$?
14996   echo "$as_me:14996: \$? = $ac_status" >&5
14997   (exit $ac_status); }; }; then
14998   cf_cv_curses_wacs_symbols=yes
14999 else
15000   echo "$as_me: failed program was:" >&5
15001 cat conftest.$ac_ext >&5
15002 fi
15003 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15004 else
15005         cat >conftest.$ac_ext <<_ACEOF
15006 #line 15006 "configure"
15007 #include "confdefs.h"
15008
15009 #ifndef _XOPEN_SOURCE_EXTENDED
15010 #define _XOPEN_SOURCE_EXTENDED
15011 #endif
15012 #include <${cf_cv_ncurses_header:-curses.h}>
15013 int
15014 main ()
15015 {
15016 cchar_t *foo = WACS_PLUS
15017   ;
15018   return 0;
15019 }
15020 _ACEOF
15021 rm -f conftest.$ac_objext conftest$ac_exeext
15022 if { (eval echo "$as_me:15022: \"$ac_link\"") >&5
15023   (eval $ac_link) 2>&5
15024   ac_status=$?
15025   echo "$as_me:15025: \$? = $ac_status" >&5
15026   (exit $ac_status); } &&
15027          { ac_try='test -s conftest$ac_exeext'
15028   { (eval echo "$as_me:15028: \"$ac_try\"") >&5
15029   (eval $ac_try) 2>&5
15030   ac_status=$?
15031   echo "$as_me:15031: \$? = $ac_status" >&5
15032   (exit $ac_status); }; }; then
15033   cf_cv_curses_wacs_symbols=yes
15034 else
15035   echo "$as_me: failed program was:" >&5
15036 cat conftest.$ac_ext >&5
15037 fi
15038 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15039 fi
15040
15041 fi
15042 echo "$as_me:15042: result: $cf_cv_curses_wacs_symbols" >&5
15043 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15044
15045 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
15046 #define CURSES_WACS_SYMBOLS 1
15047 EOF
15048
15049 fi
15050
15051 echo "$as_me:15051: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15052 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15053 cat >conftest.$ac_ext <<_ACEOF
15054 #line 15054 "configure"
15055 #include "confdefs.h"
15056
15057 #ifndef _XOPEN_SOURCE_EXTENDED
15058 #define _XOPEN_SOURCE_EXTENDED
15059 #endif
15060 #include <${cf_cv_ncurses_header:-curses.h}>
15061 int
15062 main ()
15063 {
15064
15065 attr_t foo
15066
15067   ;
15068   return 0;
15069 }
15070 _ACEOF
15071 rm -f conftest.$ac_objext
15072 if { (eval echo "$as_me:15072: \"$ac_compile\"") >&5
15073   (eval $ac_compile) 2>&5
15074   ac_status=$?
15075   echo "$as_me:15075: \$? = $ac_status" >&5
15076   (exit $ac_status); } &&
15077          { ac_try='test -s conftest.$ac_objext'
15078   { (eval echo "$as_me:15078: \"$ac_try\"") >&5
15079   (eval $ac_try) 2>&5
15080   ac_status=$?
15081   echo "$as_me:15081: \$? = $ac_status" >&5
15082   (exit $ac_status); }; }; then
15083   cf_result=yes
15084 else
15085   echo "$as_me: failed program was:" >&5
15086 cat conftest.$ac_ext >&5
15087 cf_result=no
15088 fi
15089 rm -f conftest.$ac_objext conftest.$ac_ext
15090 echo "$as_me:15090: result: $cf_result" >&5
15091 echo "${ECHO_T}$cf_result" >&6
15092 if test $cf_result = yes ; then
15093
15094 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15095
15096         cat >>confdefs.h <<EOF
15097 #define $cf_result 1
15098 EOF
15099
15100 else
15101         cat >>confdefs.h <<EOF
15102 #define attr_t long
15103 EOF
15104
15105 fi
15106
15107 if test "$cf_enable_widec" = yes; then
15108
15109 # This is needed on Tru64 5.0 to declare mbstate_t
15110 echo "$as_me:15110: checking if we must include wchar.h to declare mbstate_t" >&5
15111 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15112 if test "${cf_cv_mbstate_t+set}" = set; then
15113   echo $ECHO_N "(cached) $ECHO_C" >&6
15114 else
15115
15116 cat >conftest.$ac_ext <<_ACEOF
15117 #line 15117 "configure"
15118 #include "confdefs.h"
15119
15120 #include <stdlib.h>
15121 #include <stdarg.h>
15122 #include <stdio.h>
15123 #ifdef HAVE_LIBUTF8_H
15124 #include <libutf8.h>
15125 #endif
15126 int
15127 main ()
15128 {
15129 mbstate_t state
15130   ;
15131   return 0;
15132 }
15133 _ACEOF
15134 rm -f conftest.$ac_objext
15135 if { (eval echo "$as_me:15135: \"$ac_compile\"") >&5
15136   (eval $ac_compile) 2>&5
15137   ac_status=$?
15138   echo "$as_me:15138: \$? = $ac_status" >&5
15139   (exit $ac_status); } &&
15140          { ac_try='test -s conftest.$ac_objext'
15141   { (eval echo "$as_me:15141: \"$ac_try\"") >&5
15142   (eval $ac_try) 2>&5
15143   ac_status=$?
15144   echo "$as_me:15144: \$? = $ac_status" >&5
15145   (exit $ac_status); }; }; then
15146   cf_cv_mbstate_t=no
15147 else
15148   echo "$as_me: failed program was:" >&5
15149 cat conftest.$ac_ext >&5
15150 cat >conftest.$ac_ext <<_ACEOF
15151 #line 15151 "configure"
15152 #include "confdefs.h"
15153
15154 #include <stdlib.h>
15155 #include <stdarg.h>
15156 #include <stdio.h>
15157 #include <wchar.h>
15158 #ifdef HAVE_LIBUTF8_H
15159 #include <libutf8.h>
15160 #endif
15161 int
15162 main ()
15163 {
15164 mbstate_t value
15165   ;
15166   return 0;
15167 }
15168 _ACEOF
15169 rm -f conftest.$ac_objext
15170 if { (eval echo "$as_me:15170: \"$ac_compile\"") >&5
15171   (eval $ac_compile) 2>&5
15172   ac_status=$?
15173   echo "$as_me:15173: \$? = $ac_status" >&5
15174   (exit $ac_status); } &&
15175          { ac_try='test -s conftest.$ac_objext'
15176   { (eval echo "$as_me:15176: \"$ac_try\"") >&5
15177   (eval $ac_try) 2>&5
15178   ac_status=$?
15179   echo "$as_me:15179: \$? = $ac_status" >&5
15180   (exit $ac_status); }; }; then
15181   cf_cv_mbstate_t=yes
15182 else
15183   echo "$as_me: failed program was:" >&5
15184 cat conftest.$ac_ext >&5
15185 cf_cv_mbstate_t=unknown
15186 fi
15187 rm -f conftest.$ac_objext conftest.$ac_ext
15188 fi
15189 rm -f conftest.$ac_objext conftest.$ac_ext
15190 fi
15191 echo "$as_me:15191: result: $cf_cv_mbstate_t" >&5
15192 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15193
15194 if test "$cf_cv_mbstate_t" = yes ; then
15195         cat >>confdefs.h <<\EOF
15196 #define NEED_WCHAR_H 1
15197 EOF
15198
15199         NEED_WCHAR_H=1
15200 fi
15201
15202 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15203 if test "$cf_cv_mbstate_t" = unknown ; then
15204         NCURSES_MBSTATE_T=1
15205 fi
15206
15207 # if we find mbstate_t in either place, use substitution to provide a fallback.
15208 if test "$cf_cv_mbstate_t" != unknown ; then
15209         NCURSES_OK_MBSTATE_T=1
15210 fi
15211
15212 # This is needed on Tru64 5.0 to declare wchar_t
15213 echo "$as_me:15213: checking if we must include wchar.h to declare wchar_t" >&5
15214 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15215 if test "${cf_cv_wchar_t+set}" = set; then
15216   echo $ECHO_N "(cached) $ECHO_C" >&6
15217 else
15218
15219 cat >conftest.$ac_ext <<_ACEOF
15220 #line 15220 "configure"
15221 #include "confdefs.h"
15222
15223 #include <stdlib.h>
15224 #include <stdarg.h>
15225 #include <stdio.h>
15226 #ifdef HAVE_LIBUTF8_H
15227 #include <libutf8.h>
15228 #endif
15229 int
15230 main ()
15231 {
15232 wchar_t state
15233   ;
15234   return 0;
15235 }
15236 _ACEOF
15237 rm -f conftest.$ac_objext
15238 if { (eval echo "$as_me:15238: \"$ac_compile\"") >&5
15239   (eval $ac_compile) 2>&5
15240   ac_status=$?
15241   echo "$as_me:15241: \$? = $ac_status" >&5
15242   (exit $ac_status); } &&
15243          { ac_try='test -s conftest.$ac_objext'
15244   { (eval echo "$as_me:15244: \"$ac_try\"") >&5
15245   (eval $ac_try) 2>&5
15246   ac_status=$?
15247   echo "$as_me:15247: \$? = $ac_status" >&5
15248   (exit $ac_status); }; }; then
15249   cf_cv_wchar_t=no
15250 else
15251   echo "$as_me: failed program was:" >&5
15252 cat conftest.$ac_ext >&5
15253 cat >conftest.$ac_ext <<_ACEOF
15254 #line 15254 "configure"
15255 #include "confdefs.h"
15256
15257 #include <stdlib.h>
15258 #include <stdarg.h>
15259 #include <stdio.h>
15260 #include <wchar.h>
15261 #ifdef HAVE_LIBUTF8_H
15262 #include <libutf8.h>
15263 #endif
15264 int
15265 main ()
15266 {
15267 wchar_t value
15268   ;
15269   return 0;
15270 }
15271 _ACEOF
15272 rm -f conftest.$ac_objext
15273 if { (eval echo "$as_me:15273: \"$ac_compile\"") >&5
15274   (eval $ac_compile) 2>&5
15275   ac_status=$?
15276   echo "$as_me:15276: \$? = $ac_status" >&5
15277   (exit $ac_status); } &&
15278          { ac_try='test -s conftest.$ac_objext'
15279   { (eval echo "$as_me:15279: \"$ac_try\"") >&5
15280   (eval $ac_try) 2>&5
15281   ac_status=$?
15282   echo "$as_me:15282: \$? = $ac_status" >&5
15283   (exit $ac_status); }; }; then
15284   cf_cv_wchar_t=yes
15285 else
15286   echo "$as_me: failed program was:" >&5
15287 cat conftest.$ac_ext >&5
15288 cf_cv_wchar_t=unknown
15289 fi
15290 rm -f conftest.$ac_objext conftest.$ac_ext
15291 fi
15292 rm -f conftest.$ac_objext conftest.$ac_ext
15293 fi
15294 echo "$as_me:15294: result: $cf_cv_wchar_t" >&5
15295 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15296
15297 if test "$cf_cv_wchar_t" = yes ; then
15298         cat >>confdefs.h <<\EOF
15299 #define NEED_WCHAR_H 1
15300 EOF
15301
15302         NEED_WCHAR_H=1
15303 fi
15304
15305 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15306 if test "$cf_cv_wchar_t" = unknown ; then
15307         NCURSES_WCHAR_T=1
15308 fi
15309
15310 # if we find wchar_t in either place, use substitution to provide a fallback.
15311 if test "$cf_cv_wchar_t" != unknown ; then
15312         NCURSES_OK_WCHAR_T=1
15313 fi
15314
15315 # This is needed on Tru64 5.0 to declare wint_t
15316 echo "$as_me:15316: checking if we must include wchar.h to declare wint_t" >&5
15317 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15318 if test "${cf_cv_wint_t+set}" = set; then
15319   echo $ECHO_N "(cached) $ECHO_C" >&6
15320 else
15321
15322 cat >conftest.$ac_ext <<_ACEOF
15323 #line 15323 "configure"
15324 #include "confdefs.h"
15325
15326 #include <stdlib.h>
15327 #include <stdarg.h>
15328 #include <stdio.h>
15329 #ifdef HAVE_LIBUTF8_H
15330 #include <libutf8.h>
15331 #endif
15332 int
15333 main ()
15334 {
15335 wint_t state
15336   ;
15337   return 0;
15338 }
15339 _ACEOF
15340 rm -f conftest.$ac_objext
15341 if { (eval echo "$as_me:15341: \"$ac_compile\"") >&5
15342   (eval $ac_compile) 2>&5
15343   ac_status=$?
15344   echo "$as_me:15344: \$? = $ac_status" >&5
15345   (exit $ac_status); } &&
15346          { ac_try='test -s conftest.$ac_objext'
15347   { (eval echo "$as_me:15347: \"$ac_try\"") >&5
15348   (eval $ac_try) 2>&5
15349   ac_status=$?
15350   echo "$as_me:15350: \$? = $ac_status" >&5
15351   (exit $ac_status); }; }; then
15352   cf_cv_wint_t=no
15353 else
15354   echo "$as_me: failed program was:" >&5
15355 cat conftest.$ac_ext >&5
15356 cat >conftest.$ac_ext <<_ACEOF
15357 #line 15357 "configure"
15358 #include "confdefs.h"
15359
15360 #include <stdlib.h>
15361 #include <stdarg.h>
15362 #include <stdio.h>
15363 #include <wchar.h>
15364 #ifdef HAVE_LIBUTF8_H
15365 #include <libutf8.h>
15366 #endif
15367 int
15368 main ()
15369 {
15370 wint_t value
15371   ;
15372   return 0;
15373 }
15374 _ACEOF
15375 rm -f conftest.$ac_objext
15376 if { (eval echo "$as_me:15376: \"$ac_compile\"") >&5
15377   (eval $ac_compile) 2>&5
15378   ac_status=$?
15379   echo "$as_me:15379: \$? = $ac_status" >&5
15380   (exit $ac_status); } &&
15381          { ac_try='test -s conftest.$ac_objext'
15382   { (eval echo "$as_me:15382: \"$ac_try\"") >&5
15383   (eval $ac_try) 2>&5
15384   ac_status=$?
15385   echo "$as_me:15385: \$? = $ac_status" >&5
15386   (exit $ac_status); }; }; then
15387   cf_cv_wint_t=yes
15388 else
15389   echo "$as_me: failed program was:" >&5
15390 cat conftest.$ac_ext >&5
15391 cf_cv_wint_t=unknown
15392 fi
15393 rm -f conftest.$ac_objext conftest.$ac_ext
15394 fi
15395 rm -f conftest.$ac_objext conftest.$ac_ext
15396 fi
15397 echo "$as_me:15397: result: $cf_cv_wint_t" >&5
15398 echo "${ECHO_T}$cf_cv_wint_t" >&6
15399
15400 if test "$cf_cv_wint_t" = yes ; then
15401         cat >>confdefs.h <<\EOF
15402 #define NEED_WCHAR_H 1
15403 EOF
15404
15405         NEED_WCHAR_H=1
15406 fi
15407
15408 # if we do not find wint_t in either place, use substitution to provide a fallback.
15409 if test "$cf_cv_wint_t" = unknown ; then
15410         NCURSES_WINT_T=1
15411 fi
15412
15413 # if we find wint_t in either place, use substitution to provide a fallback.
15414 if test "$cf_cv_wint_t" != unknown ; then
15415         NCURSES_OK_WINT_T=1
15416 fi
15417
15418         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15419
15420 echo "$as_me:15420: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15421 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15422 cat >conftest.$ac_ext <<_ACEOF
15423 #line 15423 "configure"
15424 #include "confdefs.h"
15425
15426 #ifndef _XOPEN_SOURCE_EXTENDED
15427 #define _XOPEN_SOURCE_EXTENDED
15428 #endif
15429 #include <${cf_cv_ncurses_header:-curses.h}>
15430 int
15431 main ()
15432 {
15433
15434 mbstate_t foo
15435
15436   ;
15437   return 0;
15438 }
15439 _ACEOF
15440 rm -f conftest.$ac_objext
15441 if { (eval echo "$as_me:15441: \"$ac_compile\"") >&5
15442   (eval $ac_compile) 2>&5
15443   ac_status=$?
15444   echo "$as_me:15444: \$? = $ac_status" >&5
15445   (exit $ac_status); } &&
15446          { ac_try='test -s conftest.$ac_objext'
15447   { (eval echo "$as_me:15447: \"$ac_try\"") >&5
15448   (eval $ac_try) 2>&5
15449   ac_status=$?
15450   echo "$as_me:15450: \$? = $ac_status" >&5
15451   (exit $ac_status); }; }; then
15452   cf_result=yes
15453 else
15454   echo "$as_me: failed program was:" >&5
15455 cat conftest.$ac_ext >&5
15456 cf_result=no
15457 fi
15458 rm -f conftest.$ac_objext conftest.$ac_ext
15459 echo "$as_me:15459: result: $cf_result" >&5
15460 echo "${ECHO_T}$cf_result" >&6
15461 if test $cf_result = yes ; then
15462
15463 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15464
15465         cat >>confdefs.h <<EOF
15466 #define $cf_result 1
15467 EOF
15468
15469 else
15470         cat >>confdefs.h <<EOF
15471 #define mbstate_t long
15472 EOF
15473
15474 fi
15475
15476         fi
15477
15478         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15479
15480 echo "$as_me:15480: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15481 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15482 cat >conftest.$ac_ext <<_ACEOF
15483 #line 15483 "configure"
15484 #include "confdefs.h"
15485
15486 #ifndef _XOPEN_SOURCE_EXTENDED
15487 #define _XOPEN_SOURCE_EXTENDED
15488 #endif
15489 #include <${cf_cv_ncurses_header:-curses.h}>
15490 int
15491 main ()
15492 {
15493
15494 wchar_t foo
15495
15496   ;
15497   return 0;
15498 }
15499 _ACEOF
15500 rm -f conftest.$ac_objext
15501 if { (eval echo "$as_me:15501: \"$ac_compile\"") >&5
15502   (eval $ac_compile) 2>&5
15503   ac_status=$?
15504   echo "$as_me:15504: \$? = $ac_status" >&5
15505   (exit $ac_status); } &&
15506          { ac_try='test -s conftest.$ac_objext'
15507   { (eval echo "$as_me:15507: \"$ac_try\"") >&5
15508   (eval $ac_try) 2>&5
15509   ac_status=$?
15510   echo "$as_me:15510: \$? = $ac_status" >&5
15511   (exit $ac_status); }; }; then
15512   cf_result=yes
15513 else
15514   echo "$as_me: failed program was:" >&5
15515 cat conftest.$ac_ext >&5
15516 cf_result=no
15517 fi
15518 rm -f conftest.$ac_objext conftest.$ac_ext
15519 echo "$as_me:15519: result: $cf_result" >&5
15520 echo "${ECHO_T}$cf_result" >&6
15521 if test $cf_result = yes ; then
15522
15523 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15524
15525         cat >>confdefs.h <<EOF
15526 #define $cf_result 1
15527 EOF
15528
15529 else
15530         cat >>confdefs.h <<EOF
15531 #define wchar_t long
15532 EOF
15533
15534 fi
15535
15536         fi
15537
15538         if test "$NCURSES_OK_WINT_T" = 0 ; then
15539
15540 echo "$as_me:15540: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15541 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15542 cat >conftest.$ac_ext <<_ACEOF
15543 #line 15543 "configure"
15544 #include "confdefs.h"
15545
15546 #ifndef _XOPEN_SOURCE_EXTENDED
15547 #define _XOPEN_SOURCE_EXTENDED
15548 #endif
15549 #include <${cf_cv_ncurses_header:-curses.h}>
15550 int
15551 main ()
15552 {
15553
15554 wint_t foo
15555
15556   ;
15557   return 0;
15558 }
15559 _ACEOF
15560 rm -f conftest.$ac_objext
15561 if { (eval echo "$as_me:15561: \"$ac_compile\"") >&5
15562   (eval $ac_compile) 2>&5
15563   ac_status=$?
15564   echo "$as_me:15564: \$? = $ac_status" >&5
15565   (exit $ac_status); } &&
15566          { ac_try='test -s conftest.$ac_objext'
15567   { (eval echo "$as_me:15567: \"$ac_try\"") >&5
15568   (eval $ac_try) 2>&5
15569   ac_status=$?
15570   echo "$as_me:15570: \$? = $ac_status" >&5
15571   (exit $ac_status); }; }; then
15572   cf_result=yes
15573 else
15574   echo "$as_me: failed program was:" >&5
15575 cat conftest.$ac_ext >&5
15576 cf_result=no
15577 fi
15578 rm -f conftest.$ac_objext conftest.$ac_ext
15579 echo "$as_me:15579: result: $cf_result" >&5
15580 echo "${ECHO_T}$cf_result" >&6
15581 if test $cf_result = yes ; then
15582
15583 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15584
15585         cat >>confdefs.h <<EOF
15586 #define $cf_result 1
15587 EOF
15588
15589 else
15590         cat >>confdefs.h <<EOF
15591 #define wint_t long
15592 EOF
15593
15594 fi
15595
15596         fi
15597 fi
15598
15599 echo "$as_me:15599: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15600 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15601
15602 cat >conftest.$ac_ext <<_ACEOF
15603 #line 15603 "configure"
15604 #include "confdefs.h"
15605
15606 #ifdef HAVE_XCURSES
15607 #include <xcurses.h>
15608 char * XCursesProgramName = "test";
15609 #else
15610 #include <${cf_cv_ncurses_header:-curses.h}>
15611 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15612 #include <ncursesw/term.h>
15613 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15614 #include <ncurses/term.h>
15615 #elif defined(HAVE_TERM_H)
15616 #include <term.h>
15617 #endif
15618 #endif
15619
15620 int
15621 main ()
15622 {
15623
15624 void *foo = &(boolnames)
15625
15626   ;
15627   return 0;
15628 }
15629 _ACEOF
15630 rm -f conftest.$ac_objext
15631 if { (eval echo "$as_me:15631: \"$ac_compile\"") >&5
15632   (eval $ac_compile) 2>&5
15633   ac_status=$?
15634   echo "$as_me:15634: \$? = $ac_status" >&5
15635   (exit $ac_status); } &&
15636          { ac_try='test -s conftest.$ac_objext'
15637   { (eval echo "$as_me:15637: \"$ac_try\"") >&5
15638   (eval $ac_try) 2>&5
15639   ac_status=$?
15640   echo "$as_me:15640: \$? = $ac_status" >&5
15641   (exit $ac_status); }; }; then
15642   cf_result=yes
15643 else
15644   echo "$as_me: failed program was:" >&5
15645 cat conftest.$ac_ext >&5
15646 cf_result=no
15647 fi
15648 rm -f conftest.$ac_objext conftest.$ac_ext
15649 echo "$as_me:15649: result: $cf_result" >&5
15650 echo "${ECHO_T}$cf_result" >&6
15651
15652 if test $cf_result = yes ; then
15653
15654 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15655
15656         cat >>confdefs.h <<EOF
15657 #define $cf_result 1
15658 EOF
15659
15660 else
15661         echo "$as_me:15661: checking for data boolnames in library" >&5
15662 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15663         # BSD linkers insist on making weak linkage, but resolve at runtime.
15664         if test "$cross_compiling" = yes; then
15665
15666         # cross-compiling
15667         cat >conftest.$ac_ext <<_ACEOF
15668 #line 15668 "configure"
15669 #include "confdefs.h"
15670
15671 #ifdef HAVE_XCURSES
15672 #include <xcurses.h>
15673 char * XCursesProgramName = "test";
15674 #else
15675 #include <${cf_cv_ncurses_header:-curses.h}>
15676 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15677 #include <ncursesw/term.h>
15678 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15679 #include <ncurses/term.h>
15680 #elif defined(HAVE_TERM_H)
15681 #include <term.h>
15682 #endif
15683 #endif
15684
15685 extern char boolnames;
15686 int
15687 main ()
15688 {
15689
15690         do {
15691                 void *foo = &(boolnames);
15692                 ${cf_cv_main_return:-return}(foo == 0);
15693         } while (0)
15694
15695   ;
15696   return 0;
15697 }
15698 _ACEOF
15699 rm -f conftest.$ac_objext conftest$ac_exeext
15700 if { (eval echo "$as_me:15700: \"$ac_link\"") >&5
15701   (eval $ac_link) 2>&5
15702   ac_status=$?
15703   echo "$as_me:15703: \$? = $ac_status" >&5
15704   (exit $ac_status); } &&
15705          { ac_try='test -s conftest$ac_exeext'
15706   { (eval echo "$as_me:15706: \"$ac_try\"") >&5
15707   (eval $ac_try) 2>&5
15708   ac_status=$?
15709   echo "$as_me:15709: \$? = $ac_status" >&5
15710   (exit $ac_status); }; }; then
15711   cf_result=yes
15712 else
15713   echo "$as_me: failed program was:" >&5
15714 cat conftest.$ac_ext >&5
15715 cf_result=no
15716 fi
15717 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15718
15719 else
15720   cat >conftest.$ac_ext <<_ACEOF
15721 #line 15721 "configure"
15722 #include "confdefs.h"
15723
15724 #ifdef HAVE_XCURSES
15725 #include <xcurses.h>
15726 char * XCursesProgramName = "test";
15727 #else
15728 #include <${cf_cv_ncurses_header:-curses.h}>
15729 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15730 #include <ncursesw/term.h>
15731 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15732 #include <ncurses/term.h>
15733 #elif defined(HAVE_TERM_H)
15734 #include <term.h>
15735 #endif
15736 #endif
15737
15738 extern char boolnames;
15739 int main(void)
15740 {
15741         void *foo = &(boolnames);
15742         ${cf_cv_main_return:-return}(foo == 0);
15743 }
15744 _ACEOF
15745 rm -f conftest$ac_exeext
15746 if { (eval echo "$as_me:15746: \"$ac_link\"") >&5
15747   (eval $ac_link) 2>&5
15748   ac_status=$?
15749   echo "$as_me:15749: \$? = $ac_status" >&5
15750   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15751   { (eval echo "$as_me:15751: \"$ac_try\"") >&5
15752   (eval $ac_try) 2>&5
15753   ac_status=$?
15754   echo "$as_me:15754: \$? = $ac_status" >&5
15755   (exit $ac_status); }; }; then
15756   cf_result=yes
15757 else
15758   echo "$as_me: program exited with status $ac_status" >&5
15759 echo "$as_me: failed program was:" >&5
15760 cat conftest.$ac_ext >&5
15761 cf_result=no
15762 fi
15763 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15764 fi
15765         echo "$as_me:15765: result: $cf_result" >&5
15766 echo "${ECHO_T}$cf_result" >&6
15767         if test $cf_result = yes ; then
15768
15769 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15770
15771                 cat >>confdefs.h <<EOF
15772 #define $cf_result 1
15773 EOF
15774
15775         fi
15776 fi
15777
15778 echo "$as_me:15778: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15779 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15780
15781 cat >conftest.$ac_ext <<_ACEOF
15782 #line 15782 "configure"
15783 #include "confdefs.h"
15784
15785 #ifdef HAVE_XCURSES
15786 #include <xcurses.h>
15787 char * XCursesProgramName = "test";
15788 #else
15789 #include <${cf_cv_ncurses_header:-curses.h}>
15790 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15791 #include <ncursesw/term.h>
15792 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15793 #include <ncurses/term.h>
15794 #elif defined(HAVE_TERM_H)
15795 #include <term.h>
15796 #endif
15797 #endif
15798
15799 int
15800 main ()
15801 {
15802
15803 void *foo = &(boolfnames)
15804
15805   ;
15806   return 0;
15807 }
15808 _ACEOF
15809 rm -f conftest.$ac_objext
15810 if { (eval echo "$as_me:15810: \"$ac_compile\"") >&5
15811   (eval $ac_compile) 2>&5
15812   ac_status=$?
15813   echo "$as_me:15813: \$? = $ac_status" >&5
15814   (exit $ac_status); } &&
15815          { ac_try='test -s conftest.$ac_objext'
15816   { (eval echo "$as_me:15816: \"$ac_try\"") >&5
15817   (eval $ac_try) 2>&5
15818   ac_status=$?
15819   echo "$as_me:15819: \$? = $ac_status" >&5
15820   (exit $ac_status); }; }; then
15821   cf_result=yes
15822 else
15823   echo "$as_me: failed program was:" >&5
15824 cat conftest.$ac_ext >&5
15825 cf_result=no
15826 fi
15827 rm -f conftest.$ac_objext conftest.$ac_ext
15828 echo "$as_me:15828: result: $cf_result" >&5
15829 echo "${ECHO_T}$cf_result" >&6
15830
15831 if test $cf_result = yes ; then
15832
15833 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15834
15835         cat >>confdefs.h <<EOF
15836 #define $cf_result 1
15837 EOF
15838
15839 else
15840         echo "$as_me:15840: checking for data boolfnames in library" >&5
15841 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15842         # BSD linkers insist on making weak linkage, but resolve at runtime.
15843         if test "$cross_compiling" = yes; then
15844
15845         # cross-compiling
15846         cat >conftest.$ac_ext <<_ACEOF
15847 #line 15847 "configure"
15848 #include "confdefs.h"
15849
15850 #ifdef HAVE_XCURSES
15851 #include <xcurses.h>
15852 char * XCursesProgramName = "test";
15853 #else
15854 #include <${cf_cv_ncurses_header:-curses.h}>
15855 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15856 #include <ncursesw/term.h>
15857 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15858 #include <ncurses/term.h>
15859 #elif defined(HAVE_TERM_H)
15860 #include <term.h>
15861 #endif
15862 #endif
15863
15864 extern char boolfnames;
15865 int
15866 main ()
15867 {
15868
15869         do {
15870                 void *foo = &(boolfnames);
15871                 ${cf_cv_main_return:-return}(foo == 0);
15872         } while (0)
15873
15874   ;
15875   return 0;
15876 }
15877 _ACEOF
15878 rm -f conftest.$ac_objext conftest$ac_exeext
15879 if { (eval echo "$as_me:15879: \"$ac_link\"") >&5
15880   (eval $ac_link) 2>&5
15881   ac_status=$?
15882   echo "$as_me:15882: \$? = $ac_status" >&5
15883   (exit $ac_status); } &&
15884          { ac_try='test -s conftest$ac_exeext'
15885   { (eval echo "$as_me:15885: \"$ac_try\"") >&5
15886   (eval $ac_try) 2>&5
15887   ac_status=$?
15888   echo "$as_me:15888: \$? = $ac_status" >&5
15889   (exit $ac_status); }; }; then
15890   cf_result=yes
15891 else
15892   echo "$as_me: failed program was:" >&5
15893 cat conftest.$ac_ext >&5
15894 cf_result=no
15895 fi
15896 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15897
15898 else
15899   cat >conftest.$ac_ext <<_ACEOF
15900 #line 15900 "configure"
15901 #include "confdefs.h"
15902
15903 #ifdef HAVE_XCURSES
15904 #include <xcurses.h>
15905 char * XCursesProgramName = "test";
15906 #else
15907 #include <${cf_cv_ncurses_header:-curses.h}>
15908 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15909 #include <ncursesw/term.h>
15910 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15911 #include <ncurses/term.h>
15912 #elif defined(HAVE_TERM_H)
15913 #include <term.h>
15914 #endif
15915 #endif
15916
15917 extern char boolfnames;
15918 int main(void)
15919 {
15920         void *foo = &(boolfnames);
15921         ${cf_cv_main_return:-return}(foo == 0);
15922 }
15923 _ACEOF
15924 rm -f conftest$ac_exeext
15925 if { (eval echo "$as_me:15925: \"$ac_link\"") >&5
15926   (eval $ac_link) 2>&5
15927   ac_status=$?
15928   echo "$as_me:15928: \$? = $ac_status" >&5
15929   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15930   { (eval echo "$as_me:15930: \"$ac_try\"") >&5
15931   (eval $ac_try) 2>&5
15932   ac_status=$?
15933   echo "$as_me:15933: \$? = $ac_status" >&5
15934   (exit $ac_status); }; }; then
15935   cf_result=yes
15936 else
15937   echo "$as_me: program exited with status $ac_status" >&5
15938 echo "$as_me: failed program was:" >&5
15939 cat conftest.$ac_ext >&5
15940 cf_result=no
15941 fi
15942 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15943 fi
15944         echo "$as_me:15944: result: $cf_result" >&5
15945 echo "${ECHO_T}$cf_result" >&6
15946         if test $cf_result = yes ; then
15947
15948 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15949
15950                 cat >>confdefs.h <<EOF
15951 #define $cf_result 1
15952 EOF
15953
15954         fi
15955 fi
15956
15957 LD_RPATH_OPT=
15958 echo "$as_me:15958: checking for an rpath option" >&5
15959 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15960 case $cf_cv_system_name in #(vi
15961 irix*) #(vi
15962         if test "$GCC" = yes; then
15963                 LD_RPATH_OPT="-Wl,-rpath,"
15964         else
15965                 LD_RPATH_OPT="-rpath "
15966         fi
15967         ;;
15968 linux*|gnu*|k*bsd*-gnu) #(vi
15969         LD_RPATH_OPT="-Wl,-rpath,"
15970         ;;
15971 openbsd[2-9].*|mirbsd*) #(vi
15972         LD_RPATH_OPT="-Wl,-rpath,"
15973         ;;
15974 dragonfly*|freebsd*) #(vi
15975         LD_RPATH_OPT="-rpath "
15976         ;;
15977 netbsd*) #(vi
15978         LD_RPATH_OPT="-Wl,-rpath,"
15979         ;;
15980 osf*|mls+*) #(vi
15981         LD_RPATH_OPT="-rpath "
15982         ;;
15983 solaris2*) #(vi
15984         LD_RPATH_OPT="-R"
15985         ;;
15986 *)
15987         ;;
15988 esac
15989 echo "$as_me:15989: result: $LD_RPATH_OPT" >&5
15990 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15991
15992 case "x$LD_RPATH_OPT" in #(vi
15993 x-R*)
15994         echo "$as_me:15994: checking if we need a space after rpath option" >&5
15995 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15996         cf_save_LIBS="$LIBS"
15997         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15998         cat >conftest.$ac_ext <<_ACEOF
15999 #line 15999 "configure"
16000 #include "confdefs.h"
16001
16002 int
16003 main ()
16004 {
16005
16006   ;
16007   return 0;
16008 }
16009 _ACEOF
16010 rm -f conftest.$ac_objext conftest$ac_exeext
16011 if { (eval echo "$as_me:16011: \"$ac_link\"") >&5
16012   (eval $ac_link) 2>&5
16013   ac_status=$?
16014   echo "$as_me:16014: \$? = $ac_status" >&5
16015   (exit $ac_status); } &&
16016          { ac_try='test -s conftest$ac_exeext'
16017   { (eval echo "$as_me:16017: \"$ac_try\"") >&5
16018   (eval $ac_try) 2>&5
16019   ac_status=$?
16020   echo "$as_me:16020: \$? = $ac_status" >&5
16021   (exit $ac_status); }; }; then
16022   cf_rpath_space=no
16023 else
16024   echo "$as_me: failed program was:" >&5
16025 cat conftest.$ac_ext >&5
16026 cf_rpath_space=yes
16027 fi
16028 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16029         LIBS="$cf_save_LIBS"
16030         echo "$as_me:16030: result: $cf_rpath_space" >&5
16031 echo "${ECHO_T}$cf_rpath_space" >&6
16032         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16033         ;;
16034 esac
16035
16036 echo "$as_me:16036: checking if rpath-hack should be disabled" >&5
16037 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16038
16039 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16040 if test "${enable_rpath_hack+set}" = set; then
16041   enableval="$enable_rpath_hack"
16042   test "$enableval" != no && enableval=yes
16043   if test "$enableval" != "yes" ; then
16044     cf_disable_rpath_hack=yes
16045   else
16046     cf_disable_rpath_hack=no
16047   fi
16048 else
16049   enableval=yes
16050   cf_disable_rpath_hack=no
16051
16052 fi;
16053 echo "$as_me:16053: result: $cf_disable_rpath_hack" >&5
16054 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16055 if test "$cf_disable_rpath_hack" = no ; then
16056
16057 echo "$as_me:16057: checking for updated LDFLAGS" >&5
16058 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16059 if test -n "$LD_RPATH_OPT" ; then
16060         echo "$as_me:16060: result: maybe" >&5
16061 echo "${ECHO_T}maybe" >&6
16062
16063         for ac_prog in ldd
16064 do
16065   # Extract the first word of "$ac_prog", so it can be a program name with args.
16066 set dummy $ac_prog; ac_word=$2
16067 echo "$as_me:16067: checking for $ac_word" >&5
16068 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16069 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16070   echo $ECHO_N "(cached) $ECHO_C" >&6
16071 else
16072   if test -n "$cf_ldd_prog"; then
16073   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16074 else
16075   ac_save_IFS=$IFS; IFS=$ac_path_separator
16076 ac_dummy="$PATH"
16077 for ac_dir in $ac_dummy; do
16078   IFS=$ac_save_IFS
16079   test -z "$ac_dir" && ac_dir=.
16080   $as_executable_p "$ac_dir/$ac_word" || continue
16081 ac_cv_prog_cf_ldd_prog="$ac_prog"
16082 echo "$as_me:16082: found $ac_dir/$ac_word" >&5
16083 break
16084 done
16085
16086 fi
16087 fi
16088 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16089 if test -n "$cf_ldd_prog"; then
16090   echo "$as_me:16090: result: $cf_ldd_prog" >&5
16091 echo "${ECHO_T}$cf_ldd_prog" >&6
16092 else
16093   echo "$as_me:16093: result: no" >&5
16094 echo "${ECHO_T}no" >&6
16095 fi
16096
16097   test -n "$cf_ldd_prog" && break
16098 done
16099 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16100
16101         cf_rpath_list="/usr/lib /lib"
16102         if test "$cf_ldd_prog" != no
16103         then
16104                 cf_rpath_oops=
16105
16106 cat >conftest.$ac_ext <<_ACEOF
16107 #line 16107 "configure"
16108 #include "confdefs.h"
16109 #include <stdio.h>
16110 int
16111 main ()
16112 {
16113 printf("Hello");
16114   ;
16115   return 0;
16116 }
16117 _ACEOF
16118 rm -f conftest.$ac_objext conftest$ac_exeext
16119 if { (eval echo "$as_me:16119: \"$ac_link\"") >&5
16120   (eval $ac_link) 2>&5
16121   ac_status=$?
16122   echo "$as_me:16122: \$? = $ac_status" >&5
16123   (exit $ac_status); } &&
16124          { ac_try='test -s conftest$ac_exeext'
16125   { (eval echo "$as_me:16125: \"$ac_try\"") >&5
16126   (eval $ac_try) 2>&5
16127   ac_status=$?
16128   echo "$as_me:16128: \$? = $ac_status" >&5
16129   (exit $ac_status); }; }; then
16130   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
16131                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
16132 else
16133   echo "$as_me: failed program was:" >&5
16134 cat conftest.$ac_ext >&5
16135 fi
16136 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16137
16138                 # If we passed the link-test, but get a "not found" on a given library,
16139                 # this could be due to inept reconfiguration of gcc to make it only
16140                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16141                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16142                 # /usr/local libraries.
16143                 if test -n "$cf_rpath_oops"
16144                 then
16145                         for cf_rpath_src in $cf_rpath_oops
16146                         do
16147                                 for cf_rpath_dir in \
16148                                         /usr/local \
16149                                         /usr/pkg \
16150                                         /opt/sfw
16151                                 do
16152                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16153                                         then
16154                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16155
16156 echo "${as_me:-configure}:16156: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16157
16158                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16159                                                 break
16160                                         fi
16161                                 done
16162                         done
16163                 fi
16164         fi
16165
16166         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16167
16168 echo "${as_me:-configure}:16168: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16169
16170 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16171
16172 echo "${as_me:-configure}:16172: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16173
16174 cf_rpath_dst=
16175 for cf_rpath_src in $LDFLAGS
16176 do
16177         case $cf_rpath_src in #(vi
16178         -L*) #(vi
16179
16180                 # check if this refers to a directory which we will ignore
16181                 cf_rpath_skip=no
16182                 if test -n "$cf_rpath_list"
16183                 then
16184                         for cf_rpath_item in $cf_rpath_list
16185                         do
16186                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16187                                 then
16188                                         cf_rpath_skip=yes
16189                                         break
16190                                 fi
16191                         done
16192                 fi
16193
16194                 if test "$cf_rpath_skip" = no
16195                 then
16196                         # transform the option
16197                         if test "$LD_RPATH_OPT" = "-R " ; then
16198                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16199                         else
16200                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16201                         fi
16202
16203                         # if we have not already added this, add it now
16204                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16205                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16206                         then
16207                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16208
16209 echo "${as_me:-configure}:16209: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16210
16211                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16212                         fi
16213                 fi
16214                 ;;
16215         esac
16216         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16217 done
16218 LDFLAGS=$cf_rpath_dst
16219
16220 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16221
16222 echo "${as_me:-configure}:16222: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16223
16224 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16225
16226 echo "${as_me:-configure}:16226: testing ...checking LIBS $LIBS ..." 1>&5
16227
16228 cf_rpath_dst=
16229 for cf_rpath_src in $LIBS
16230 do
16231         case $cf_rpath_src in #(vi
16232         -L*) #(vi
16233
16234                 # check if this refers to a directory which we will ignore
16235                 cf_rpath_skip=no
16236                 if test -n "$cf_rpath_list"
16237                 then
16238                         for cf_rpath_item in $cf_rpath_list
16239                         do
16240                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16241                                 then
16242                                         cf_rpath_skip=yes
16243                                         break
16244                                 fi
16245                         done
16246                 fi
16247
16248                 if test "$cf_rpath_skip" = no
16249                 then
16250                         # transform the option
16251                         if test "$LD_RPATH_OPT" = "-R " ; then
16252                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16253                         else
16254                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16255                         fi
16256
16257                         # if we have not already added this, add it now
16258                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16259                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16260                         then
16261                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16262
16263 echo "${as_me:-configure}:16263: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16264
16265                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16266                         fi
16267                 fi
16268                 ;;
16269         esac
16270         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16271 done
16272 LIBS=$cf_rpath_dst
16273
16274 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16275
16276 echo "${as_me:-configure}:16276: testing ...checked LIBS $LIBS ..." 1>&5
16277
16278         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16279
16280 echo "${as_me:-configure}:16280: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16281
16282 fi
16283
16284 fi
16285
16286 TEST_ARGS="$LIBS"
16287 LIBS=
16288
16289 ac_config_files="$ac_config_files Makefile"
16290 ac_config_commands="$ac_config_commands default"
16291 cat >confcache <<\_ACEOF
16292 # This file is a shell script that caches the results of configure
16293 # tests run on this system so they can be shared between configure
16294 # scripts and configure runs, see configure's option --config-cache.
16295 # It is not useful on other systems.  If it contains results you don't
16296 # want to keep, you may remove or edit it.
16297 #
16298 # config.status only pays attention to the cache file if you give it
16299 # the --recheck option to rerun configure.
16300 #
16301 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16302 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16303 # following values.
16304
16305 _ACEOF
16306
16307 # The following way of writing the cache mishandles newlines in values,
16308 # but we know of no workaround that is simple, portable, and efficient.
16309 # So, don't put newlines in cache variables' values.
16310 # Ultrix sh set writes to stderr and can't be redirected directly,
16311 # and sets the high bit in the cache file unless we assign to the vars.
16312 {
16313   (set) 2>&1 |
16314     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16315     *ac_space=\ *)
16316       # `set' does not quote correctly, so add quotes (double-quote
16317       # substitution turns \\\\ into \\, and sed turns \\ into \).
16318       sed -n \
16319         "s/'/'\\\\''/g;
16320           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16321       ;;
16322     *)
16323       # `set' quotes correctly as required by POSIX, so do not add quotes.
16324       sed -n \
16325         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16326       ;;
16327     esac;
16328 } |
16329   sed '
16330      t clear
16331      : clear
16332      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16333      t end
16334      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16335      : end' >>confcache
16336 if cmp -s $cache_file confcache; then :; else
16337   if test -w $cache_file; then
16338     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16339     cat confcache >$cache_file
16340   else
16341     echo "not updating unwritable cache $cache_file"
16342   fi
16343 fi
16344 rm -f confcache
16345
16346 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16347 # Let make expand exec_prefix.
16348 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16349
16350 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16351 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16352 # trailing colons and then remove the whole line if VPATH becomes empty
16353 # (actually we leave an empty line to preserve line numbers).
16354 if test "x$srcdir" = x.; then
16355   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16356 s/:*\$(srcdir):*/:/;
16357 s/:*\${srcdir}:*/:/;
16358 s/:*@srcdir@:*/:/;
16359 s/^\([^=]*=[    ]*\):*/\1/;
16360 s/:*$//;
16361 s/^[^=]*=[      ]*$//;
16362 }'
16363 fi
16364
16365 DEFS=-DHAVE_CONFIG_H
16366
16367 : ${CONFIG_STATUS=./config.status}
16368 ac_clean_files_save=$ac_clean_files
16369 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16370 { echo "$as_me:16370: creating $CONFIG_STATUS" >&5
16371 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16372 cat >$CONFIG_STATUS <<_ACEOF
16373 #! $SHELL
16374 # Generated automatically by configure.
16375 # Run this file to recreate the current configuration.
16376 # Compiler output produced by configure, useful for debugging
16377 # configure, is in config.log if it exists.
16378
16379 debug=false
16380 SHELL=\${CONFIG_SHELL-$SHELL}
16381 ac_cs_invocation="\$0 \$@"
16382
16383 _ACEOF
16384
16385 cat >>$CONFIG_STATUS <<\_ACEOF
16386 # Be Bourne compatible
16387 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16388   emulate sh
16389   NULLCMD=:
16390 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16391   set -o posix
16392 fi
16393
16394 # Name of the executable.
16395 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16396
16397 if expr a : '\(a\)' >/dev/null 2>&1; then
16398   as_expr=expr
16399 else
16400   as_expr=false
16401 fi
16402
16403 rm -f conf$$ conf$$.exe conf$$.file
16404 echo >conf$$.file
16405 if ln -s conf$$.file conf$$ 2>/dev/null; then
16406   # We could just check for DJGPP; but this test a) works b) is more generic
16407   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16408   if test -f conf$$.exe; then
16409     # Don't use ln at all; we don't have any links
16410     as_ln_s='cp -p'
16411   else
16412     as_ln_s='ln -s'
16413   fi
16414 elif ln conf$$.file conf$$ 2>/dev/null; then
16415   as_ln_s=ln
16416 else
16417   as_ln_s='cp -p'
16418 fi
16419 rm -f conf$$ conf$$.exe conf$$.file
16420
16421 as_executable_p="test -f"
16422
16423 # Support unset when possible.
16424 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16425   as_unset=unset
16426 else
16427   as_unset=false
16428 fi
16429
16430 # NLS nuisances.
16431 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16432 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16433 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16434 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16435 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16436 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16437 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16438 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16439
16440 # IFS
16441 # We need space, tab and new line, in precisely that order.
16442 as_nl='
16443 '
16444 IFS="   $as_nl"
16445
16446 # CDPATH.
16447 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16448
16449 exec 6>&1
16450
16451 _ACEOF
16452
16453 # Files that config.status was made for.
16454 if test -n "$ac_config_files"; then
16455   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16456 fi
16457
16458 if test -n "$ac_config_headers"; then
16459   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16460 fi
16461
16462 if test -n "$ac_config_links"; then
16463   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16464 fi
16465
16466 if test -n "$ac_config_commands"; then
16467   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16468 fi
16469
16470 cat >>$CONFIG_STATUS <<\EOF
16471
16472 ac_cs_usage="\
16473 \`$as_me' instantiates files from templates according to the
16474 current configuration.
16475
16476 Usage: $0 [OPTIONS] [FILE]...
16477
16478   -h, --help       print this help, then exit
16479   -V, --version    print version number, then exit
16480   -d, --debug      don't remove temporary files
16481       --recheck    update $as_me by reconfiguring in the same conditions
16482   --file=FILE[:TEMPLATE]
16483                    instantiate the configuration file FILE
16484   --header=FILE[:TEMPLATE]
16485                    instantiate the configuration header FILE
16486
16487 Configuration files:
16488 $config_files
16489
16490 Configuration headers:
16491 $config_headers
16492
16493 Configuration commands:
16494 $config_commands
16495
16496 Report bugs to <dickey@invisible-island.net>."
16497 EOF
16498
16499 cat >>$CONFIG_STATUS <<EOF
16500 ac_cs_version="\\
16501 config.status
16502 configured by $0, generated by GNU Autoconf 2.52.20101002,
16503   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16504
16505 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16506 Free Software Foundation, Inc.
16507 This config.status script is free software; the Free Software Foundation
16508 gives unlimited permission to copy, distribute and modify it."
16509 srcdir=$srcdir
16510 INSTALL="$INSTALL"
16511 EOF
16512
16513 cat >>$CONFIG_STATUS <<\EOF
16514 # If no file are specified by the user, then we need to provide default
16515 # value.  By we need to know if files were specified by the user.
16516 ac_need_defaults=:
16517 while test $# != 0
16518 do
16519   case $1 in
16520   --*=*)
16521     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16522     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16523     shift
16524     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16525     shift
16526     ;;
16527   -*);;
16528   *) # This is not an option, so the user has probably given explicit
16529      # arguments.
16530      ac_need_defaults=false;;
16531   esac
16532
16533   case $1 in
16534   # Handling of the options.
16535 EOF
16536 cat >>$CONFIG_STATUS <<EOF
16537   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16538     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16539     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16540 EOF
16541 cat >>$CONFIG_STATUS <<\EOF
16542   --version | --vers* | -V )
16543     echo "$ac_cs_version"; exit 0 ;;
16544   --he | --h)
16545     # Conflict between --help and --header
16546     { { echo "$as_me:16546: error: ambiguous option: $1
16547 Try \`$0 --help' for more information." >&5
16548 echo "$as_me: error: ambiguous option: $1
16549 Try \`$0 --help' for more information." >&2;}
16550    { (exit 1); exit 1; }; };;
16551   --help | --hel | -h )
16552     echo "$ac_cs_usage"; exit 0 ;;
16553   --debug | --d* | -d )
16554     debug=: ;;
16555   --file | --fil | --fi | --f )
16556     shift
16557     CONFIG_FILES="$CONFIG_FILES $1"
16558     ac_need_defaults=false;;
16559   --header | --heade | --head | --hea )
16560     shift
16561     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16562     ac_need_defaults=false;;
16563
16564   # This is an error.
16565   -*) { { echo "$as_me:16565: error: unrecognized option: $1
16566 Try \`$0 --help' for more information." >&5
16567 echo "$as_me: error: unrecognized option: $1
16568 Try \`$0 --help' for more information." >&2;}
16569    { (exit 1); exit 1; }; } ;;
16570
16571   *) ac_config_targets="$ac_config_targets $1" ;;
16572
16573   esac
16574   shift
16575 done
16576
16577 exec 5>>config.log
16578 cat >&5 << _ACEOF
16579
16580 ## ----------------------- ##
16581 ## Running config.status.  ##
16582 ## ----------------------- ##
16583
16584 This file was extended by $as_me 2.52.20101002, executed with
16585   CONFIG_FILES    = $CONFIG_FILES
16586   CONFIG_HEADERS  = $CONFIG_HEADERS
16587   CONFIG_LINKS    = $CONFIG_LINKS
16588   CONFIG_COMMANDS = $CONFIG_COMMANDS
16589   > $ac_cs_invocation
16590 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16591
16592 _ACEOF
16593 EOF
16594
16595 cat >>$CONFIG_STATUS <<EOF
16596 #
16597 # INIT-COMMANDS section.
16598 #
16599
16600 AWK="$AWK"
16601 ECHO_LD="$ECHO_LD"
16602
16603 EOF
16604
16605 cat >>$CONFIG_STATUS <<\EOF
16606 for ac_config_target in $ac_config_targets
16607 do
16608   case "$ac_config_target" in
16609   # Handling of arguments.
16610   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16611   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16612   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16613   *) { { echo "$as_me:16613: error: invalid argument: $ac_config_target" >&5
16614 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16615    { (exit 1); exit 1; }; };;
16616   esac
16617 done
16618
16619 # If the user did not use the arguments to specify the items to instantiate,
16620 # then the envvar interface is used.  Set only those that are not.
16621 # We use the long form for the default assignment because of an extremely
16622 # bizarre bug on SunOS 4.1.3.
16623 if $ac_need_defaults; then
16624   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16625   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16626   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16627 fi
16628
16629 # Create a temporary directory, and hook for its removal unless debugging.
16630 $debug ||
16631 {
16632   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16633   trap '{ (exit 1); exit 1; }' 1 2 13 15
16634 }
16635
16636 # Create a (secure) tmp directory for tmp files.
16637 : ${TMPDIR=/tmp}
16638 {
16639   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16640   test -n "$tmp" && test -d "$tmp"
16641 }  ||
16642 {
16643   tmp=$TMPDIR/cs$$-$RANDOM
16644   (umask 077 && mkdir $tmp)
16645 } ||
16646 {
16647    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16648    { (exit 1); exit 1; }
16649 }
16650
16651 EOF
16652
16653 cat >>$CONFIG_STATUS <<EOF
16654
16655 #
16656 # CONFIG_FILES section.
16657 #
16658
16659 # No need to generate the scripts if there are no CONFIG_FILES.
16660 # This happens for instance when ./config.status config.h
16661 if test -n "\$CONFIG_FILES"; then
16662   # Protect against being on the right side of a sed subst in config.status.
16663   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16664    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16665 s,@SHELL@,$SHELL,;t t
16666 s,@exec_prefix@,$exec_prefix,;t t
16667 s,@prefix@,$prefix,;t t
16668 s,@program_transform_name@,$program_transform_name,;t t
16669 s,@bindir@,$bindir,;t t
16670 s,@sbindir@,$sbindir,;t t
16671 s,@libexecdir@,$libexecdir,;t t
16672 s,@datadir@,$datadir,;t t
16673 s,@sysconfdir@,$sysconfdir,;t t
16674 s,@sharedstatedir@,$sharedstatedir,;t t
16675 s,@localstatedir@,$localstatedir,;t t
16676 s,@libdir@,$libdir,;t t
16677 s,@includedir@,$includedir,;t t
16678 s,@oldincludedir@,$oldincludedir,;t t
16679 s,@infodir@,$infodir,;t t
16680 s,@mandir@,$mandir,;t t
16681 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16682 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16683 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16684 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16685 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16686 s,@build_alias@,$build_alias,;t t
16687 s,@host_alias@,$host_alias,;t t
16688 s,@target_alias@,$target_alias,;t t
16689 s,@ECHO_C@,$ECHO_C,;t t
16690 s,@ECHO_N@,$ECHO_N,;t t
16691 s,@ECHO_T@,$ECHO_T,;t t
16692 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16693 s,@DEFS@,$DEFS,;t t
16694 s,@LIBS@,$LIBS,;t t
16695 s,@build@,$build,;t t
16696 s,@build_cpu@,$build_cpu,;t t
16697 s,@build_vendor@,$build_vendor,;t t
16698 s,@build_os@,$build_os,;t t
16699 s,@host@,$host,;t t
16700 s,@host_cpu@,$host_cpu,;t t
16701 s,@host_vendor@,$host_vendor,;t t
16702 s,@host_os@,$host_os,;t t
16703 s,@SET_MAKE@,$SET_MAKE,;t t
16704 s,@CC@,$CC,;t t
16705 s,@CFLAGS@,$CFLAGS,;t t
16706 s,@LDFLAGS@,$LDFLAGS,;t t
16707 s,@CPPFLAGS@,$CPPFLAGS,;t t
16708 s,@ac_ct_CC@,$ac_ct_CC,;t t
16709 s,@EXEEXT@,$EXEEXT,;t t
16710 s,@OBJEXT@,$OBJEXT,;t t
16711 s,@CPP@,$CPP,;t t
16712 s,@AWK@,$AWK,;t t
16713 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16714 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16715 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16716 s,@LINT@,$LINT,;t t
16717 s,@LINT_OPTS@,$LINT_OPTS,;t t
16718 s,@CTAGS@,$CTAGS,;t t
16719 s,@ETAGS@,$ETAGS,;t t
16720 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16721 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16722 s,@MATH_LIB@,$MATH_LIB,;t t
16723 s,@top_builddir@,$top_builddir,;t t
16724 s,@CC_G_OPT@,$CC_G_OPT,;t t
16725 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16726 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16727 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16728 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16729 s,@LD@,$LD,;t t
16730 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16731 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16732 s,@LD_MODEL@,$LD_MODEL,;t t
16733 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16734 s,@LIBTOOL@,$LIBTOOL,;t t
16735 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16736 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16737 s,@LIB_LINK@,$LIB_LINK,;t t
16738 s,@LINK_TESTS@,$LINK_TESTS,;t t
16739 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16740 s,@PTHREAD@,$PTHREAD,;t t
16741 s,@TEST_ARGS@,$TEST_ARGS,;t t
16742 s,@TEST_DEPS@,$TEST_DEPS,;t t
16743 s,@TEST_LIBS@,$TEST_LIBS,;t t
16744 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16745 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16746 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16747 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16748 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16749 s,@ECHO_LT@,$ECHO_LT,;t t
16750 s,@ECHO_LD@,$ECHO_LD,;t t
16751 s,@RULE_CC@,$RULE_CC,;t t
16752 s,@SHOW_CC@,$SHOW_CC,;t t
16753 s,@ECHO_CC@,$ECHO_CC,;t t
16754 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16755 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16756 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16757 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16758 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16759 s,@X_CFLAGS@,$X_CFLAGS,;t t
16760 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16761 s,@X_LIBS@,$X_LIBS,;t t
16762 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16763 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16764 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16765 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16766 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16767 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16768 CEOF
16769
16770 EOF
16771
16772   cat >>$CONFIG_STATUS <<\EOF
16773   # Split the substitutions into bite-sized pieces for seds with
16774   # small command number limits, like on Digital OSF/1 and HP-UX.
16775   ac_max_sed_lines=48
16776   ac_sed_frag=1 # Number of current file.
16777   ac_beg=1 # First line for current file.
16778   ac_end=$ac_max_sed_lines # Line after last line for current file.
16779   ac_more_lines=:
16780   ac_sed_cmds=
16781   while $ac_more_lines; do
16782     if test $ac_beg -gt 1; then
16783       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16784     else
16785       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16786     fi
16787     if test ! -s $tmp/subs.frag; then
16788       ac_more_lines=false
16789     else
16790       # The purpose of the label and of the branching condition is to
16791       # speed up the sed processing (if there are no `@' at all, there
16792       # is no need to browse any of the substitutions).
16793       # These are the two extra sed commands mentioned above.
16794       (echo ':t
16795   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16796       if test -z "$ac_sed_cmds"; then
16797         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16798       else
16799         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16800       fi
16801       ac_sed_frag=`expr $ac_sed_frag + 1`
16802       ac_beg=$ac_end
16803       ac_end=`expr $ac_end + $ac_max_sed_lines`
16804     fi
16805   done
16806   if test -z "$ac_sed_cmds"; then
16807     ac_sed_cmds=cat
16808   fi
16809 fi # test -n "$CONFIG_FILES"
16810
16811 EOF
16812 cat >>$CONFIG_STATUS <<\EOF
16813 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16814   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16815   case $ac_file in
16816   - | *:- | *:-:* ) # input from stdin
16817         cat >$tmp/stdin
16818         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16819         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16820   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16821         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16822   * )   ac_file_in=$ac_file.in ;;
16823   esac
16824
16825   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16826   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16827          X"$ac_file" : 'X\(//\)[^/]' \| \
16828          X"$ac_file" : 'X\(//\)$' \| \
16829          X"$ac_file" : 'X\(/\)' \| \
16830          .     : '\(.\)' 2>/dev/null ||
16831 echo X"$ac_file" |
16832     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16833           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16834           /^X\(\/\/\)$/{ s//\1/; q; }
16835           /^X\(\/\).*/{ s//\1/; q; }
16836           s/.*/./; q'`
16837   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16838     { case "$ac_dir" in
16839   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16840   *)                      as_incr_dir=.;;
16841 esac
16842 as_dummy="$ac_dir"
16843 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16844   case $as_mkdir_dir in
16845     # Skip DOS drivespec
16846     ?:) as_incr_dir=$as_mkdir_dir ;;
16847     *)
16848       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16849       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16850     ;;
16851   esac
16852 done; }
16853
16854     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16855     # A "../" for each directory in $ac_dir_suffix.
16856     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16857   else
16858     ac_dir_suffix= ac_dots=
16859   fi
16860
16861   case $srcdir in
16862   .)  ac_srcdir=.
16863       if test -z "$ac_dots"; then
16864          ac_top_srcdir=.
16865       else
16866          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16867       fi ;;
16868   [\\/]* | ?:[\\/]* )
16869       ac_srcdir=$srcdir$ac_dir_suffix;
16870       ac_top_srcdir=$srcdir ;;
16871   *) # Relative path.
16872     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16873     ac_top_srcdir=$ac_dots$srcdir ;;
16874   esac
16875
16876   case $INSTALL in
16877   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16878   *) ac_INSTALL=$ac_dots$INSTALL ;;
16879   esac
16880
16881   if test x"$ac_file" != x-; then
16882     { echo "$as_me:16882: creating $ac_file" >&5
16883 echo "$as_me: creating $ac_file" >&6;}
16884     rm -f "$ac_file"
16885   fi
16886   # Let's still pretend it is `configure' which instantiates (i.e., don't
16887   # use $as_me), people would be surprised to read:
16888   #    /* config.h.  Generated automatically by config.status.  */
16889   configure_input="Generated automatically from `echo $ac_file_in |
16890                                                  sed 's,.*/,,'` by configure."
16891
16892   # First look for the input files in the build tree, otherwise in the
16893   # src tree.
16894   ac_file_inputs=`IFS=:
16895     for f in $ac_file_in; do
16896       case $f in
16897       -) echo $tmp/stdin ;;
16898       [\\/$]*)
16899          # Absolute (can't be DOS-style, as IFS=:)
16900          test -f "$f" || { { echo "$as_me:16900: error: cannot find input file: $f" >&5
16901 echo "$as_me: error: cannot find input file: $f" >&2;}
16902    { (exit 1); exit 1; }; }
16903          echo $f;;
16904       *) # Relative
16905          if test -f "$f"; then
16906            # Build tree
16907            echo $f
16908          elif test -f "$srcdir/$f"; then
16909            # Source tree
16910            echo $srcdir/$f
16911          else
16912            # /dev/null tree
16913            { { echo "$as_me:16913: error: cannot find input file: $f" >&5
16914 echo "$as_me: error: cannot find input file: $f" >&2;}
16915    { (exit 1); exit 1; }; }
16916          fi;;
16917       esac
16918     done` || { (exit 1); exit 1; }
16919 EOF
16920 cat >>$CONFIG_STATUS <<EOF
16921   sed "$ac_vpsub
16922 $extrasub
16923 EOF
16924 cat >>$CONFIG_STATUS <<\EOF
16925 :t
16926 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16927 s,@configure_input@,$configure_input,;t t
16928 s,@srcdir@,$ac_srcdir,;t t
16929 s,@top_srcdir@,$ac_top_srcdir,;t t
16930 s,@INSTALL@,$ac_INSTALL,;t t
16931 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16932   rm -f $tmp/stdin
16933   if test x"$ac_file" != x-; then
16934     mv $tmp/out $ac_file
16935   else
16936     cat $tmp/out
16937     rm -f $tmp/out
16938   fi
16939
16940 done
16941 EOF
16942 cat >>$CONFIG_STATUS <<\EOF
16943
16944 #
16945 # CONFIG_HEADER section.
16946 #
16947
16948 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16949 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16950 #
16951 # ac_d sets the value in "#define NAME VALUE" lines.
16952 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16953 ac_dB='[        ].*$,\1#\2'
16954 ac_dC=' '
16955 ac_dD=',;t'
16956 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16957 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16958 ac_iB='\([      ]\),\1#\2define\3'
16959 ac_iC=' '
16960 ac_iD='\4,;t'
16961 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16962 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16963 ac_uB='$,\1#\2define\3'
16964 ac_uC=' '
16965 ac_uD=',;t'
16966
16967 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16968   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16969   case $ac_file in
16970   - | *:- | *:-:* ) # input from stdin
16971         cat >$tmp/stdin
16972         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16973         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16974   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16975         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16976   * )   ac_file_in=$ac_file.in ;;
16977   esac
16978
16979   test x"$ac_file" != x- && { echo "$as_me:16979: creating $ac_file" >&5
16980 echo "$as_me: creating $ac_file" >&6;}
16981
16982   # First look for the input files in the build tree, otherwise in the
16983   # src tree.
16984   ac_file_inputs=`IFS=:
16985     for f in $ac_file_in; do
16986       case $f in
16987       -) echo $tmp/stdin ;;
16988       [\\/$]*)
16989          # Absolute (can't be DOS-style, as IFS=:)
16990          test -f "$f" || { { echo "$as_me:16990: error: cannot find input file: $f" >&5
16991 echo "$as_me: error: cannot find input file: $f" >&2;}
16992    { (exit 1); exit 1; }; }
16993          echo $f;;
16994       *) # Relative
16995          if test -f "$f"; then
16996            # Build tree
16997            echo $f
16998          elif test -f "$srcdir/$f"; then
16999            # Source tree
17000            echo $srcdir/$f
17001          else
17002            # /dev/null tree
17003            { { echo "$as_me:17003: error: cannot find input file: $f" >&5
17004 echo "$as_me: error: cannot find input file: $f" >&2;}
17005    { (exit 1); exit 1; }; }
17006          fi;;
17007       esac
17008     done` || { (exit 1); exit 1; }
17009   # Remove the trailing spaces.
17010   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17011
17012 EOF
17013
17014 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17015 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17016 # be either 'cat' or 'sort'.
17017 cat confdefs.h | uniq >conftest.vals
17018
17019 # Break up conftest.vals because some shells have a limit on
17020 # the size of here documents, and old seds have small limits too.
17021
17022 rm -f conftest.tail
17023 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17024 while grep . conftest.vals >/dev/null
17025 do
17026   # Write chunks of a limited-size here document to conftest.frag.
17027   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17028   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17029   echo 'CEOF' >> $CONFIG_STATUS
17030   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17031   rm -f conftest.vals
17032   mv conftest.tail conftest.vals
17033 done
17034 rm -f conftest.vals
17035
17036 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17037 # marker @DEFS@.
17038 echo '  cat >> conftest.edit <<CEOF
17039 /@DEFS@/r conftest.frag
17040 /@DEFS@/d
17041 CEOF
17042 sed -f conftest.edit $tmp/in > $tmp/out
17043 rm -f $tmp/in
17044 mv $tmp/out $tmp/in
17045 rm -f conftest.edit conftest.frag
17046 ' >> $CONFIG_STATUS
17047
17048 cat >>$CONFIG_STATUS <<\EOF
17049   # Let's still pretend it is `configure' which instantiates (i.e., don't
17050   # use $as_me), people would be surprised to read:
17051   #    /* config.h.  Generated automatically by config.status.  */
17052   if test x"$ac_file" = x-; then
17053     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17054   else
17055     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17056   fi
17057   cat $tmp/in >>$tmp/config.h
17058   rm -f $tmp/in
17059   if test x"$ac_file" != x-; then
17060     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17061       { echo "$as_me:17061: $ac_file is unchanged" >&5
17062 echo "$as_me: $ac_file is unchanged" >&6;}
17063     else
17064       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17065          X"$ac_file" : 'X\(//\)[^/]' \| \
17066          X"$ac_file" : 'X\(//\)$' \| \
17067          X"$ac_file" : 'X\(/\)' \| \
17068          .     : '\(.\)' 2>/dev/null ||
17069 echo X"$ac_file" |
17070     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17071           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17072           /^X\(\/\/\)$/{ s//\1/; q; }
17073           /^X\(\/\).*/{ s//\1/; q; }
17074           s/.*/./; q'`
17075       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17076         { case "$ac_dir" in
17077   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17078   *)                      as_incr_dir=.;;
17079 esac
17080 as_dummy="$ac_dir"
17081 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17082   case $as_mkdir_dir in
17083     # Skip DOS drivespec
17084     ?:) as_incr_dir=$as_mkdir_dir ;;
17085     *)
17086       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17087       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17088     ;;
17089   esac
17090 done; }
17091
17092       fi
17093       rm -f $ac_file
17094       mv $tmp/config.h $ac_file
17095     fi
17096   else
17097     cat $tmp/config.h
17098     rm -f $tmp/config.h
17099   fi
17100 done
17101 EOF
17102 cat >>$CONFIG_STATUS <<\EOF
17103 #
17104 # CONFIG_COMMANDS section.
17105 #
17106 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17107   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17108   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17109
17110   case $ac_dest in
17111     default )
17112
17113 for cf_dir in .
17114 do
17115         if test ! -d $srcdir/$cf_dir; then
17116                 continue
17117         elif test -f $srcdir/$cf_dir/programs; then
17118                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17119         fi
17120 done
17121
17122         cat >>Makefile <<TEST_EOF
17123
17124 # These rules are generated so we do not rely on suffix rules, which do not
17125 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17126 # some, and the '\$x' confuses others).
17127 TEST_EOF
17128
17129 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17130 for N in $LIST
17131 do
17132         cat >>Makefile <<TEST_EOF
17133
17134 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17135         \$(srcdir)/test.priv.h \\
17136         ncurses_cfg.h
17137         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17138 TEST_EOF
17139 done
17140
17141 if test -f ../config.guess && test -f ../config.sub
17142 then
17143         cat >>Makefile <<TEST_EOF
17144
17145 # if we used CF_INHERIT for getting these files, we can remove them
17146 distclean::
17147         rm -f config.guess config.sub
17148 TEST_EOF
17149 fi
17150  ;;
17151   esac
17152 done
17153 EOF
17154
17155 cat >>$CONFIG_STATUS <<\EOF
17156
17157 { (exit 0); exit 0; }
17158 EOF
17159 chmod +x $CONFIG_STATUS
17160 ac_clean_files=$ac_clean_files_save
17161
17162 # configure is writing to config.log, and then calls config.status.
17163 # config.status does its own redirection, appending to config.log.
17164 # Unfortunately, on DOS this fails, as config.log is still kept open
17165 # by configure, so config.status won't be able to write to it; its
17166 # output is simply discarded.  So we exec the FD to /dev/null,
17167 # effectively closing config.log, so it can be properly (re)opened and
17168 # appended to by config.status.  When coming back to configure, we
17169 # need to make the FD available again.
17170 if test "$no_create" != yes; then
17171   ac_cs_success=:
17172   exec 5>/dev/null
17173   $SHELL $CONFIG_STATUS || ac_cs_success=false
17174   exec 5>>config.log
17175   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17176   # would make configure fail if this is the last instruction.
17177   $ac_cs_success || { (exit 1); exit 1; }
17178 fi
17179