]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20120107
[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         cf_XOPEN_SOURCE=
2944         ;;
2945 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2946
2947 echo "$as_me:2947: checking if we must define _GNU_SOURCE" >&5
2948 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2949 if test "${cf_cv_gnu_source+set}" = set; then
2950   echo $ECHO_N "(cached) $ECHO_C" >&6
2951 else
2952
2953 cat >conftest.$ac_ext <<_ACEOF
2954 #line 2954 "configure"
2955 #include "confdefs.h"
2956 #include <sys/types.h>
2957 int
2958 main ()
2959 {
2960
2961 #ifndef _XOPEN_SOURCE
2962 make an error
2963 #endif
2964   ;
2965   return 0;
2966 }
2967 _ACEOF
2968 rm -f conftest.$ac_objext
2969 if { (eval echo "$as_me:2969: \"$ac_compile\"") >&5
2970   (eval $ac_compile) 2>&5
2971   ac_status=$?
2972   echo "$as_me:2972: \$? = $ac_status" >&5
2973   (exit $ac_status); } &&
2974          { ac_try='test -s conftest.$ac_objext'
2975   { (eval echo "$as_me:2975: \"$ac_try\"") >&5
2976   (eval $ac_try) 2>&5
2977   ac_status=$?
2978   echo "$as_me:2978: \$? = $ac_status" >&5
2979   (exit $ac_status); }; }; then
2980   cf_cv_gnu_source=no
2981 else
2982   echo "$as_me: failed program was:" >&5
2983 cat conftest.$ac_ext >&5
2984 cf_save="$CPPFLAGS"
2985          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2986          cat >conftest.$ac_ext <<_ACEOF
2987 #line 2987 "configure"
2988 #include "confdefs.h"
2989 #include <sys/types.h>
2990 int
2991 main ()
2992 {
2993
2994 #ifdef _XOPEN_SOURCE
2995 make an error
2996 #endif
2997   ;
2998   return 0;
2999 }
3000 _ACEOF
3001 rm -f conftest.$ac_objext
3002 if { (eval echo "$as_me:3002: \"$ac_compile\"") >&5
3003   (eval $ac_compile) 2>&5
3004   ac_status=$?
3005   echo "$as_me:3005: \$? = $ac_status" >&5
3006   (exit $ac_status); } &&
3007          { ac_try='test -s conftest.$ac_objext'
3008   { (eval echo "$as_me:3008: \"$ac_try\"") >&5
3009   (eval $ac_try) 2>&5
3010   ac_status=$?
3011   echo "$as_me:3011: \$? = $ac_status" >&5
3012   (exit $ac_status); }; }; then
3013   cf_cv_gnu_source=no
3014 else
3015   echo "$as_me: failed program was:" >&5
3016 cat conftest.$ac_ext >&5
3017 cf_cv_gnu_source=yes
3018 fi
3019 rm -f conftest.$ac_objext conftest.$ac_ext
3020         CPPFLAGS="$cf_save"
3021
3022 fi
3023 rm -f conftest.$ac_objext conftest.$ac_ext
3024
3025 fi
3026 echo "$as_me:3026: result: $cf_cv_gnu_source" >&5
3027 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3028 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3029
3030         ;;
3031 mirbsd*) #(vi
3032         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3033         cf_XOPEN_SOURCE=
3034
3035 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3036
3037 cf_save_CFLAGS="$CFLAGS"
3038 cf_save_CPPFLAGS="$CPPFLAGS"
3039
3040 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3041         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3042                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3043
3044 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3045         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3046                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3047
3048 echo "$as_me:3048: checking if we should define _POSIX_C_SOURCE" >&5
3049 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3050 if test "${cf_cv_posix_c_source+set}" = set; then
3051   echo $ECHO_N "(cached) $ECHO_C" >&6
3052 else
3053
3054 echo "${as_me:-configure}:3054: testing if the symbol is already defined go no further ..." 1>&5
3055
3056         cat >conftest.$ac_ext <<_ACEOF
3057 #line 3057 "configure"
3058 #include "confdefs.h"
3059 #include <sys/types.h>
3060 int
3061 main ()
3062 {
3063
3064 #ifndef _POSIX_C_SOURCE
3065 make an error
3066 #endif
3067   ;
3068   return 0;
3069 }
3070 _ACEOF
3071 rm -f conftest.$ac_objext
3072 if { (eval echo "$as_me:3072: \"$ac_compile\"") >&5
3073   (eval $ac_compile) 2>&5
3074   ac_status=$?
3075   echo "$as_me:3075: \$? = $ac_status" >&5
3076   (exit $ac_status); } &&
3077          { ac_try='test -s conftest.$ac_objext'
3078   { (eval echo "$as_me:3078: \"$ac_try\"") >&5
3079   (eval $ac_try) 2>&5
3080   ac_status=$?
3081   echo "$as_me:3081: \$? = $ac_status" >&5
3082   (exit $ac_status); }; }; then
3083   cf_cv_posix_c_source=no
3084 else
3085   echo "$as_me: failed program was:" >&5
3086 cat conftest.$ac_ext >&5
3087 cf_want_posix_source=no
3088          case .$cf_POSIX_C_SOURCE in #(vi
3089          .[12]??*) #(vi
3090                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3091                 ;;
3092          .2) #(vi
3093                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3094                 cf_want_posix_source=yes
3095                 ;;
3096          .*)
3097                 cf_want_posix_source=yes
3098                 ;;
3099          esac
3100          if test "$cf_want_posix_source" = yes ; then
3101                 cat >conftest.$ac_ext <<_ACEOF
3102 #line 3102 "configure"
3103 #include "confdefs.h"
3104 #include <sys/types.h>
3105 int
3106 main ()
3107 {
3108
3109 #ifdef _POSIX_SOURCE
3110 make an error
3111 #endif
3112   ;
3113   return 0;
3114 }
3115 _ACEOF
3116 rm -f conftest.$ac_objext
3117 if { (eval echo "$as_me:3117: \"$ac_compile\"") >&5
3118   (eval $ac_compile) 2>&5
3119   ac_status=$?
3120   echo "$as_me:3120: \$? = $ac_status" >&5
3121   (exit $ac_status); } &&
3122          { ac_try='test -s conftest.$ac_objext'
3123   { (eval echo "$as_me:3123: \"$ac_try\"") >&5
3124   (eval $ac_try) 2>&5
3125   ac_status=$?
3126   echo "$as_me:3126: \$? = $ac_status" >&5
3127   (exit $ac_status); }; }; then
3128   :
3129 else
3130   echo "$as_me: failed program was:" >&5
3131 cat conftest.$ac_ext >&5
3132 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3133 fi
3134 rm -f conftest.$ac_objext conftest.$ac_ext
3135          fi
3136
3137 echo "${as_me:-configure}:3137: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3138
3139          CFLAGS="$cf_trim_CFLAGS"
3140          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3141
3142 echo "${as_me:-configure}:3142: testing if the second compile does not leave our definition intact error ..." 1>&5
3143
3144          cat >conftest.$ac_ext <<_ACEOF
3145 #line 3145 "configure"
3146 #include "confdefs.h"
3147 #include <sys/types.h>
3148 int
3149 main ()
3150 {
3151
3152 #ifndef _POSIX_C_SOURCE
3153 make an error
3154 #endif
3155   ;
3156   return 0;
3157 }
3158 _ACEOF
3159 rm -f conftest.$ac_objext
3160 if { (eval echo "$as_me:3160: \"$ac_compile\"") >&5
3161   (eval $ac_compile) 2>&5
3162   ac_status=$?
3163   echo "$as_me:3163: \$? = $ac_status" >&5
3164   (exit $ac_status); } &&
3165          { ac_try='test -s conftest.$ac_objext'
3166   { (eval echo "$as_me:3166: \"$ac_try\"") >&5
3167   (eval $ac_try) 2>&5
3168   ac_status=$?
3169   echo "$as_me:3169: \$? = $ac_status" >&5
3170   (exit $ac_status); }; }; then
3171   :
3172 else
3173   echo "$as_me: failed program was:" >&5
3174 cat conftest.$ac_ext >&5
3175 cf_cv_posix_c_source=no
3176 fi
3177 rm -f conftest.$ac_objext conftest.$ac_ext
3178          CFLAGS="$cf_save_CFLAGS"
3179          CPPFLAGS="$cf_save_CPPFLAGS"
3180
3181 fi
3182 rm -f conftest.$ac_objext conftest.$ac_ext
3183
3184 fi
3185 echo "$as_me:3185: result: $cf_cv_posix_c_source" >&5
3186 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3187
3188 if test "$cf_cv_posix_c_source" != no ; then
3189         CFLAGS="$cf_trim_CFLAGS"
3190         CPPFLAGS="$cf_trim_CPPFLAGS"
3191
3192 cf_fix_cppflags=no
3193 cf_new_cflags=
3194 cf_new_cppflags=
3195 cf_new_extra_cppflags=
3196
3197 for cf_add_cflags in $cf_cv_posix_c_source
3198 do
3199 case $cf_fix_cppflags in
3200 no)
3201         case $cf_add_cflags in #(vi
3202         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3203                 case $cf_add_cflags in
3204                 -D*)
3205                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3206
3207                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3208                                 && test -z "${cf_tst_cflags}" \
3209                                 && cf_fix_cppflags=yes
3210
3211                         if test $cf_fix_cppflags = yes ; then
3212                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3213                                 continue
3214                         elif test "${cf_tst_cflags}" = "\"'" ; then
3215                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3216                                 continue
3217                         fi
3218                         ;;
3219                 esac
3220                 case "$CPPFLAGS" in
3221                 *$cf_add_cflags) #(vi
3222                         ;;
3223                 *) #(vi
3224                         case $cf_add_cflags in #(vi
3225                         -D*)
3226                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3227
3228 CPPFLAGS=`echo "$CPPFLAGS" | \
3229         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3230                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3231
3232                                 ;;
3233                         esac
3234                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3235                         ;;
3236                 esac
3237                 ;;
3238         *)
3239                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3240                 ;;
3241         esac
3242         ;;
3243 yes)
3244         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3245
3246         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3247
3248         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3249                 && test -z "${cf_tst_cflags}" \
3250                 && cf_fix_cppflags=no
3251         ;;
3252 esac
3253 done
3254
3255 if test -n "$cf_new_cflags" ; then
3256
3257         CFLAGS="$CFLAGS $cf_new_cflags"
3258 fi
3259
3260 if test -n "$cf_new_cppflags" ; then
3261
3262         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3263 fi
3264
3265 if test -n "$cf_new_extra_cppflags" ; then
3266
3267         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3268 fi
3269
3270 fi
3271
3272         ;;
3273 netbsd*) #(vi
3274         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3275         ;;
3276 openbsd[4-9]*) #(vi
3277         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3278         cf_XOPEN_SOURCE=600
3279         ;;
3280 openbsd*) #(vi
3281         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3282         ;;
3283 osf[45]*) #(vi
3284         cf_xopen_source="-D_OSF_SOURCE"
3285         ;;
3286 nto-qnx*) #(vi
3287         cf_xopen_source="-D_QNX_SOURCE"
3288         ;;
3289 sco*) #(vi
3290         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3291         ;;
3292 solaris2.*) #(vi
3293         cf_xopen_source="-D__EXTENSIONS__"
3294         ;;
3295 *)
3296
3297 echo "$as_me:3297: checking if we should define _XOPEN_SOURCE" >&5
3298 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3299 if test "${cf_cv_xopen_source+set}" = set; then
3300   echo $ECHO_N "(cached) $ECHO_C" >&6
3301 else
3302
3303         cat >conftest.$ac_ext <<_ACEOF
3304 #line 3304 "configure"
3305 #include "confdefs.h"
3306
3307 #include <stdlib.h>
3308 #include <string.h>
3309 #include <sys/types.h>
3310
3311 int
3312 main ()
3313 {
3314
3315 #ifndef _XOPEN_SOURCE
3316 make an error
3317 #endif
3318   ;
3319   return 0;
3320 }
3321 _ACEOF
3322 rm -f conftest.$ac_objext
3323 if { (eval echo "$as_me:3323: \"$ac_compile\"") >&5
3324   (eval $ac_compile) 2>&5
3325   ac_status=$?
3326   echo "$as_me:3326: \$? = $ac_status" >&5
3327   (exit $ac_status); } &&
3328          { ac_try='test -s conftest.$ac_objext'
3329   { (eval echo "$as_me:3329: \"$ac_try\"") >&5
3330   (eval $ac_try) 2>&5
3331   ac_status=$?
3332   echo "$as_me:3332: \$? = $ac_status" >&5
3333   (exit $ac_status); }; }; then
3334   cf_cv_xopen_source=no
3335 else
3336   echo "$as_me: failed program was:" >&5
3337 cat conftest.$ac_ext >&5
3338 cf_save="$CPPFLAGS"
3339          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3340          cat >conftest.$ac_ext <<_ACEOF
3341 #line 3341 "configure"
3342 #include "confdefs.h"
3343
3344 #include <stdlib.h>
3345 #include <string.h>
3346 #include <sys/types.h>
3347
3348 int
3349 main ()
3350 {
3351
3352 #ifdef _XOPEN_SOURCE
3353 make an error
3354 #endif
3355   ;
3356   return 0;
3357 }
3358 _ACEOF
3359 rm -f conftest.$ac_objext
3360 if { (eval echo "$as_me:3360: \"$ac_compile\"") >&5
3361   (eval $ac_compile) 2>&5
3362   ac_status=$?
3363   echo "$as_me:3363: \$? = $ac_status" >&5
3364   (exit $ac_status); } &&
3365          { ac_try='test -s conftest.$ac_objext'
3366   { (eval echo "$as_me:3366: \"$ac_try\"") >&5
3367   (eval $ac_try) 2>&5
3368   ac_status=$?
3369   echo "$as_me:3369: \$? = $ac_status" >&5
3370   (exit $ac_status); }; }; then
3371   cf_cv_xopen_source=no
3372 else
3373   echo "$as_me: failed program was:" >&5
3374 cat conftest.$ac_ext >&5
3375 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3376 fi
3377 rm -f conftest.$ac_objext conftest.$ac_ext
3378         CPPFLAGS="$cf_save"
3379
3380 fi
3381 rm -f conftest.$ac_objext conftest.$ac_ext
3382
3383 fi
3384 echo "$as_me:3384: result: $cf_cv_xopen_source" >&5
3385 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3386
3387 if test "$cf_cv_xopen_source" != no ; then
3388
3389 CFLAGS=`echo "$CFLAGS" | \
3390         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3391                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3392
3393 CPPFLAGS=`echo "$CPPFLAGS" | \
3394         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3395                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3396
3397         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3398
3399 cf_fix_cppflags=no
3400 cf_new_cflags=
3401 cf_new_cppflags=
3402 cf_new_extra_cppflags=
3403
3404 for cf_add_cflags in $cf_temp_xopen_source
3405 do
3406 case $cf_fix_cppflags in
3407 no)
3408         case $cf_add_cflags in #(vi
3409         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3410                 case $cf_add_cflags in
3411                 -D*)
3412                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3413
3414                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3415                                 && test -z "${cf_tst_cflags}" \
3416                                 && cf_fix_cppflags=yes
3417
3418                         if test $cf_fix_cppflags = yes ; then
3419                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3420                                 continue
3421                         elif test "${cf_tst_cflags}" = "\"'" ; then
3422                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3423                                 continue
3424                         fi
3425                         ;;
3426                 esac
3427                 case "$CPPFLAGS" in
3428                 *$cf_add_cflags) #(vi
3429                         ;;
3430                 *) #(vi
3431                         case $cf_add_cflags in #(vi
3432                         -D*)
3433                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3434
3435 CPPFLAGS=`echo "$CPPFLAGS" | \
3436         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3437                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3438
3439                                 ;;
3440                         esac
3441                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3442                         ;;
3443                 esac
3444                 ;;
3445         *)
3446                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3447                 ;;
3448         esac
3449         ;;
3450 yes)
3451         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3452
3453         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3454
3455         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3456                 && test -z "${cf_tst_cflags}" \
3457                 && cf_fix_cppflags=no
3458         ;;
3459 esac
3460 done
3461
3462 if test -n "$cf_new_cflags" ; then
3463
3464         CFLAGS="$CFLAGS $cf_new_cflags"
3465 fi
3466
3467 if test -n "$cf_new_cppflags" ; then
3468
3469         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3470 fi
3471
3472 if test -n "$cf_new_extra_cppflags" ; then
3473
3474         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3475 fi
3476
3477 fi
3478
3479 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3480
3481 cf_save_CFLAGS="$CFLAGS"
3482 cf_save_CPPFLAGS="$CPPFLAGS"
3483
3484 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3485         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3486                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3487
3488 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3489         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3490                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3491
3492 echo "$as_me:3492: checking if we should define _POSIX_C_SOURCE" >&5
3493 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3494 if test "${cf_cv_posix_c_source+set}" = set; then
3495   echo $ECHO_N "(cached) $ECHO_C" >&6
3496 else
3497
3498 echo "${as_me:-configure}:3498: testing if the symbol is already defined go no further ..." 1>&5
3499
3500         cat >conftest.$ac_ext <<_ACEOF
3501 #line 3501 "configure"
3502 #include "confdefs.h"
3503 #include <sys/types.h>
3504 int
3505 main ()
3506 {
3507
3508 #ifndef _POSIX_C_SOURCE
3509 make an error
3510 #endif
3511   ;
3512   return 0;
3513 }
3514 _ACEOF
3515 rm -f conftest.$ac_objext
3516 if { (eval echo "$as_me:3516: \"$ac_compile\"") >&5
3517   (eval $ac_compile) 2>&5
3518   ac_status=$?
3519   echo "$as_me:3519: \$? = $ac_status" >&5
3520   (exit $ac_status); } &&
3521          { ac_try='test -s conftest.$ac_objext'
3522   { (eval echo "$as_me:3522: \"$ac_try\"") >&5
3523   (eval $ac_try) 2>&5
3524   ac_status=$?
3525   echo "$as_me:3525: \$? = $ac_status" >&5
3526   (exit $ac_status); }; }; then
3527   cf_cv_posix_c_source=no
3528 else
3529   echo "$as_me: failed program was:" >&5
3530 cat conftest.$ac_ext >&5
3531 cf_want_posix_source=no
3532          case .$cf_POSIX_C_SOURCE in #(vi
3533          .[12]??*) #(vi
3534                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3535                 ;;
3536          .2) #(vi
3537                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3538                 cf_want_posix_source=yes
3539                 ;;
3540          .*)
3541                 cf_want_posix_source=yes
3542                 ;;
3543          esac
3544          if test "$cf_want_posix_source" = yes ; then
3545                 cat >conftest.$ac_ext <<_ACEOF
3546 #line 3546 "configure"
3547 #include "confdefs.h"
3548 #include <sys/types.h>
3549 int
3550 main ()
3551 {
3552
3553 #ifdef _POSIX_SOURCE
3554 make an error
3555 #endif
3556   ;
3557   return 0;
3558 }
3559 _ACEOF
3560 rm -f conftest.$ac_objext
3561 if { (eval echo "$as_me:3561: \"$ac_compile\"") >&5
3562   (eval $ac_compile) 2>&5
3563   ac_status=$?
3564   echo "$as_me:3564: \$? = $ac_status" >&5
3565   (exit $ac_status); } &&
3566          { ac_try='test -s conftest.$ac_objext'
3567   { (eval echo "$as_me:3567: \"$ac_try\"") >&5
3568   (eval $ac_try) 2>&5
3569   ac_status=$?
3570   echo "$as_me:3570: \$? = $ac_status" >&5
3571   (exit $ac_status); }; }; then
3572   :
3573 else
3574   echo "$as_me: failed program was:" >&5
3575 cat conftest.$ac_ext >&5
3576 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3577 fi
3578 rm -f conftest.$ac_objext conftest.$ac_ext
3579          fi
3580
3581 echo "${as_me:-configure}:3581: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3582
3583          CFLAGS="$cf_trim_CFLAGS"
3584          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3585
3586 echo "${as_me:-configure}:3586: testing if the second compile does not leave our definition intact error ..." 1>&5
3587
3588          cat >conftest.$ac_ext <<_ACEOF
3589 #line 3589 "configure"
3590 #include "confdefs.h"
3591 #include <sys/types.h>
3592 int
3593 main ()
3594 {
3595
3596 #ifndef _POSIX_C_SOURCE
3597 make an error
3598 #endif
3599   ;
3600   return 0;
3601 }
3602 _ACEOF
3603 rm -f conftest.$ac_objext
3604 if { (eval echo "$as_me:3604: \"$ac_compile\"") >&5
3605   (eval $ac_compile) 2>&5
3606   ac_status=$?
3607   echo "$as_me:3607: \$? = $ac_status" >&5
3608   (exit $ac_status); } &&
3609          { ac_try='test -s conftest.$ac_objext'
3610   { (eval echo "$as_me:3610: \"$ac_try\"") >&5
3611   (eval $ac_try) 2>&5
3612   ac_status=$?
3613   echo "$as_me:3613: \$? = $ac_status" >&5
3614   (exit $ac_status); }; }; then
3615   :
3616 else
3617   echo "$as_me: failed program was:" >&5
3618 cat conftest.$ac_ext >&5
3619 cf_cv_posix_c_source=no
3620 fi
3621 rm -f conftest.$ac_objext conftest.$ac_ext
3622          CFLAGS="$cf_save_CFLAGS"
3623          CPPFLAGS="$cf_save_CPPFLAGS"
3624
3625 fi
3626 rm -f conftest.$ac_objext conftest.$ac_ext
3627
3628 fi
3629 echo "$as_me:3629: result: $cf_cv_posix_c_source" >&5
3630 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3631
3632 if test "$cf_cv_posix_c_source" != no ; then
3633         CFLAGS="$cf_trim_CFLAGS"
3634         CPPFLAGS="$cf_trim_CPPFLAGS"
3635
3636 cf_fix_cppflags=no
3637 cf_new_cflags=
3638 cf_new_cppflags=
3639 cf_new_extra_cppflags=
3640
3641 for cf_add_cflags in $cf_cv_posix_c_source
3642 do
3643 case $cf_fix_cppflags in
3644 no)
3645         case $cf_add_cflags in #(vi
3646         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3647                 case $cf_add_cflags in
3648                 -D*)
3649                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3650
3651                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3652                                 && test -z "${cf_tst_cflags}" \
3653                                 && cf_fix_cppflags=yes
3654
3655                         if test $cf_fix_cppflags = yes ; then
3656                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3657                                 continue
3658                         elif test "${cf_tst_cflags}" = "\"'" ; then
3659                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3660                                 continue
3661                         fi
3662                         ;;
3663                 esac
3664                 case "$CPPFLAGS" in
3665                 *$cf_add_cflags) #(vi
3666                         ;;
3667                 *) #(vi
3668                         case $cf_add_cflags in #(vi
3669                         -D*)
3670                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3671
3672 CPPFLAGS=`echo "$CPPFLAGS" | \
3673         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3674                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3675
3676                                 ;;
3677                         esac
3678                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3679                         ;;
3680                 esac
3681                 ;;
3682         *)
3683                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3684                 ;;
3685         esac
3686         ;;
3687 yes)
3688         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3689
3690         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3691
3692         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3693                 && test -z "${cf_tst_cflags}" \
3694                 && cf_fix_cppflags=no
3695         ;;
3696 esac
3697 done
3698
3699 if test -n "$cf_new_cflags" ; then
3700
3701         CFLAGS="$CFLAGS $cf_new_cflags"
3702 fi
3703
3704 if test -n "$cf_new_cppflags" ; then
3705
3706         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3707 fi
3708
3709 if test -n "$cf_new_extra_cppflags" ; then
3710
3711         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3712 fi
3713
3714 fi
3715
3716         ;;
3717 esac
3718
3719 if test -n "$cf_xopen_source" ; then
3720
3721 cf_fix_cppflags=no
3722 cf_new_cflags=
3723 cf_new_cppflags=
3724 cf_new_extra_cppflags=
3725
3726 for cf_add_cflags in $cf_xopen_source
3727 do
3728 case $cf_fix_cppflags in
3729 no)
3730         case $cf_add_cflags in #(vi
3731         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3732                 case $cf_add_cflags in
3733                 -D*)
3734                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3735
3736                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3737                                 && test -z "${cf_tst_cflags}" \
3738                                 && cf_fix_cppflags=yes
3739
3740                         if test $cf_fix_cppflags = yes ; then
3741                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3742                                 continue
3743                         elif test "${cf_tst_cflags}" = "\"'" ; then
3744                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3745                                 continue
3746                         fi
3747                         ;;
3748                 esac
3749                 case "$CPPFLAGS" in
3750                 *$cf_add_cflags) #(vi
3751                         ;;
3752                 *) #(vi
3753                         case $cf_add_cflags in #(vi
3754                         -D*)
3755                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3756
3757 CPPFLAGS=`echo "$CPPFLAGS" | \
3758         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3759                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3760
3761                                 ;;
3762                         esac
3763                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3764                         ;;
3765                 esac
3766                 ;;
3767         *)
3768                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3769                 ;;
3770         esac
3771         ;;
3772 yes)
3773         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3774
3775         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3776
3777         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3778                 && test -z "${cf_tst_cflags}" \
3779                 && cf_fix_cppflags=no
3780         ;;
3781 esac
3782 done
3783
3784 if test -n "$cf_new_cflags" ; then
3785
3786         CFLAGS="$CFLAGS $cf_new_cflags"
3787 fi
3788
3789 if test -n "$cf_new_cppflags" ; then
3790
3791         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3792 fi
3793
3794 if test -n "$cf_new_extra_cppflags" ; then
3795
3796         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3797 fi
3798
3799 fi
3800
3801 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3802         echo "$as_me:3802: checking if _XOPEN_SOURCE really is set" >&5
3803 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3804         cat >conftest.$ac_ext <<_ACEOF
3805 #line 3805 "configure"
3806 #include "confdefs.h"
3807 #include <stdlib.h>
3808 int
3809 main ()
3810 {
3811
3812 #ifndef _XOPEN_SOURCE
3813 make an error
3814 #endif
3815   ;
3816   return 0;
3817 }
3818 _ACEOF
3819 rm -f conftest.$ac_objext
3820 if { (eval echo "$as_me:3820: \"$ac_compile\"") >&5
3821   (eval $ac_compile) 2>&5
3822   ac_status=$?
3823   echo "$as_me:3823: \$? = $ac_status" >&5
3824   (exit $ac_status); } &&
3825          { ac_try='test -s conftest.$ac_objext'
3826   { (eval echo "$as_me:3826: \"$ac_try\"") >&5
3827   (eval $ac_try) 2>&5
3828   ac_status=$?
3829   echo "$as_me:3829: \$? = $ac_status" >&5
3830   (exit $ac_status); }; }; then
3831   cf_XOPEN_SOURCE_set=yes
3832 else
3833   echo "$as_me: failed program was:" >&5
3834 cat conftest.$ac_ext >&5
3835 cf_XOPEN_SOURCE_set=no
3836 fi
3837 rm -f conftest.$ac_objext conftest.$ac_ext
3838         echo "$as_me:3838: result: $cf_XOPEN_SOURCE_set" >&5
3839 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3840         if test $cf_XOPEN_SOURCE_set = yes
3841         then
3842                 cat >conftest.$ac_ext <<_ACEOF
3843 #line 3843 "configure"
3844 #include "confdefs.h"
3845 #include <stdlib.h>
3846 int
3847 main ()
3848 {
3849
3850 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3851 make an error
3852 #endif
3853   ;
3854   return 0;
3855 }
3856 _ACEOF
3857 rm -f conftest.$ac_objext
3858 if { (eval echo "$as_me:3858: \"$ac_compile\"") >&5
3859   (eval $ac_compile) 2>&5
3860   ac_status=$?
3861   echo "$as_me:3861: \$? = $ac_status" >&5
3862   (exit $ac_status); } &&
3863          { ac_try='test -s conftest.$ac_objext'
3864   { (eval echo "$as_me:3864: \"$ac_try\"") >&5
3865   (eval $ac_try) 2>&5
3866   ac_status=$?
3867   echo "$as_me:3867: \$? = $ac_status" >&5
3868   (exit $ac_status); }; }; then
3869   cf_XOPEN_SOURCE_set_ok=yes
3870 else
3871   echo "$as_me: failed program was:" >&5
3872 cat conftest.$ac_ext >&5
3873 cf_XOPEN_SOURCE_set_ok=no
3874 fi
3875 rm -f conftest.$ac_objext conftest.$ac_ext
3876                 if test $cf_XOPEN_SOURCE_set_ok = no
3877                 then
3878                         { echo "$as_me:3878: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3879 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3880                 fi
3881         else
3882
3883 echo "$as_me:3883: checking if we should define _XOPEN_SOURCE" >&5
3884 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3885 if test "${cf_cv_xopen_source+set}" = set; then
3886   echo $ECHO_N "(cached) $ECHO_C" >&6
3887 else
3888
3889         cat >conftest.$ac_ext <<_ACEOF
3890 #line 3890 "configure"
3891 #include "confdefs.h"
3892
3893 #include <stdlib.h>
3894 #include <string.h>
3895 #include <sys/types.h>
3896
3897 int
3898 main ()
3899 {
3900
3901 #ifndef _XOPEN_SOURCE
3902 make an error
3903 #endif
3904   ;
3905   return 0;
3906 }
3907 _ACEOF
3908 rm -f conftest.$ac_objext
3909 if { (eval echo "$as_me:3909: \"$ac_compile\"") >&5
3910   (eval $ac_compile) 2>&5
3911   ac_status=$?
3912   echo "$as_me:3912: \$? = $ac_status" >&5
3913   (exit $ac_status); } &&
3914          { ac_try='test -s conftest.$ac_objext'
3915   { (eval echo "$as_me:3915: \"$ac_try\"") >&5
3916   (eval $ac_try) 2>&5
3917   ac_status=$?
3918   echo "$as_me:3918: \$? = $ac_status" >&5
3919   (exit $ac_status); }; }; then
3920   cf_cv_xopen_source=no
3921 else
3922   echo "$as_me: failed program was:" >&5
3923 cat conftest.$ac_ext >&5
3924 cf_save="$CPPFLAGS"
3925          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3926          cat >conftest.$ac_ext <<_ACEOF
3927 #line 3927 "configure"
3928 #include "confdefs.h"
3929
3930 #include <stdlib.h>
3931 #include <string.h>
3932 #include <sys/types.h>
3933
3934 int
3935 main ()
3936 {
3937
3938 #ifdef _XOPEN_SOURCE
3939 make an error
3940 #endif
3941   ;
3942   return 0;
3943 }
3944 _ACEOF
3945 rm -f conftest.$ac_objext
3946 if { (eval echo "$as_me:3946: \"$ac_compile\"") >&5
3947   (eval $ac_compile) 2>&5
3948   ac_status=$?
3949   echo "$as_me:3949: \$? = $ac_status" >&5
3950   (exit $ac_status); } &&
3951          { ac_try='test -s conftest.$ac_objext'
3952   { (eval echo "$as_me:3952: \"$ac_try\"") >&5
3953   (eval $ac_try) 2>&5
3954   ac_status=$?
3955   echo "$as_me:3955: \$? = $ac_status" >&5
3956   (exit $ac_status); }; }; then
3957   cf_cv_xopen_source=no
3958 else
3959   echo "$as_me: failed program was:" >&5
3960 cat conftest.$ac_ext >&5
3961 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3962 fi
3963 rm -f conftest.$ac_objext conftest.$ac_ext
3964         CPPFLAGS="$cf_save"
3965
3966 fi
3967 rm -f conftest.$ac_objext conftest.$ac_ext
3968
3969 fi
3970 echo "$as_me:3970: result: $cf_cv_xopen_source" >&5
3971 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3972
3973 if test "$cf_cv_xopen_source" != no ; then
3974
3975 CFLAGS=`echo "$CFLAGS" | \
3976         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3977                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3978
3979 CPPFLAGS=`echo "$CPPFLAGS" | \
3980         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3981                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3982
3983         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3984
3985 cf_fix_cppflags=no
3986 cf_new_cflags=
3987 cf_new_cppflags=
3988 cf_new_extra_cppflags=
3989
3990 for cf_add_cflags in $cf_temp_xopen_source
3991 do
3992 case $cf_fix_cppflags in
3993 no)
3994         case $cf_add_cflags in #(vi
3995         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3996                 case $cf_add_cflags in
3997                 -D*)
3998                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3999
4000                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4001                                 && test -z "${cf_tst_cflags}" \
4002                                 && cf_fix_cppflags=yes
4003
4004                         if test $cf_fix_cppflags = yes ; then
4005                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4006                                 continue
4007                         elif test "${cf_tst_cflags}" = "\"'" ; then
4008                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4009                                 continue
4010                         fi
4011                         ;;
4012                 esac
4013                 case "$CPPFLAGS" in
4014                 *$cf_add_cflags) #(vi
4015                         ;;
4016                 *) #(vi
4017                         case $cf_add_cflags in #(vi
4018                         -D*)
4019                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4020
4021 CPPFLAGS=`echo "$CPPFLAGS" | \
4022         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4023                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4024
4025                                 ;;
4026                         esac
4027                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4028                         ;;
4029                 esac
4030                 ;;
4031         *)
4032                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4033                 ;;
4034         esac
4035         ;;
4036 yes)
4037         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4038
4039         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4040
4041         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4042                 && test -z "${cf_tst_cflags}" \
4043                 && cf_fix_cppflags=no
4044         ;;
4045 esac
4046 done
4047
4048 if test -n "$cf_new_cflags" ; then
4049
4050         CFLAGS="$CFLAGS $cf_new_cflags"
4051 fi
4052
4053 if test -n "$cf_new_cppflags" ; then
4054
4055         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4056 fi
4057
4058 if test -n "$cf_new_extra_cppflags" ; then
4059
4060         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4061 fi
4062
4063 fi
4064
4065         fi
4066 fi
4067
4068 echo "$as_me:4068: checking for $CC option to accept ANSI C" >&5
4069 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
4070 if test "${ac_cv_prog_cc_stdc+set}" = set; then
4071   echo $ECHO_N "(cached) $ECHO_C" >&6
4072 else
4073   ac_cv_prog_cc_stdc=no
4074 ac_save_CC=$CC
4075 cat >conftest.$ac_ext <<_ACEOF
4076 #line 4076 "configure"
4077 #include "confdefs.h"
4078 #include <stdarg.h>
4079 #include <stdio.h>
4080 #include <sys/types.h>
4081 #include <sys/stat.h>
4082 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4083 struct buf { int x; };
4084 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4085 static char *e (p, i)
4086      char **p;
4087      int i;
4088 {
4089   return p[i];
4090 }
4091 static char *f (char * (*g) (char **, int), char **p, ...)
4092 {
4093   char *s;
4094   va_list v;
4095   va_start (v,p);
4096   s = g (p, va_arg (v,int));
4097   va_end (v);
4098   return s;
4099 }
4100 int test (int i, double x);
4101 struct s1 {int (*f) (int a);};
4102 struct s2 {int (*f) (double a);};
4103 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4104 int argc;
4105 char **argv;
4106 int
4107 main ()
4108 {
4109 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4110   ;
4111   return 0;
4112 }
4113 _ACEOF
4114 # Don't try gcc -ansi; that turns off useful extensions and
4115 # breaks some systems' header files.
4116 # AIX                   -qlanglvl=ansi
4117 # Ultrix and OSF/1      -std1
4118 # HP-UX 10.20 and later -Ae
4119 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4120 # SVR4                  -Xc -D__EXTENSIONS__
4121 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4122 do
4123   CC="$ac_save_CC $ac_arg"
4124   rm -f conftest.$ac_objext
4125 if { (eval echo "$as_me:4125: \"$ac_compile\"") >&5
4126   (eval $ac_compile) 2>&5
4127   ac_status=$?
4128   echo "$as_me:4128: \$? = $ac_status" >&5
4129   (exit $ac_status); } &&
4130          { ac_try='test -s conftest.$ac_objext'
4131   { (eval echo "$as_me:4131: \"$ac_try\"") >&5
4132   (eval $ac_try) 2>&5
4133   ac_status=$?
4134   echo "$as_me:4134: \$? = $ac_status" >&5
4135   (exit $ac_status); }; }; then
4136   ac_cv_prog_cc_stdc=$ac_arg
4137 break
4138 else
4139   echo "$as_me: failed program was:" >&5
4140 cat conftest.$ac_ext >&5
4141 fi
4142 rm -f conftest.$ac_objext
4143 done
4144 rm -f conftest.$ac_ext conftest.$ac_objext
4145 CC=$ac_save_CC
4146
4147 fi
4148
4149 case "x$ac_cv_prog_cc_stdc" in
4150   x|xno)
4151     echo "$as_me:4151: result: none needed" >&5
4152 echo "${ECHO_T}none needed" >&6 ;;
4153   *)
4154     echo "$as_me:4154: result: $ac_cv_prog_cc_stdc" >&5
4155 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
4156     CC="$CC $ac_cv_prog_cc_stdc" ;;
4157 esac
4158
4159 echo "$as_me:4159: checking for an ANSI C-conforming const" >&5
4160 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
4161 if test "${ac_cv_c_const+set}" = set; then
4162   echo $ECHO_N "(cached) $ECHO_C" >&6
4163 else
4164   cat >conftest.$ac_ext <<_ACEOF
4165 #line 4165 "configure"
4166 #include "confdefs.h"
4167
4168 int
4169 main ()
4170 {
4171 /* FIXME: Include the comments suggested by Paul. */
4172 #ifndef __cplusplus
4173   /* Ultrix mips cc rejects this.  */
4174   typedef int charset[2];
4175   const charset x;
4176   /* SunOS 4.1.1 cc rejects this.  */
4177   char const *const *ccp;
4178   char **p;
4179   /* NEC SVR4.0.2 mips cc rejects this.  */
4180   struct point {int x, y;};
4181   static struct point const zero = {0,0};
4182   /* AIX XL C 1.02.0.0 rejects this.
4183      It does not let you subtract one const X* pointer from another in
4184      an arm of an if-expression whose if-part is not a constant
4185      expression */
4186   const char *g = "string";
4187   ccp = &g + (g ? g-g : 0);
4188   /* HPUX 7.0 cc rejects these. */
4189   ++ccp;
4190   p = (char**) ccp;
4191   ccp = (char const *const *) p;
4192   { /* SCO 3.2v4 cc rejects this.  */
4193     char *t;
4194     char const *s = 0 ? (char *) 0 : (char const *) 0;
4195
4196     *t++ = 0;
4197   }
4198   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4199     int x[] = {25, 17};
4200     const int *foo = &x[0];
4201     ++foo;
4202   }
4203   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4204     typedef const int *iptr;
4205     iptr p = 0;
4206     ++p;
4207   }
4208   { /* AIX XL C 1.02.0.0 rejects this saying
4209        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4210     struct s { int j; const int *ap[3]; };
4211     struct s *b; b->j = 5;
4212   }
4213   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4214     const int foo = 10;
4215   }
4216 #endif
4217
4218   ;
4219   return 0;
4220 }
4221 _ACEOF
4222 rm -f conftest.$ac_objext
4223 if { (eval echo "$as_me:4223: \"$ac_compile\"") >&5
4224   (eval $ac_compile) 2>&5
4225   ac_status=$?
4226   echo "$as_me:4226: \$? = $ac_status" >&5
4227   (exit $ac_status); } &&
4228          { ac_try='test -s conftest.$ac_objext'
4229   { (eval echo "$as_me:4229: \"$ac_try\"") >&5
4230   (eval $ac_try) 2>&5
4231   ac_status=$?
4232   echo "$as_me:4232: \$? = $ac_status" >&5
4233   (exit $ac_status); }; }; then
4234   ac_cv_c_const=yes
4235 else
4236   echo "$as_me: failed program was:" >&5
4237 cat conftest.$ac_ext >&5
4238 ac_cv_c_const=no
4239 fi
4240 rm -f conftest.$ac_objext conftest.$ac_ext
4241 fi
4242 echo "$as_me:4242: result: $ac_cv_c_const" >&5
4243 echo "${ECHO_T}$ac_cv_c_const" >&6
4244 if test $ac_cv_c_const = no; then
4245
4246 cat >>confdefs.h <<\EOF
4247 #define const
4248 EOF
4249
4250 fi
4251
4252 echo "$as_me:4252: checking for signal global datatype" >&5
4253 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4254 if test "${cf_cv_sig_atomic_t+set}" = set; then
4255   echo $ECHO_N "(cached) $ECHO_C" >&6
4256 else
4257
4258         for cf_type in \
4259                 "volatile sig_atomic_t" \
4260                 "sig_atomic_t" \
4261                 "int"
4262         do
4263         cat >conftest.$ac_ext <<_ACEOF
4264 #line 4264 "configure"
4265 #include "confdefs.h"
4266
4267 #include <sys/types.h>
4268 #include <signal.h>
4269 #include <stdio.h>
4270
4271 extern $cf_type x;
4272 $cf_type x;
4273 static void handler(int sig)
4274 {
4275         x = 5;
4276 }
4277 int
4278 main ()
4279 {
4280 signal(SIGINT, handler);
4281                  x = 1
4282   ;
4283   return 0;
4284 }
4285 _ACEOF
4286 rm -f conftest.$ac_objext
4287 if { (eval echo "$as_me:4287: \"$ac_compile\"") >&5
4288   (eval $ac_compile) 2>&5
4289   ac_status=$?
4290   echo "$as_me:4290: \$? = $ac_status" >&5
4291   (exit $ac_status); } &&
4292          { ac_try='test -s conftest.$ac_objext'
4293   { (eval echo "$as_me:4293: \"$ac_try\"") >&5
4294   (eval $ac_try) 2>&5
4295   ac_status=$?
4296   echo "$as_me:4296: \$? = $ac_status" >&5
4297   (exit $ac_status); }; }; then
4298   cf_cv_sig_atomic_t=$cf_type
4299 else
4300   echo "$as_me: failed program was:" >&5
4301 cat conftest.$ac_ext >&5
4302 cf_cv_sig_atomic_t=no
4303 fi
4304 rm -f conftest.$ac_objext conftest.$ac_ext
4305                 test "$cf_cv_sig_atomic_t" != no && break
4306         done
4307
4308 fi
4309
4310 echo "$as_me:4310: result: $cf_cv_sig_atomic_t" >&5
4311 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4312 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
4313 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4314 EOF
4315
4316 echo "$as_me:4316: checking if you want to see long compiling messages" >&5
4317 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4318
4319 # Check whether --enable-echo or --disable-echo was given.
4320 if test "${enable_echo+set}" = set; then
4321   enableval="$enable_echo"
4322   test "$enableval" != no && enableval=yes
4323   if test "$enableval" != "yes" ; then
4324
4325     ECHO_LT='--silent'
4326     ECHO_LD='@echo linking $@;'
4327     RULE_CC='@echo compiling $<'
4328     SHOW_CC='@echo compiling $@'
4329     ECHO_CC='@'
4330
4331   else
4332
4333     ECHO_LT=''
4334     ECHO_LD=''
4335     RULE_CC=''
4336     SHOW_CC=''
4337     ECHO_CC=''
4338
4339   fi
4340 else
4341   enableval=yes
4342
4343     ECHO_LT=''
4344     ECHO_LD=''
4345     RULE_CC=''
4346     SHOW_CC=''
4347     ECHO_CC=''
4348
4349 fi;
4350 echo "$as_me:4350: result: $enableval" >&5
4351 echo "${ECHO_T}$enableval" >&6
4352
4353 GCC_VERSION=none
4354 if test "$GCC" = yes ; then
4355         echo "$as_me:4355: checking version of $CC" >&5
4356 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
4357         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
4358         test -z "$GCC_VERSION" && GCC_VERSION=unknown
4359         echo "$as_me:4359: result: $GCC_VERSION" >&5
4360 echo "${ECHO_T}$GCC_VERSION" >&6
4361 fi
4362
4363 if ( test "$GCC" = yes || test "$GXX" = yes )
4364 then
4365 echo "$as_me:4365: checking if you want to turn on gcc warnings" >&5
4366 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
4367
4368 # Check whether --enable-warnings or --disable-warnings was given.
4369 if test "${enable_warnings+set}" = set; then
4370   enableval="$enable_warnings"
4371   test "$enableval" != yes && enableval=no
4372   if test "$enableval" != "no" ; then
4373     with_warnings=yes
4374   else
4375     with_warnings=no
4376   fi
4377 else
4378   enableval=no
4379   with_warnings=no
4380
4381 fi;
4382 echo "$as_me:4382: result: $with_warnings" >&5
4383 echo "${ECHO_T}$with_warnings" >&6
4384 if test "$with_warnings" = "yes"
4385 then
4386
4387 if test "$GCC" = yes
4388 then
4389 cat > conftest.i <<EOF
4390 #ifndef GCC_PRINTF
4391 #define GCC_PRINTF 0
4392 #endif
4393 #ifndef GCC_SCANF
4394 #define GCC_SCANF 0
4395 #endif
4396 #ifndef GCC_NORETURN
4397 #define GCC_NORETURN /* nothing */
4398 #endif
4399 #ifndef GCC_UNUSED
4400 #define GCC_UNUSED /* nothing */
4401 #endif
4402 EOF
4403 if test "$GCC" = yes
4404 then
4405         { echo "$as_me:4405: checking for $CC __attribute__ directives..." >&5
4406 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
4407 cat > conftest.$ac_ext <<EOF
4408 #line 4408 "${as_me:-configure}"
4409 #include "confdefs.h"
4410 #include "conftest.h"
4411 #include "conftest.i"
4412 #if     GCC_PRINTF
4413 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4414 #else
4415 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4416 #endif
4417 #if     GCC_SCANF
4418 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4419 #else
4420 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4421 #endif
4422 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4423 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4424 extern void foo(void) GCC_NORETURN;
4425 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4426 EOF
4427         cf_printf_attribute=no
4428         cf_scanf_attribute=no
4429         for cf_attribute in scanf printf unused noreturn
4430         do
4431
4432 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4433
4434                 cf_directive="__attribute__(($cf_attribute))"
4435                 echo "checking for $CC $cf_directive" 1>&5
4436
4437                 case $cf_attribute in #(vi
4438                 printf) #(vi
4439                         cf_printf_attribute=yes
4440                         cat >conftest.h <<EOF
4441 #define GCC_$cf_ATTRIBUTE 1
4442 EOF
4443                         ;;
4444                 scanf) #(vi
4445                         cf_scanf_attribute=yes
4446                         cat >conftest.h <<EOF
4447 #define GCC_$cf_ATTRIBUTE 1
4448 EOF
4449                         ;;
4450                 *) #(vi
4451                         cat >conftest.h <<EOF
4452 #define GCC_$cf_ATTRIBUTE $cf_directive
4453 EOF
4454                         ;;
4455                 esac
4456
4457                 if { (eval echo "$as_me:4457: \"$ac_compile\"") >&5
4458   (eval $ac_compile) 2>&5
4459   ac_status=$?
4460   echo "$as_me:4460: \$? = $ac_status" >&5
4461   (exit $ac_status); }; then
4462                         test -n "$verbose" && echo "$as_me:4462: result: ... $cf_attribute" >&5
4463 echo "${ECHO_T}... $cf_attribute" >&6
4464                         cat conftest.h >>confdefs.h
4465                         case $cf_attribute in #(vi
4466                         printf) #(vi
4467                                 if test "$cf_printf_attribute" = no ; then
4468                                         cat >>confdefs.h <<EOF
4469 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
4470 EOF
4471                                 else
4472                                         cat >>confdefs.h <<EOF
4473 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4474 EOF
4475                                 fi
4476                                 ;;
4477                         scanf) #(vi
4478                                 if test "$cf_scanf_attribute" = no ; then
4479                                         cat >>confdefs.h <<EOF
4480 #define GCC_SCANFLIKE(fmt,var) /* nothing */
4481 EOF
4482                                 else
4483                                         cat >>confdefs.h <<EOF
4484 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4485 EOF
4486                                 fi
4487                                 ;;
4488                         esac
4489                 fi
4490         done
4491 else
4492         fgrep define conftest.i >>confdefs.h
4493 fi
4494 rm -rf conftest*
4495 fi
4496
4497 INTEL_COMPILER=no
4498
4499 if test "$GCC" = yes ; then
4500         case $host_os in
4501         linux*|gnu*)
4502                 echo "$as_me:4502: checking if this is really Intel C compiler" >&5
4503 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
4504                 cf_save_CFLAGS="$CFLAGS"
4505                 CFLAGS="$CFLAGS -no-gcc"
4506                 cat >conftest.$ac_ext <<_ACEOF
4507 #line 4507 "configure"
4508 #include "confdefs.h"
4509
4510 int
4511 main ()
4512 {
4513
4514 #ifdef __INTEL_COMPILER
4515 #else
4516 make an error
4517 #endif
4518
4519   ;
4520   return 0;
4521 }
4522 _ACEOF
4523 rm -f conftest.$ac_objext
4524 if { (eval echo "$as_me:4524: \"$ac_compile\"") >&5
4525   (eval $ac_compile) 2>&5
4526   ac_status=$?
4527   echo "$as_me:4527: \$? = $ac_status" >&5
4528   (exit $ac_status); } &&
4529          { ac_try='test -s conftest.$ac_objext'
4530   { (eval echo "$as_me:4530: \"$ac_try\"") >&5
4531   (eval $ac_try) 2>&5
4532   ac_status=$?
4533   echo "$as_me:4533: \$? = $ac_status" >&5
4534   (exit $ac_status); }; }; then
4535   INTEL_COMPILER=yes
4536 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
4537
4538 else
4539   echo "$as_me: failed program was:" >&5
4540 cat conftest.$ac_ext >&5
4541 fi
4542 rm -f conftest.$ac_objext conftest.$ac_ext
4543                 CFLAGS="$cf_save_CFLAGS"
4544                 echo "$as_me:4544: result: $INTEL_COMPILER" >&5
4545 echo "${ECHO_T}$INTEL_COMPILER" >&6
4546                 ;;
4547         esac
4548 fi
4549
4550 cat > conftest.$ac_ext <<EOF
4551 #line 4551 "${as_me:-configure}"
4552 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4553 EOF
4554
4555 if test "$INTEL_COMPILER" = yes
4556 then
4557 # The "-wdXXX" options suppress warnings:
4558 # remark #1419: external declaration in primary source file
4559 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4560 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4561 # remark #193: zero used for undefined preprocessing identifier
4562 # remark #593: variable "curs_sb_left_arrow" was set but never used
4563 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4564 # remark #869: parameter "tw" was never referenced
4565 # remark #981: operands are evaluated in unspecified order
4566 # warning #279: controlling expression is constant
4567
4568         { echo "$as_me:4568: checking for $CC warning options..." >&5
4569 echo "$as_me: checking for $CC warning options..." >&6;}
4570         cf_save_CFLAGS="$CFLAGS"
4571         EXTRA_CFLAGS="-Wall"
4572         for cf_opt in \
4573                 wd1419 \
4574                 wd1683 \
4575                 wd1684 \
4576                 wd193 \
4577                 wd593 \
4578                 wd279 \
4579                 wd810 \
4580                 wd869 \
4581                 wd981
4582         do
4583                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4584                 if { (eval echo "$as_me:4584: \"$ac_compile\"") >&5
4585   (eval $ac_compile) 2>&5
4586   ac_status=$?
4587   echo "$as_me:4587: \$? = $ac_status" >&5
4588   (exit $ac_status); }; then
4589                         test -n "$verbose" && echo "$as_me:4589: result: ... -$cf_opt" >&5
4590 echo "${ECHO_T}... -$cf_opt" >&6
4591                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4592                 fi
4593         done
4594         CFLAGS="$cf_save_CFLAGS"
4595
4596 elif test "$GCC" = yes
4597 then
4598         { echo "$as_me:4598: checking for $CC warning options..." >&5
4599 echo "$as_me: checking for $CC warning options..." >&6;}
4600         cf_save_CFLAGS="$CFLAGS"
4601         EXTRA_CFLAGS=
4602         cf_warn_CONST=""
4603         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4604         for cf_opt in W Wall \
4605                 Wbad-function-cast \
4606                 Wcast-align \
4607                 Wcast-qual \
4608                 Winline \
4609                 Wmissing-declarations \
4610                 Wmissing-prototypes \
4611                 Wnested-externs \
4612                 Wpointer-arith \
4613                 Wshadow \
4614                 Wstrict-prototypes \
4615                 Wundef $cf_warn_CONST
4616         do
4617                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4618                 if { (eval echo "$as_me:4618: \"$ac_compile\"") >&5
4619   (eval $ac_compile) 2>&5
4620   ac_status=$?
4621   echo "$as_me:4621: \$? = $ac_status" >&5
4622   (exit $ac_status); }; then
4623                         test -n "$verbose" && echo "$as_me:4623: result: ... -$cf_opt" >&5
4624 echo "${ECHO_T}... -$cf_opt" >&6
4625                         case $cf_opt in #(vi
4626                         Wcast-qual) #(vi
4627                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4628                                 ;;
4629                         Winline) #(vi
4630                                 case $GCC_VERSION in
4631                                 [34].*)
4632                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4633
4634 echo "${as_me:-configure}:4634: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4635
4636                                         continue;;
4637                                 esac
4638                                 ;;
4639                         esac
4640                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4641                 fi
4642         done
4643         CFLAGS="$cf_save_CFLAGS"
4644 fi
4645 rm -rf conftest*
4646
4647 fi
4648 fi
4649
4650 echo "$as_me:4650: checking if you want to use dmalloc for testing" >&5
4651 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4652
4653 # Check whether --with-dmalloc or --without-dmalloc was given.
4654 if test "${with_dmalloc+set}" = set; then
4655   withval="$with_dmalloc"
4656   cat >>confdefs.h <<\EOF
4657 #define USE_DMALLOC 1
4658 EOF
4659
4660         : ${with_cflags:=-g}
4661         : ${with_no_leaks:=yes}
4662          with_dmalloc=yes
4663 else
4664   with_dmalloc=
4665 fi;
4666 echo "$as_me:4666: result: ${with_dmalloc:-no}" >&5
4667 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4668
4669 case .$with_cflags in #(vi
4670 .*-g*)
4671         case .$CFLAGS in #(vi
4672         .*-g*) #(vi
4673                 ;;
4674         *)
4675
4676 cf_fix_cppflags=no
4677 cf_new_cflags=
4678 cf_new_cppflags=
4679 cf_new_extra_cppflags=
4680
4681 for cf_add_cflags in -g
4682 do
4683 case $cf_fix_cppflags in
4684 no)
4685         case $cf_add_cflags in #(vi
4686         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4687                 case $cf_add_cflags in
4688                 -D*)
4689                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4690
4691                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4692                                 && test -z "${cf_tst_cflags}" \
4693                                 && cf_fix_cppflags=yes
4694
4695                         if test $cf_fix_cppflags = yes ; then
4696                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4697                                 continue
4698                         elif test "${cf_tst_cflags}" = "\"'" ; then
4699                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4700                                 continue
4701                         fi
4702                         ;;
4703                 esac
4704                 case "$CPPFLAGS" in
4705                 *$cf_add_cflags) #(vi
4706                         ;;
4707                 *) #(vi
4708                         case $cf_add_cflags in #(vi
4709                         -D*)
4710                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4711
4712 CPPFLAGS=`echo "$CPPFLAGS" | \
4713         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4714                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4715
4716                                 ;;
4717                         esac
4718                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4719                         ;;
4720                 esac
4721                 ;;
4722         *)
4723                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4724                 ;;
4725         esac
4726         ;;
4727 yes)
4728         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4729
4730         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4731
4732         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4733                 && test -z "${cf_tst_cflags}" \
4734                 && cf_fix_cppflags=no
4735         ;;
4736 esac
4737 done
4738
4739 if test -n "$cf_new_cflags" ; then
4740
4741         CFLAGS="$CFLAGS $cf_new_cflags"
4742 fi
4743
4744 if test -n "$cf_new_cppflags" ; then
4745
4746         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4747 fi
4748
4749 if test -n "$cf_new_extra_cppflags" ; then
4750
4751         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4752 fi
4753
4754                 ;;
4755         esac
4756         ;;
4757 esac
4758
4759 if test "$with_dmalloc" = yes ; then
4760         echo "$as_me:4760: checking for dmalloc.h" >&5
4761 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4762 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4763   echo $ECHO_N "(cached) $ECHO_C" >&6
4764 else
4765   cat >conftest.$ac_ext <<_ACEOF
4766 #line 4766 "configure"
4767 #include "confdefs.h"
4768 #include <dmalloc.h>
4769 _ACEOF
4770 if { (eval echo "$as_me:4770: \"$ac_cpp conftest.$ac_ext\"") >&5
4771   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4772   ac_status=$?
4773   egrep -v '^ *\+' conftest.er1 >conftest.err
4774   rm -f conftest.er1
4775   cat conftest.err >&5
4776   echo "$as_me:4776: \$? = $ac_status" >&5
4777   (exit $ac_status); } >/dev/null; then
4778   if test -s conftest.err; then
4779     ac_cpp_err=$ac_c_preproc_warn_flag
4780   else
4781     ac_cpp_err=
4782   fi
4783 else
4784   ac_cpp_err=yes
4785 fi
4786 if test -z "$ac_cpp_err"; then
4787   ac_cv_header_dmalloc_h=yes
4788 else
4789   echo "$as_me: failed program was:" >&5
4790   cat conftest.$ac_ext >&5
4791   ac_cv_header_dmalloc_h=no
4792 fi
4793 rm -f conftest.err conftest.$ac_ext
4794 fi
4795 echo "$as_me:4795: result: $ac_cv_header_dmalloc_h" >&5
4796 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4797 if test $ac_cv_header_dmalloc_h = yes; then
4798
4799 echo "$as_me:4799: checking for dmalloc_debug in -ldmalloc" >&5
4800 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4801 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4802   echo $ECHO_N "(cached) $ECHO_C" >&6
4803 else
4804   ac_check_lib_save_LIBS=$LIBS
4805 LIBS="-ldmalloc  $LIBS"
4806 cat >conftest.$ac_ext <<_ACEOF
4807 #line 4807 "configure"
4808 #include "confdefs.h"
4809
4810 /* Override any gcc2 internal prototype to avoid an error.  */
4811 #ifdef __cplusplus
4812 extern "C"
4813 #endif
4814 /* We use char because int might match the return type of a gcc2
4815    builtin and then its argument prototype would still apply.  */
4816 char dmalloc_debug ();
4817 int
4818 main ()
4819 {
4820 dmalloc_debug ();
4821   ;
4822   return 0;
4823 }
4824 _ACEOF
4825 rm -f conftest.$ac_objext conftest$ac_exeext
4826 if { (eval echo "$as_me:4826: \"$ac_link\"") >&5
4827   (eval $ac_link) 2>&5
4828   ac_status=$?
4829   echo "$as_me:4829: \$? = $ac_status" >&5
4830   (exit $ac_status); } &&
4831          { ac_try='test -s conftest$ac_exeext'
4832   { (eval echo "$as_me:4832: \"$ac_try\"") >&5
4833   (eval $ac_try) 2>&5
4834   ac_status=$?
4835   echo "$as_me:4835: \$? = $ac_status" >&5
4836   (exit $ac_status); }; }; then
4837   ac_cv_lib_dmalloc_dmalloc_debug=yes
4838 else
4839   echo "$as_me: failed program was:" >&5
4840 cat conftest.$ac_ext >&5
4841 ac_cv_lib_dmalloc_dmalloc_debug=no
4842 fi
4843 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4844 LIBS=$ac_check_lib_save_LIBS
4845 fi
4846 echo "$as_me:4846: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4847 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4848 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4849   cat >>confdefs.h <<EOF
4850 #define HAVE_LIBDMALLOC 1
4851 EOF
4852
4853   LIBS="-ldmalloc $LIBS"
4854
4855 fi
4856
4857 fi
4858
4859 fi
4860
4861 echo "$as_me:4861: checking if you want to use dbmalloc for testing" >&5
4862 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4863
4864 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4865 if test "${with_dbmalloc+set}" = set; then
4866   withval="$with_dbmalloc"
4867   cat >>confdefs.h <<\EOF
4868 #define USE_DBMALLOC 1
4869 EOF
4870
4871         : ${with_cflags:=-g}
4872         : ${with_no_leaks:=yes}
4873          with_dbmalloc=yes
4874 else
4875   with_dbmalloc=
4876 fi;
4877 echo "$as_me:4877: result: ${with_dbmalloc:-no}" >&5
4878 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4879
4880 case .$with_cflags in #(vi
4881 .*-g*)
4882         case .$CFLAGS in #(vi
4883         .*-g*) #(vi
4884                 ;;
4885         *)
4886
4887 cf_fix_cppflags=no
4888 cf_new_cflags=
4889 cf_new_cppflags=
4890 cf_new_extra_cppflags=
4891
4892 for cf_add_cflags in -g
4893 do
4894 case $cf_fix_cppflags in
4895 no)
4896         case $cf_add_cflags in #(vi
4897         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4898                 case $cf_add_cflags in
4899                 -D*)
4900                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4901
4902                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4903                                 && test -z "${cf_tst_cflags}" \
4904                                 && cf_fix_cppflags=yes
4905
4906                         if test $cf_fix_cppflags = yes ; then
4907                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4908                                 continue
4909                         elif test "${cf_tst_cflags}" = "\"'" ; then
4910                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4911                                 continue
4912                         fi
4913                         ;;
4914                 esac
4915                 case "$CPPFLAGS" in
4916                 *$cf_add_cflags) #(vi
4917                         ;;
4918                 *) #(vi
4919                         case $cf_add_cflags in #(vi
4920                         -D*)
4921                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4922
4923 CPPFLAGS=`echo "$CPPFLAGS" | \
4924         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4925                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4926
4927                                 ;;
4928                         esac
4929                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4930                         ;;
4931                 esac
4932                 ;;
4933         *)
4934                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4935                 ;;
4936         esac
4937         ;;
4938 yes)
4939         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4940
4941         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4942
4943         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4944                 && test -z "${cf_tst_cflags}" \
4945                 && cf_fix_cppflags=no
4946         ;;
4947 esac
4948 done
4949
4950 if test -n "$cf_new_cflags" ; then
4951
4952         CFLAGS="$CFLAGS $cf_new_cflags"
4953 fi
4954
4955 if test -n "$cf_new_cppflags" ; then
4956
4957         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4958 fi
4959
4960 if test -n "$cf_new_extra_cppflags" ; then
4961
4962         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4963 fi
4964
4965                 ;;
4966         esac
4967         ;;
4968 esac
4969
4970 if test "$with_dbmalloc" = yes ; then
4971         echo "$as_me:4971: checking for dbmalloc.h" >&5
4972 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
4973 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
4974   echo $ECHO_N "(cached) $ECHO_C" >&6
4975 else
4976   cat >conftest.$ac_ext <<_ACEOF
4977 #line 4977 "configure"
4978 #include "confdefs.h"
4979 #include <dbmalloc.h>
4980 _ACEOF
4981 if { (eval echo "$as_me:4981: \"$ac_cpp conftest.$ac_ext\"") >&5
4982   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4983   ac_status=$?
4984   egrep -v '^ *\+' conftest.er1 >conftest.err
4985   rm -f conftest.er1
4986   cat conftest.err >&5
4987   echo "$as_me:4987: \$? = $ac_status" >&5
4988   (exit $ac_status); } >/dev/null; then
4989   if test -s conftest.err; then
4990     ac_cpp_err=$ac_c_preproc_warn_flag
4991   else
4992     ac_cpp_err=
4993   fi
4994 else
4995   ac_cpp_err=yes
4996 fi
4997 if test -z "$ac_cpp_err"; then
4998   ac_cv_header_dbmalloc_h=yes
4999 else
5000   echo "$as_me: failed program was:" >&5
5001   cat conftest.$ac_ext >&5
5002   ac_cv_header_dbmalloc_h=no
5003 fi
5004 rm -f conftest.err conftest.$ac_ext
5005 fi
5006 echo "$as_me:5006: result: $ac_cv_header_dbmalloc_h" >&5
5007 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
5008 if test $ac_cv_header_dbmalloc_h = yes; then
5009
5010 echo "$as_me:5010: checking for debug_malloc in -ldbmalloc" >&5
5011 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
5012 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
5013   echo $ECHO_N "(cached) $ECHO_C" >&6
5014 else
5015   ac_check_lib_save_LIBS=$LIBS
5016 LIBS="-ldbmalloc  $LIBS"
5017 cat >conftest.$ac_ext <<_ACEOF
5018 #line 5018 "configure"
5019 #include "confdefs.h"
5020
5021 /* Override any gcc2 internal prototype to avoid an error.  */
5022 #ifdef __cplusplus
5023 extern "C"
5024 #endif
5025 /* We use char because int might match the return type of a gcc2
5026    builtin and then its argument prototype would still apply.  */
5027 char debug_malloc ();
5028 int
5029 main ()
5030 {
5031 debug_malloc ();
5032   ;
5033   return 0;
5034 }
5035 _ACEOF
5036 rm -f conftest.$ac_objext conftest$ac_exeext
5037 if { (eval echo "$as_me:5037: \"$ac_link\"") >&5
5038   (eval $ac_link) 2>&5
5039   ac_status=$?
5040   echo "$as_me:5040: \$? = $ac_status" >&5
5041   (exit $ac_status); } &&
5042          { ac_try='test -s conftest$ac_exeext'
5043   { (eval echo "$as_me:5043: \"$ac_try\"") >&5
5044   (eval $ac_try) 2>&5
5045   ac_status=$?
5046   echo "$as_me:5046: \$? = $ac_status" >&5
5047   (exit $ac_status); }; }; then
5048   ac_cv_lib_dbmalloc_debug_malloc=yes
5049 else
5050   echo "$as_me: failed program was:" >&5
5051 cat conftest.$ac_ext >&5
5052 ac_cv_lib_dbmalloc_debug_malloc=no
5053 fi
5054 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5055 LIBS=$ac_check_lib_save_LIBS
5056 fi
5057 echo "$as_me:5057: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
5058 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
5059 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
5060   cat >>confdefs.h <<EOF
5061 #define HAVE_LIBDBMALLOC 1
5062 EOF
5063
5064   LIBS="-ldbmalloc $LIBS"
5065
5066 fi
5067
5068 fi
5069
5070 fi
5071
5072 echo "$as_me:5072: checking if you want to use valgrind for testing" >&5
5073 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
5074
5075 # Check whether --with-valgrind or --without-valgrind was given.
5076 if test "${with_valgrind+set}" = set; then
5077   withval="$with_valgrind"
5078   cat >>confdefs.h <<\EOF
5079 #define USE_VALGRIND 1
5080 EOF
5081
5082         : ${with_cflags:=-g}
5083         : ${with_no_leaks:=yes}
5084          with_valgrind=yes
5085 else
5086   with_valgrind=
5087 fi;
5088 echo "$as_me:5088: result: ${with_valgrind:-no}" >&5
5089 echo "${ECHO_T}${with_valgrind:-no}" >&6
5090
5091 case .$with_cflags in #(vi
5092 .*-g*)
5093         case .$CFLAGS in #(vi
5094         .*-g*) #(vi
5095                 ;;
5096         *)
5097
5098 cf_fix_cppflags=no
5099 cf_new_cflags=
5100 cf_new_cppflags=
5101 cf_new_extra_cppflags=
5102
5103 for cf_add_cflags in -g
5104 do
5105 case $cf_fix_cppflags in
5106 no)
5107         case $cf_add_cflags in #(vi
5108         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5109                 case $cf_add_cflags in
5110                 -D*)
5111                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5112
5113                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5114                                 && test -z "${cf_tst_cflags}" \
5115                                 && cf_fix_cppflags=yes
5116
5117                         if test $cf_fix_cppflags = yes ; then
5118                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5119                                 continue
5120                         elif test "${cf_tst_cflags}" = "\"'" ; then
5121                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5122                                 continue
5123                         fi
5124                         ;;
5125                 esac
5126                 case "$CPPFLAGS" in
5127                 *$cf_add_cflags) #(vi
5128                         ;;
5129                 *) #(vi
5130                         case $cf_add_cflags in #(vi
5131                         -D*)
5132                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5133
5134 CPPFLAGS=`echo "$CPPFLAGS" | \
5135         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5136                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5137
5138                                 ;;
5139                         esac
5140                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5141                         ;;
5142                 esac
5143                 ;;
5144         *)
5145                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5146                 ;;
5147         esac
5148         ;;
5149 yes)
5150         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5151
5152         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5153
5154         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5155                 && test -z "${cf_tst_cflags}" \
5156                 && cf_fix_cppflags=no
5157         ;;
5158 esac
5159 done
5160
5161 if test -n "$cf_new_cflags" ; then
5162
5163         CFLAGS="$CFLAGS $cf_new_cflags"
5164 fi
5165
5166 if test -n "$cf_new_cppflags" ; then
5167
5168         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5169 fi
5170
5171 if test -n "$cf_new_extra_cppflags" ; then
5172
5173         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5174 fi
5175
5176                 ;;
5177         esac
5178         ;;
5179 esac
5180
5181 echo "$as_me:5181: checking if you want to perform memory-leak testing" >&5
5182 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
5183
5184 # Check whether --enable-leaks or --disable-leaks was given.
5185 if test "${enable_leaks+set}" = set; then
5186   enableval="$enable_leaks"
5187   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
5188 else
5189   : ${with_no_leaks:=no}
5190 fi;
5191 echo "$as_me:5191: result: $with_no_leaks" >&5
5192 echo "${ECHO_T}$with_no_leaks" >&6
5193
5194 if test "$with_no_leaks" = yes ; then
5195         cat >>confdefs.h <<\EOF
5196 #define NO_LEAKS 1
5197 EOF
5198
5199         cat >>confdefs.h <<\EOF
5200 #define YY_NO_LEAKS 1
5201 EOF
5202
5203 fi
5204
5205 echo "$as_me:5205: checking if you want to check for wide-character functions" >&5
5206 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5207
5208 # Check whether --enable-widec or --disable-widec was given.
5209 if test "${enable_widec+set}" = set; then
5210   enableval="$enable_widec"
5211   test "$enableval" != no && enableval=yes
5212   if test "$enableval" != "yes" ; then
5213     cf_enable_widec=no
5214   else
5215     cf_enable_widec=yes
5216   fi
5217 else
5218   enableval=yes
5219   cf_enable_widec=yes
5220
5221 fi;
5222 echo "$as_me:5222: result: $cf_enable_widec" >&5
5223 echo "${ECHO_T}$cf_enable_widec" >&6
5224
5225 echo "$as_me:5225: checking for specific curses-directory" >&5
5226 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5227
5228 # Check whether --with-curses-dir or --without-curses-dir was given.
5229 if test "${with_curses_dir+set}" = set; then
5230   withval="$with_curses_dir"
5231   cf_cv_curses_dir=$withval
5232 else
5233   cf_cv_curses_dir=no
5234 fi;
5235 echo "$as_me:5235: result: $cf_cv_curses_dir" >&5
5236 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5237
5238 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5239 then
5240
5241 if test "x$prefix" != xNONE; then
5242   cf_path_syntax="$prefix"
5243 else
5244   cf_path_syntax="$ac_default_prefix"
5245 fi
5246
5247 case ".$withval" in #(vi
5248 .\$\(*\)*|.\'*\'*) #(vi
5249   ;;
5250 ..|./*|.\\*) #(vi
5251   ;;
5252 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5253   ;;
5254 .\${*prefix}*) #(vi
5255   eval withval="$withval"
5256   case ".$withval" in #(vi
5257   .NONE/*)
5258     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5259     ;;
5260   esac
5261   ;; #(vi
5262 .no|.NONE/*)
5263   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5264   ;;
5265 *)
5266   { { echo "$as_me:5266: error: expected a pathname, not \"$withval\"" >&5
5267 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5268    { (exit 1); exit 1; }; }
5269   ;;
5270 esac
5271
5272         if test -d "$cf_cv_curses_dir"
5273         then
5274
5275 if test -n "$cf_cv_curses_dir/include" ; then
5276   for cf_add_incdir in $cf_cv_curses_dir/include
5277   do
5278         while test $cf_add_incdir != /usr/include
5279         do
5280           if test -d $cf_add_incdir
5281           then
5282                 cf_have_incdir=no
5283                 if test -n "$CFLAGS$CPPFLAGS" ; then
5284                   # a loop is needed to ensure we can add subdirs of existing dirs
5285                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5286                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5287                           cf_have_incdir=yes; break
5288                         fi
5289                   done
5290                 fi
5291
5292                 if test "$cf_have_incdir" = no ; then
5293                   if test "$cf_add_incdir" = /usr/local/include ; then
5294                         if test "$GCC" = yes
5295                         then
5296                           cf_save_CPPFLAGS=$CPPFLAGS
5297                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5298                           cat >conftest.$ac_ext <<_ACEOF
5299 #line 5299 "configure"
5300 #include "confdefs.h"
5301 #include <stdio.h>
5302 int
5303 main ()
5304 {
5305 printf("Hello")
5306   ;
5307   return 0;
5308 }
5309 _ACEOF
5310 rm -f conftest.$ac_objext
5311 if { (eval echo "$as_me:5311: \"$ac_compile\"") >&5
5312   (eval $ac_compile) 2>&5
5313   ac_status=$?
5314   echo "$as_me:5314: \$? = $ac_status" >&5
5315   (exit $ac_status); } &&
5316          { ac_try='test -s conftest.$ac_objext'
5317   { (eval echo "$as_me:5317: \"$ac_try\"") >&5
5318   (eval $ac_try) 2>&5
5319   ac_status=$?
5320   echo "$as_me:5320: \$? = $ac_status" >&5
5321   (exit $ac_status); }; }; then
5322   :
5323 else
5324   echo "$as_me: failed program was:" >&5
5325 cat conftest.$ac_ext >&5
5326 cf_have_incdir=yes
5327 fi
5328 rm -f conftest.$ac_objext conftest.$ac_ext
5329                           CPPFLAGS=$cf_save_CPPFLAGS
5330                         fi
5331                   fi
5332                 fi
5333
5334                 if test "$cf_have_incdir" = no ; then
5335                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5336
5337 echo "${as_me:-configure}:5337: testing adding $cf_add_incdir to include-path ..." 1>&5
5338
5339                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5340
5341                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5342                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5343                   cf_add_incdir="$cf_top_incdir"
5344                 else
5345                   break
5346                 fi
5347           fi
5348         done
5349   done
5350 fi
5351
5352 if test -n "$cf_cv_curses_dir/lib" ; then
5353   for cf_add_libdir in $cf_cv_curses_dir/lib
5354   do
5355     if test $cf_add_libdir = /usr/lib ; then
5356       :
5357     elif test -d $cf_add_libdir
5358     then
5359       cf_have_libdir=no
5360       if test -n "$LDFLAGS$LIBS" ; then
5361         # a loop is needed to ensure we can add subdirs of existing dirs
5362         for cf_test_libdir in $LDFLAGS $LIBS ; do
5363           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5364             cf_have_libdir=yes; break
5365           fi
5366         done
5367       fi
5368       if test "$cf_have_libdir" = no ; then
5369         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5370
5371 echo "${as_me:-configure}:5371: testing adding $cf_add_libdir to library-path ..." 1>&5
5372
5373         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5374       fi
5375     fi
5376   done
5377 fi
5378
5379         fi
5380 fi
5381
5382 echo "$as_me:5382: checking for specified curses library type" >&5
5383 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5384
5385 # Check whether --with-ncursesw or --without-ncursesw was given.
5386 if test "${with_ncursesw+set}" = set; then
5387   withval="$with_ncursesw"
5388   cf_cv_screen=ncursesw
5389 else
5390
5391 # Check whether --with-ncurses or --without-ncurses was given.
5392 if test "${with_ncurses+set}" = set; then
5393   withval="$with_ncurses"
5394   cf_cv_screen=ncurses
5395 else
5396
5397 # Check whether --with-pdcurses or --without-pdcurses was given.
5398 if test "${with_pdcurses+set}" = set; then
5399   withval="$with_pdcurses"
5400   cf_cv_screen=pdcurses
5401 else
5402
5403 # Check whether --with-curses-colr or --without-curses-colr was given.
5404 if test "${with_curses_colr+set}" = set; then
5405   withval="$with_curses_colr"
5406   cf_cv_screen=curses_colr
5407 else
5408
5409 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5410 if test "${with_curses_5lib+set}" = set; then
5411   withval="$with_curses_5lib"
5412   cf_cv_screen=curses_5lib
5413 fi;
5414 fi;
5415 fi;
5416 fi;
5417 fi;
5418
5419 echo "$as_me:5419: result: $cf_cv_screen" >&5
5420 echo "${ECHO_T}$cf_cv_screen" >&6
5421
5422 case $cf_cv_screen in
5423 curses|curses_*)
5424
5425 echo "$as_me:5425: checking for extra include directories" >&5
5426 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5427 if test "${cf_cv_curses_incdir+set}" = set; then
5428   echo $ECHO_N "(cached) $ECHO_C" >&6
5429 else
5430
5431 cf_cv_curses_incdir=no
5432 case $host_os in #(vi
5433 hpux10.*) #(vi
5434         if test "x$cf_cv_screen" = "xcurses_colr"
5435         then
5436                 test -d /usr/include/curses_colr && \
5437                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5438         fi
5439         ;;
5440 sunos3*|sunos4*)
5441         if test "x$cf_cv_screen" = "xcurses_5lib"
5442         then
5443                 test -d /usr/5lib && \
5444                 test -d /usr/5include && \
5445                 cf_cv_curses_incdir="-I/usr/5include"
5446         fi
5447         ;;
5448 esac
5449
5450 fi
5451 echo "$as_me:5451: result: $cf_cv_curses_incdir" >&5
5452 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5453 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5454
5455 echo "$as_me:5455: checking if we have identified curses headers" >&5
5456 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5457 if test "${cf_cv_ncurses_header+set}" = set; then
5458   echo $ECHO_N "(cached) $ECHO_C" >&6
5459 else
5460
5461 cf_cv_ncurses_header=none
5462 for cf_header in  \
5463         ncurses.h \
5464         curses.h ncurses/ncurses.h ncurses/curses.h
5465 do
5466 cat >conftest.$ac_ext <<_ACEOF
5467 #line 5467 "configure"
5468 #include "confdefs.h"
5469 #include <${cf_header}>
5470 int
5471 main ()
5472 {
5473 initscr(); tgoto("?", 0,0)
5474   ;
5475   return 0;
5476 }
5477 _ACEOF
5478 rm -f conftest.$ac_objext
5479 if { (eval echo "$as_me:5479: \"$ac_compile\"") >&5
5480   (eval $ac_compile) 2>&5
5481   ac_status=$?
5482   echo "$as_me:5482: \$? = $ac_status" >&5
5483   (exit $ac_status); } &&
5484          { ac_try='test -s conftest.$ac_objext'
5485   { (eval echo "$as_me:5485: \"$ac_try\"") >&5
5486   (eval $ac_try) 2>&5
5487   ac_status=$?
5488   echo "$as_me:5488: \$? = $ac_status" >&5
5489   (exit $ac_status); }; }; then
5490   cf_cv_ncurses_header=$cf_header; break
5491 else
5492   echo "$as_me: failed program was:" >&5
5493 cat conftest.$ac_ext >&5
5494 fi
5495 rm -f conftest.$ac_objext conftest.$ac_ext
5496 done
5497
5498 fi
5499 echo "$as_me:5499: result: $cf_cv_ncurses_header" >&5
5500 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5501
5502 if test "$cf_cv_ncurses_header" = none ; then
5503         { { echo "$as_me:5503: error: No curses header-files found" >&5
5504 echo "$as_me: error: No curses header-files found" >&2;}
5505    { (exit 1); exit 1; }; }
5506 fi
5507
5508 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5509
5510 for ac_header in $cf_cv_ncurses_header
5511 do
5512 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5513 echo "$as_me:5513: checking for $ac_header" >&5
5514 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5515 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5516   echo $ECHO_N "(cached) $ECHO_C" >&6
5517 else
5518   cat >conftest.$ac_ext <<_ACEOF
5519 #line 5519 "configure"
5520 #include "confdefs.h"
5521 #include <$ac_header>
5522 _ACEOF
5523 if { (eval echo "$as_me:5523: \"$ac_cpp conftest.$ac_ext\"") >&5
5524   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5525   ac_status=$?
5526   egrep -v '^ *\+' conftest.er1 >conftest.err
5527   rm -f conftest.er1
5528   cat conftest.err >&5
5529   echo "$as_me:5529: \$? = $ac_status" >&5
5530   (exit $ac_status); } >/dev/null; then
5531   if test -s conftest.err; then
5532     ac_cpp_err=$ac_c_preproc_warn_flag
5533   else
5534     ac_cpp_err=
5535   fi
5536 else
5537   ac_cpp_err=yes
5538 fi
5539 if test -z "$ac_cpp_err"; then
5540   eval "$as_ac_Header=yes"
5541 else
5542   echo "$as_me: failed program was:" >&5
5543   cat conftest.$ac_ext >&5
5544   eval "$as_ac_Header=no"
5545 fi
5546 rm -f conftest.err conftest.$ac_ext
5547 fi
5548 echo "$as_me:5548: result: `eval echo '${'$as_ac_Header'}'`" >&5
5549 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5550 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5551   cat >>confdefs.h <<EOF
5552 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5553 EOF
5554
5555 fi
5556 done
5557
5558 echo "$as_me:5558: checking for terminfo header" >&5
5559 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5560 if test "${cf_cv_term_header+set}" = set; then
5561   echo $ECHO_N "(cached) $ECHO_C" >&6
5562 else
5563
5564 case ${cf_cv_ncurses_header} in #(vi
5565 */ncurses.h|*/ncursesw.h) #(vi
5566         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5567         ;;
5568 *)
5569         cf_term_header=term.h
5570         ;;
5571 esac
5572
5573 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5574 do
5575 cat >conftest.$ac_ext <<_ACEOF
5576 #line 5576 "configure"
5577 #include "confdefs.h"
5578 #include <stdio.h>
5579 #include <${cf_cv_ncurses_header:-curses.h}>
5580 #include <$cf_test>
5581
5582 int
5583 main ()
5584 {
5585 int x = auto_left_margin
5586   ;
5587   return 0;
5588 }
5589 _ACEOF
5590 rm -f conftest.$ac_objext
5591 if { (eval echo "$as_me:5591: \"$ac_compile\"") >&5
5592   (eval $ac_compile) 2>&5
5593   ac_status=$?
5594   echo "$as_me:5594: \$? = $ac_status" >&5
5595   (exit $ac_status); } &&
5596          { ac_try='test -s conftest.$ac_objext'
5597   { (eval echo "$as_me:5597: \"$ac_try\"") >&5
5598   (eval $ac_try) 2>&5
5599   ac_status=$?
5600   echo "$as_me:5600: \$? = $ac_status" >&5
5601   (exit $ac_status); }; }; then
5602
5603         cf_cv_term_header="$cf_test"
5604 else
5605   echo "$as_me: failed program was:" >&5
5606 cat conftest.$ac_ext >&5
5607
5608         cf_cv_term_header=unknown
5609
5610 fi
5611 rm -f conftest.$ac_objext conftest.$ac_ext
5612         test "$cf_cv_term_header" != unknown && break
5613 done
5614
5615 fi
5616 echo "$as_me:5616: result: $cf_cv_term_header" >&5
5617 echo "${ECHO_T}$cf_cv_term_header" >&6
5618
5619 # Set definitions to allow ifdef'ing to accommodate subdirectories
5620
5621 case $cf_cv_term_header in # (vi
5622 *term.h)
5623         cat >>confdefs.h <<\EOF
5624 #define HAVE_TERM_H 1
5625 EOF
5626
5627         ;;
5628 esac
5629
5630 case $cf_cv_term_header in # (vi
5631 ncurses/term.h) #(vi
5632         cat >>confdefs.h <<\EOF
5633 #define HAVE_NCURSES_TERM_H 1
5634 EOF
5635
5636         ;;
5637 ncursesw/term.h)
5638         cat >>confdefs.h <<\EOF
5639 #define HAVE_NCURSESW_TERM_H 1
5640 EOF
5641
5642         ;;
5643 esac
5644
5645 echo "$as_me:5645: checking for ncurses version" >&5
5646 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5647 if test "${cf_cv_ncurses_version+set}" = set; then
5648   echo $ECHO_N "(cached) $ECHO_C" >&6
5649 else
5650
5651         cf_cv_ncurses_version=no
5652         cf_tempfile=out$$
5653         rm -f $cf_tempfile
5654         if test "$cross_compiling" = yes; then
5655
5656         # This will not work if the preprocessor splits the line after the
5657         # Autoconf token.  The 'unproto' program does that.
5658         cat > conftest.$ac_ext <<EOF
5659 #include <${cf_cv_ncurses_header:-curses.h}>
5660 #undef Autoconf
5661 #ifdef NCURSES_VERSION
5662 Autoconf NCURSES_VERSION
5663 #else
5664 #ifdef __NCURSES_H
5665 Autoconf "old"
5666 #endif
5667 ;
5668 #endif
5669 EOF
5670         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5671         { (eval echo "$as_me:5671: \"$cf_try\"") >&5
5672   (eval $cf_try) 2>&5
5673   ac_status=$?
5674   echo "$as_me:5674: \$? = $ac_status" >&5
5675   (exit $ac_status); }
5676         if test -f conftest.out ; then
5677                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5678                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5679                 rm -f conftest.out
5680         fi
5681
5682 else
5683   cat >conftest.$ac_ext <<_ACEOF
5684 #line 5684 "configure"
5685 #include "confdefs.h"
5686
5687 #include <${cf_cv_ncurses_header:-curses.h}>
5688 #include <stdio.h>
5689 int main()
5690 {
5691         FILE *fp = fopen("$cf_tempfile", "w");
5692 #ifdef NCURSES_VERSION
5693 # ifdef NCURSES_VERSION_PATCH
5694         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5695 # else
5696         fprintf(fp, "%s\n", NCURSES_VERSION);
5697 # endif
5698 #else
5699 # ifdef __NCURSES_H
5700         fprintf(fp, "old\n");
5701 # else
5702         make an error
5703 # endif
5704 #endif
5705         ${cf_cv_main_return:-return}(0);
5706 }
5707 _ACEOF
5708 rm -f conftest$ac_exeext
5709 if { (eval echo "$as_me:5709: \"$ac_link\"") >&5
5710   (eval $ac_link) 2>&5
5711   ac_status=$?
5712   echo "$as_me:5712: \$? = $ac_status" >&5
5713   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5714   { (eval echo "$as_me:5714: \"$ac_try\"") >&5
5715   (eval $ac_try) 2>&5
5716   ac_status=$?
5717   echo "$as_me:5717: \$? = $ac_status" >&5
5718   (exit $ac_status); }; }; then
5719
5720         cf_cv_ncurses_version=`cat $cf_tempfile`
5721 else
5722   echo "$as_me: program exited with status $ac_status" >&5
5723 echo "$as_me: failed program was:" >&5
5724 cat conftest.$ac_ext >&5
5725 fi
5726 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5727 fi
5728         rm -f $cf_tempfile
5729
5730 fi
5731 echo "$as_me:5731: result: $cf_cv_ncurses_version" >&5
5732 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5733 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5734 #define NCURSES 1
5735 EOF
5736
5737 echo "$as_me:5737: checking if we have identified curses libraries" >&5
5738 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5739 cat >conftest.$ac_ext <<_ACEOF
5740 #line 5740 "configure"
5741 #include "confdefs.h"
5742 #include <${cf_cv_ncurses_header:-curses.h}>
5743 int
5744 main ()
5745 {
5746 initscr(); tgoto("?", 0,0)
5747   ;
5748   return 0;
5749 }
5750 _ACEOF
5751 rm -f conftest.$ac_objext conftest$ac_exeext
5752 if { (eval echo "$as_me:5752: \"$ac_link\"") >&5
5753   (eval $ac_link) 2>&5
5754   ac_status=$?
5755   echo "$as_me:5755: \$? = $ac_status" >&5
5756   (exit $ac_status); } &&
5757          { ac_try='test -s conftest$ac_exeext'
5758   { (eval echo "$as_me:5758: \"$ac_try\"") >&5
5759   (eval $ac_try) 2>&5
5760   ac_status=$?
5761   echo "$as_me:5761: \$? = $ac_status" >&5
5762   (exit $ac_status); }; }; then
5763   cf_result=yes
5764 else
5765   echo "$as_me: failed program was:" >&5
5766 cat conftest.$ac_ext >&5
5767 cf_result=no
5768 fi
5769 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5770 echo "$as_me:5770: result: $cf_result" >&5
5771 echo "${ECHO_T}$cf_result" >&6
5772
5773 if test "$cf_result" = no ; then
5774 case $host_os in #(vi
5775 freebsd*) #(vi
5776     echo "$as_me:5776: checking for tgoto in -lmytinfo" >&5
5777 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5778 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5779   echo $ECHO_N "(cached) $ECHO_C" >&6
5780 else
5781   ac_check_lib_save_LIBS=$LIBS
5782 LIBS="-lmytinfo  $LIBS"
5783 cat >conftest.$ac_ext <<_ACEOF
5784 #line 5784 "configure"
5785 #include "confdefs.h"
5786
5787 /* Override any gcc2 internal prototype to avoid an error.  */
5788 #ifdef __cplusplus
5789 extern "C"
5790 #endif
5791 /* We use char because int might match the return type of a gcc2
5792    builtin and then its argument prototype would still apply.  */
5793 char tgoto ();
5794 int
5795 main ()
5796 {
5797 tgoto ();
5798   ;
5799   return 0;
5800 }
5801 _ACEOF
5802 rm -f conftest.$ac_objext conftest$ac_exeext
5803 if { (eval echo "$as_me:5803: \"$ac_link\"") >&5
5804   (eval $ac_link) 2>&5
5805   ac_status=$?
5806   echo "$as_me:5806: \$? = $ac_status" >&5
5807   (exit $ac_status); } &&
5808          { ac_try='test -s conftest$ac_exeext'
5809   { (eval echo "$as_me:5809: \"$ac_try\"") >&5
5810   (eval $ac_try) 2>&5
5811   ac_status=$?
5812   echo "$as_me:5812: \$? = $ac_status" >&5
5813   (exit $ac_status); }; }; then
5814   ac_cv_lib_mytinfo_tgoto=yes
5815 else
5816   echo "$as_me: failed program was:" >&5
5817 cat conftest.$ac_ext >&5
5818 ac_cv_lib_mytinfo_tgoto=no
5819 fi
5820 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5821 LIBS=$ac_check_lib_save_LIBS
5822 fi
5823 echo "$as_me:5823: result: $ac_cv_lib_mytinfo_tgoto" >&5
5824 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5825 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5826   LIBS="-lmytinfo $LIBS"
5827 fi
5828
5829     ;;
5830 hpux10.*) #(vi
5831         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5832         # next (1998), and xcurses "newer" (2000).  There is no header file for
5833         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5834         # term.h) for cur_colr
5835         if test "x$cf_cv_screen" = "xcurses_colr"
5836         then
5837                 echo "$as_me:5837: checking for initscr in -lcur_colr" >&5
5838 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5839 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5840   echo $ECHO_N "(cached) $ECHO_C" >&6
5841 else
5842   ac_check_lib_save_LIBS=$LIBS
5843 LIBS="-lcur_colr  $LIBS"
5844 cat >conftest.$ac_ext <<_ACEOF
5845 #line 5845 "configure"
5846 #include "confdefs.h"
5847
5848 /* Override any gcc2 internal prototype to avoid an error.  */
5849 #ifdef __cplusplus
5850 extern "C"
5851 #endif
5852 /* We use char because int might match the return type of a gcc2
5853    builtin and then its argument prototype would still apply.  */
5854 char initscr ();
5855 int
5856 main ()
5857 {
5858 initscr ();
5859   ;
5860   return 0;
5861 }
5862 _ACEOF
5863 rm -f conftest.$ac_objext conftest$ac_exeext
5864 if { (eval echo "$as_me:5864: \"$ac_link\"") >&5
5865   (eval $ac_link) 2>&5
5866   ac_status=$?
5867   echo "$as_me:5867: \$? = $ac_status" >&5
5868   (exit $ac_status); } &&
5869          { ac_try='test -s conftest$ac_exeext'
5870   { (eval echo "$as_me:5870: \"$ac_try\"") >&5
5871   (eval $ac_try) 2>&5
5872   ac_status=$?
5873   echo "$as_me:5873: \$? = $ac_status" >&5
5874   (exit $ac_status); }; }; then
5875   ac_cv_lib_cur_colr_initscr=yes
5876 else
5877   echo "$as_me: failed program was:" >&5
5878 cat conftest.$ac_ext >&5
5879 ac_cv_lib_cur_colr_initscr=no
5880 fi
5881 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5882 LIBS=$ac_check_lib_save_LIBS
5883 fi
5884 echo "$as_me:5884: result: $ac_cv_lib_cur_colr_initscr" >&5
5885 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5886 if test $ac_cv_lib_cur_colr_initscr = yes; then
5887
5888                         LIBS="-lcur_colr $LIBS"
5889                         ac_cv_func_initscr=yes
5890
5891 else
5892
5893                 echo "$as_me:5893: checking for initscr in -lHcurses" >&5
5894 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5895 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5896   echo $ECHO_N "(cached) $ECHO_C" >&6
5897 else
5898   ac_check_lib_save_LIBS=$LIBS
5899 LIBS="-lHcurses  $LIBS"
5900 cat >conftest.$ac_ext <<_ACEOF
5901 #line 5901 "configure"
5902 #include "confdefs.h"
5903
5904 /* Override any gcc2 internal prototype to avoid an error.  */
5905 #ifdef __cplusplus
5906 extern "C"
5907 #endif
5908 /* We use char because int might match the return type of a gcc2
5909    builtin and then its argument prototype would still apply.  */
5910 char initscr ();
5911 int
5912 main ()
5913 {
5914 initscr ();
5915   ;
5916   return 0;
5917 }
5918 _ACEOF
5919 rm -f conftest.$ac_objext conftest$ac_exeext
5920 if { (eval echo "$as_me:5920: \"$ac_link\"") >&5
5921   (eval $ac_link) 2>&5
5922   ac_status=$?
5923   echo "$as_me:5923: \$? = $ac_status" >&5
5924   (exit $ac_status); } &&
5925          { ac_try='test -s conftest$ac_exeext'
5926   { (eval echo "$as_me:5926: \"$ac_try\"") >&5
5927   (eval $ac_try) 2>&5
5928   ac_status=$?
5929   echo "$as_me:5929: \$? = $ac_status" >&5
5930   (exit $ac_status); }; }; then
5931   ac_cv_lib_Hcurses_initscr=yes
5932 else
5933   echo "$as_me: failed program was:" >&5
5934 cat conftest.$ac_ext >&5
5935 ac_cv_lib_Hcurses_initscr=no
5936 fi
5937 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5938 LIBS=$ac_check_lib_save_LIBS
5939 fi
5940 echo "$as_me:5940: result: $ac_cv_lib_Hcurses_initscr" >&5
5941 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5942 if test $ac_cv_lib_Hcurses_initscr = yes; then
5943
5944                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5945                         LIBS="-lHcurses $LIBS"
5946                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5947                         ac_cv_func_initscr=yes
5948
5949 fi
5950
5951 fi
5952
5953         fi
5954     ;;
5955 linux*)
5956         case `arch 2>/dev/null` in
5957         x86_64)
5958                 if test -d /lib64
5959                 then
5960
5961 if test -n "/lib64" ; then
5962   for cf_add_libdir in /lib64
5963   do
5964     if test $cf_add_libdir = /usr/lib ; then
5965       :
5966     elif test -d $cf_add_libdir
5967     then
5968       cf_have_libdir=no
5969       if test -n "$LDFLAGS$LIBS" ; then
5970         # a loop is needed to ensure we can add subdirs of existing dirs
5971         for cf_test_libdir in $LDFLAGS $LIBS ; do
5972           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5973             cf_have_libdir=yes; break
5974           fi
5975         done
5976       fi
5977       if test "$cf_have_libdir" = no ; then
5978         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5979
5980 echo "${as_me:-configure}:5980: testing adding $cf_add_libdir to library-path ..." 1>&5
5981
5982         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5983       fi
5984     fi
5985   done
5986 fi
5987
5988                 else
5989
5990 if test -n "/lib" ; then
5991   for cf_add_libdir in /lib
5992   do
5993     if test $cf_add_libdir = /usr/lib ; then
5994       :
5995     elif test -d $cf_add_libdir
5996     then
5997       cf_have_libdir=no
5998       if test -n "$LDFLAGS$LIBS" ; then
5999         # a loop is needed to ensure we can add subdirs of existing dirs
6000         for cf_test_libdir in $LDFLAGS $LIBS ; do
6001           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6002             cf_have_libdir=yes; break
6003           fi
6004         done
6005       fi
6006       if test "$cf_have_libdir" = no ; then
6007         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6008
6009 echo "${as_me:-configure}:6009: testing adding $cf_add_libdir to library-path ..." 1>&5
6010
6011         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6012       fi
6013     fi
6014   done
6015 fi
6016
6017                 fi
6018                 ;;
6019         *)
6020
6021 if test -n "/lib" ; then
6022   for cf_add_libdir in /lib
6023   do
6024     if test $cf_add_libdir = /usr/lib ; then
6025       :
6026     elif test -d $cf_add_libdir
6027     then
6028       cf_have_libdir=no
6029       if test -n "$LDFLAGS$LIBS" ; then
6030         # a loop is needed to ensure we can add subdirs of existing dirs
6031         for cf_test_libdir in $LDFLAGS $LIBS ; do
6032           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6033             cf_have_libdir=yes; break
6034           fi
6035         done
6036       fi
6037       if test "$cf_have_libdir" = no ; then
6038         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6039
6040 echo "${as_me:-configure}:6040: testing adding $cf_add_libdir to library-path ..." 1>&5
6041
6042         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6043       fi
6044     fi
6045   done
6046 fi
6047
6048                 ;;
6049         esac
6050     ;;
6051 sunos3*|sunos4*)
6052         if test "x$cf_cv_screen" = "xcurses_5lib"
6053         then
6054                 if test -d /usr/5lib ; then
6055
6056 if test -n "/usr/5lib" ; then
6057   for cf_add_libdir in /usr/5lib
6058   do
6059     if test $cf_add_libdir = /usr/lib ; then
6060       :
6061     elif test -d $cf_add_libdir
6062     then
6063       cf_have_libdir=no
6064       if test -n "$LDFLAGS$LIBS" ; then
6065         # a loop is needed to ensure we can add subdirs of existing dirs
6066         for cf_test_libdir in $LDFLAGS $LIBS ; do
6067           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6068             cf_have_libdir=yes; break
6069           fi
6070         done
6071       fi
6072       if test "$cf_have_libdir" = no ; then
6073         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6074
6075 echo "${as_me:-configure}:6075: testing adding $cf_add_libdir to library-path ..." 1>&5
6076
6077         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6078       fi
6079     fi
6080   done
6081 fi
6082
6083                         LIBS="-lcurses -ltermcap $LIBS"
6084                 fi
6085     fi
6086     ac_cv_func_initscr=yes
6087     ;;
6088 esac
6089
6090 if test ".$ac_cv_func_initscr" != .yes ; then
6091     cf_save_LIBS="$LIBS"
6092     cf_term_lib=""
6093     cf_curs_lib=""
6094
6095     if test ".${cf_cv_ncurses_version:-no}" != .no
6096     then
6097         cf_check_list="ncurses curses cursesX"
6098     else
6099         cf_check_list="cursesX curses ncurses"
6100     fi
6101
6102     # Check for library containing tgoto.  Do this before curses library
6103     # because it may be needed to link the test-case for initscr.
6104     echo "$as_me:6104: checking for tgoto" >&5
6105 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6106 if test "${ac_cv_func_tgoto+set}" = set; then
6107   echo $ECHO_N "(cached) $ECHO_C" >&6
6108 else
6109   cat >conftest.$ac_ext <<_ACEOF
6110 #line 6110 "configure"
6111 #include "confdefs.h"
6112 /* System header to define __stub macros and hopefully few prototypes,
6113     which can conflict with char tgoto (); below.  */
6114 #include <assert.h>
6115 /* Override any gcc2 internal prototype to avoid an error.  */
6116 #ifdef __cplusplus
6117 extern "C"
6118 #endif
6119 /* We use char because int might match the return type of a gcc2
6120    builtin and then its argument prototype would still apply.  */
6121 char tgoto ();
6122 char (*f) ();
6123
6124 int
6125 main ()
6126 {
6127 /* The GNU C library defines this for functions which it implements
6128     to always fail with ENOSYS.  Some functions are actually named
6129     something starting with __ and the normal name is an alias.  */
6130 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6131 choke me
6132 #else
6133 f = tgoto;
6134 #endif
6135
6136   ;
6137   return 0;
6138 }
6139 _ACEOF
6140 rm -f conftest.$ac_objext conftest$ac_exeext
6141 if { (eval echo "$as_me:6141: \"$ac_link\"") >&5
6142   (eval $ac_link) 2>&5
6143   ac_status=$?
6144   echo "$as_me:6144: \$? = $ac_status" >&5
6145   (exit $ac_status); } &&
6146          { ac_try='test -s conftest$ac_exeext'
6147   { (eval echo "$as_me:6147: \"$ac_try\"") >&5
6148   (eval $ac_try) 2>&5
6149   ac_status=$?
6150   echo "$as_me:6150: \$? = $ac_status" >&5
6151   (exit $ac_status); }; }; then
6152   ac_cv_func_tgoto=yes
6153 else
6154   echo "$as_me: failed program was:" >&5
6155 cat conftest.$ac_ext >&5
6156 ac_cv_func_tgoto=no
6157 fi
6158 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6159 fi
6160 echo "$as_me:6160: result: $ac_cv_func_tgoto" >&5
6161 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6162 if test $ac_cv_func_tgoto = yes; then
6163   cf_term_lib=predefined
6164 else
6165
6166         for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
6167         do
6168             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6169 echo "$as_me:6169: checking for tgoto in -l$cf_term_lib" >&5
6170 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6171 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6172   echo $ECHO_N "(cached) $ECHO_C" >&6
6173 else
6174   ac_check_lib_save_LIBS=$LIBS
6175 LIBS="-l$cf_term_lib  $LIBS"
6176 cat >conftest.$ac_ext <<_ACEOF
6177 #line 6177 "configure"
6178 #include "confdefs.h"
6179
6180 /* Override any gcc2 internal prototype to avoid an error.  */
6181 #ifdef __cplusplus
6182 extern "C"
6183 #endif
6184 /* We use char because int might match the return type of a gcc2
6185    builtin and then its argument prototype would still apply.  */
6186 char tgoto ();
6187 int
6188 main ()
6189 {
6190 tgoto ();
6191   ;
6192   return 0;
6193 }
6194 _ACEOF
6195 rm -f conftest.$ac_objext conftest$ac_exeext
6196 if { (eval echo "$as_me:6196: \"$ac_link\"") >&5
6197   (eval $ac_link) 2>&5
6198   ac_status=$?
6199   echo "$as_me:6199: \$? = $ac_status" >&5
6200   (exit $ac_status); } &&
6201          { ac_try='test -s conftest$ac_exeext'
6202   { (eval echo "$as_me:6202: \"$ac_try\"") >&5
6203   (eval $ac_try) 2>&5
6204   ac_status=$?
6205   echo "$as_me:6205: \$? = $ac_status" >&5
6206   (exit $ac_status); }; }; then
6207   eval "$as_ac_Lib=yes"
6208 else
6209   echo "$as_me: failed program was:" >&5
6210 cat conftest.$ac_ext >&5
6211 eval "$as_ac_Lib=no"
6212 fi
6213 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6214 LIBS=$ac_check_lib_save_LIBS
6215 fi
6216 echo "$as_me:6216: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6217 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6218 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6219   break
6220 fi
6221
6222         done
6223
6224 fi
6225
6226     # Check for library containing initscr
6227     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6228         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6229     do
6230         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6231 echo "$as_me:6231: checking for initscr in -l$cf_curs_lib" >&5
6232 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6233 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6234   echo $ECHO_N "(cached) $ECHO_C" >&6
6235 else
6236   ac_check_lib_save_LIBS=$LIBS
6237 LIBS="-l$cf_curs_lib  $LIBS"
6238 cat >conftest.$ac_ext <<_ACEOF
6239 #line 6239 "configure"
6240 #include "confdefs.h"
6241
6242 /* Override any gcc2 internal prototype to avoid an error.  */
6243 #ifdef __cplusplus
6244 extern "C"
6245 #endif
6246 /* We use char because int might match the return type of a gcc2
6247    builtin and then its argument prototype would still apply.  */
6248 char initscr ();
6249 int
6250 main ()
6251 {
6252 initscr ();
6253   ;
6254   return 0;
6255 }
6256 _ACEOF
6257 rm -f conftest.$ac_objext conftest$ac_exeext
6258 if { (eval echo "$as_me:6258: \"$ac_link\"") >&5
6259   (eval $ac_link) 2>&5
6260   ac_status=$?
6261   echo "$as_me:6261: \$? = $ac_status" >&5
6262   (exit $ac_status); } &&
6263          { ac_try='test -s conftest$ac_exeext'
6264   { (eval echo "$as_me:6264: \"$ac_try\"") >&5
6265   (eval $ac_try) 2>&5
6266   ac_status=$?
6267   echo "$as_me:6267: \$? = $ac_status" >&5
6268   (exit $ac_status); }; }; then
6269   eval "$as_ac_Lib=yes"
6270 else
6271   echo "$as_me: failed program was:" >&5
6272 cat conftest.$ac_ext >&5
6273 eval "$as_ac_Lib=no"
6274 fi
6275 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6276 LIBS=$ac_check_lib_save_LIBS
6277 fi
6278 echo "$as_me:6278: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6279 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6280 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6281   break
6282 fi
6283
6284     done
6285     test $cf_curs_lib = unknown && { { echo "$as_me:6285: error: no curses library found" >&5
6286 echo "$as_me: error: no curses library found" >&2;}
6287    { (exit 1); exit 1; }; }
6288
6289     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6290     if test "$cf_term_lib" = unknown ; then
6291         echo "$as_me:6291: checking if we can link with $cf_curs_lib library" >&5
6292 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6293         cat >conftest.$ac_ext <<_ACEOF
6294 #line 6294 "configure"
6295 #include "confdefs.h"
6296 #include <${cf_cv_ncurses_header:-curses.h}>
6297 int
6298 main ()
6299 {
6300 initscr()
6301   ;
6302   return 0;
6303 }
6304 _ACEOF
6305 rm -f conftest.$ac_objext conftest$ac_exeext
6306 if { (eval echo "$as_me:6306: \"$ac_link\"") >&5
6307   (eval $ac_link) 2>&5
6308   ac_status=$?
6309   echo "$as_me:6309: \$? = $ac_status" >&5
6310   (exit $ac_status); } &&
6311          { ac_try='test -s conftest$ac_exeext'
6312   { (eval echo "$as_me:6312: \"$ac_try\"") >&5
6313   (eval $ac_try) 2>&5
6314   ac_status=$?
6315   echo "$as_me:6315: \$? = $ac_status" >&5
6316   (exit $ac_status); }; }; then
6317   cf_result=yes
6318 else
6319   echo "$as_me: failed program was:" >&5
6320 cat conftest.$ac_ext >&5
6321 cf_result=no
6322 fi
6323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6324         echo "$as_me:6324: result: $cf_result" >&5
6325 echo "${ECHO_T}$cf_result" >&6
6326         test $cf_result = no && { { echo "$as_me:6326: error: Cannot link curses library" >&5
6327 echo "$as_me: error: Cannot link curses library" >&2;}
6328    { (exit 1); exit 1; }; }
6329     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6330         :
6331     elif test "$cf_term_lib" != predefined ; then
6332         echo "$as_me:6332: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6333 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6334         cat >conftest.$ac_ext <<_ACEOF
6335 #line 6335 "configure"
6336 #include "confdefs.h"
6337 #include <${cf_cv_ncurses_header:-curses.h}>
6338 int
6339 main ()
6340 {
6341 initscr(); tgoto((char *)0, 0, 0);
6342   ;
6343   return 0;
6344 }
6345 _ACEOF
6346 rm -f conftest.$ac_objext conftest$ac_exeext
6347 if { (eval echo "$as_me:6347: \"$ac_link\"") >&5
6348   (eval $ac_link) 2>&5
6349   ac_status=$?
6350   echo "$as_me:6350: \$? = $ac_status" >&5
6351   (exit $ac_status); } &&
6352          { ac_try='test -s conftest$ac_exeext'
6353   { (eval echo "$as_me:6353: \"$ac_try\"") >&5
6354   (eval $ac_try) 2>&5
6355   ac_status=$?
6356   echo "$as_me:6356: \$? = $ac_status" >&5
6357   (exit $ac_status); }; }; then
6358   cf_result=no
6359 else
6360   echo "$as_me: failed program was:" >&5
6361 cat conftest.$ac_ext >&5
6362
6363             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6364             cat >conftest.$ac_ext <<_ACEOF
6365 #line 6365 "configure"
6366 #include "confdefs.h"
6367 #include <${cf_cv_ncurses_header:-curses.h}>
6368 int
6369 main ()
6370 {
6371 initscr()
6372   ;
6373   return 0;
6374 }
6375 _ACEOF
6376 rm -f conftest.$ac_objext conftest$ac_exeext
6377 if { (eval echo "$as_me:6377: \"$ac_link\"") >&5
6378   (eval $ac_link) 2>&5
6379   ac_status=$?
6380   echo "$as_me:6380: \$? = $ac_status" >&5
6381   (exit $ac_status); } &&
6382          { ac_try='test -s conftest$ac_exeext'
6383   { (eval echo "$as_me:6383: \"$ac_try\"") >&5
6384   (eval $ac_try) 2>&5
6385   ac_status=$?
6386   echo "$as_me:6386: \$? = $ac_status" >&5
6387   (exit $ac_status); }; }; then
6388   cf_result=yes
6389 else
6390   echo "$as_me: failed program was:" >&5
6391 cat conftest.$ac_ext >&5
6392 cf_result=error
6393 fi
6394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6395
6396 fi
6397 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6398         echo "$as_me:6398: result: $cf_result" >&5
6399 echo "${ECHO_T}$cf_result" >&6
6400     fi
6401 fi
6402 fi
6403
6404 echo "$as_me:6404: checking for NetBSD form.h" >&5
6405 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
6406 if test "${cf_cv_netbsd_form_h+set}" = set; then
6407   echo $ECHO_N "(cached) $ECHO_C" >&6
6408 else
6409
6410 cat >conftest.$ac_ext <<_ACEOF
6411 #line 6411 "configure"
6412 #include "confdefs.h"
6413
6414 #include <${cf_cv_ncurses_header:-curses.h}>
6415 #include <form.h>
6416
6417 int
6418 main ()
6419 {
6420
6421         FORM *form;
6422         int y = current_field(form)->cursor_ypos;
6423         int x = current_field(form)->cursor_xpos;
6424
6425   ;
6426   return 0;
6427 }
6428 _ACEOF
6429 rm -f conftest.$ac_objext
6430 if { (eval echo "$as_me:6430: \"$ac_compile\"") >&5
6431   (eval $ac_compile) 2>&5
6432   ac_status=$?
6433   echo "$as_me:6433: \$? = $ac_status" >&5
6434   (exit $ac_status); } &&
6435          { ac_try='test -s conftest.$ac_objext'
6436   { (eval echo "$as_me:6436: \"$ac_try\"") >&5
6437   (eval $ac_try) 2>&5
6438   ac_status=$?
6439   echo "$as_me:6439: \$? = $ac_status" >&5
6440   (exit $ac_status); }; }; then
6441   cf_cv_netbsd_form_h=yes
6442
6443 else
6444   echo "$as_me: failed program was:" >&5
6445 cat conftest.$ac_ext >&5
6446 cf_cv_netbsd_form_h=no
6447 fi
6448 rm -f conftest.$ac_objext conftest.$ac_ext
6449
6450 fi
6451 echo "$as_me:6451: result: $cf_cv_netbsd_form_h" >&5
6452 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
6453
6454 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
6455 #define HAVE_NETBSD_FORM_H 1
6456 EOF
6457
6458 echo "$as_me:6458: checking for NetBSD menu.h" >&5
6459 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
6460 if test "${cf_cv_netbsd_menu_h+set}" = set; then
6461   echo $ECHO_N "(cached) $ECHO_C" >&6
6462 else
6463
6464 cat >conftest.$ac_ext <<_ACEOF
6465 #line 6465 "configure"
6466 #include "confdefs.h"
6467
6468 #include <${cf_cv_ncurses_header:-curses.h}>
6469 #include <menu.h>
6470
6471 int
6472 main ()
6473 {
6474
6475         MENU *menu;
6476         int y = menu->max_item_width;
6477
6478   ;
6479   return 0;
6480 }
6481 _ACEOF
6482 rm -f conftest.$ac_objext
6483 if { (eval echo "$as_me:6483: \"$ac_compile\"") >&5
6484   (eval $ac_compile) 2>&5
6485   ac_status=$?
6486   echo "$as_me:6486: \$? = $ac_status" >&5
6487   (exit $ac_status); } &&
6488          { ac_try='test -s conftest.$ac_objext'
6489   { (eval echo "$as_me:6489: \"$ac_try\"") >&5
6490   (eval $ac_try) 2>&5
6491   ac_status=$?
6492   echo "$as_me:6492: \$? = $ac_status" >&5
6493   (exit $ac_status); }; }; then
6494   cf_cv_netbsd_menu_h=yes
6495
6496 else
6497   echo "$as_me: failed program was:" >&5
6498 cat conftest.$ac_ext >&5
6499 cf_cv_netbsd_menu_h=no
6500 fi
6501 rm -f conftest.$ac_objext conftest.$ac_ext
6502
6503 fi
6504 echo "$as_me:6504: result: $cf_cv_netbsd_menu_h" >&5
6505 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
6506
6507 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
6508 #define HAVE_NETBSD_MENU_H 1
6509 EOF
6510
6511         ;;
6512 ncurses)
6513
6514 cf_ncuconfig_root=ncurses
6515
6516 echo "Looking for ${cf_ncuconfig_root}-config"
6517
6518 if test -n "$ac_tool_prefix"; then
6519   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6520   do
6521     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6522 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6523 echo "$as_me:6523: checking for $ac_word" >&5
6524 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6525 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6526   echo $ECHO_N "(cached) $ECHO_C" >&6
6527 else
6528   if test -n "$NCURSES_CONFIG"; then
6529   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6530 else
6531   ac_save_IFS=$IFS; IFS=$ac_path_separator
6532 ac_dummy="$PATH"
6533 for ac_dir in $ac_dummy; do
6534   IFS=$ac_save_IFS
6535   test -z "$ac_dir" && ac_dir=.
6536   $as_executable_p "$ac_dir/$ac_word" || continue
6537 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6538 echo "$as_me:6538: found $ac_dir/$ac_word" >&5
6539 break
6540 done
6541
6542 fi
6543 fi
6544 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6545 if test -n "$NCURSES_CONFIG"; then
6546   echo "$as_me:6546: result: $NCURSES_CONFIG" >&5
6547 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6548 else
6549   echo "$as_me:6549: result: no" >&5
6550 echo "${ECHO_T}no" >&6
6551 fi
6552
6553     test -n "$NCURSES_CONFIG" && break
6554   done
6555 fi
6556 if test -z "$NCURSES_CONFIG"; then
6557   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6558   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6559 do
6560   # Extract the first word of "$ac_prog", so it can be a program name with args.
6561 set dummy $ac_prog; ac_word=$2
6562 echo "$as_me:6562: checking for $ac_word" >&5
6563 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6564 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6565   echo $ECHO_N "(cached) $ECHO_C" >&6
6566 else
6567   if test -n "$ac_ct_NCURSES_CONFIG"; then
6568   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6569 else
6570   ac_save_IFS=$IFS; IFS=$ac_path_separator
6571 ac_dummy="$PATH"
6572 for ac_dir in $ac_dummy; do
6573   IFS=$ac_save_IFS
6574   test -z "$ac_dir" && ac_dir=.
6575   $as_executable_p "$ac_dir/$ac_word" || continue
6576 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6577 echo "$as_me:6577: found $ac_dir/$ac_word" >&5
6578 break
6579 done
6580
6581 fi
6582 fi
6583 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6584 if test -n "$ac_ct_NCURSES_CONFIG"; then
6585   echo "$as_me:6585: result: $ac_ct_NCURSES_CONFIG" >&5
6586 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6587 else
6588   echo "$as_me:6588: result: no" >&5
6589 echo "${ECHO_T}no" >&6
6590 fi
6591
6592   test -n "$ac_ct_NCURSES_CONFIG" && break
6593 done
6594 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6595
6596   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6597 fi
6598
6599 if test "$NCURSES_CONFIG" != none ; then
6600
6601 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6602 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6603
6604 # even with config script, some packages use no-override for curses.h
6605
6606 echo "$as_me:6606: checking if we have identified curses headers" >&5
6607 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6608 if test "${cf_cv_ncurses_header+set}" = set; then
6609   echo $ECHO_N "(cached) $ECHO_C" >&6
6610 else
6611
6612 cf_cv_ncurses_header=none
6613 for cf_header in  \
6614     ncurses/ncurses.h \
6615         ncurses/curses.h \
6616         ncurses.h \
6617         curses.h
6618 do
6619 cat >conftest.$ac_ext <<_ACEOF
6620 #line 6620 "configure"
6621 #include "confdefs.h"
6622 #include <${cf_header}>
6623 int
6624 main ()
6625 {
6626 initscr(); tgoto("?", 0,0)
6627   ;
6628   return 0;
6629 }
6630 _ACEOF
6631 rm -f conftest.$ac_objext
6632 if { (eval echo "$as_me:6632: \"$ac_compile\"") >&5
6633   (eval $ac_compile) 2>&5
6634   ac_status=$?
6635   echo "$as_me:6635: \$? = $ac_status" >&5
6636   (exit $ac_status); } &&
6637          { ac_try='test -s conftest.$ac_objext'
6638   { (eval echo "$as_me:6638: \"$ac_try\"") >&5
6639   (eval $ac_try) 2>&5
6640   ac_status=$?
6641   echo "$as_me:6641: \$? = $ac_status" >&5
6642   (exit $ac_status); }; }; then
6643   cf_cv_ncurses_header=$cf_header; break
6644 else
6645   echo "$as_me: failed program was:" >&5
6646 cat conftest.$ac_ext >&5
6647 fi
6648 rm -f conftest.$ac_objext conftest.$ac_ext
6649 done
6650
6651 fi
6652 echo "$as_me:6652: result: $cf_cv_ncurses_header" >&5
6653 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6654
6655 if test "$cf_cv_ncurses_header" = none ; then
6656         { { echo "$as_me:6656: error: No curses header-files found" >&5
6657 echo "$as_me: error: No curses header-files found" >&2;}
6658    { (exit 1); exit 1; }; }
6659 fi
6660
6661 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6662
6663 for ac_header in $cf_cv_ncurses_header
6664 do
6665 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6666 echo "$as_me:6666: checking for $ac_header" >&5
6667 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6668 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6669   echo $ECHO_N "(cached) $ECHO_C" >&6
6670 else
6671   cat >conftest.$ac_ext <<_ACEOF
6672 #line 6672 "configure"
6673 #include "confdefs.h"
6674 #include <$ac_header>
6675 _ACEOF
6676 if { (eval echo "$as_me:6676: \"$ac_cpp conftest.$ac_ext\"") >&5
6677   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6678   ac_status=$?
6679   egrep -v '^ *\+' conftest.er1 >conftest.err
6680   rm -f conftest.er1
6681   cat conftest.err >&5
6682   echo "$as_me:6682: \$? = $ac_status" >&5
6683   (exit $ac_status); } >/dev/null; then
6684   if test -s conftest.err; then
6685     ac_cpp_err=$ac_c_preproc_warn_flag
6686   else
6687     ac_cpp_err=
6688   fi
6689 else
6690   ac_cpp_err=yes
6691 fi
6692 if test -z "$ac_cpp_err"; then
6693   eval "$as_ac_Header=yes"
6694 else
6695   echo "$as_me: failed program was:" >&5
6696   cat conftest.$ac_ext >&5
6697   eval "$as_ac_Header=no"
6698 fi
6699 rm -f conftest.err conftest.$ac_ext
6700 fi
6701 echo "$as_me:6701: result: `eval echo '${'$as_ac_Header'}'`" >&5
6702 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6703 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6704   cat >>confdefs.h <<EOF
6705 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6706 EOF
6707
6708 fi
6709 done
6710
6711 cat >>confdefs.h <<\EOF
6712 #define NCURSES 1
6713 EOF
6714
6715 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6716
6717 cat >>confdefs.h <<EOF
6718 #define $cf_nculib_ROOT 1
6719 EOF
6720
6721 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6722
6723 else
6724
6725 cf_ncuhdr_root=ncurses
6726
6727 test -n "$cf_cv_curses_dir" && \
6728 test "$cf_cv_curses_dir" != "no" && { \
6729
6730 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6731   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6732   do
6733         while test $cf_add_incdir != /usr/include
6734         do
6735           if test -d $cf_add_incdir
6736           then
6737                 cf_have_incdir=no
6738                 if test -n "$CFLAGS$CPPFLAGS" ; then
6739                   # a loop is needed to ensure we can add subdirs of existing dirs
6740                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6741                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6742                           cf_have_incdir=yes; break
6743                         fi
6744                   done
6745                 fi
6746
6747                 if test "$cf_have_incdir" = no ; then
6748                   if test "$cf_add_incdir" = /usr/local/include ; then
6749                         if test "$GCC" = yes
6750                         then
6751                           cf_save_CPPFLAGS=$CPPFLAGS
6752                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6753                           cat >conftest.$ac_ext <<_ACEOF
6754 #line 6754 "configure"
6755 #include "confdefs.h"
6756 #include <stdio.h>
6757 int
6758 main ()
6759 {
6760 printf("Hello")
6761   ;
6762   return 0;
6763 }
6764 _ACEOF
6765 rm -f conftest.$ac_objext
6766 if { (eval echo "$as_me:6766: \"$ac_compile\"") >&5
6767   (eval $ac_compile) 2>&5
6768   ac_status=$?
6769   echo "$as_me:6769: \$? = $ac_status" >&5
6770   (exit $ac_status); } &&
6771          { ac_try='test -s conftest.$ac_objext'
6772   { (eval echo "$as_me:6772: \"$ac_try\"") >&5
6773   (eval $ac_try) 2>&5
6774   ac_status=$?
6775   echo "$as_me:6775: \$? = $ac_status" >&5
6776   (exit $ac_status); }; }; then
6777   :
6778 else
6779   echo "$as_me: failed program was:" >&5
6780 cat conftest.$ac_ext >&5
6781 cf_have_incdir=yes
6782 fi
6783 rm -f conftest.$ac_objext conftest.$ac_ext
6784                           CPPFLAGS=$cf_save_CPPFLAGS
6785                         fi
6786                   fi
6787                 fi
6788
6789                 if test "$cf_have_incdir" = no ; then
6790                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6791
6792 echo "${as_me:-configure}:6792: testing adding $cf_add_incdir to include-path ..." 1>&5
6793
6794                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6795
6796                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6797                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6798                   cf_add_incdir="$cf_top_incdir"
6799                 else
6800                   break
6801                 fi
6802           fi
6803         done
6804   done
6805 fi
6806
6807 }
6808
6809 echo "$as_me:6809: checking for $cf_ncuhdr_root header in include-path" >&5
6810 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6811 if test "${cf_cv_ncurses_h+set}" = set; then
6812   echo $ECHO_N "(cached) $ECHO_C" >&6
6813 else
6814
6815         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6816         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6817         for cf_header in $cf_header_list
6818         do
6819
6820         cat >conftest.$ac_ext <<_ACEOF
6821 #line 6821 "configure"
6822 #include "confdefs.h"
6823
6824 #include <$cf_header>
6825 int
6826 main ()
6827 {
6828
6829 #ifdef NCURSES_VERSION
6830
6831 printf("%s\n", NCURSES_VERSION);
6832 #else
6833 #ifdef __NCURSES_H
6834 printf("old\n");
6835 #else
6836         make an error
6837 #endif
6838 #endif
6839
6840   ;
6841   return 0;
6842 }
6843 _ACEOF
6844 rm -f conftest.$ac_objext
6845 if { (eval echo "$as_me:6845: \"$ac_compile\"") >&5
6846   (eval $ac_compile) 2>&5
6847   ac_status=$?
6848   echo "$as_me:6848: \$? = $ac_status" >&5
6849   (exit $ac_status); } &&
6850          { ac_try='test -s conftest.$ac_objext'
6851   { (eval echo "$as_me:6851: \"$ac_try\"") >&5
6852   (eval $ac_try) 2>&5
6853   ac_status=$?
6854   echo "$as_me:6854: \$? = $ac_status" >&5
6855   (exit $ac_status); }; }; then
6856   cf_cv_ncurses_h=$cf_header
6857
6858 else
6859   echo "$as_me: failed program was:" >&5
6860 cat conftest.$ac_ext >&5
6861 cf_cv_ncurses_h=no
6862 fi
6863 rm -f conftest.$ac_objext conftest.$ac_ext
6864
6865                 test "$cf_cv_ncurses_h" != no && break
6866         done
6867
6868 fi
6869 echo "$as_me:6869: result: $cf_cv_ncurses_h" >&5
6870 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6871
6872 if test "$cf_cv_ncurses_h" != no ; then
6873         cf_cv_ncurses_header=$cf_cv_ncurses_h
6874 else
6875
6876 echo "$as_me:6876: checking for $cf_ncuhdr_root include-path" >&5
6877 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6878 if test "${cf_cv_ncurses_h2+set}" = set; then
6879   echo $ECHO_N "(cached) $ECHO_C" >&6
6880 else
6881
6882         test -n "$verbose" && echo
6883
6884 cf_search=
6885
6886 # collect the current set of include-directories from compiler flags
6887 cf_header_path_list=""
6888 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6889         for cf_header_path in $CPPFLAGS $CFLAGS
6890         do
6891                 case $cf_header_path in #(vi
6892                 -I*)
6893                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6894
6895 test "$cf_header_path" != "NONE" && \
6896 test -d "$cf_header_path" && \
6897  {
6898         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6899         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6900         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6901         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6902         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6903         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"
6904 }
6905
6906                         cf_header_path_list="$cf_header_path_list $cf_search"
6907                         ;;
6908                 esac
6909         done
6910 fi
6911
6912 # add the variations for the package we are looking for
6913
6914 cf_search=
6915
6916 test "/usr" != "$prefix" && \
6917 test -d "/usr" && \
6918 (test $prefix = NONE || test "/usr" != "$prefix") && {
6919         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6920         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6921         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6922         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6923         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6924         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6925 }
6926
6927 test "$prefix" != "NONE" && \
6928 test -d "$prefix" && \
6929  {
6930         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6931         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6932         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6933         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6934         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6935         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6936 }
6937
6938 test "/usr/local" != "$prefix" && \
6939 test -d "/usr/local" && \
6940 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6941         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6942         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6943         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6944         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6945         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6946         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6947 }
6948
6949 test "/opt" != "$prefix" && \
6950 test -d "/opt" && \
6951 (test $prefix = NONE || test "/opt" != "$prefix") && {
6952         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6953         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6954         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6955         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6956         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6957         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6958 }
6959
6960 test "$HOME" != "$prefix" && \
6961 test -d "$HOME" && \
6962 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6963         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6964         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6965         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6966         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6967         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6968         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6969 }
6970
6971 test "$includedir" != NONE && \
6972 test "$includedir" != "/usr/include" && \
6973 test -d "$includedir" && {
6974         test -d $includedir &&    cf_search="$cf_search $includedir"
6975         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6976 }
6977
6978 test "$oldincludedir" != NONE && \
6979 test "$oldincludedir" != "/usr/include" && \
6980 test -d "$oldincludedir" && {
6981         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6982         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6983 }
6984
6985 cf_search="$cf_search $cf_header_path_list"
6986
6987         test -n "$verbose" && echo search path $cf_search
6988         cf_save2_CPPFLAGS="$CPPFLAGS"
6989         for cf_incdir in $cf_search
6990         do
6991
6992 if test -n "$cf_incdir" ; then
6993   for cf_add_incdir in $cf_incdir
6994   do
6995         while test $cf_add_incdir != /usr/include
6996         do
6997           if test -d $cf_add_incdir
6998           then
6999                 cf_have_incdir=no
7000                 if test -n "$CFLAGS$CPPFLAGS" ; then
7001                   # a loop is needed to ensure we can add subdirs of existing dirs
7002                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7003                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7004                           cf_have_incdir=yes; break
7005                         fi
7006                   done
7007                 fi
7008
7009                 if test "$cf_have_incdir" = no ; then
7010                   if test "$cf_add_incdir" = /usr/local/include ; then
7011                         if test "$GCC" = yes
7012                         then
7013                           cf_save_CPPFLAGS=$CPPFLAGS
7014                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7015                           cat >conftest.$ac_ext <<_ACEOF
7016 #line 7016 "configure"
7017 #include "confdefs.h"
7018 #include <stdio.h>
7019 int
7020 main ()
7021 {
7022 printf("Hello")
7023   ;
7024   return 0;
7025 }
7026 _ACEOF
7027 rm -f conftest.$ac_objext
7028 if { (eval echo "$as_me:7028: \"$ac_compile\"") >&5
7029   (eval $ac_compile) 2>&5
7030   ac_status=$?
7031   echo "$as_me:7031: \$? = $ac_status" >&5
7032   (exit $ac_status); } &&
7033          { ac_try='test -s conftest.$ac_objext'
7034   { (eval echo "$as_me:7034: \"$ac_try\"") >&5
7035   (eval $ac_try) 2>&5
7036   ac_status=$?
7037   echo "$as_me:7037: \$? = $ac_status" >&5
7038   (exit $ac_status); }; }; then
7039   :
7040 else
7041   echo "$as_me: failed program was:" >&5
7042 cat conftest.$ac_ext >&5
7043 cf_have_incdir=yes
7044 fi
7045 rm -f conftest.$ac_objext conftest.$ac_ext
7046                           CPPFLAGS=$cf_save_CPPFLAGS
7047                         fi
7048                   fi
7049                 fi
7050
7051                 if test "$cf_have_incdir" = no ; then
7052                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7053
7054 echo "${as_me:-configure}:7054: testing adding $cf_add_incdir to include-path ..." 1>&5
7055
7056                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7057
7058                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7059                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7060                   cf_add_incdir="$cf_top_incdir"
7061                 else
7062                   break
7063                 fi
7064           fi
7065         done
7066   done
7067 fi
7068
7069                 for cf_header in \
7070                         ncurses.h \
7071                         curses.h
7072                 do
7073
7074         cat >conftest.$ac_ext <<_ACEOF
7075 #line 7075 "configure"
7076 #include "confdefs.h"
7077
7078 #include <$cf_header>
7079 int
7080 main ()
7081 {
7082
7083 #ifdef NCURSES_VERSION
7084
7085 printf("%s\n", NCURSES_VERSION);
7086 #else
7087 #ifdef __NCURSES_H
7088 printf("old\n");
7089 #else
7090         make an error
7091 #endif
7092 #endif
7093
7094   ;
7095   return 0;
7096 }
7097 _ACEOF
7098 rm -f conftest.$ac_objext
7099 if { (eval echo "$as_me:7099: \"$ac_compile\"") >&5
7100   (eval $ac_compile) 2>&5
7101   ac_status=$?
7102   echo "$as_me:7102: \$? = $ac_status" >&5
7103   (exit $ac_status); } &&
7104          { ac_try='test -s conftest.$ac_objext'
7105   { (eval echo "$as_me:7105: \"$ac_try\"") >&5
7106   (eval $ac_try) 2>&5
7107   ac_status=$?
7108   echo "$as_me:7108: \$? = $ac_status" >&5
7109   (exit $ac_status); }; }; then
7110   cf_cv_ncurses_h2=$cf_header
7111
7112 else
7113   echo "$as_me: failed program was:" >&5
7114 cat conftest.$ac_ext >&5
7115 cf_cv_ncurses_h2=no
7116 fi
7117 rm -f conftest.$ac_objext conftest.$ac_ext
7118
7119                         if test "$cf_cv_ncurses_h2" != no ; then
7120                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7121                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7122                                 break
7123                         fi
7124                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7125                 done
7126                 CPPFLAGS="$cf_save2_CPPFLAGS"
7127                 test "$cf_cv_ncurses_h2" != no && break
7128         done
7129         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7129: error: not found" >&5
7130 echo "$as_me: error: not found" >&2;}
7131    { (exit 1); exit 1; }; }
7132
7133 fi
7134 echo "$as_me:7134: result: $cf_cv_ncurses_h2" >&5
7135 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7136
7137         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7138         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7139         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7140                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7141         fi
7142
7143 if test -n "$cf_1st_incdir" ; then
7144   for cf_add_incdir in $cf_1st_incdir
7145   do
7146         while test $cf_add_incdir != /usr/include
7147         do
7148           if test -d $cf_add_incdir
7149           then
7150                 cf_have_incdir=no
7151                 if test -n "$CFLAGS$CPPFLAGS" ; then
7152                   # a loop is needed to ensure we can add subdirs of existing dirs
7153                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7154                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7155                           cf_have_incdir=yes; break
7156                         fi
7157                   done
7158                 fi
7159
7160                 if test "$cf_have_incdir" = no ; then
7161                   if test "$cf_add_incdir" = /usr/local/include ; then
7162                         if test "$GCC" = yes
7163                         then
7164                           cf_save_CPPFLAGS=$CPPFLAGS
7165                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7166                           cat >conftest.$ac_ext <<_ACEOF
7167 #line 7167 "configure"
7168 #include "confdefs.h"
7169 #include <stdio.h>
7170 int
7171 main ()
7172 {
7173 printf("Hello")
7174   ;
7175   return 0;
7176 }
7177 _ACEOF
7178 rm -f conftest.$ac_objext
7179 if { (eval echo "$as_me:7179: \"$ac_compile\"") >&5
7180   (eval $ac_compile) 2>&5
7181   ac_status=$?
7182   echo "$as_me:7182: \$? = $ac_status" >&5
7183   (exit $ac_status); } &&
7184          { ac_try='test -s conftest.$ac_objext'
7185   { (eval echo "$as_me:7185: \"$ac_try\"") >&5
7186   (eval $ac_try) 2>&5
7187   ac_status=$?
7188   echo "$as_me:7188: \$? = $ac_status" >&5
7189   (exit $ac_status); }; }; then
7190   :
7191 else
7192   echo "$as_me: failed program was:" >&5
7193 cat conftest.$ac_ext >&5
7194 cf_have_incdir=yes
7195 fi
7196 rm -f conftest.$ac_objext conftest.$ac_ext
7197                           CPPFLAGS=$cf_save_CPPFLAGS
7198                         fi
7199                   fi
7200                 fi
7201
7202                 if test "$cf_have_incdir" = no ; then
7203                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7204
7205 echo "${as_me:-configure}:7205: testing adding $cf_add_incdir to include-path ..." 1>&5
7206
7207                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7208
7209                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7210                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7211                   cf_add_incdir="$cf_top_incdir"
7212                 else
7213                   break
7214                 fi
7215           fi
7216         done
7217   done
7218 fi
7219
7220 fi
7221
7222 # Set definitions to allow ifdef'ing for ncurses.h
7223
7224 case $cf_cv_ncurses_header in # (vi
7225 *ncurses.h)
7226         cat >>confdefs.h <<\EOF
7227 #define HAVE_NCURSES_H 1
7228 EOF
7229
7230         ;;
7231 esac
7232
7233 case $cf_cv_ncurses_header in # (vi
7234 ncurses/curses.h|ncurses/ncurses.h)
7235         cat >>confdefs.h <<\EOF
7236 #define HAVE_NCURSES_NCURSES_H 1
7237 EOF
7238
7239         ;;
7240 ncursesw/curses.h|ncursesw/ncurses.h)
7241         cat >>confdefs.h <<\EOF
7242 #define HAVE_NCURSESW_NCURSES_H 1
7243 EOF
7244
7245         ;;
7246 esac
7247
7248 echo "$as_me:7248: checking for terminfo header" >&5
7249 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7250 if test "${cf_cv_term_header+set}" = set; then
7251   echo $ECHO_N "(cached) $ECHO_C" >&6
7252 else
7253
7254 case ${cf_cv_ncurses_header} in #(vi
7255 */ncurses.h|*/ncursesw.h) #(vi
7256         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7257         ;;
7258 *)
7259         cf_term_header=term.h
7260         ;;
7261 esac
7262
7263 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7264 do
7265 cat >conftest.$ac_ext <<_ACEOF
7266 #line 7266 "configure"
7267 #include "confdefs.h"
7268 #include <stdio.h>
7269 #include <${cf_cv_ncurses_header:-curses.h}>
7270 #include <$cf_test>
7271
7272 int
7273 main ()
7274 {
7275 int x = auto_left_margin
7276   ;
7277   return 0;
7278 }
7279 _ACEOF
7280 rm -f conftest.$ac_objext
7281 if { (eval echo "$as_me:7281: \"$ac_compile\"") >&5
7282   (eval $ac_compile) 2>&5
7283   ac_status=$?
7284   echo "$as_me:7284: \$? = $ac_status" >&5
7285   (exit $ac_status); } &&
7286          { ac_try='test -s conftest.$ac_objext'
7287   { (eval echo "$as_me:7287: \"$ac_try\"") >&5
7288   (eval $ac_try) 2>&5
7289   ac_status=$?
7290   echo "$as_me:7290: \$? = $ac_status" >&5
7291   (exit $ac_status); }; }; then
7292
7293         cf_cv_term_header="$cf_test"
7294 else
7295   echo "$as_me: failed program was:" >&5
7296 cat conftest.$ac_ext >&5
7297
7298         cf_cv_term_header=unknown
7299
7300 fi
7301 rm -f conftest.$ac_objext conftest.$ac_ext
7302         test "$cf_cv_term_header" != unknown && break
7303 done
7304
7305 fi
7306 echo "$as_me:7306: result: $cf_cv_term_header" >&5
7307 echo "${ECHO_T}$cf_cv_term_header" >&6
7308
7309 # Set definitions to allow ifdef'ing to accommodate subdirectories
7310
7311 case $cf_cv_term_header in # (vi
7312 *term.h)
7313         cat >>confdefs.h <<\EOF
7314 #define HAVE_TERM_H 1
7315 EOF
7316
7317         ;;
7318 esac
7319
7320 case $cf_cv_term_header in # (vi
7321 ncurses/term.h) #(vi
7322         cat >>confdefs.h <<\EOF
7323 #define HAVE_NCURSES_TERM_H 1
7324 EOF
7325
7326         ;;
7327 ncursesw/term.h)
7328         cat >>confdefs.h <<\EOF
7329 #define HAVE_NCURSESW_TERM_H 1
7330 EOF
7331
7332         ;;
7333 esac
7334
7335 # some applications need this, but should check for NCURSES_VERSION
7336 cat >>confdefs.h <<\EOF
7337 #define NCURSES 1
7338 EOF
7339
7340 echo "$as_me:7340: checking for ncurses version" >&5
7341 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7342 if test "${cf_cv_ncurses_version+set}" = set; then
7343   echo $ECHO_N "(cached) $ECHO_C" >&6
7344 else
7345
7346         cf_cv_ncurses_version=no
7347         cf_tempfile=out$$
7348         rm -f $cf_tempfile
7349         if test "$cross_compiling" = yes; then
7350
7351         # This will not work if the preprocessor splits the line after the
7352         # Autoconf token.  The 'unproto' program does that.
7353         cat > conftest.$ac_ext <<EOF
7354 #include <${cf_cv_ncurses_header:-curses.h}>
7355 #undef Autoconf
7356 #ifdef NCURSES_VERSION
7357 Autoconf NCURSES_VERSION
7358 #else
7359 #ifdef __NCURSES_H
7360 Autoconf "old"
7361 #endif
7362 ;
7363 #endif
7364 EOF
7365         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7366         { (eval echo "$as_me:7366: \"$cf_try\"") >&5
7367   (eval $cf_try) 2>&5
7368   ac_status=$?
7369   echo "$as_me:7369: \$? = $ac_status" >&5
7370   (exit $ac_status); }
7371         if test -f conftest.out ; then
7372                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7373                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7374                 rm -f conftest.out
7375         fi
7376
7377 else
7378   cat >conftest.$ac_ext <<_ACEOF
7379 #line 7379 "configure"
7380 #include "confdefs.h"
7381
7382 #include <${cf_cv_ncurses_header:-curses.h}>
7383 #include <stdio.h>
7384 int main()
7385 {
7386         FILE *fp = fopen("$cf_tempfile", "w");
7387 #ifdef NCURSES_VERSION
7388 # ifdef NCURSES_VERSION_PATCH
7389         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7390 # else
7391         fprintf(fp, "%s\n", NCURSES_VERSION);
7392 # endif
7393 #else
7394 # ifdef __NCURSES_H
7395         fprintf(fp, "old\n");
7396 # else
7397         make an error
7398 # endif
7399 #endif
7400         ${cf_cv_main_return:-return}(0);
7401 }
7402 _ACEOF
7403 rm -f conftest$ac_exeext
7404 if { (eval echo "$as_me:7404: \"$ac_link\"") >&5
7405   (eval $ac_link) 2>&5
7406   ac_status=$?
7407   echo "$as_me:7407: \$? = $ac_status" >&5
7408   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7409   { (eval echo "$as_me:7409: \"$ac_try\"") >&5
7410   (eval $ac_try) 2>&5
7411   ac_status=$?
7412   echo "$as_me:7412: \$? = $ac_status" >&5
7413   (exit $ac_status); }; }; then
7414
7415         cf_cv_ncurses_version=`cat $cf_tempfile`
7416 else
7417   echo "$as_me: program exited with status $ac_status" >&5
7418 echo "$as_me: failed program was:" >&5
7419 cat conftest.$ac_ext >&5
7420 fi
7421 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7422 fi
7423         rm -f $cf_tempfile
7424
7425 fi
7426 echo "$as_me:7426: result: $cf_cv_ncurses_version" >&5
7427 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7428 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7429 #define NCURSES 1
7430 EOF
7431
7432 cf_nculib_root=ncurses
7433         # This works, except for the special case where we find gpm, but
7434         # ncurses is in a nonstandard location via $LIBS, and we really want
7435         # to link gpm.
7436 cf_ncurses_LIBS=""
7437 cf_ncurses_SAVE="$LIBS"
7438 echo "$as_me:7438: checking for Gpm_Open in -lgpm" >&5
7439 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7440 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7441   echo $ECHO_N "(cached) $ECHO_C" >&6
7442 else
7443   ac_check_lib_save_LIBS=$LIBS
7444 LIBS="-lgpm  $LIBS"
7445 cat >conftest.$ac_ext <<_ACEOF
7446 #line 7446 "configure"
7447 #include "confdefs.h"
7448
7449 /* Override any gcc2 internal prototype to avoid an error.  */
7450 #ifdef __cplusplus
7451 extern "C"
7452 #endif
7453 /* We use char because int might match the return type of a gcc2
7454    builtin and then its argument prototype would still apply.  */
7455 char Gpm_Open ();
7456 int
7457 main ()
7458 {
7459 Gpm_Open ();
7460   ;
7461   return 0;
7462 }
7463 _ACEOF
7464 rm -f conftest.$ac_objext conftest$ac_exeext
7465 if { (eval echo "$as_me:7465: \"$ac_link\"") >&5
7466   (eval $ac_link) 2>&5
7467   ac_status=$?
7468   echo "$as_me:7468: \$? = $ac_status" >&5
7469   (exit $ac_status); } &&
7470          { ac_try='test -s conftest$ac_exeext'
7471   { (eval echo "$as_me:7471: \"$ac_try\"") >&5
7472   (eval $ac_try) 2>&5
7473   ac_status=$?
7474   echo "$as_me:7474: \$? = $ac_status" >&5
7475   (exit $ac_status); }; }; then
7476   ac_cv_lib_gpm_Gpm_Open=yes
7477 else
7478   echo "$as_me: failed program was:" >&5
7479 cat conftest.$ac_ext >&5
7480 ac_cv_lib_gpm_Gpm_Open=no
7481 fi
7482 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7483 LIBS=$ac_check_lib_save_LIBS
7484 fi
7485 echo "$as_me:7485: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7486 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7487 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7488   echo "$as_me:7488: checking for initscr in -lgpm" >&5
7489 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7490 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7491   echo $ECHO_N "(cached) $ECHO_C" >&6
7492 else
7493   ac_check_lib_save_LIBS=$LIBS
7494 LIBS="-lgpm  $LIBS"
7495 cat >conftest.$ac_ext <<_ACEOF
7496 #line 7496 "configure"
7497 #include "confdefs.h"
7498
7499 /* Override any gcc2 internal prototype to avoid an error.  */
7500 #ifdef __cplusplus
7501 extern "C"
7502 #endif
7503 /* We use char because int might match the return type of a gcc2
7504    builtin and then its argument prototype would still apply.  */
7505 char initscr ();
7506 int
7507 main ()
7508 {
7509 initscr ();
7510   ;
7511   return 0;
7512 }
7513 _ACEOF
7514 rm -f conftest.$ac_objext conftest$ac_exeext
7515 if { (eval echo "$as_me:7515: \"$ac_link\"") >&5
7516   (eval $ac_link) 2>&5
7517   ac_status=$?
7518   echo "$as_me:7518: \$? = $ac_status" >&5
7519   (exit $ac_status); } &&
7520          { ac_try='test -s conftest$ac_exeext'
7521   { (eval echo "$as_me:7521: \"$ac_try\"") >&5
7522   (eval $ac_try) 2>&5
7523   ac_status=$?
7524   echo "$as_me:7524: \$? = $ac_status" >&5
7525   (exit $ac_status); }; }; then
7526   ac_cv_lib_gpm_initscr=yes
7527 else
7528   echo "$as_me: failed program was:" >&5
7529 cat conftest.$ac_ext >&5
7530 ac_cv_lib_gpm_initscr=no
7531 fi
7532 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7533 LIBS=$ac_check_lib_save_LIBS
7534 fi
7535 echo "$as_me:7535: result: $ac_cv_lib_gpm_initscr" >&5
7536 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7537 if test $ac_cv_lib_gpm_initscr = yes; then
7538   LIBS="$cf_ncurses_SAVE"
7539 else
7540   cf_ncurses_LIBS="-lgpm"
7541 fi
7542
7543 fi
7544
7545 case $host_os in #(vi
7546 freebsd*)
7547         # This is only necessary if you are linking against an obsolete
7548         # version of ncurses (but it should do no harm, since it's static).
7549         if test "$cf_nculib_root" = ncurses ; then
7550                 echo "$as_me:7550: checking for tgoto in -lmytinfo" >&5
7551 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7552 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7553   echo $ECHO_N "(cached) $ECHO_C" >&6
7554 else
7555   ac_check_lib_save_LIBS=$LIBS
7556 LIBS="-lmytinfo  $LIBS"
7557 cat >conftest.$ac_ext <<_ACEOF
7558 #line 7558 "configure"
7559 #include "confdefs.h"
7560
7561 /* Override any gcc2 internal prototype to avoid an error.  */
7562 #ifdef __cplusplus
7563 extern "C"
7564 #endif
7565 /* We use char because int might match the return type of a gcc2
7566    builtin and then its argument prototype would still apply.  */
7567 char tgoto ();
7568 int
7569 main ()
7570 {
7571 tgoto ();
7572   ;
7573   return 0;
7574 }
7575 _ACEOF
7576 rm -f conftest.$ac_objext conftest$ac_exeext
7577 if { (eval echo "$as_me:7577: \"$ac_link\"") >&5
7578   (eval $ac_link) 2>&5
7579   ac_status=$?
7580   echo "$as_me:7580: \$? = $ac_status" >&5
7581   (exit $ac_status); } &&
7582          { ac_try='test -s conftest$ac_exeext'
7583   { (eval echo "$as_me:7583: \"$ac_try\"") >&5
7584   (eval $ac_try) 2>&5
7585   ac_status=$?
7586   echo "$as_me:7586: \$? = $ac_status" >&5
7587   (exit $ac_status); }; }; then
7588   ac_cv_lib_mytinfo_tgoto=yes
7589 else
7590   echo "$as_me: failed program was:" >&5
7591 cat conftest.$ac_ext >&5
7592 ac_cv_lib_mytinfo_tgoto=no
7593 fi
7594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7595 LIBS=$ac_check_lib_save_LIBS
7596 fi
7597 echo "$as_me:7597: result: $ac_cv_lib_mytinfo_tgoto" >&5
7598 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7599 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7600   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7601 fi
7602
7603         fi
7604         ;;
7605 esac
7606
7607 LIBS="$cf_ncurses_LIBS $LIBS"
7608
7609 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7610 then
7611         LIBS="-l$cf_nculib_root $LIBS"
7612 else
7613
7614         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7615         cf_libdir=""
7616         echo "$as_me:7616: checking for initscr" >&5
7617 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7618 if test "${ac_cv_func_initscr+set}" = set; then
7619   echo $ECHO_N "(cached) $ECHO_C" >&6
7620 else
7621   cat >conftest.$ac_ext <<_ACEOF
7622 #line 7622 "configure"
7623 #include "confdefs.h"
7624 /* System header to define __stub macros and hopefully few prototypes,
7625     which can conflict with char initscr (); below.  */
7626 #include <assert.h>
7627 /* Override any gcc2 internal prototype to avoid an error.  */
7628 #ifdef __cplusplus
7629 extern "C"
7630 #endif
7631 /* We use char because int might match the return type of a gcc2
7632    builtin and then its argument prototype would still apply.  */
7633 char initscr ();
7634 char (*f) ();
7635
7636 int
7637 main ()
7638 {
7639 /* The GNU C library defines this for functions which it implements
7640     to always fail with ENOSYS.  Some functions are actually named
7641     something starting with __ and the normal name is an alias.  */
7642 #if defined (__stub_initscr) || defined (__stub___initscr)
7643 choke me
7644 #else
7645 f = initscr;
7646 #endif
7647
7648   ;
7649   return 0;
7650 }
7651 _ACEOF
7652 rm -f conftest.$ac_objext conftest$ac_exeext
7653 if { (eval echo "$as_me:7653: \"$ac_link\"") >&5
7654   (eval $ac_link) 2>&5
7655   ac_status=$?
7656   echo "$as_me:7656: \$? = $ac_status" >&5
7657   (exit $ac_status); } &&
7658          { ac_try='test -s conftest$ac_exeext'
7659   { (eval echo "$as_me:7659: \"$ac_try\"") >&5
7660   (eval $ac_try) 2>&5
7661   ac_status=$?
7662   echo "$as_me:7662: \$? = $ac_status" >&5
7663   (exit $ac_status); }; }; then
7664   ac_cv_func_initscr=yes
7665 else
7666   echo "$as_me: failed program was:" >&5
7667 cat conftest.$ac_ext >&5
7668 ac_cv_func_initscr=no
7669 fi
7670 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7671 fi
7672 echo "$as_me:7672: result: $ac_cv_func_initscr" >&5
7673 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7674 if test $ac_cv_func_initscr = yes; then
7675   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7676 else
7677
7678                 cf_save_LIBS="$LIBS"
7679                 echo "$as_me:7679: checking for initscr in -l$cf_nculib_root" >&5
7680 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7681                 LIBS="-l$cf_nculib_root $LIBS"
7682                 cat >conftest.$ac_ext <<_ACEOF
7683 #line 7683 "configure"
7684 #include "confdefs.h"
7685 #include <${cf_cv_ncurses_header:-curses.h}>
7686 int
7687 main ()
7688 {
7689 initscr()
7690   ;
7691   return 0;
7692 }
7693 _ACEOF
7694 rm -f conftest.$ac_objext conftest$ac_exeext
7695 if { (eval echo "$as_me:7695: \"$ac_link\"") >&5
7696   (eval $ac_link) 2>&5
7697   ac_status=$?
7698   echo "$as_me:7698: \$? = $ac_status" >&5
7699   (exit $ac_status); } &&
7700          { ac_try='test -s conftest$ac_exeext'
7701   { (eval echo "$as_me:7701: \"$ac_try\"") >&5
7702   (eval $ac_try) 2>&5
7703   ac_status=$?
7704   echo "$as_me:7704: \$? = $ac_status" >&5
7705   (exit $ac_status); }; }; then
7706   echo "$as_me:7706: result: yes" >&5
7707 echo "${ECHO_T}yes" >&6
7708                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7709
7710 else
7711   echo "$as_me: failed program was:" >&5
7712 cat conftest.$ac_ext >&5
7713 echo "$as_me:7713: result: no" >&5
7714 echo "${ECHO_T}no" >&6
7715
7716 cf_search=
7717 cf_library_path_list=""
7718 if test -n "${LDFLAGS}${LIBS}" ; then
7719         for cf_library_path in $LDFLAGS $LIBS
7720         do
7721                 case $cf_library_path in #(vi
7722                 -L*)
7723                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7724
7725 test "$cf_library_path" != "NONE" && \
7726 test -d "$cf_library_path" && \
7727  {
7728         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7729         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7730         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7731         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7732         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7733         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"
7734 }
7735
7736                         cf_library_path_list="$cf_library_path_list $cf_search"
7737                         ;;
7738                 esac
7739         done
7740 fi
7741
7742 cf_search=
7743
7744 test "/usr" != "$prefix" && \
7745 test -d "/usr" && \
7746 (test $prefix = NONE || test "/usr" != "$prefix") && {
7747         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7748         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7749         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7750         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7751         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7752         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7753 }
7754
7755 test "$prefix" != "NONE" && \
7756 test -d "$prefix" && \
7757  {
7758         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7759         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7760         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7761         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7762         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7763         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7764 }
7765
7766 test "/usr/local" != "$prefix" && \
7767 test -d "/usr/local" && \
7768 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7769         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7770         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7771         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7772         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7773         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7774         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7775 }
7776
7777 test "/opt" != "$prefix" && \
7778 test -d "/opt" && \
7779 (test $prefix = NONE || test "/opt" != "$prefix") && {
7780         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7781         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7782         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7783         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7784         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7785         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7786 }
7787
7788 test "$HOME" != "$prefix" && \
7789 test -d "$HOME" && \
7790 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7791         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7792         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7793         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7794         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7795         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7796         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7797 }
7798
7799 cf_search="$cf_library_path_list $cf_search"
7800
7801                         for cf_libdir in $cf_search
7802                         do
7803                                 echo "$as_me:7803: checking for -l$cf_nculib_root in $cf_libdir" >&5
7804 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7805                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7806                                 cat >conftest.$ac_ext <<_ACEOF
7807 #line 7807 "configure"
7808 #include "confdefs.h"
7809 #include <${cf_cv_ncurses_header:-curses.h}>
7810 int
7811 main ()
7812 {
7813 initscr()
7814   ;
7815   return 0;
7816 }
7817 _ACEOF
7818 rm -f conftest.$ac_objext conftest$ac_exeext
7819 if { (eval echo "$as_me:7819: \"$ac_link\"") >&5
7820   (eval $ac_link) 2>&5
7821   ac_status=$?
7822   echo "$as_me:7822: \$? = $ac_status" >&5
7823   (exit $ac_status); } &&
7824          { ac_try='test -s conftest$ac_exeext'
7825   { (eval echo "$as_me:7825: \"$ac_try\"") >&5
7826   (eval $ac_try) 2>&5
7827   ac_status=$?
7828   echo "$as_me:7828: \$? = $ac_status" >&5
7829   (exit $ac_status); }; }; then
7830   echo "$as_me:7830: result: yes" >&5
7831 echo "${ECHO_T}yes" >&6
7832                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7833                                          break
7834 else
7835   echo "$as_me: failed program was:" >&5
7836 cat conftest.$ac_ext >&5
7837 echo "$as_me:7837: result: no" >&5
7838 echo "${ECHO_T}no" >&6
7839                                          LIBS="$cf_save_LIBS"
7840 fi
7841 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7842                         done
7843
7844 fi
7845 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7846
7847 fi
7848
7849 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7850
7851 if test $cf_found_library = no ; then
7852         { { echo "$as_me:7852: error: Cannot link $cf_nculib_root library" >&5
7853 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7854    { (exit 1); exit 1; }; }
7855 fi
7856
7857 fi
7858
7859 if test -n "$cf_ncurses_LIBS" ; then
7860         echo "$as_me:7860: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7861 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7862         cf_ncurses_SAVE="$LIBS"
7863         for p in $cf_ncurses_LIBS ; do
7864                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7865                 if test "$q" != "$LIBS" ; then
7866                         LIBS="$q"
7867                 fi
7868         done
7869         cat >conftest.$ac_ext <<_ACEOF
7870 #line 7870 "configure"
7871 #include "confdefs.h"
7872 #include <${cf_cv_ncurses_header:-curses.h}>
7873 int
7874 main ()
7875 {
7876 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7877   ;
7878   return 0;
7879 }
7880 _ACEOF
7881 rm -f conftest.$ac_objext conftest$ac_exeext
7882 if { (eval echo "$as_me:7882: \"$ac_link\"") >&5
7883   (eval $ac_link) 2>&5
7884   ac_status=$?
7885   echo "$as_me:7885: \$? = $ac_status" >&5
7886   (exit $ac_status); } &&
7887          { ac_try='test -s conftest$ac_exeext'
7888   { (eval echo "$as_me:7888: \"$ac_try\"") >&5
7889   (eval $ac_try) 2>&5
7890   ac_status=$?
7891   echo "$as_me:7891: \$? = $ac_status" >&5
7892   (exit $ac_status); }; }; then
7893   echo "$as_me:7893: result: yes" >&5
7894 echo "${ECHO_T}yes" >&6
7895 else
7896   echo "$as_me: failed program was:" >&5
7897 cat conftest.$ac_ext >&5
7898 echo "$as_me:7898: result: no" >&5
7899 echo "${ECHO_T}no" >&6
7900                  LIBS="$cf_ncurses_SAVE"
7901 fi
7902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7903 fi
7904
7905 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7906
7907 cat >>confdefs.h <<EOF
7908 #define $cf_nculib_ROOT 1
7909 EOF
7910
7911 fi
7912
7913         ;;
7914 ncursesw)
7915         cf_cv_libtype=w
7916
7917 echo "$as_me:7917: checking for multibyte character support" >&5
7918 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7919 if test "${cf_cv_utf8_lib+set}" = set; then
7920   echo $ECHO_N "(cached) $ECHO_C" >&6
7921 else
7922
7923         cf_save_LIBS="$LIBS"
7924         cat >conftest.$ac_ext <<_ACEOF
7925 #line 7925 "configure"
7926 #include "confdefs.h"
7927
7928 #include <stdlib.h>
7929 int
7930 main ()
7931 {
7932 putwc(0,0);
7933   ;
7934   return 0;
7935 }
7936 _ACEOF
7937 rm -f conftest.$ac_objext conftest$ac_exeext
7938 if { (eval echo "$as_me:7938: \"$ac_link\"") >&5
7939   (eval $ac_link) 2>&5
7940   ac_status=$?
7941   echo "$as_me:7941: \$? = $ac_status" >&5
7942   (exit $ac_status); } &&
7943          { ac_try='test -s conftest$ac_exeext'
7944   { (eval echo "$as_me:7944: \"$ac_try\"") >&5
7945   (eval $ac_try) 2>&5
7946   ac_status=$?
7947   echo "$as_me:7947: \$? = $ac_status" >&5
7948   (exit $ac_status); }; }; then
7949   cf_cv_utf8_lib=yes
7950 else
7951   echo "$as_me: failed program was:" >&5
7952 cat conftest.$ac_ext >&5
7953
7954 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7955 # will be set on completion of the AC_TRY_LINK below.
7956 cf_cv_header_path_utf8=
7957 cf_cv_library_path_utf8=
7958
7959 echo "${as_me:-configure}:7959: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7960
7961 cf_save_LIBS="$LIBS"
7962
7963 cat >conftest.$ac_ext <<_ACEOF
7964 #line 7964 "configure"
7965 #include "confdefs.h"
7966
7967 #include <libutf8.h>
7968 int
7969 main ()
7970 {
7971 putwc(0,0);
7972   ;
7973   return 0;
7974 }
7975 _ACEOF
7976 rm -f conftest.$ac_objext conftest$ac_exeext
7977 if { (eval echo "$as_me:7977: \"$ac_link\"") >&5
7978   (eval $ac_link) 2>&5
7979   ac_status=$?
7980   echo "$as_me:7980: \$? = $ac_status" >&5
7981   (exit $ac_status); } &&
7982          { ac_try='test -s conftest$ac_exeext'
7983   { (eval echo "$as_me:7983: \"$ac_try\"") >&5
7984   (eval $ac_try) 2>&5
7985   ac_status=$?
7986   echo "$as_me:7986: \$? = $ac_status" >&5
7987   (exit $ac_status); }; }; then
7988
7989         cf_cv_find_linkage_utf8=yes
7990         cf_cv_header_path_utf8=/usr/include
7991         cf_cv_library_path_utf8=/usr/lib
7992
7993 else
7994   echo "$as_me: failed program was:" >&5
7995 cat conftest.$ac_ext >&5
7996
7997 LIBS="-lutf8  $cf_save_LIBS"
7998
7999 cat >conftest.$ac_ext <<_ACEOF
8000 #line 8000 "configure"
8001 #include "confdefs.h"
8002
8003 #include <libutf8.h>
8004 int
8005 main ()
8006 {
8007 putwc(0,0);
8008   ;
8009   return 0;
8010 }
8011 _ACEOF
8012 rm -f conftest.$ac_objext conftest$ac_exeext
8013 if { (eval echo "$as_me:8013: \"$ac_link\"") >&5
8014   (eval $ac_link) 2>&5
8015   ac_status=$?
8016   echo "$as_me:8016: \$? = $ac_status" >&5
8017   (exit $ac_status); } &&
8018          { ac_try='test -s conftest$ac_exeext'
8019   { (eval echo "$as_me:8019: \"$ac_try\"") >&5
8020   (eval $ac_try) 2>&5
8021   ac_status=$?
8022   echo "$as_me:8022: \$? = $ac_status" >&5
8023   (exit $ac_status); }; }; then
8024
8025         cf_cv_find_linkage_utf8=yes
8026         cf_cv_header_path_utf8=/usr/include
8027         cf_cv_library_path_utf8=/usr/lib
8028         cf_cv_library_file_utf8="-lutf8"
8029
8030 else
8031   echo "$as_me: failed program was:" >&5
8032 cat conftest.$ac_ext >&5
8033
8034         cf_cv_find_linkage_utf8=no
8035         LIBS="$cf_save_LIBS"
8036
8037     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
8038
8039 echo "${as_me:-configure}:8039: testing find linkage for utf8 library ..." 1>&5
8040
8041 echo "${as_me:-configure}:8041: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
8042
8043     cf_save_CPPFLAGS="$CPPFLAGS"
8044     cf_test_CPPFLAGS="$CPPFLAGS"
8045
8046 cf_search=
8047
8048 # collect the current set of include-directories from compiler flags
8049 cf_header_path_list=""
8050 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8051         for cf_header_path in $CPPFLAGS $CFLAGS
8052         do
8053                 case $cf_header_path in #(vi
8054                 -I*)
8055                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8056
8057 test "$cf_header_path" != "NONE" && \
8058 test -d "$cf_header_path" && \
8059  {
8060         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8061         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8062         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
8063         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
8064         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
8065         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
8066 }
8067
8068                         cf_header_path_list="$cf_header_path_list $cf_search"
8069                         ;;
8070                 esac
8071         done
8072 fi
8073
8074 # add the variations for the package we are looking for
8075
8076 cf_search=
8077
8078 test "/usr" != "$prefix" && \
8079 test -d "/usr" && \
8080 (test $prefix = NONE || test "/usr" != "$prefix") && {
8081         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8082         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8083         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
8084         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
8085         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
8086         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
8087 }
8088
8089 test "$prefix" != "NONE" && \
8090 test -d "$prefix" && \
8091  {
8092         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8093         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8094         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
8095         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
8096         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
8097         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8098 }
8099
8100 test "/usr/local" != "$prefix" && \
8101 test -d "/usr/local" && \
8102 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8103         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8104         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8105         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
8106         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
8107         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
8108         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
8109 }
8110
8111 test "/opt" != "$prefix" && \
8112 test -d "/opt" && \
8113 (test $prefix = NONE || test "/opt" != "$prefix") && {
8114         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8115         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8116         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
8117         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
8118         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
8119         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
8120 }
8121
8122 test "$HOME" != "$prefix" && \
8123 test -d "$HOME" && \
8124 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8125         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8126         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8127         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
8128         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
8129         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
8130         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
8131 }
8132
8133 test "$includedir" != NONE && \
8134 test "$includedir" != "/usr/include" && \
8135 test -d "$includedir" && {
8136         test -d $includedir &&    cf_search="$cf_search $includedir"
8137         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
8138 }
8139
8140 test "$oldincludedir" != NONE && \
8141 test "$oldincludedir" != "/usr/include" && \
8142 test -d "$oldincludedir" && {
8143         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8144         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
8145 }
8146
8147 cf_search="$cf_search $cf_header_path_list"
8148
8149     for cf_cv_header_path_utf8 in $cf_search
8150     do
8151       if test -d $cf_cv_header_path_utf8 ; then
8152         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8153
8154 echo "${as_me:-configure}:8154: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8155
8156         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
8157         cat >conftest.$ac_ext <<_ACEOF
8158 #line 8158 "configure"
8159 #include "confdefs.h"
8160
8161 #include <libutf8.h>
8162 int
8163 main ()
8164 {
8165 putwc(0,0);
8166   ;
8167   return 0;
8168 }
8169 _ACEOF
8170 rm -f conftest.$ac_objext
8171 if { (eval echo "$as_me:8171: \"$ac_compile\"") >&5
8172   (eval $ac_compile) 2>&5
8173   ac_status=$?
8174   echo "$as_me:8174: \$? = $ac_status" >&5
8175   (exit $ac_status); } &&
8176          { ac_try='test -s conftest.$ac_objext'
8177   { (eval echo "$as_me:8177: \"$ac_try\"") >&5
8178   (eval $ac_try) 2>&5
8179   ac_status=$?
8180   echo "$as_me:8180: \$? = $ac_status" >&5
8181   (exit $ac_status); }; }; then
8182
8183             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8184
8185 echo "${as_me:-configure}:8185: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8186
8187             cf_cv_find_linkage_utf8=maybe
8188             cf_test_CPPFLAGS="$CPPFLAGS"
8189             break
8190 else
8191   echo "$as_me: failed program was:" >&5
8192 cat conftest.$ac_ext >&5
8193
8194             CPPFLAGS="$cf_save_CPPFLAGS"
8195
8196 fi
8197 rm -f conftest.$ac_objext conftest.$ac_ext
8198       fi
8199     done
8200
8201     if test "$cf_cv_find_linkage_utf8" = maybe ; then
8202
8203 echo "${as_me:-configure}:8203: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8204
8205       cf_save_LIBS="$LIBS"
8206       cf_save_LDFLAGS="$LDFLAGS"
8207
8208       if test "$cf_cv_find_linkage_utf8" != yes ; then
8209
8210 cf_search=
8211 cf_library_path_list=""
8212 if test -n "${LDFLAGS}${LIBS}" ; then
8213         for cf_library_path in $LDFLAGS $LIBS
8214         do
8215                 case $cf_library_path in #(vi
8216                 -L*)
8217                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8218
8219 test "$cf_library_path" != "NONE" && \
8220 test -d "$cf_library_path" && \
8221  {
8222         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8223         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8224         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8225         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8226         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8227         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8228 }
8229
8230                         cf_library_path_list="$cf_library_path_list $cf_search"
8231                         ;;
8232                 esac
8233         done
8234 fi
8235
8236 cf_search=
8237
8238 test "/usr" != "$prefix" && \
8239 test -d "/usr" && \
8240 (test $prefix = NONE || test "/usr" != "$prefix") && {
8241         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8242         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8243         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
8244         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
8245         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
8246         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
8247 }
8248
8249 test "$prefix" != "NONE" && \
8250 test -d "$prefix" && \
8251  {
8252         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8253         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8254         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
8255         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8256         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
8257         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8258 }
8259
8260 test "/usr/local" != "$prefix" && \
8261 test -d "/usr/local" && \
8262 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8263         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8264         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8265         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
8266         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
8267         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
8268         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
8269 }
8270
8271 test "/opt" != "$prefix" && \
8272 test -d "/opt" && \
8273 (test $prefix = NONE || test "/opt" != "$prefix") && {
8274         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8275         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8276         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
8277         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
8278         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
8279         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
8280 }
8281
8282 test "$HOME" != "$prefix" && \
8283 test -d "$HOME" && \
8284 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8285         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8286         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8287         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8288         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8289         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8290         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8291 }
8292
8293 cf_search="$cf_library_path_list $cf_search"
8294
8295         for cf_cv_library_path_utf8 in $cf_search
8296         do
8297           if test -d $cf_cv_library_path_utf8 ; then
8298             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8299
8300 echo "${as_me:-configure}:8300: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8301
8302             CPPFLAGS="$cf_test_CPPFLAGS"
8303             LIBS="-lutf8  $cf_save_LIBS"
8304             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8305             cat >conftest.$ac_ext <<_ACEOF
8306 #line 8306 "configure"
8307 #include "confdefs.h"
8308
8309 #include <libutf8.h>
8310 int
8311 main ()
8312 {
8313 putwc(0,0);
8314   ;
8315   return 0;
8316 }
8317 _ACEOF
8318 rm -f conftest.$ac_objext conftest$ac_exeext
8319 if { (eval echo "$as_me:8319: \"$ac_link\"") >&5
8320   (eval $ac_link) 2>&5
8321   ac_status=$?
8322   echo "$as_me:8322: \$? = $ac_status" >&5
8323   (exit $ac_status); } &&
8324          { ac_try='test -s conftest$ac_exeext'
8325   { (eval echo "$as_me:8325: \"$ac_try\"") >&5
8326   (eval $ac_try) 2>&5
8327   ac_status=$?
8328   echo "$as_me:8328: \$? = $ac_status" >&5
8329   (exit $ac_status); }; }; then
8330
8331                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8332
8333 echo "${as_me:-configure}:8333: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8334
8335                 cf_cv_find_linkage_utf8=yes
8336                 cf_cv_library_file_utf8="-lutf8"
8337                 break
8338 else
8339   echo "$as_me: failed program was:" >&5
8340 cat conftest.$ac_ext >&5
8341
8342                 CPPFLAGS="$cf_save_CPPFLAGS"
8343                 LIBS="$cf_save_LIBS"
8344                 LDFLAGS="$cf_save_LDFLAGS"
8345
8346 fi
8347 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8348           fi
8349         done
8350         CPPFLAGS="$cf_save_CPPFLAGS"
8351         LDFLAGS="$cf_save_LDFLAGS"
8352       fi
8353
8354     else
8355       cf_cv_find_linkage_utf8=no
8356     fi
8357
8358 fi
8359 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8360
8361 fi
8362 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8363
8364 LIBS="$cf_save_LIBS"
8365
8366 if test "$cf_cv_find_linkage_utf8" = yes ; then
8367 cf_cv_utf8_lib=add-on
8368 else
8369 cf_cv_utf8_lib=no
8370 fi
8371
8372 fi
8373 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8374 fi
8375 echo "$as_me:8375: result: $cf_cv_utf8_lib" >&5
8376 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8377
8378 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8379 # ncurses/ncursesw:
8380 if test "$cf_cv_utf8_lib" = "add-on" ; then
8381         cat >>confdefs.h <<\EOF
8382 #define HAVE_LIBUTF8_H 1
8383 EOF
8384
8385 if test -n "$cf_cv_header_path_utf8" ; then
8386   for cf_add_incdir in $cf_cv_header_path_utf8
8387   do
8388         while test $cf_add_incdir != /usr/include
8389         do
8390           if test -d $cf_add_incdir
8391           then
8392                 cf_have_incdir=no
8393                 if test -n "$CFLAGS$CPPFLAGS" ; then
8394                   # a loop is needed to ensure we can add subdirs of existing dirs
8395                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8396                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8397                           cf_have_incdir=yes; break
8398                         fi
8399                   done
8400                 fi
8401
8402                 if test "$cf_have_incdir" = no ; then
8403                   if test "$cf_add_incdir" = /usr/local/include ; then
8404                         if test "$GCC" = yes
8405                         then
8406                           cf_save_CPPFLAGS=$CPPFLAGS
8407                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8408                           cat >conftest.$ac_ext <<_ACEOF
8409 #line 8409 "configure"
8410 #include "confdefs.h"
8411 #include <stdio.h>
8412 int
8413 main ()
8414 {
8415 printf("Hello")
8416   ;
8417   return 0;
8418 }
8419 _ACEOF
8420 rm -f conftest.$ac_objext
8421 if { (eval echo "$as_me:8421: \"$ac_compile\"") >&5
8422   (eval $ac_compile) 2>&5
8423   ac_status=$?
8424   echo "$as_me:8424: \$? = $ac_status" >&5
8425   (exit $ac_status); } &&
8426          { ac_try='test -s conftest.$ac_objext'
8427   { (eval echo "$as_me:8427: \"$ac_try\"") >&5
8428   (eval $ac_try) 2>&5
8429   ac_status=$?
8430   echo "$as_me:8430: \$? = $ac_status" >&5
8431   (exit $ac_status); }; }; then
8432   :
8433 else
8434   echo "$as_me: failed program was:" >&5
8435 cat conftest.$ac_ext >&5
8436 cf_have_incdir=yes
8437 fi
8438 rm -f conftest.$ac_objext conftest.$ac_ext
8439                           CPPFLAGS=$cf_save_CPPFLAGS
8440                         fi
8441                   fi
8442                 fi
8443
8444                 if test "$cf_have_incdir" = no ; then
8445                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8446
8447 echo "${as_me:-configure}:8447: testing adding $cf_add_incdir to include-path ..." 1>&5
8448
8449                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8450
8451                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8452                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8453                   cf_add_incdir="$cf_top_incdir"
8454                 else
8455                   break
8456                 fi
8457           fi
8458         done
8459   done
8460 fi
8461
8462 if test -n "$cf_cv_library_path_utf8" ; then
8463   for cf_add_libdir in $cf_cv_library_path_utf8
8464   do
8465     if test $cf_add_libdir = /usr/lib ; then
8466       :
8467     elif test -d $cf_add_libdir
8468     then
8469       cf_have_libdir=no
8470       if test -n "$LDFLAGS$LIBS" ; then
8471         # a loop is needed to ensure we can add subdirs of existing dirs
8472         for cf_test_libdir in $LDFLAGS $LIBS ; do
8473           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8474             cf_have_libdir=yes; break
8475           fi
8476         done
8477       fi
8478       if test "$cf_have_libdir" = no ; then
8479         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8480
8481 echo "${as_me:-configure}:8481: testing adding $cf_add_libdir to library-path ..." 1>&5
8482
8483         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8484       fi
8485     fi
8486   done
8487 fi
8488
8489         LIBS="$cf_cv_library_file_utf8 $LIBS"
8490 fi
8491
8492 cf_ncuconfig_root=ncursesw
8493
8494 echo "Looking for ${cf_ncuconfig_root}-config"
8495
8496 if test -n "$ac_tool_prefix"; then
8497   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8498   do
8499     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8500 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8501 echo "$as_me:8501: checking for $ac_word" >&5
8502 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8503 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8504   echo $ECHO_N "(cached) $ECHO_C" >&6
8505 else
8506   if test -n "$NCURSES_CONFIG"; then
8507   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8508 else
8509   ac_save_IFS=$IFS; IFS=$ac_path_separator
8510 ac_dummy="$PATH"
8511 for ac_dir in $ac_dummy; do
8512   IFS=$ac_save_IFS
8513   test -z "$ac_dir" && ac_dir=.
8514   $as_executable_p "$ac_dir/$ac_word" || continue
8515 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8516 echo "$as_me:8516: found $ac_dir/$ac_word" >&5
8517 break
8518 done
8519
8520 fi
8521 fi
8522 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8523 if test -n "$NCURSES_CONFIG"; then
8524   echo "$as_me:8524: result: $NCURSES_CONFIG" >&5
8525 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8526 else
8527   echo "$as_me:8527: result: no" >&5
8528 echo "${ECHO_T}no" >&6
8529 fi
8530
8531     test -n "$NCURSES_CONFIG" && break
8532   done
8533 fi
8534 if test -z "$NCURSES_CONFIG"; then
8535   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8536   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8537 do
8538   # Extract the first word of "$ac_prog", so it can be a program name with args.
8539 set dummy $ac_prog; ac_word=$2
8540 echo "$as_me:8540: checking for $ac_word" >&5
8541 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8542 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8543   echo $ECHO_N "(cached) $ECHO_C" >&6
8544 else
8545   if test -n "$ac_ct_NCURSES_CONFIG"; then
8546   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8547 else
8548   ac_save_IFS=$IFS; IFS=$ac_path_separator
8549 ac_dummy="$PATH"
8550 for ac_dir in $ac_dummy; do
8551   IFS=$ac_save_IFS
8552   test -z "$ac_dir" && ac_dir=.
8553   $as_executable_p "$ac_dir/$ac_word" || continue
8554 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8555 echo "$as_me:8555: found $ac_dir/$ac_word" >&5
8556 break
8557 done
8558
8559 fi
8560 fi
8561 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8562 if test -n "$ac_ct_NCURSES_CONFIG"; then
8563   echo "$as_me:8563: result: $ac_ct_NCURSES_CONFIG" >&5
8564 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8565 else
8566   echo "$as_me:8566: result: no" >&5
8567 echo "${ECHO_T}no" >&6
8568 fi
8569
8570   test -n "$ac_ct_NCURSES_CONFIG" && break
8571 done
8572 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8573
8574   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8575 fi
8576
8577 if test "$NCURSES_CONFIG" != none ; then
8578
8579 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8580 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8581
8582 # even with config script, some packages use no-override for curses.h
8583
8584 echo "$as_me:8584: checking if we have identified curses headers" >&5
8585 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8586 if test "${cf_cv_ncurses_header+set}" = set; then
8587   echo $ECHO_N "(cached) $ECHO_C" >&6
8588 else
8589
8590 cf_cv_ncurses_header=none
8591 for cf_header in  \
8592     ncursesw/ncurses.h \
8593         ncursesw/curses.h \
8594         ncurses.h \
8595         curses.h
8596 do
8597 cat >conftest.$ac_ext <<_ACEOF
8598 #line 8598 "configure"
8599 #include "confdefs.h"
8600 #include <${cf_header}>
8601 int
8602 main ()
8603 {
8604 initscr(); tgoto("?", 0,0)
8605   ;
8606   return 0;
8607 }
8608 _ACEOF
8609 rm -f conftest.$ac_objext
8610 if { (eval echo "$as_me:8610: \"$ac_compile\"") >&5
8611   (eval $ac_compile) 2>&5
8612   ac_status=$?
8613   echo "$as_me:8613: \$? = $ac_status" >&5
8614   (exit $ac_status); } &&
8615          { ac_try='test -s conftest.$ac_objext'
8616   { (eval echo "$as_me:8616: \"$ac_try\"") >&5
8617   (eval $ac_try) 2>&5
8618   ac_status=$?
8619   echo "$as_me:8619: \$? = $ac_status" >&5
8620   (exit $ac_status); }; }; then
8621   cf_cv_ncurses_header=$cf_header; break
8622 else
8623   echo "$as_me: failed program was:" >&5
8624 cat conftest.$ac_ext >&5
8625 fi
8626 rm -f conftest.$ac_objext conftest.$ac_ext
8627 done
8628
8629 fi
8630 echo "$as_me:8630: result: $cf_cv_ncurses_header" >&5
8631 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8632
8633 if test "$cf_cv_ncurses_header" = none ; then
8634         { { echo "$as_me:8634: error: No curses header-files found" >&5
8635 echo "$as_me: error: No curses header-files found" >&2;}
8636    { (exit 1); exit 1; }; }
8637 fi
8638
8639 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8640
8641 for ac_header in $cf_cv_ncurses_header
8642 do
8643 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8644 echo "$as_me:8644: checking for $ac_header" >&5
8645 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8646 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8647   echo $ECHO_N "(cached) $ECHO_C" >&6
8648 else
8649   cat >conftest.$ac_ext <<_ACEOF
8650 #line 8650 "configure"
8651 #include "confdefs.h"
8652 #include <$ac_header>
8653 _ACEOF
8654 if { (eval echo "$as_me:8654: \"$ac_cpp conftest.$ac_ext\"") >&5
8655   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8656   ac_status=$?
8657   egrep -v '^ *\+' conftest.er1 >conftest.err
8658   rm -f conftest.er1
8659   cat conftest.err >&5
8660   echo "$as_me:8660: \$? = $ac_status" >&5
8661   (exit $ac_status); } >/dev/null; then
8662   if test -s conftest.err; then
8663     ac_cpp_err=$ac_c_preproc_warn_flag
8664   else
8665     ac_cpp_err=
8666   fi
8667 else
8668   ac_cpp_err=yes
8669 fi
8670 if test -z "$ac_cpp_err"; then
8671   eval "$as_ac_Header=yes"
8672 else
8673   echo "$as_me: failed program was:" >&5
8674   cat conftest.$ac_ext >&5
8675   eval "$as_ac_Header=no"
8676 fi
8677 rm -f conftest.err conftest.$ac_ext
8678 fi
8679 echo "$as_me:8679: result: `eval echo '${'$as_ac_Header'}'`" >&5
8680 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8681 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8682   cat >>confdefs.h <<EOF
8683 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8684 EOF
8685
8686 fi
8687 done
8688
8689 cat >>confdefs.h <<\EOF
8690 #define NCURSES 1
8691 EOF
8692
8693 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8694
8695 cat >>confdefs.h <<EOF
8696 #define $cf_nculib_ROOT 1
8697 EOF
8698
8699 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8700
8701 else
8702
8703 cf_ncuhdr_root=ncursesw
8704
8705 test -n "$cf_cv_curses_dir" && \
8706 test "$cf_cv_curses_dir" != "no" && { \
8707
8708 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8709   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8710   do
8711         while test $cf_add_incdir != /usr/include
8712         do
8713           if test -d $cf_add_incdir
8714           then
8715                 cf_have_incdir=no
8716                 if test -n "$CFLAGS$CPPFLAGS" ; then
8717                   # a loop is needed to ensure we can add subdirs of existing dirs
8718                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8719                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8720                           cf_have_incdir=yes; break
8721                         fi
8722                   done
8723                 fi
8724
8725                 if test "$cf_have_incdir" = no ; then
8726                   if test "$cf_add_incdir" = /usr/local/include ; then
8727                         if test "$GCC" = yes
8728                         then
8729                           cf_save_CPPFLAGS=$CPPFLAGS
8730                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8731                           cat >conftest.$ac_ext <<_ACEOF
8732 #line 8732 "configure"
8733 #include "confdefs.h"
8734 #include <stdio.h>
8735 int
8736 main ()
8737 {
8738 printf("Hello")
8739   ;
8740   return 0;
8741 }
8742 _ACEOF
8743 rm -f conftest.$ac_objext
8744 if { (eval echo "$as_me:8744: \"$ac_compile\"") >&5
8745   (eval $ac_compile) 2>&5
8746   ac_status=$?
8747   echo "$as_me:8747: \$? = $ac_status" >&5
8748   (exit $ac_status); } &&
8749          { ac_try='test -s conftest.$ac_objext'
8750   { (eval echo "$as_me:8750: \"$ac_try\"") >&5
8751   (eval $ac_try) 2>&5
8752   ac_status=$?
8753   echo "$as_me:8753: \$? = $ac_status" >&5
8754   (exit $ac_status); }; }; then
8755   :
8756 else
8757   echo "$as_me: failed program was:" >&5
8758 cat conftest.$ac_ext >&5
8759 cf_have_incdir=yes
8760 fi
8761 rm -f conftest.$ac_objext conftest.$ac_ext
8762                           CPPFLAGS=$cf_save_CPPFLAGS
8763                         fi
8764                   fi
8765                 fi
8766
8767                 if test "$cf_have_incdir" = no ; then
8768                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8769
8770 echo "${as_me:-configure}:8770: testing adding $cf_add_incdir to include-path ..." 1>&5
8771
8772                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8773
8774                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8775                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8776                   cf_add_incdir="$cf_top_incdir"
8777                 else
8778                   break
8779                 fi
8780           fi
8781         done
8782   done
8783 fi
8784
8785 }
8786
8787 echo "$as_me:8787: checking for $cf_ncuhdr_root header in include-path" >&5
8788 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8789 if test "${cf_cv_ncurses_h+set}" = set; then
8790   echo $ECHO_N "(cached) $ECHO_C" >&6
8791 else
8792
8793         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8794         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8795         for cf_header in $cf_header_list
8796         do
8797
8798         cat >conftest.$ac_ext <<_ACEOF
8799 #line 8799 "configure"
8800 #include "confdefs.h"
8801
8802 #define _XOPEN_SOURCE_EXTENDED
8803 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8804 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8805
8806 #include <$cf_header>
8807 int
8808 main ()
8809 {
8810
8811 #ifdef NCURSES_VERSION
8812
8813 #ifndef WACS_BSSB
8814         make an error
8815 #endif
8816
8817 printf("%s\n", NCURSES_VERSION);
8818 #else
8819 #ifdef __NCURSES_H
8820 printf("old\n");
8821 #else
8822         make an error
8823 #endif
8824 #endif
8825
8826   ;
8827   return 0;
8828 }
8829 _ACEOF
8830 rm -f conftest.$ac_objext
8831 if { (eval echo "$as_me:8831: \"$ac_compile\"") >&5
8832   (eval $ac_compile) 2>&5
8833   ac_status=$?
8834   echo "$as_me:8834: \$? = $ac_status" >&5
8835   (exit $ac_status); } &&
8836          { ac_try='test -s conftest.$ac_objext'
8837   { (eval echo "$as_me:8837: \"$ac_try\"") >&5
8838   (eval $ac_try) 2>&5
8839   ac_status=$?
8840   echo "$as_me:8840: \$? = $ac_status" >&5
8841   (exit $ac_status); }; }; then
8842   cf_cv_ncurses_h=$cf_header
8843
8844 else
8845   echo "$as_me: failed program was:" >&5
8846 cat conftest.$ac_ext >&5
8847 cf_cv_ncurses_h=no
8848 fi
8849 rm -f conftest.$ac_objext conftest.$ac_ext
8850
8851                 test "$cf_cv_ncurses_h" != no && break
8852         done
8853
8854 fi
8855 echo "$as_me:8855: result: $cf_cv_ncurses_h" >&5
8856 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8857
8858 if test "$cf_cv_ncurses_h" != no ; then
8859         cf_cv_ncurses_header=$cf_cv_ncurses_h
8860 else
8861
8862 echo "$as_me:8862: checking for $cf_ncuhdr_root include-path" >&5
8863 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8864 if test "${cf_cv_ncurses_h2+set}" = set; then
8865   echo $ECHO_N "(cached) $ECHO_C" >&6
8866 else
8867
8868         test -n "$verbose" && echo
8869
8870 cf_search=
8871
8872 # collect the current set of include-directories from compiler flags
8873 cf_header_path_list=""
8874 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8875         for cf_header_path in $CPPFLAGS $CFLAGS
8876         do
8877                 case $cf_header_path in #(vi
8878                 -I*)
8879                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8880
8881 test "$cf_header_path" != "NONE" && \
8882 test -d "$cf_header_path" && \
8883  {
8884         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8885         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8886         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8887         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8888         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8889         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"
8890 }
8891
8892                         cf_header_path_list="$cf_header_path_list $cf_search"
8893                         ;;
8894                 esac
8895         done
8896 fi
8897
8898 # add the variations for the package we are looking for
8899
8900 cf_search=
8901
8902 test "/usr" != "$prefix" && \
8903 test -d "/usr" && \
8904 (test $prefix = NONE || test "/usr" != "$prefix") && {
8905         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8906         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8907         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8908         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8909         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8910         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8911 }
8912
8913 test "$prefix" != "NONE" && \
8914 test -d "$prefix" && \
8915  {
8916         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8917         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8918         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8919         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8920         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8921         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8922 }
8923
8924 test "/usr/local" != "$prefix" && \
8925 test -d "/usr/local" && \
8926 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8927         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8928         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8929         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8930         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8931         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8932         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8933 }
8934
8935 test "/opt" != "$prefix" && \
8936 test -d "/opt" && \
8937 (test $prefix = NONE || test "/opt" != "$prefix") && {
8938         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8939         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8940         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8941         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8942         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8943         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8944 }
8945
8946 test "$HOME" != "$prefix" && \
8947 test -d "$HOME" && \
8948 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8949         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8950         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8951         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8952         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8953         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8954         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8955 }
8956
8957 test "$includedir" != NONE && \
8958 test "$includedir" != "/usr/include" && \
8959 test -d "$includedir" && {
8960         test -d $includedir &&    cf_search="$cf_search $includedir"
8961         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8962 }
8963
8964 test "$oldincludedir" != NONE && \
8965 test "$oldincludedir" != "/usr/include" && \
8966 test -d "$oldincludedir" && {
8967         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8968         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8969 }
8970
8971 cf_search="$cf_search $cf_header_path_list"
8972
8973         test -n "$verbose" && echo search path $cf_search
8974         cf_save2_CPPFLAGS="$CPPFLAGS"
8975         for cf_incdir in $cf_search
8976         do
8977
8978 if test -n "$cf_incdir" ; then
8979   for cf_add_incdir in $cf_incdir
8980   do
8981         while test $cf_add_incdir != /usr/include
8982         do
8983           if test -d $cf_add_incdir
8984           then
8985                 cf_have_incdir=no
8986                 if test -n "$CFLAGS$CPPFLAGS" ; then
8987                   # a loop is needed to ensure we can add subdirs of existing dirs
8988                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8989                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8990                           cf_have_incdir=yes; break
8991                         fi
8992                   done
8993                 fi
8994
8995                 if test "$cf_have_incdir" = no ; then
8996                   if test "$cf_add_incdir" = /usr/local/include ; then
8997                         if test "$GCC" = yes
8998                         then
8999                           cf_save_CPPFLAGS=$CPPFLAGS
9000                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9001                           cat >conftest.$ac_ext <<_ACEOF
9002 #line 9002 "configure"
9003 #include "confdefs.h"
9004 #include <stdio.h>
9005 int
9006 main ()
9007 {
9008 printf("Hello")
9009   ;
9010   return 0;
9011 }
9012 _ACEOF
9013 rm -f conftest.$ac_objext
9014 if { (eval echo "$as_me:9014: \"$ac_compile\"") >&5
9015   (eval $ac_compile) 2>&5
9016   ac_status=$?
9017   echo "$as_me:9017: \$? = $ac_status" >&5
9018   (exit $ac_status); } &&
9019          { ac_try='test -s conftest.$ac_objext'
9020   { (eval echo "$as_me:9020: \"$ac_try\"") >&5
9021   (eval $ac_try) 2>&5
9022   ac_status=$?
9023   echo "$as_me:9023: \$? = $ac_status" >&5
9024   (exit $ac_status); }; }; then
9025   :
9026 else
9027   echo "$as_me: failed program was:" >&5
9028 cat conftest.$ac_ext >&5
9029 cf_have_incdir=yes
9030 fi
9031 rm -f conftest.$ac_objext conftest.$ac_ext
9032                           CPPFLAGS=$cf_save_CPPFLAGS
9033                         fi
9034                   fi
9035                 fi
9036
9037                 if test "$cf_have_incdir" = no ; then
9038                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9039
9040 echo "${as_me:-configure}:9040: testing adding $cf_add_incdir to include-path ..." 1>&5
9041
9042                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9043
9044                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9045                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9046                   cf_add_incdir="$cf_top_incdir"
9047                 else
9048                   break
9049                 fi
9050           fi
9051         done
9052   done
9053 fi
9054
9055                 for cf_header in \
9056                         ncurses.h \
9057                         curses.h
9058                 do
9059
9060         cat >conftest.$ac_ext <<_ACEOF
9061 #line 9061 "configure"
9062 #include "confdefs.h"
9063
9064 #include <$cf_header>
9065 int
9066 main ()
9067 {
9068
9069 #ifdef NCURSES_VERSION
9070
9071 printf("%s\n", NCURSES_VERSION);
9072 #else
9073 #ifdef __NCURSES_H
9074 printf("old\n");
9075 #else
9076         make an error
9077 #endif
9078 #endif
9079
9080   ;
9081   return 0;
9082 }
9083 _ACEOF
9084 rm -f conftest.$ac_objext
9085 if { (eval echo "$as_me:9085: \"$ac_compile\"") >&5
9086   (eval $ac_compile) 2>&5
9087   ac_status=$?
9088   echo "$as_me:9088: \$? = $ac_status" >&5
9089   (exit $ac_status); } &&
9090          { ac_try='test -s conftest.$ac_objext'
9091   { (eval echo "$as_me:9091: \"$ac_try\"") >&5
9092   (eval $ac_try) 2>&5
9093   ac_status=$?
9094   echo "$as_me:9094: \$? = $ac_status" >&5
9095   (exit $ac_status); }; }; then
9096   cf_cv_ncurses_h2=$cf_header
9097
9098 else
9099   echo "$as_me: failed program was:" >&5
9100 cat conftest.$ac_ext >&5
9101 cf_cv_ncurses_h2=no
9102 fi
9103 rm -f conftest.$ac_objext conftest.$ac_ext
9104
9105                         if test "$cf_cv_ncurses_h2" != no ; then
9106                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9107                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9108                                 break
9109                         fi
9110                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9111                 done
9112                 CPPFLAGS="$cf_save2_CPPFLAGS"
9113                 test "$cf_cv_ncurses_h2" != no && break
9114         done
9115         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9115: error: not found" >&5
9116 echo "$as_me: error: not found" >&2;}
9117    { (exit 1); exit 1; }; }
9118
9119 fi
9120 echo "$as_me:9120: result: $cf_cv_ncurses_h2" >&5
9121 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9122
9123         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9124         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9125         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9126                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9127         fi
9128
9129 if test -n "$cf_1st_incdir" ; then
9130   for cf_add_incdir in $cf_1st_incdir
9131   do
9132         while test $cf_add_incdir != /usr/include
9133         do
9134           if test -d $cf_add_incdir
9135           then
9136                 cf_have_incdir=no
9137                 if test -n "$CFLAGS$CPPFLAGS" ; then
9138                   # a loop is needed to ensure we can add subdirs of existing dirs
9139                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9140                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9141                           cf_have_incdir=yes; break
9142                         fi
9143                   done
9144                 fi
9145
9146                 if test "$cf_have_incdir" = no ; then
9147                   if test "$cf_add_incdir" = /usr/local/include ; then
9148                         if test "$GCC" = yes
9149                         then
9150                           cf_save_CPPFLAGS=$CPPFLAGS
9151                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9152                           cat >conftest.$ac_ext <<_ACEOF
9153 #line 9153 "configure"
9154 #include "confdefs.h"
9155 #include <stdio.h>
9156 int
9157 main ()
9158 {
9159 printf("Hello")
9160   ;
9161   return 0;
9162 }
9163 _ACEOF
9164 rm -f conftest.$ac_objext
9165 if { (eval echo "$as_me:9165: \"$ac_compile\"") >&5
9166   (eval $ac_compile) 2>&5
9167   ac_status=$?
9168   echo "$as_me:9168: \$? = $ac_status" >&5
9169   (exit $ac_status); } &&
9170          { ac_try='test -s conftest.$ac_objext'
9171   { (eval echo "$as_me:9171: \"$ac_try\"") >&5
9172   (eval $ac_try) 2>&5
9173   ac_status=$?
9174   echo "$as_me:9174: \$? = $ac_status" >&5
9175   (exit $ac_status); }; }; then
9176   :
9177 else
9178   echo "$as_me: failed program was:" >&5
9179 cat conftest.$ac_ext >&5
9180 cf_have_incdir=yes
9181 fi
9182 rm -f conftest.$ac_objext conftest.$ac_ext
9183                           CPPFLAGS=$cf_save_CPPFLAGS
9184                         fi
9185                   fi
9186                 fi
9187
9188                 if test "$cf_have_incdir" = no ; then
9189                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9190
9191 echo "${as_me:-configure}:9191: testing adding $cf_add_incdir to include-path ..." 1>&5
9192
9193                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9194
9195                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9196                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9197                   cf_add_incdir="$cf_top_incdir"
9198                 else
9199                   break
9200                 fi
9201           fi
9202         done
9203   done
9204 fi
9205
9206 fi
9207
9208 # Set definitions to allow ifdef'ing for ncurses.h
9209
9210 case $cf_cv_ncurses_header in # (vi
9211 *ncurses.h)
9212         cat >>confdefs.h <<\EOF
9213 #define HAVE_NCURSES_H 1
9214 EOF
9215
9216         ;;
9217 esac
9218
9219 case $cf_cv_ncurses_header in # (vi
9220 ncurses/curses.h|ncurses/ncurses.h)
9221         cat >>confdefs.h <<\EOF
9222 #define HAVE_NCURSES_NCURSES_H 1
9223 EOF
9224
9225         ;;
9226 ncursesw/curses.h|ncursesw/ncurses.h)
9227         cat >>confdefs.h <<\EOF
9228 #define HAVE_NCURSESW_NCURSES_H 1
9229 EOF
9230
9231         ;;
9232 esac
9233
9234 echo "$as_me:9234: checking for terminfo header" >&5
9235 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9236 if test "${cf_cv_term_header+set}" = set; then
9237   echo $ECHO_N "(cached) $ECHO_C" >&6
9238 else
9239
9240 case ${cf_cv_ncurses_header} in #(vi
9241 */ncurses.h|*/ncursesw.h) #(vi
9242         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9243         ;;
9244 *)
9245         cf_term_header=term.h
9246         ;;
9247 esac
9248
9249 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9250 do
9251 cat >conftest.$ac_ext <<_ACEOF
9252 #line 9252 "configure"
9253 #include "confdefs.h"
9254 #include <stdio.h>
9255 #include <${cf_cv_ncurses_header:-curses.h}>
9256 #include <$cf_test>
9257
9258 int
9259 main ()
9260 {
9261 int x = auto_left_margin
9262   ;
9263   return 0;
9264 }
9265 _ACEOF
9266 rm -f conftest.$ac_objext
9267 if { (eval echo "$as_me:9267: \"$ac_compile\"") >&5
9268   (eval $ac_compile) 2>&5
9269   ac_status=$?
9270   echo "$as_me:9270: \$? = $ac_status" >&5
9271   (exit $ac_status); } &&
9272          { ac_try='test -s conftest.$ac_objext'
9273   { (eval echo "$as_me:9273: \"$ac_try\"") >&5
9274   (eval $ac_try) 2>&5
9275   ac_status=$?
9276   echo "$as_me:9276: \$? = $ac_status" >&5
9277   (exit $ac_status); }; }; then
9278
9279         cf_cv_term_header="$cf_test"
9280 else
9281   echo "$as_me: failed program was:" >&5
9282 cat conftest.$ac_ext >&5
9283
9284         cf_cv_term_header=unknown
9285
9286 fi
9287 rm -f conftest.$ac_objext conftest.$ac_ext
9288         test "$cf_cv_term_header" != unknown && break
9289 done
9290
9291 fi
9292 echo "$as_me:9292: result: $cf_cv_term_header" >&5
9293 echo "${ECHO_T}$cf_cv_term_header" >&6
9294
9295 # Set definitions to allow ifdef'ing to accommodate subdirectories
9296
9297 case $cf_cv_term_header in # (vi
9298 *term.h)
9299         cat >>confdefs.h <<\EOF
9300 #define HAVE_TERM_H 1
9301 EOF
9302
9303         ;;
9304 esac
9305
9306 case $cf_cv_term_header in # (vi
9307 ncurses/term.h) #(vi
9308         cat >>confdefs.h <<\EOF
9309 #define HAVE_NCURSES_TERM_H 1
9310 EOF
9311
9312         ;;
9313 ncursesw/term.h)
9314         cat >>confdefs.h <<\EOF
9315 #define HAVE_NCURSESW_TERM_H 1
9316 EOF
9317
9318         ;;
9319 esac
9320
9321 # some applications need this, but should check for NCURSES_VERSION
9322 cat >>confdefs.h <<\EOF
9323 #define NCURSES 1
9324 EOF
9325
9326 echo "$as_me:9326: checking for ncurses version" >&5
9327 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9328 if test "${cf_cv_ncurses_version+set}" = set; then
9329   echo $ECHO_N "(cached) $ECHO_C" >&6
9330 else
9331
9332         cf_cv_ncurses_version=no
9333         cf_tempfile=out$$
9334         rm -f $cf_tempfile
9335         if test "$cross_compiling" = yes; then
9336
9337         # This will not work if the preprocessor splits the line after the
9338         # Autoconf token.  The 'unproto' program does that.
9339         cat > conftest.$ac_ext <<EOF
9340 #include <${cf_cv_ncurses_header:-curses.h}>
9341 #undef Autoconf
9342 #ifdef NCURSES_VERSION
9343 Autoconf NCURSES_VERSION
9344 #else
9345 #ifdef __NCURSES_H
9346 Autoconf "old"
9347 #endif
9348 ;
9349 #endif
9350 EOF
9351         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9352         { (eval echo "$as_me:9352: \"$cf_try\"") >&5
9353   (eval $cf_try) 2>&5
9354   ac_status=$?
9355   echo "$as_me:9355: \$? = $ac_status" >&5
9356   (exit $ac_status); }
9357         if test -f conftest.out ; then
9358                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9359                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9360                 rm -f conftest.out
9361         fi
9362
9363 else
9364   cat >conftest.$ac_ext <<_ACEOF
9365 #line 9365 "configure"
9366 #include "confdefs.h"
9367
9368 #include <${cf_cv_ncurses_header:-curses.h}>
9369 #include <stdio.h>
9370 int main()
9371 {
9372         FILE *fp = fopen("$cf_tempfile", "w");
9373 #ifdef NCURSES_VERSION
9374 # ifdef NCURSES_VERSION_PATCH
9375         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9376 # else
9377         fprintf(fp, "%s\n", NCURSES_VERSION);
9378 # endif
9379 #else
9380 # ifdef __NCURSES_H
9381         fprintf(fp, "old\n");
9382 # else
9383         make an error
9384 # endif
9385 #endif
9386         ${cf_cv_main_return:-return}(0);
9387 }
9388 _ACEOF
9389 rm -f conftest$ac_exeext
9390 if { (eval echo "$as_me:9390: \"$ac_link\"") >&5
9391   (eval $ac_link) 2>&5
9392   ac_status=$?
9393   echo "$as_me:9393: \$? = $ac_status" >&5
9394   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9395   { (eval echo "$as_me:9395: \"$ac_try\"") >&5
9396   (eval $ac_try) 2>&5
9397   ac_status=$?
9398   echo "$as_me:9398: \$? = $ac_status" >&5
9399   (exit $ac_status); }; }; then
9400
9401         cf_cv_ncurses_version=`cat $cf_tempfile`
9402 else
9403   echo "$as_me: program exited with status $ac_status" >&5
9404 echo "$as_me: failed program was:" >&5
9405 cat conftest.$ac_ext >&5
9406 fi
9407 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9408 fi
9409         rm -f $cf_tempfile
9410
9411 fi
9412 echo "$as_me:9412: result: $cf_cv_ncurses_version" >&5
9413 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9414 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9415 #define NCURSES 1
9416 EOF
9417
9418 cf_nculib_root=ncursesw
9419         # This works, except for the special case where we find gpm, but
9420         # ncurses is in a nonstandard location via $LIBS, and we really want
9421         # to link gpm.
9422 cf_ncurses_LIBS=""
9423 cf_ncurses_SAVE="$LIBS"
9424 echo "$as_me:9424: checking for Gpm_Open in -lgpm" >&5
9425 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9426 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9427   echo $ECHO_N "(cached) $ECHO_C" >&6
9428 else
9429   ac_check_lib_save_LIBS=$LIBS
9430 LIBS="-lgpm  $LIBS"
9431 cat >conftest.$ac_ext <<_ACEOF
9432 #line 9432 "configure"
9433 #include "confdefs.h"
9434
9435 /* Override any gcc2 internal prototype to avoid an error.  */
9436 #ifdef __cplusplus
9437 extern "C"
9438 #endif
9439 /* We use char because int might match the return type of a gcc2
9440    builtin and then its argument prototype would still apply.  */
9441 char Gpm_Open ();
9442 int
9443 main ()
9444 {
9445 Gpm_Open ();
9446   ;
9447   return 0;
9448 }
9449 _ACEOF
9450 rm -f conftest.$ac_objext conftest$ac_exeext
9451 if { (eval echo "$as_me:9451: \"$ac_link\"") >&5
9452   (eval $ac_link) 2>&5
9453   ac_status=$?
9454   echo "$as_me:9454: \$? = $ac_status" >&5
9455   (exit $ac_status); } &&
9456          { ac_try='test -s conftest$ac_exeext'
9457   { (eval echo "$as_me:9457: \"$ac_try\"") >&5
9458   (eval $ac_try) 2>&5
9459   ac_status=$?
9460   echo "$as_me:9460: \$? = $ac_status" >&5
9461   (exit $ac_status); }; }; then
9462   ac_cv_lib_gpm_Gpm_Open=yes
9463 else
9464   echo "$as_me: failed program was:" >&5
9465 cat conftest.$ac_ext >&5
9466 ac_cv_lib_gpm_Gpm_Open=no
9467 fi
9468 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9469 LIBS=$ac_check_lib_save_LIBS
9470 fi
9471 echo "$as_me:9471: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9472 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9473 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9474   echo "$as_me:9474: checking for initscr in -lgpm" >&5
9475 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9476 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9477   echo $ECHO_N "(cached) $ECHO_C" >&6
9478 else
9479   ac_check_lib_save_LIBS=$LIBS
9480 LIBS="-lgpm  $LIBS"
9481 cat >conftest.$ac_ext <<_ACEOF
9482 #line 9482 "configure"
9483 #include "confdefs.h"
9484
9485 /* Override any gcc2 internal prototype to avoid an error.  */
9486 #ifdef __cplusplus
9487 extern "C"
9488 #endif
9489 /* We use char because int might match the return type of a gcc2
9490    builtin and then its argument prototype would still apply.  */
9491 char initscr ();
9492 int
9493 main ()
9494 {
9495 initscr ();
9496   ;
9497   return 0;
9498 }
9499 _ACEOF
9500 rm -f conftest.$ac_objext conftest$ac_exeext
9501 if { (eval echo "$as_me:9501: \"$ac_link\"") >&5
9502   (eval $ac_link) 2>&5
9503   ac_status=$?
9504   echo "$as_me:9504: \$? = $ac_status" >&5
9505   (exit $ac_status); } &&
9506          { ac_try='test -s conftest$ac_exeext'
9507   { (eval echo "$as_me:9507: \"$ac_try\"") >&5
9508   (eval $ac_try) 2>&5
9509   ac_status=$?
9510   echo "$as_me:9510: \$? = $ac_status" >&5
9511   (exit $ac_status); }; }; then
9512   ac_cv_lib_gpm_initscr=yes
9513 else
9514   echo "$as_me: failed program was:" >&5
9515 cat conftest.$ac_ext >&5
9516 ac_cv_lib_gpm_initscr=no
9517 fi
9518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9519 LIBS=$ac_check_lib_save_LIBS
9520 fi
9521 echo "$as_me:9521: result: $ac_cv_lib_gpm_initscr" >&5
9522 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9523 if test $ac_cv_lib_gpm_initscr = yes; then
9524   LIBS="$cf_ncurses_SAVE"
9525 else
9526   cf_ncurses_LIBS="-lgpm"
9527 fi
9528
9529 fi
9530
9531 case $host_os in #(vi
9532 freebsd*)
9533         # This is only necessary if you are linking against an obsolete
9534         # version of ncurses (but it should do no harm, since it's static).
9535         if test "$cf_nculib_root" = ncurses ; then
9536                 echo "$as_me:9536: checking for tgoto in -lmytinfo" >&5
9537 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9538 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9539   echo $ECHO_N "(cached) $ECHO_C" >&6
9540 else
9541   ac_check_lib_save_LIBS=$LIBS
9542 LIBS="-lmytinfo  $LIBS"
9543 cat >conftest.$ac_ext <<_ACEOF
9544 #line 9544 "configure"
9545 #include "confdefs.h"
9546
9547 /* Override any gcc2 internal prototype to avoid an error.  */
9548 #ifdef __cplusplus
9549 extern "C"
9550 #endif
9551 /* We use char because int might match the return type of a gcc2
9552    builtin and then its argument prototype would still apply.  */
9553 char tgoto ();
9554 int
9555 main ()
9556 {
9557 tgoto ();
9558   ;
9559   return 0;
9560 }
9561 _ACEOF
9562 rm -f conftest.$ac_objext conftest$ac_exeext
9563 if { (eval echo "$as_me:9563: \"$ac_link\"") >&5
9564   (eval $ac_link) 2>&5
9565   ac_status=$?
9566   echo "$as_me:9566: \$? = $ac_status" >&5
9567   (exit $ac_status); } &&
9568          { ac_try='test -s conftest$ac_exeext'
9569   { (eval echo "$as_me:9569: \"$ac_try\"") >&5
9570   (eval $ac_try) 2>&5
9571   ac_status=$?
9572   echo "$as_me:9572: \$? = $ac_status" >&5
9573   (exit $ac_status); }; }; then
9574   ac_cv_lib_mytinfo_tgoto=yes
9575 else
9576   echo "$as_me: failed program was:" >&5
9577 cat conftest.$ac_ext >&5
9578 ac_cv_lib_mytinfo_tgoto=no
9579 fi
9580 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9581 LIBS=$ac_check_lib_save_LIBS
9582 fi
9583 echo "$as_me:9583: result: $ac_cv_lib_mytinfo_tgoto" >&5
9584 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9585 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9586   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9587 fi
9588
9589         fi
9590         ;;
9591 esac
9592
9593 LIBS="$cf_ncurses_LIBS $LIBS"
9594
9595 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9596 then
9597         LIBS="-l$cf_nculib_root $LIBS"
9598 else
9599
9600         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9601         cf_libdir=""
9602         echo "$as_me:9602: checking for initscr" >&5
9603 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9604 if test "${ac_cv_func_initscr+set}" = set; then
9605   echo $ECHO_N "(cached) $ECHO_C" >&6
9606 else
9607   cat >conftest.$ac_ext <<_ACEOF
9608 #line 9608 "configure"
9609 #include "confdefs.h"
9610 /* System header to define __stub macros and hopefully few prototypes,
9611     which can conflict with char initscr (); below.  */
9612 #include <assert.h>
9613 /* Override any gcc2 internal prototype to avoid an error.  */
9614 #ifdef __cplusplus
9615 extern "C"
9616 #endif
9617 /* We use char because int might match the return type of a gcc2
9618    builtin and then its argument prototype would still apply.  */
9619 char initscr ();
9620 char (*f) ();
9621
9622 int
9623 main ()
9624 {
9625 /* The GNU C library defines this for functions which it implements
9626     to always fail with ENOSYS.  Some functions are actually named
9627     something starting with __ and the normal name is an alias.  */
9628 #if defined (__stub_initscr) || defined (__stub___initscr)
9629 choke me
9630 #else
9631 f = initscr;
9632 #endif
9633
9634   ;
9635   return 0;
9636 }
9637 _ACEOF
9638 rm -f conftest.$ac_objext conftest$ac_exeext
9639 if { (eval echo "$as_me:9639: \"$ac_link\"") >&5
9640   (eval $ac_link) 2>&5
9641   ac_status=$?
9642   echo "$as_me:9642: \$? = $ac_status" >&5
9643   (exit $ac_status); } &&
9644          { ac_try='test -s conftest$ac_exeext'
9645   { (eval echo "$as_me:9645: \"$ac_try\"") >&5
9646   (eval $ac_try) 2>&5
9647   ac_status=$?
9648   echo "$as_me:9648: \$? = $ac_status" >&5
9649   (exit $ac_status); }; }; then
9650   ac_cv_func_initscr=yes
9651 else
9652   echo "$as_me: failed program was:" >&5
9653 cat conftest.$ac_ext >&5
9654 ac_cv_func_initscr=no
9655 fi
9656 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9657 fi
9658 echo "$as_me:9658: result: $ac_cv_func_initscr" >&5
9659 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9660 if test $ac_cv_func_initscr = yes; then
9661   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9662 else
9663
9664                 cf_save_LIBS="$LIBS"
9665                 echo "$as_me:9665: checking for initscr in -l$cf_nculib_root" >&5
9666 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9667                 LIBS="-l$cf_nculib_root $LIBS"
9668                 cat >conftest.$ac_ext <<_ACEOF
9669 #line 9669 "configure"
9670 #include "confdefs.h"
9671 #include <${cf_cv_ncurses_header:-curses.h}>
9672 int
9673 main ()
9674 {
9675 initscr()
9676   ;
9677   return 0;
9678 }
9679 _ACEOF
9680 rm -f conftest.$ac_objext conftest$ac_exeext
9681 if { (eval echo "$as_me:9681: \"$ac_link\"") >&5
9682   (eval $ac_link) 2>&5
9683   ac_status=$?
9684   echo "$as_me:9684: \$? = $ac_status" >&5
9685   (exit $ac_status); } &&
9686          { ac_try='test -s conftest$ac_exeext'
9687   { (eval echo "$as_me:9687: \"$ac_try\"") >&5
9688   (eval $ac_try) 2>&5
9689   ac_status=$?
9690   echo "$as_me:9690: \$? = $ac_status" >&5
9691   (exit $ac_status); }; }; then
9692   echo "$as_me:9692: result: yes" >&5
9693 echo "${ECHO_T}yes" >&6
9694                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9695
9696 else
9697   echo "$as_me: failed program was:" >&5
9698 cat conftest.$ac_ext >&5
9699 echo "$as_me:9699: result: no" >&5
9700 echo "${ECHO_T}no" >&6
9701
9702 cf_search=
9703 cf_library_path_list=""
9704 if test -n "${LDFLAGS}${LIBS}" ; then
9705         for cf_library_path in $LDFLAGS $LIBS
9706         do
9707                 case $cf_library_path in #(vi
9708                 -L*)
9709                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9710
9711 test "$cf_library_path" != "NONE" && \
9712 test -d "$cf_library_path" && \
9713  {
9714         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9715         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9716         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9717         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9718         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9719         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"
9720 }
9721
9722                         cf_library_path_list="$cf_library_path_list $cf_search"
9723                         ;;
9724                 esac
9725         done
9726 fi
9727
9728 cf_search=
9729
9730 test "/usr" != "$prefix" && \
9731 test -d "/usr" && \
9732 (test $prefix = NONE || test "/usr" != "$prefix") && {
9733         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9734         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9735         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9736         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9737         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9738         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9739 }
9740
9741 test "$prefix" != "NONE" && \
9742 test -d "$prefix" && \
9743  {
9744         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9745         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9746         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9747         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9748         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9749         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9750 }
9751
9752 test "/usr/local" != "$prefix" && \
9753 test -d "/usr/local" && \
9754 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9755         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9756         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9757         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9758         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9759         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9760         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9761 }
9762
9763 test "/opt" != "$prefix" && \
9764 test -d "/opt" && \
9765 (test $prefix = NONE || test "/opt" != "$prefix") && {
9766         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9767         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9768         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9769         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9770         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9771         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9772 }
9773
9774 test "$HOME" != "$prefix" && \
9775 test -d "$HOME" && \
9776 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9777         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9778         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9779         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9780         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9781         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9782         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9783 }
9784
9785 cf_search="$cf_library_path_list $cf_search"
9786
9787                         for cf_libdir in $cf_search
9788                         do
9789                                 echo "$as_me:9789: checking for -l$cf_nculib_root in $cf_libdir" >&5
9790 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9791                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9792                                 cat >conftest.$ac_ext <<_ACEOF
9793 #line 9793 "configure"
9794 #include "confdefs.h"
9795 #include <${cf_cv_ncurses_header:-curses.h}>
9796 int
9797 main ()
9798 {
9799 initscr()
9800   ;
9801   return 0;
9802 }
9803 _ACEOF
9804 rm -f conftest.$ac_objext conftest$ac_exeext
9805 if { (eval echo "$as_me:9805: \"$ac_link\"") >&5
9806   (eval $ac_link) 2>&5
9807   ac_status=$?
9808   echo "$as_me:9808: \$? = $ac_status" >&5
9809   (exit $ac_status); } &&
9810          { ac_try='test -s conftest$ac_exeext'
9811   { (eval echo "$as_me:9811: \"$ac_try\"") >&5
9812   (eval $ac_try) 2>&5
9813   ac_status=$?
9814   echo "$as_me:9814: \$? = $ac_status" >&5
9815   (exit $ac_status); }; }; then
9816   echo "$as_me:9816: result: yes" >&5
9817 echo "${ECHO_T}yes" >&6
9818                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9819                                          break
9820 else
9821   echo "$as_me: failed program was:" >&5
9822 cat conftest.$ac_ext >&5
9823 echo "$as_me:9823: result: no" >&5
9824 echo "${ECHO_T}no" >&6
9825                                          LIBS="$cf_save_LIBS"
9826 fi
9827 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9828                         done
9829
9830 fi
9831 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9832
9833 fi
9834
9835 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9836
9837 if test $cf_found_library = no ; then
9838         { { echo "$as_me:9838: error: Cannot link $cf_nculib_root library" >&5
9839 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9840    { (exit 1); exit 1; }; }
9841 fi
9842
9843 fi
9844
9845 if test -n "$cf_ncurses_LIBS" ; then
9846         echo "$as_me:9846: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9847 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9848         cf_ncurses_SAVE="$LIBS"
9849         for p in $cf_ncurses_LIBS ; do
9850                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9851                 if test "$q" != "$LIBS" ; then
9852                         LIBS="$q"
9853                 fi
9854         done
9855         cat >conftest.$ac_ext <<_ACEOF
9856 #line 9856 "configure"
9857 #include "confdefs.h"
9858 #include <${cf_cv_ncurses_header:-curses.h}>
9859 int
9860 main ()
9861 {
9862 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9863   ;
9864   return 0;
9865 }
9866 _ACEOF
9867 rm -f conftest.$ac_objext conftest$ac_exeext
9868 if { (eval echo "$as_me:9868: \"$ac_link\"") >&5
9869   (eval $ac_link) 2>&5
9870   ac_status=$?
9871   echo "$as_me:9871: \$? = $ac_status" >&5
9872   (exit $ac_status); } &&
9873          { ac_try='test -s conftest$ac_exeext'
9874   { (eval echo "$as_me:9874: \"$ac_try\"") >&5
9875   (eval $ac_try) 2>&5
9876   ac_status=$?
9877   echo "$as_me:9877: \$? = $ac_status" >&5
9878   (exit $ac_status); }; }; then
9879   echo "$as_me:9879: result: yes" >&5
9880 echo "${ECHO_T}yes" >&6
9881 else
9882   echo "$as_me: failed program was:" >&5
9883 cat conftest.$ac_ext >&5
9884 echo "$as_me:9884: result: no" >&5
9885 echo "${ECHO_T}no" >&6
9886                  LIBS="$cf_ncurses_SAVE"
9887 fi
9888 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9889 fi
9890
9891 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9892
9893 cat >>confdefs.h <<EOF
9894 #define $cf_nculib_ROOT 1
9895 EOF
9896
9897 fi
9898
9899         ;;
9900 pdcurses) #(vi
9901
9902 echo "$as_me:9902: checking if you want to use pkg-config" >&5
9903 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9904
9905 # Check whether --with-pkg-config or --without-pkg-config was given.
9906 if test "${with_pkg_config+set}" = set; then
9907   withval="$with_pkg_config"
9908   cf_pkg_config=$withval
9909 else
9910   cf_pkg_config=yes
9911 fi;
9912 echo "$as_me:9912: result: $cf_pkg_config" >&5
9913 echo "${ECHO_T}$cf_pkg_config" >&6
9914
9915 case $cf_pkg_config in #(vi
9916 no) #(vi
9917         PKG_CONFIG=none
9918         ;;
9919 yes) #(vi
9920
9921 if test -n "$ac_tool_prefix"; then
9922   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9923 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9924 echo "$as_me:9924: checking for $ac_word" >&5
9925 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9926 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9927   echo $ECHO_N "(cached) $ECHO_C" >&6
9928 else
9929   case $PKG_CONFIG in
9930   [\\/]* | ?:[\\/]*)
9931   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9932   ;;
9933   *)
9934   ac_save_IFS=$IFS; IFS=$ac_path_separator
9935 ac_dummy="$PATH"
9936 for ac_dir in $ac_dummy; do
9937   IFS=$ac_save_IFS
9938   test -z "$ac_dir" && ac_dir=.
9939   if $as_executable_p "$ac_dir/$ac_word"; then
9940    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9941    echo "$as_me:9941: found $ac_dir/$ac_word" >&5
9942    break
9943 fi
9944 done
9945
9946   ;;
9947 esac
9948 fi
9949 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9950
9951 if test -n "$PKG_CONFIG"; then
9952   echo "$as_me:9952: result: $PKG_CONFIG" >&5
9953 echo "${ECHO_T}$PKG_CONFIG" >&6
9954 else
9955   echo "$as_me:9955: result: no" >&5
9956 echo "${ECHO_T}no" >&6
9957 fi
9958
9959 fi
9960 if test -z "$ac_cv_path_PKG_CONFIG"; then
9961   ac_pt_PKG_CONFIG=$PKG_CONFIG
9962   # Extract the first word of "pkg-config", so it can be a program name with args.
9963 set dummy pkg-config; ac_word=$2
9964 echo "$as_me:9964: checking for $ac_word" >&5
9965 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9966 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9967   echo $ECHO_N "(cached) $ECHO_C" >&6
9968 else
9969   case $ac_pt_PKG_CONFIG in
9970   [\\/]* | ?:[\\/]*)
9971   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9972   ;;
9973   *)
9974   ac_save_IFS=$IFS; IFS=$ac_path_separator
9975 ac_dummy="$PATH"
9976 for ac_dir in $ac_dummy; do
9977   IFS=$ac_save_IFS
9978   test -z "$ac_dir" && ac_dir=.
9979   if $as_executable_p "$ac_dir/$ac_word"; then
9980    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9981    echo "$as_me:9981: found $ac_dir/$ac_word" >&5
9982    break
9983 fi
9984 done
9985
9986   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9987   ;;
9988 esac
9989 fi
9990 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9991
9992 if test -n "$ac_pt_PKG_CONFIG"; then
9993   echo "$as_me:9993: result: $ac_pt_PKG_CONFIG" >&5
9994 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9995 else
9996   echo "$as_me:9996: result: no" >&5
9997 echo "${ECHO_T}no" >&6
9998 fi
9999
10000   PKG_CONFIG=$ac_pt_PKG_CONFIG
10001 else
10002   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
10003 fi
10004
10005         ;;
10006 *)
10007         PKG_CONFIG=$withval
10008         ;;
10009 esac
10010
10011 test -z "$PKG_CONFIG" && PKG_CONFIG=none
10012 if test "$PKG_CONFIG" != none ; then
10013
10014 if test "x$prefix" != xNONE; then
10015   cf_path_syntax="$prefix"
10016 else
10017   cf_path_syntax="$ac_default_prefix"
10018 fi
10019
10020 case ".$PKG_CONFIG" in #(vi
10021 .\$\(*\)*|.\'*\'*) #(vi
10022   ;;
10023 ..|./*|.\\*) #(vi
10024   ;;
10025 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
10026   ;;
10027 .\${*prefix}*) #(vi
10028   eval PKG_CONFIG="$PKG_CONFIG"
10029   case ".$PKG_CONFIG" in #(vi
10030   .NONE/*)
10031     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
10032     ;;
10033   esac
10034   ;; #(vi
10035 .no|.NONE/*)
10036   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
10037   ;;
10038 *)
10039   { { echo "$as_me:10039: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
10040 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
10041    { (exit 1); exit 1; }; }
10042   ;;
10043 esac
10044
10045 fi
10046
10047 echo "$as_me:10047: checking for X" >&5
10048 echo $ECHO_N "checking for X... $ECHO_C" >&6
10049
10050 # Check whether --with-x or --without-x was given.
10051 if test "${with_x+set}" = set; then
10052   withval="$with_x"
10053
10054 fi;
10055 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10056 if test "x$with_x" = xno; then
10057   # The user explicitly disabled X.
10058   have_x=disabled
10059 else
10060   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10061     # Both variables are already set.
10062     have_x=yes
10063   else
10064     if test "${ac_cv_have_x+set}" = set; then
10065   echo $ECHO_N "(cached) $ECHO_C" >&6
10066 else
10067   # One or both of the vars are not set, and there is no cached value.
10068 ac_x_includes=no ac_x_libraries=no
10069 rm -fr conftest.dir
10070 if mkdir conftest.dir; then
10071   cd conftest.dir
10072   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10073   cat >Imakefile <<'EOF'
10074 acfindx:
10075         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10076 EOF
10077   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10078     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10079     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10080     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10081     for ac_extension in a so sl dylib dll; do
10082       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10083          test -f $ac_im_libdir/libX11.$ac_extension; then
10084         ac_im_usrlibdir=$ac_im_libdir; break
10085       fi
10086     done
10087     # Screen out bogus values from the imake configuration.  They are
10088     # bogus both because they are the default anyway, and because
10089     # using them would break gcc on systems where it needs fixed includes.
10090     case $ac_im_incroot in
10091         /usr/include) ;;
10092         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10093     esac
10094     case $ac_im_usrlibdir in
10095         /usr/lib | /lib) ;;
10096         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10097     esac
10098   fi
10099   cd ..
10100   rm -fr conftest.dir
10101 fi
10102
10103 # Standard set of common directories for X headers.
10104 # Check X11 before X11Rn because it is often a symlink to the current release.
10105 ac_x_header_dirs='
10106 /usr/X11/include
10107 /usr/X11R6/include
10108 /usr/X11R5/include
10109 /usr/X11R4/include
10110
10111 /usr/include/X11
10112 /usr/include/X11R6
10113 /usr/include/X11R5
10114 /usr/include/X11R4
10115
10116 /usr/local/X11/include
10117 /usr/local/X11R6/include
10118 /usr/local/X11R5/include
10119 /usr/local/X11R4/include
10120
10121 /usr/local/include/X11
10122 /usr/local/include/X11R6
10123 /usr/local/include/X11R5
10124 /usr/local/include/X11R4
10125
10126 /usr/X386/include
10127 /usr/x386/include
10128 /usr/XFree86/include/X11
10129
10130 /usr/include
10131 /usr/local/include
10132 /usr/unsupported/include
10133 /usr/athena/include
10134 /usr/local/x11r5/include
10135 /usr/lpp/Xamples/include
10136
10137 /usr/openwin/include
10138 /usr/openwin/share/include'
10139
10140 if test "$ac_x_includes" = no; then
10141   # Guess where to find include files, by looking for Intrinsic.h.
10142   # First, try using that file with no special directory specified.
10143   cat >conftest.$ac_ext <<_ACEOF
10144 #line 10144 "configure"
10145 #include "confdefs.h"
10146 #include <X11/Intrinsic.h>
10147 _ACEOF
10148 if { (eval echo "$as_me:10148: \"$ac_cpp conftest.$ac_ext\"") >&5
10149   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10150   ac_status=$?
10151   egrep -v '^ *\+' conftest.er1 >conftest.err
10152   rm -f conftest.er1
10153   cat conftest.err >&5
10154   echo "$as_me:10154: \$? = $ac_status" >&5
10155   (exit $ac_status); } >/dev/null; then
10156   if test -s conftest.err; then
10157     ac_cpp_err=$ac_c_preproc_warn_flag
10158   else
10159     ac_cpp_err=
10160   fi
10161 else
10162   ac_cpp_err=yes
10163 fi
10164 if test -z "$ac_cpp_err"; then
10165   # We can compile using X headers with no special include directory.
10166 ac_x_includes=
10167 else
10168   echo "$as_me: failed program was:" >&5
10169   cat conftest.$ac_ext >&5
10170   for ac_dir in $ac_x_header_dirs; do
10171   if test -r "$ac_dir/X11/Intrinsic.h"; then
10172     ac_x_includes=$ac_dir
10173     break
10174   fi
10175 done
10176 fi
10177 rm -f conftest.err conftest.$ac_ext
10178 fi # $ac_x_includes = no
10179
10180 if test "$ac_x_libraries" = no; then
10181   # Check for the libraries.
10182   # See if we find them without any special options.
10183   # Don't add to $LIBS permanently.
10184   ac_save_LIBS=$LIBS
10185   LIBS="-lXt $LIBS"
10186   cat >conftest.$ac_ext <<_ACEOF
10187 #line 10187 "configure"
10188 #include "confdefs.h"
10189 #include <X11/Intrinsic.h>
10190 int
10191 main ()
10192 {
10193 XtMalloc (0)
10194   ;
10195   return 0;
10196 }
10197 _ACEOF
10198 rm -f conftest.$ac_objext conftest$ac_exeext
10199 if { (eval echo "$as_me:10199: \"$ac_link\"") >&5
10200   (eval $ac_link) 2>&5
10201   ac_status=$?
10202   echo "$as_me:10202: \$? = $ac_status" >&5
10203   (exit $ac_status); } &&
10204          { ac_try='test -s conftest$ac_exeext'
10205   { (eval echo "$as_me:10205: \"$ac_try\"") >&5
10206   (eval $ac_try) 2>&5
10207   ac_status=$?
10208   echo "$as_me:10208: \$? = $ac_status" >&5
10209   (exit $ac_status); }; }; then
10210   LIBS=$ac_save_LIBS
10211 # We can link X programs with no special library path.
10212 ac_x_libraries=
10213 else
10214   echo "$as_me: failed program was:" >&5
10215 cat conftest.$ac_ext >&5
10216 LIBS=$ac_save_LIBS
10217 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10218 do
10219   # Don't even attempt the hair of trying to link an X program!
10220   for ac_extension in a so sl dylib dll; do
10221     if test -r $ac_dir/libXt.$ac_extension; then
10222       ac_x_libraries=$ac_dir
10223       break 2
10224     fi
10225   done
10226 done
10227 fi
10228 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10229 fi # $ac_x_libraries = no
10230
10231 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10232   # Didn't find X anywhere.  Cache the known absence of X.
10233   ac_cv_have_x="have_x=no"
10234 else
10235   # Record where we found X for the cache.
10236   ac_cv_have_x="have_x=yes \
10237                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10238 fi
10239 fi
10240
10241   fi
10242   eval "$ac_cv_have_x"
10243 fi # $with_x != no
10244
10245 if test "$have_x" != yes; then
10246   echo "$as_me:10246: result: $have_x" >&5
10247 echo "${ECHO_T}$have_x" >&6
10248   no_x=yes
10249 else
10250   # If each of the values was on the command line, it overrides each guess.
10251   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10252   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10253   # Update the cache value to reflect the command line values.
10254   ac_cv_have_x="have_x=yes \
10255                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10256   echo "$as_me:10256: result: libraries $x_libraries, headers $x_includes" >&5
10257 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10258 fi
10259
10260 if test "$no_x" = yes; then
10261   # Not all programs may use this symbol, but it does not hurt to define it.
10262
10263 cat >>confdefs.h <<\EOF
10264 #define X_DISPLAY_MISSING 1
10265 EOF
10266
10267   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10268 else
10269   if test -n "$x_includes"; then
10270     X_CFLAGS="$X_CFLAGS -I$x_includes"
10271   fi
10272
10273   # It would also be nice to do this for all -L options, not just this one.
10274   if test -n "$x_libraries"; then
10275     X_LIBS="$X_LIBS -L$x_libraries"
10276     # For Solaris; some versions of Sun CC require a space after -R and
10277     # others require no space.  Words are not sufficient . . . .
10278     case `(uname -sr) 2>/dev/null` in
10279     "SunOS 5"*)
10280       echo "$as_me:10280: checking whether -R must be followed by a space" >&5
10281 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10282       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10283       cat >conftest.$ac_ext <<_ACEOF
10284 #line 10284 "configure"
10285 #include "confdefs.h"
10286
10287 int
10288 main ()
10289 {
10290
10291   ;
10292   return 0;
10293 }
10294 _ACEOF
10295 rm -f conftest.$ac_objext conftest$ac_exeext
10296 if { (eval echo "$as_me:10296: \"$ac_link\"") >&5
10297   (eval $ac_link) 2>&5
10298   ac_status=$?
10299   echo "$as_me:10299: \$? = $ac_status" >&5
10300   (exit $ac_status); } &&
10301          { ac_try='test -s conftest$ac_exeext'
10302   { (eval echo "$as_me:10302: \"$ac_try\"") >&5
10303   (eval $ac_try) 2>&5
10304   ac_status=$?
10305   echo "$as_me:10305: \$? = $ac_status" >&5
10306   (exit $ac_status); }; }; then
10307   ac_R_nospace=yes
10308 else
10309   echo "$as_me: failed program was:" >&5
10310 cat conftest.$ac_ext >&5
10311 ac_R_nospace=no
10312 fi
10313 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10314       if test $ac_R_nospace = yes; then
10315         echo "$as_me:10315: result: no" >&5
10316 echo "${ECHO_T}no" >&6
10317         X_LIBS="$X_LIBS -R$x_libraries"
10318       else
10319         LIBS="$ac_xsave_LIBS -R $x_libraries"
10320         cat >conftest.$ac_ext <<_ACEOF
10321 #line 10321 "configure"
10322 #include "confdefs.h"
10323
10324 int
10325 main ()
10326 {
10327
10328   ;
10329   return 0;
10330 }
10331 _ACEOF
10332 rm -f conftest.$ac_objext conftest$ac_exeext
10333 if { (eval echo "$as_me:10333: \"$ac_link\"") >&5
10334   (eval $ac_link) 2>&5
10335   ac_status=$?
10336   echo "$as_me:10336: \$? = $ac_status" >&5
10337   (exit $ac_status); } &&
10338          { ac_try='test -s conftest$ac_exeext'
10339   { (eval echo "$as_me:10339: \"$ac_try\"") >&5
10340   (eval $ac_try) 2>&5
10341   ac_status=$?
10342   echo "$as_me:10342: \$? = $ac_status" >&5
10343   (exit $ac_status); }; }; then
10344   ac_R_space=yes
10345 else
10346   echo "$as_me: failed program was:" >&5
10347 cat conftest.$ac_ext >&5
10348 ac_R_space=no
10349 fi
10350 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10351         if test $ac_R_space = yes; then
10352           echo "$as_me:10352: result: yes" >&5
10353 echo "${ECHO_T}yes" >&6
10354           X_LIBS="$X_LIBS -R $x_libraries"
10355         else
10356           echo "$as_me:10356: result: neither works" >&5
10357 echo "${ECHO_T}neither works" >&6
10358         fi
10359       fi
10360       LIBS=$ac_xsave_LIBS
10361     esac
10362   fi
10363
10364   # Check for system-dependent libraries X programs must link with.
10365   # Do this before checking for the system-independent R6 libraries
10366   # (-lICE), since we may need -lsocket or whatever for X linking.
10367
10368   if test "$ISC" = yes; then
10369     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10370   else
10371     # Martyn Johnson says this is needed for Ultrix, if the X
10372     # libraries were built with DECnet support.  And Karl Berry says
10373     # the Alpha needs dnet_stub (dnet does not exist).
10374     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10375     cat >conftest.$ac_ext <<_ACEOF
10376 #line 10376 "configure"
10377 #include "confdefs.h"
10378
10379 /* Override any gcc2 internal prototype to avoid an error.  */
10380 #ifdef __cplusplus
10381 extern "C"
10382 #endif
10383 /* We use char because int might match the return type of a gcc2
10384    builtin and then its argument prototype would still apply.  */
10385 char XOpenDisplay ();
10386 int
10387 main ()
10388 {
10389 XOpenDisplay ();
10390   ;
10391   return 0;
10392 }
10393 _ACEOF
10394 rm -f conftest.$ac_objext conftest$ac_exeext
10395 if { (eval echo "$as_me:10395: \"$ac_link\"") >&5
10396   (eval $ac_link) 2>&5
10397   ac_status=$?
10398   echo "$as_me:10398: \$? = $ac_status" >&5
10399   (exit $ac_status); } &&
10400          { ac_try='test -s conftest$ac_exeext'
10401   { (eval echo "$as_me:10401: \"$ac_try\"") >&5
10402   (eval $ac_try) 2>&5
10403   ac_status=$?
10404   echo "$as_me:10404: \$? = $ac_status" >&5
10405   (exit $ac_status); }; }; then
10406   :
10407 else
10408   echo "$as_me: failed program was:" >&5
10409 cat conftest.$ac_ext >&5
10410 echo "$as_me:10410: checking for dnet_ntoa in -ldnet" >&5
10411 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10412 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10413   echo $ECHO_N "(cached) $ECHO_C" >&6
10414 else
10415   ac_check_lib_save_LIBS=$LIBS
10416 LIBS="-ldnet  $LIBS"
10417 cat >conftest.$ac_ext <<_ACEOF
10418 #line 10418 "configure"
10419 #include "confdefs.h"
10420
10421 /* Override any gcc2 internal prototype to avoid an error.  */
10422 #ifdef __cplusplus
10423 extern "C"
10424 #endif
10425 /* We use char because int might match the return type of a gcc2
10426    builtin and then its argument prototype would still apply.  */
10427 char dnet_ntoa ();
10428 int
10429 main ()
10430 {
10431 dnet_ntoa ();
10432   ;
10433   return 0;
10434 }
10435 _ACEOF
10436 rm -f conftest.$ac_objext conftest$ac_exeext
10437 if { (eval echo "$as_me:10437: \"$ac_link\"") >&5
10438   (eval $ac_link) 2>&5
10439   ac_status=$?
10440   echo "$as_me:10440: \$? = $ac_status" >&5
10441   (exit $ac_status); } &&
10442          { ac_try='test -s conftest$ac_exeext'
10443   { (eval echo "$as_me:10443: \"$ac_try\"") >&5
10444   (eval $ac_try) 2>&5
10445   ac_status=$?
10446   echo "$as_me:10446: \$? = $ac_status" >&5
10447   (exit $ac_status); }; }; then
10448   ac_cv_lib_dnet_dnet_ntoa=yes
10449 else
10450   echo "$as_me: failed program was:" >&5
10451 cat conftest.$ac_ext >&5
10452 ac_cv_lib_dnet_dnet_ntoa=no
10453 fi
10454 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10455 LIBS=$ac_check_lib_save_LIBS
10456 fi
10457 echo "$as_me:10457: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10458 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10459 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10460   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10461 fi
10462
10463     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10464       echo "$as_me:10464: checking for dnet_ntoa in -ldnet_stub" >&5
10465 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10466 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10467   echo $ECHO_N "(cached) $ECHO_C" >&6
10468 else
10469   ac_check_lib_save_LIBS=$LIBS
10470 LIBS="-ldnet_stub  $LIBS"
10471 cat >conftest.$ac_ext <<_ACEOF
10472 #line 10472 "configure"
10473 #include "confdefs.h"
10474
10475 /* Override any gcc2 internal prototype to avoid an error.  */
10476 #ifdef __cplusplus
10477 extern "C"
10478 #endif
10479 /* We use char because int might match the return type of a gcc2
10480    builtin and then its argument prototype would still apply.  */
10481 char dnet_ntoa ();
10482 int
10483 main ()
10484 {
10485 dnet_ntoa ();
10486   ;
10487   return 0;
10488 }
10489 _ACEOF
10490 rm -f conftest.$ac_objext conftest$ac_exeext
10491 if { (eval echo "$as_me:10491: \"$ac_link\"") >&5
10492   (eval $ac_link) 2>&5
10493   ac_status=$?
10494   echo "$as_me:10494: \$? = $ac_status" >&5
10495   (exit $ac_status); } &&
10496          { ac_try='test -s conftest$ac_exeext'
10497   { (eval echo "$as_me:10497: \"$ac_try\"") >&5
10498   (eval $ac_try) 2>&5
10499   ac_status=$?
10500   echo "$as_me:10500: \$? = $ac_status" >&5
10501   (exit $ac_status); }; }; then
10502   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10503 else
10504   echo "$as_me: failed program was:" >&5
10505 cat conftest.$ac_ext >&5
10506 ac_cv_lib_dnet_stub_dnet_ntoa=no
10507 fi
10508 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10509 LIBS=$ac_check_lib_save_LIBS
10510 fi
10511 echo "$as_me:10511: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10512 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10513 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10514   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10515 fi
10516
10517     fi
10518 fi
10519 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10520     LIBS="$ac_xsave_LIBS"
10521
10522     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10523     # to get the SysV transport functions.
10524     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10525     # needs -lnsl.
10526     # The nsl library prevents programs from opening the X display
10527     # on Irix 5.2, according to T.E. Dickey.
10528     # The functions gethostbyname, getservbyname, and inet_addr are
10529     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10530     echo "$as_me:10530: checking for gethostbyname" >&5
10531 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10532 if test "${ac_cv_func_gethostbyname+set}" = set; then
10533   echo $ECHO_N "(cached) $ECHO_C" >&6
10534 else
10535   cat >conftest.$ac_ext <<_ACEOF
10536 #line 10536 "configure"
10537 #include "confdefs.h"
10538 /* System header to define __stub macros and hopefully few prototypes,
10539     which can conflict with char gethostbyname (); below.  */
10540 #include <assert.h>
10541 /* Override any gcc2 internal prototype to avoid an error.  */
10542 #ifdef __cplusplus
10543 extern "C"
10544 #endif
10545 /* We use char because int might match the return type of a gcc2
10546    builtin and then its argument prototype would still apply.  */
10547 char gethostbyname ();
10548 char (*f) ();
10549
10550 int
10551 main ()
10552 {
10553 /* The GNU C library defines this for functions which it implements
10554     to always fail with ENOSYS.  Some functions are actually named
10555     something starting with __ and the normal name is an alias.  */
10556 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10557 choke me
10558 #else
10559 f = gethostbyname;
10560 #endif
10561
10562   ;
10563   return 0;
10564 }
10565 _ACEOF
10566 rm -f conftest.$ac_objext conftest$ac_exeext
10567 if { (eval echo "$as_me:10567: \"$ac_link\"") >&5
10568   (eval $ac_link) 2>&5
10569   ac_status=$?
10570   echo "$as_me:10570: \$? = $ac_status" >&5
10571   (exit $ac_status); } &&
10572          { ac_try='test -s conftest$ac_exeext'
10573   { (eval echo "$as_me:10573: \"$ac_try\"") >&5
10574   (eval $ac_try) 2>&5
10575   ac_status=$?
10576   echo "$as_me:10576: \$? = $ac_status" >&5
10577   (exit $ac_status); }; }; then
10578   ac_cv_func_gethostbyname=yes
10579 else
10580   echo "$as_me: failed program was:" >&5
10581 cat conftest.$ac_ext >&5
10582 ac_cv_func_gethostbyname=no
10583 fi
10584 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10585 fi
10586 echo "$as_me:10586: result: $ac_cv_func_gethostbyname" >&5
10587 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10588
10589     if test $ac_cv_func_gethostbyname = no; then
10590       echo "$as_me:10590: checking for gethostbyname in -lnsl" >&5
10591 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10592 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10593   echo $ECHO_N "(cached) $ECHO_C" >&6
10594 else
10595   ac_check_lib_save_LIBS=$LIBS
10596 LIBS="-lnsl  $LIBS"
10597 cat >conftest.$ac_ext <<_ACEOF
10598 #line 10598 "configure"
10599 #include "confdefs.h"
10600
10601 /* Override any gcc2 internal prototype to avoid an error.  */
10602 #ifdef __cplusplus
10603 extern "C"
10604 #endif
10605 /* We use char because int might match the return type of a gcc2
10606    builtin and then its argument prototype would still apply.  */
10607 char gethostbyname ();
10608 int
10609 main ()
10610 {
10611 gethostbyname ();
10612   ;
10613   return 0;
10614 }
10615 _ACEOF
10616 rm -f conftest.$ac_objext conftest$ac_exeext
10617 if { (eval echo "$as_me:10617: \"$ac_link\"") >&5
10618   (eval $ac_link) 2>&5
10619   ac_status=$?
10620   echo "$as_me:10620: \$? = $ac_status" >&5
10621   (exit $ac_status); } &&
10622          { ac_try='test -s conftest$ac_exeext'
10623   { (eval echo "$as_me:10623: \"$ac_try\"") >&5
10624   (eval $ac_try) 2>&5
10625   ac_status=$?
10626   echo "$as_me:10626: \$? = $ac_status" >&5
10627   (exit $ac_status); }; }; then
10628   ac_cv_lib_nsl_gethostbyname=yes
10629 else
10630   echo "$as_me: failed program was:" >&5
10631 cat conftest.$ac_ext >&5
10632 ac_cv_lib_nsl_gethostbyname=no
10633 fi
10634 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10635 LIBS=$ac_check_lib_save_LIBS
10636 fi
10637 echo "$as_me:10637: result: $ac_cv_lib_nsl_gethostbyname" >&5
10638 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10639 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10640   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10641 fi
10642
10643       if test $ac_cv_lib_nsl_gethostbyname = no; then
10644         echo "$as_me:10644: checking for gethostbyname in -lbsd" >&5
10645 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10646 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10647   echo $ECHO_N "(cached) $ECHO_C" >&6
10648 else
10649   ac_check_lib_save_LIBS=$LIBS
10650 LIBS="-lbsd  $LIBS"
10651 cat >conftest.$ac_ext <<_ACEOF
10652 #line 10652 "configure"
10653 #include "confdefs.h"
10654
10655 /* Override any gcc2 internal prototype to avoid an error.  */
10656 #ifdef __cplusplus
10657 extern "C"
10658 #endif
10659 /* We use char because int might match the return type of a gcc2
10660    builtin and then its argument prototype would still apply.  */
10661 char gethostbyname ();
10662 int
10663 main ()
10664 {
10665 gethostbyname ();
10666   ;
10667   return 0;
10668 }
10669 _ACEOF
10670 rm -f conftest.$ac_objext conftest$ac_exeext
10671 if { (eval echo "$as_me:10671: \"$ac_link\"") >&5
10672   (eval $ac_link) 2>&5
10673   ac_status=$?
10674   echo "$as_me:10674: \$? = $ac_status" >&5
10675   (exit $ac_status); } &&
10676          { ac_try='test -s conftest$ac_exeext'
10677   { (eval echo "$as_me:10677: \"$ac_try\"") >&5
10678   (eval $ac_try) 2>&5
10679   ac_status=$?
10680   echo "$as_me:10680: \$? = $ac_status" >&5
10681   (exit $ac_status); }; }; then
10682   ac_cv_lib_bsd_gethostbyname=yes
10683 else
10684   echo "$as_me: failed program was:" >&5
10685 cat conftest.$ac_ext >&5
10686 ac_cv_lib_bsd_gethostbyname=no
10687 fi
10688 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10689 LIBS=$ac_check_lib_save_LIBS
10690 fi
10691 echo "$as_me:10691: result: $ac_cv_lib_bsd_gethostbyname" >&5
10692 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10693 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10694   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10695 fi
10696
10697       fi
10698     fi
10699
10700     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10701     # socket/setsockopt and other routines are undefined under SCO ODT
10702     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10703     # on later versions), says Simon Leinen: it contains gethostby*
10704     # variants that don't use the nameserver (or something).  -lsocket
10705     # must be given before -lnsl if both are needed.  We assume that
10706     # if connect needs -lnsl, so does gethostbyname.
10707     echo "$as_me:10707: checking for connect" >&5
10708 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10709 if test "${ac_cv_func_connect+set}" = set; then
10710   echo $ECHO_N "(cached) $ECHO_C" >&6
10711 else
10712   cat >conftest.$ac_ext <<_ACEOF
10713 #line 10713 "configure"
10714 #include "confdefs.h"
10715 /* System header to define __stub macros and hopefully few prototypes,
10716     which can conflict with char connect (); below.  */
10717 #include <assert.h>
10718 /* Override any gcc2 internal prototype to avoid an error.  */
10719 #ifdef __cplusplus
10720 extern "C"
10721 #endif
10722 /* We use char because int might match the return type of a gcc2
10723    builtin and then its argument prototype would still apply.  */
10724 char connect ();
10725 char (*f) ();
10726
10727 int
10728 main ()
10729 {
10730 /* The GNU C library defines this for functions which it implements
10731     to always fail with ENOSYS.  Some functions are actually named
10732     something starting with __ and the normal name is an alias.  */
10733 #if defined (__stub_connect) || defined (__stub___connect)
10734 choke me
10735 #else
10736 f = connect;
10737 #endif
10738
10739   ;
10740   return 0;
10741 }
10742 _ACEOF
10743 rm -f conftest.$ac_objext conftest$ac_exeext
10744 if { (eval echo "$as_me:10744: \"$ac_link\"") >&5
10745   (eval $ac_link) 2>&5
10746   ac_status=$?
10747   echo "$as_me:10747: \$? = $ac_status" >&5
10748   (exit $ac_status); } &&
10749          { ac_try='test -s conftest$ac_exeext'
10750   { (eval echo "$as_me:10750: \"$ac_try\"") >&5
10751   (eval $ac_try) 2>&5
10752   ac_status=$?
10753   echo "$as_me:10753: \$? = $ac_status" >&5
10754   (exit $ac_status); }; }; then
10755   ac_cv_func_connect=yes
10756 else
10757   echo "$as_me: failed program was:" >&5
10758 cat conftest.$ac_ext >&5
10759 ac_cv_func_connect=no
10760 fi
10761 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10762 fi
10763 echo "$as_me:10763: result: $ac_cv_func_connect" >&5
10764 echo "${ECHO_T}$ac_cv_func_connect" >&6
10765
10766     if test $ac_cv_func_connect = no; then
10767       echo "$as_me:10767: checking for connect in -lsocket" >&5
10768 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10769 if test "${ac_cv_lib_socket_connect+set}" = set; then
10770   echo $ECHO_N "(cached) $ECHO_C" >&6
10771 else
10772   ac_check_lib_save_LIBS=$LIBS
10773 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10774 cat >conftest.$ac_ext <<_ACEOF
10775 #line 10775 "configure"
10776 #include "confdefs.h"
10777
10778 /* Override any gcc2 internal prototype to avoid an error.  */
10779 #ifdef __cplusplus
10780 extern "C"
10781 #endif
10782 /* We use char because int might match the return type of a gcc2
10783    builtin and then its argument prototype would still apply.  */
10784 char connect ();
10785 int
10786 main ()
10787 {
10788 connect ();
10789   ;
10790   return 0;
10791 }
10792 _ACEOF
10793 rm -f conftest.$ac_objext conftest$ac_exeext
10794 if { (eval echo "$as_me:10794: \"$ac_link\"") >&5
10795   (eval $ac_link) 2>&5
10796   ac_status=$?
10797   echo "$as_me:10797: \$? = $ac_status" >&5
10798   (exit $ac_status); } &&
10799          { ac_try='test -s conftest$ac_exeext'
10800   { (eval echo "$as_me:10800: \"$ac_try\"") >&5
10801   (eval $ac_try) 2>&5
10802   ac_status=$?
10803   echo "$as_me:10803: \$? = $ac_status" >&5
10804   (exit $ac_status); }; }; then
10805   ac_cv_lib_socket_connect=yes
10806 else
10807   echo "$as_me: failed program was:" >&5
10808 cat conftest.$ac_ext >&5
10809 ac_cv_lib_socket_connect=no
10810 fi
10811 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10812 LIBS=$ac_check_lib_save_LIBS
10813 fi
10814 echo "$as_me:10814: result: $ac_cv_lib_socket_connect" >&5
10815 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10816 if test $ac_cv_lib_socket_connect = yes; then
10817   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10818 fi
10819
10820     fi
10821
10822     # Guillermo Gomez says -lposix is necessary on A/UX.
10823     echo "$as_me:10823: checking for remove" >&5
10824 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10825 if test "${ac_cv_func_remove+set}" = set; then
10826   echo $ECHO_N "(cached) $ECHO_C" >&6
10827 else
10828   cat >conftest.$ac_ext <<_ACEOF
10829 #line 10829 "configure"
10830 #include "confdefs.h"
10831 /* System header to define __stub macros and hopefully few prototypes,
10832     which can conflict with char remove (); below.  */
10833 #include <assert.h>
10834 /* Override any gcc2 internal prototype to avoid an error.  */
10835 #ifdef __cplusplus
10836 extern "C"
10837 #endif
10838 /* We use char because int might match the return type of a gcc2
10839    builtin and then its argument prototype would still apply.  */
10840 char remove ();
10841 char (*f) ();
10842
10843 int
10844 main ()
10845 {
10846 /* The GNU C library defines this for functions which it implements
10847     to always fail with ENOSYS.  Some functions are actually named
10848     something starting with __ and the normal name is an alias.  */
10849 #if defined (__stub_remove) || defined (__stub___remove)
10850 choke me
10851 #else
10852 f = remove;
10853 #endif
10854
10855   ;
10856   return 0;
10857 }
10858 _ACEOF
10859 rm -f conftest.$ac_objext conftest$ac_exeext
10860 if { (eval echo "$as_me:10860: \"$ac_link\"") >&5
10861   (eval $ac_link) 2>&5
10862   ac_status=$?
10863   echo "$as_me:10863: \$? = $ac_status" >&5
10864   (exit $ac_status); } &&
10865          { ac_try='test -s conftest$ac_exeext'
10866   { (eval echo "$as_me:10866: \"$ac_try\"") >&5
10867   (eval $ac_try) 2>&5
10868   ac_status=$?
10869   echo "$as_me:10869: \$? = $ac_status" >&5
10870   (exit $ac_status); }; }; then
10871   ac_cv_func_remove=yes
10872 else
10873   echo "$as_me: failed program was:" >&5
10874 cat conftest.$ac_ext >&5
10875 ac_cv_func_remove=no
10876 fi
10877 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10878 fi
10879 echo "$as_me:10879: result: $ac_cv_func_remove" >&5
10880 echo "${ECHO_T}$ac_cv_func_remove" >&6
10881
10882     if test $ac_cv_func_remove = no; then
10883       echo "$as_me:10883: checking for remove in -lposix" >&5
10884 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10885 if test "${ac_cv_lib_posix_remove+set}" = set; then
10886   echo $ECHO_N "(cached) $ECHO_C" >&6
10887 else
10888   ac_check_lib_save_LIBS=$LIBS
10889 LIBS="-lposix  $LIBS"
10890 cat >conftest.$ac_ext <<_ACEOF
10891 #line 10891 "configure"
10892 #include "confdefs.h"
10893
10894 /* Override any gcc2 internal prototype to avoid an error.  */
10895 #ifdef __cplusplus
10896 extern "C"
10897 #endif
10898 /* We use char because int might match the return type of a gcc2
10899    builtin and then its argument prototype would still apply.  */
10900 char remove ();
10901 int
10902 main ()
10903 {
10904 remove ();
10905   ;
10906   return 0;
10907 }
10908 _ACEOF
10909 rm -f conftest.$ac_objext conftest$ac_exeext
10910 if { (eval echo "$as_me:10910: \"$ac_link\"") >&5
10911   (eval $ac_link) 2>&5
10912   ac_status=$?
10913   echo "$as_me:10913: \$? = $ac_status" >&5
10914   (exit $ac_status); } &&
10915          { ac_try='test -s conftest$ac_exeext'
10916   { (eval echo "$as_me:10916: \"$ac_try\"") >&5
10917   (eval $ac_try) 2>&5
10918   ac_status=$?
10919   echo "$as_me:10919: \$? = $ac_status" >&5
10920   (exit $ac_status); }; }; then
10921   ac_cv_lib_posix_remove=yes
10922 else
10923   echo "$as_me: failed program was:" >&5
10924 cat conftest.$ac_ext >&5
10925 ac_cv_lib_posix_remove=no
10926 fi
10927 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10928 LIBS=$ac_check_lib_save_LIBS
10929 fi
10930 echo "$as_me:10930: result: $ac_cv_lib_posix_remove" >&5
10931 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10932 if test $ac_cv_lib_posix_remove = yes; then
10933   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10934 fi
10935
10936     fi
10937
10938     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10939     echo "$as_me:10939: checking for shmat" >&5
10940 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10941 if test "${ac_cv_func_shmat+set}" = set; then
10942   echo $ECHO_N "(cached) $ECHO_C" >&6
10943 else
10944   cat >conftest.$ac_ext <<_ACEOF
10945 #line 10945 "configure"
10946 #include "confdefs.h"
10947 /* System header to define __stub macros and hopefully few prototypes,
10948     which can conflict with char shmat (); below.  */
10949 #include <assert.h>
10950 /* Override any gcc2 internal prototype to avoid an error.  */
10951 #ifdef __cplusplus
10952 extern "C"
10953 #endif
10954 /* We use char because int might match the return type of a gcc2
10955    builtin and then its argument prototype would still apply.  */
10956 char shmat ();
10957 char (*f) ();
10958
10959 int
10960 main ()
10961 {
10962 /* The GNU C library defines this for functions which it implements
10963     to always fail with ENOSYS.  Some functions are actually named
10964     something starting with __ and the normal name is an alias.  */
10965 #if defined (__stub_shmat) || defined (__stub___shmat)
10966 choke me
10967 #else
10968 f = shmat;
10969 #endif
10970
10971   ;
10972   return 0;
10973 }
10974 _ACEOF
10975 rm -f conftest.$ac_objext conftest$ac_exeext
10976 if { (eval echo "$as_me:10976: \"$ac_link\"") >&5
10977   (eval $ac_link) 2>&5
10978   ac_status=$?
10979   echo "$as_me:10979: \$? = $ac_status" >&5
10980   (exit $ac_status); } &&
10981          { ac_try='test -s conftest$ac_exeext'
10982   { (eval echo "$as_me:10982: \"$ac_try\"") >&5
10983   (eval $ac_try) 2>&5
10984   ac_status=$?
10985   echo "$as_me:10985: \$? = $ac_status" >&5
10986   (exit $ac_status); }; }; then
10987   ac_cv_func_shmat=yes
10988 else
10989   echo "$as_me: failed program was:" >&5
10990 cat conftest.$ac_ext >&5
10991 ac_cv_func_shmat=no
10992 fi
10993 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10994 fi
10995 echo "$as_me:10995: result: $ac_cv_func_shmat" >&5
10996 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10997
10998     if test $ac_cv_func_shmat = no; then
10999       echo "$as_me:10999: checking for shmat in -lipc" >&5
11000 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
11001 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
11002   echo $ECHO_N "(cached) $ECHO_C" >&6
11003 else
11004   ac_check_lib_save_LIBS=$LIBS
11005 LIBS="-lipc  $LIBS"
11006 cat >conftest.$ac_ext <<_ACEOF
11007 #line 11007 "configure"
11008 #include "confdefs.h"
11009
11010 /* Override any gcc2 internal prototype to avoid an error.  */
11011 #ifdef __cplusplus
11012 extern "C"
11013 #endif
11014 /* We use char because int might match the return type of a gcc2
11015    builtin and then its argument prototype would still apply.  */
11016 char shmat ();
11017 int
11018 main ()
11019 {
11020 shmat ();
11021   ;
11022   return 0;
11023 }
11024 _ACEOF
11025 rm -f conftest.$ac_objext conftest$ac_exeext
11026 if { (eval echo "$as_me:11026: \"$ac_link\"") >&5
11027   (eval $ac_link) 2>&5
11028   ac_status=$?
11029   echo "$as_me:11029: \$? = $ac_status" >&5
11030   (exit $ac_status); } &&
11031          { ac_try='test -s conftest$ac_exeext'
11032   { (eval echo "$as_me:11032: \"$ac_try\"") >&5
11033   (eval $ac_try) 2>&5
11034   ac_status=$?
11035   echo "$as_me:11035: \$? = $ac_status" >&5
11036   (exit $ac_status); }; }; then
11037   ac_cv_lib_ipc_shmat=yes
11038 else
11039   echo "$as_me: failed program was:" >&5
11040 cat conftest.$ac_ext >&5
11041 ac_cv_lib_ipc_shmat=no
11042 fi
11043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11044 LIBS=$ac_check_lib_save_LIBS
11045 fi
11046 echo "$as_me:11046: result: $ac_cv_lib_ipc_shmat" >&5
11047 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11048 if test $ac_cv_lib_ipc_shmat = yes; then
11049   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11050 fi
11051
11052     fi
11053   fi
11054
11055   # Check for libraries that X11R6 Xt/Xaw programs need.
11056   ac_save_LDFLAGS=$LDFLAGS
11057   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11058   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11059   # check for ICE first), but we must link in the order -lSM -lICE or
11060   # we get undefined symbols.  So assume we have SM if we have ICE.
11061   # These have to be linked with before -lX11, unlike the other
11062   # libraries we check for below, so use a different variable.
11063   # John Interrante, Karl Berry
11064   echo "$as_me:11064: checking for IceConnectionNumber in -lICE" >&5
11065 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11066 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11067   echo $ECHO_N "(cached) $ECHO_C" >&6
11068 else
11069   ac_check_lib_save_LIBS=$LIBS
11070 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11071 cat >conftest.$ac_ext <<_ACEOF
11072 #line 11072 "configure"
11073 #include "confdefs.h"
11074
11075 /* Override any gcc2 internal prototype to avoid an error.  */
11076 #ifdef __cplusplus
11077 extern "C"
11078 #endif
11079 /* We use char because int might match the return type of a gcc2
11080    builtin and then its argument prototype would still apply.  */
11081 char IceConnectionNumber ();
11082 int
11083 main ()
11084 {
11085 IceConnectionNumber ();
11086   ;
11087   return 0;
11088 }
11089 _ACEOF
11090 rm -f conftest.$ac_objext conftest$ac_exeext
11091 if { (eval echo "$as_me:11091: \"$ac_link\"") >&5
11092   (eval $ac_link) 2>&5
11093   ac_status=$?
11094   echo "$as_me:11094: \$? = $ac_status" >&5
11095   (exit $ac_status); } &&
11096          { ac_try='test -s conftest$ac_exeext'
11097   { (eval echo "$as_me:11097: \"$ac_try\"") >&5
11098   (eval $ac_try) 2>&5
11099   ac_status=$?
11100   echo "$as_me:11100: \$? = $ac_status" >&5
11101   (exit $ac_status); }; }; then
11102   ac_cv_lib_ICE_IceConnectionNumber=yes
11103 else
11104   echo "$as_me: failed program was:" >&5
11105 cat conftest.$ac_ext >&5
11106 ac_cv_lib_ICE_IceConnectionNumber=no
11107 fi
11108 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11109 LIBS=$ac_check_lib_save_LIBS
11110 fi
11111 echo "$as_me:11111: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11112 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11113 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11114   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11115 fi
11116
11117   LDFLAGS=$ac_save_LDFLAGS
11118
11119 fi
11120
11121 cf_x_athena=${cf_x_athena:-Xaw}
11122
11123 echo "$as_me:11123: checking if you want to link with Xaw 3d library" >&5
11124 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11125 withval=
11126
11127 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11128 if test "${with_Xaw3d+set}" = set; then
11129   withval="$with_Xaw3d"
11130
11131 fi;
11132 if test "$withval" = yes ; then
11133         cf_x_athena=Xaw3d
11134         echo "$as_me:11134: result: yes" >&5
11135 echo "${ECHO_T}yes" >&6
11136 else
11137         echo "$as_me:11137: result: no" >&5
11138 echo "${ECHO_T}no" >&6
11139 fi
11140
11141 echo "$as_me:11141: checking if you want to link with neXT Athena library" >&5
11142 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11143 withval=
11144
11145 # Check whether --with-neXtaw or --without-neXtaw was given.
11146 if test "${with_neXtaw+set}" = set; then
11147   withval="$with_neXtaw"
11148
11149 fi;
11150 if test "$withval" = yes ; then
11151         cf_x_athena=neXtaw
11152         echo "$as_me:11152: result: yes" >&5
11153 echo "${ECHO_T}yes" >&6
11154 else
11155         echo "$as_me:11155: result: no" >&5
11156 echo "${ECHO_T}no" >&6
11157 fi
11158
11159 echo "$as_me:11159: checking if you want to link with Athena-Plus library" >&5
11160 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11161 withval=
11162
11163 # Check whether --with-XawPlus or --without-XawPlus was given.
11164 if test "${with_XawPlus+set}" = set; then
11165   withval="$with_XawPlus"
11166
11167 fi;
11168 if test "$withval" = yes ; then
11169         cf_x_athena=XawPlus
11170         echo "$as_me:11170: result: yes" >&5
11171 echo "${ECHO_T}yes" >&6
11172 else
11173         echo "$as_me:11173: result: no" >&5
11174 echo "${ECHO_T}no" >&6
11175 fi
11176
11177 cf_x_athena_lib=""
11178
11179 if test "$PKG_CONFIG" != none ; then
11180         cf_athena_list=
11181         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11182         for cf_athena_pkg in \
11183                 $cf_athena_list \
11184                 ${cf_x_athena} \
11185                 ${cf_x_athena}-devel \
11186                 lib${cf_x_athena} \
11187                 lib${cf_x_athena}-devel
11188         do
11189
11190 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11191         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11192
11193 echo "${as_me:-configure}:11193: testing found package $cf_athena_pkg ..." 1>&5
11194
11195         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11196         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11197         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11198
11199 echo "${as_me:-configure}:11199: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11200
11201         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11202
11203 echo "${as_me:-configure}:11203: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11204
11205 cf_fix_cppflags=no
11206 cf_new_cflags=
11207 cf_new_cppflags=
11208 cf_new_extra_cppflags=
11209
11210 for cf_add_cflags in $cf_pkgconfig_incs
11211 do
11212 case $cf_fix_cppflags in
11213 no)
11214         case $cf_add_cflags in #(vi
11215         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11216                 case $cf_add_cflags in
11217                 -D*)
11218                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11219
11220                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11221                                 && test -z "${cf_tst_cflags}" \
11222                                 && cf_fix_cppflags=yes
11223
11224                         if test $cf_fix_cppflags = yes ; then
11225                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11226                                 continue
11227                         elif test "${cf_tst_cflags}" = "\"'" ; then
11228                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11229                                 continue
11230                         fi
11231                         ;;
11232                 esac
11233                 case "$CPPFLAGS" in
11234                 *$cf_add_cflags) #(vi
11235                         ;;
11236                 *) #(vi
11237                         case $cf_add_cflags in #(vi
11238                         -D*)
11239                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11240
11241 CPPFLAGS=`echo "$CPPFLAGS" | \
11242         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11243                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11244
11245                                 ;;
11246                         esac
11247                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11248                         ;;
11249                 esac
11250                 ;;
11251         *)
11252                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11253                 ;;
11254         esac
11255         ;;
11256 yes)
11257         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11258
11259         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11260
11261         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11262                 && test -z "${cf_tst_cflags}" \
11263                 && cf_fix_cppflags=no
11264         ;;
11265 esac
11266 done
11267
11268 if test -n "$cf_new_cflags" ; then
11269
11270         CFLAGS="$CFLAGS $cf_new_cflags"
11271 fi
11272
11273 if test -n "$cf_new_cppflags" ; then
11274
11275         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11276 fi
11277
11278 if test -n "$cf_new_extra_cppflags" ; then
11279
11280         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11281 fi
11282
11283         LIBS="$cf_pkgconfig_libs $LIBS"
11284
11285                         cf_x_athena_lib="$cf_pkgconfig_libs"
11286
11287 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11288
11289                         cat >>confdefs.h <<EOF
11290 #define $cf_x_athena_LIBS 1
11291 EOF
11292
11293 echo "$as_me:11293: checking for usable $cf_x_athena/Xmu package" >&5
11294 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11295 if test "${cf_cv_xaw_compat+set}" = set; then
11296   echo $ECHO_N "(cached) $ECHO_C" >&6
11297 else
11298
11299 cat >conftest.$ac_ext <<_ACEOF
11300 #line 11300 "configure"
11301 #include "confdefs.h"
11302
11303 #include <X11/Xmu/CharSet.h>
11304
11305 int
11306 main ()
11307 {
11308
11309 int check = XmuCompareISOLatin1("big", "small")
11310
11311   ;
11312   return 0;
11313 }
11314 _ACEOF
11315 rm -f conftest.$ac_objext conftest$ac_exeext
11316 if { (eval echo "$as_me:11316: \"$ac_link\"") >&5
11317   (eval $ac_link) 2>&5
11318   ac_status=$?
11319   echo "$as_me:11319: \$? = $ac_status" >&5
11320   (exit $ac_status); } &&
11321          { ac_try='test -s conftest$ac_exeext'
11322   { (eval echo "$as_me:11322: \"$ac_try\"") >&5
11323   (eval $ac_try) 2>&5
11324   ac_status=$?
11325   echo "$as_me:11325: \$? = $ac_status" >&5
11326   (exit $ac_status); }; }; then
11327   cf_cv_xaw_compat=yes
11328 else
11329   echo "$as_me: failed program was:" >&5
11330 cat conftest.$ac_ext >&5
11331 cf_cv_xaw_compat=no
11332 fi
11333 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11334 fi
11335 echo "$as_me:11335: result: $cf_cv_xaw_compat" >&5
11336 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11337
11338                         if test "$cf_cv_xaw_compat" = no
11339                         then
11340                                 # workaround for broken ".pc" files...
11341                                 case "$cf_x_athena_lib" in #(vi
11342                                 *-lXmu*) #(vi
11343                                         ;;
11344                                 *)
11345                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11346
11347 echo "${as_me:-configure}:11347: testing work around broken package ..." 1>&5
11348
11349 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11350         test -n "$verbose" && echo "    found package xmu" 1>&6
11351
11352 echo "${as_me:-configure}:11352: testing found package xmu ..." 1>&5
11353
11354         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11355         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11356         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11357
11358 echo "${as_me:-configure}:11358: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11359
11360         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11361
11362 echo "${as_me:-configure}:11362: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11363
11364 cf_fix_cppflags=no
11365 cf_new_cflags=
11366 cf_new_cppflags=
11367 cf_new_extra_cppflags=
11368
11369 for cf_add_cflags in $cf_pkgconfig_incs
11370 do
11371 case $cf_fix_cppflags in
11372 no)
11373         case $cf_add_cflags in #(vi
11374         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11375                 case $cf_add_cflags in
11376                 -D*)
11377                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11378
11379                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11380                                 && test -z "${cf_tst_cflags}" \
11381                                 && cf_fix_cppflags=yes
11382
11383                         if test $cf_fix_cppflags = yes ; then
11384                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11385                                 continue
11386                         elif test "${cf_tst_cflags}" = "\"'" ; then
11387                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11388                                 continue
11389                         fi
11390                         ;;
11391                 esac
11392                 case "$CPPFLAGS" in
11393                 *$cf_add_cflags) #(vi
11394                         ;;
11395                 *) #(vi
11396                         case $cf_add_cflags in #(vi
11397                         -D*)
11398                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11399
11400 CPPFLAGS=`echo "$CPPFLAGS" | \
11401         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11402                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11403
11404                                 ;;
11405                         esac
11406                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11407                         ;;
11408                 esac
11409                 ;;
11410         *)
11411                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11412                 ;;
11413         esac
11414         ;;
11415 yes)
11416         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11417
11418         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11419
11420         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11421                 && test -z "${cf_tst_cflags}" \
11422                 && cf_fix_cppflags=no
11423         ;;
11424 esac
11425 done
11426
11427 if test -n "$cf_new_cflags" ; then
11428
11429         CFLAGS="$CFLAGS $cf_new_cflags"
11430 fi
11431
11432 if test -n "$cf_new_cppflags" ; then
11433
11434         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11435 fi
11436
11437 if test -n "$cf_new_extra_cppflags" ; then
11438
11439         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11440 fi
11441
11442         LIBS="$cf_pkgconfig_libs $LIBS"
11443         :
11444 else
11445
11446 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11447
11448 echo "${as_me:-configure}:11448: testing ...before $LIBS ..." 1>&5
11449
11450 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11451 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11452
11453 echo "${as_me:-configure}:11453: testing ...after  $LIBS ..." 1>&5
11454
11455 fi
11456
11457                                         ;;
11458                                 esac
11459                         fi
11460
11461                         break
11462 else
11463         :
11464 fi
11465
11466         done
11467 fi
11468
11469 if test -z "$cf_x_athena_lib" ; then
11470
11471 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11472         test -n "$verbose" && echo "    found package Xext" 1>&6
11473
11474 echo "${as_me:-configure}:11474: testing found package Xext ..." 1>&5
11475
11476         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11477         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11478         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11479
11480 echo "${as_me:-configure}:11480: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11481
11482         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11483
11484 echo "${as_me:-configure}:11484: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11485
11486 cf_fix_cppflags=no
11487 cf_new_cflags=
11488 cf_new_cppflags=
11489 cf_new_extra_cppflags=
11490
11491 for cf_add_cflags in $cf_pkgconfig_incs
11492 do
11493 case $cf_fix_cppflags in
11494 no)
11495         case $cf_add_cflags in #(vi
11496         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11497                 case $cf_add_cflags in
11498                 -D*)
11499                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11500
11501                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11502                                 && test -z "${cf_tst_cflags}" \
11503                                 && cf_fix_cppflags=yes
11504
11505                         if test $cf_fix_cppflags = yes ; then
11506                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11507                                 continue
11508                         elif test "${cf_tst_cflags}" = "\"'" ; then
11509                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11510                                 continue
11511                         fi
11512                         ;;
11513                 esac
11514                 case "$CPPFLAGS" in
11515                 *$cf_add_cflags) #(vi
11516                         ;;
11517                 *) #(vi
11518                         case $cf_add_cflags in #(vi
11519                         -D*)
11520                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11521
11522 CPPFLAGS=`echo "$CPPFLAGS" | \
11523         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11524                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11525
11526                                 ;;
11527                         esac
11528                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11529                         ;;
11530                 esac
11531                 ;;
11532         *)
11533                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11534                 ;;
11535         esac
11536         ;;
11537 yes)
11538         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11539
11540         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11541
11542         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11543                 && test -z "${cf_tst_cflags}" \
11544                 && cf_fix_cppflags=no
11545         ;;
11546 esac
11547 done
11548
11549 if test -n "$cf_new_cflags" ; then
11550
11551         CFLAGS="$CFLAGS $cf_new_cflags"
11552 fi
11553
11554 if test -n "$cf_new_cppflags" ; then
11555
11556         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11557 fi
11558
11559 if test -n "$cf_new_extra_cppflags" ; then
11560
11561         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11562 fi
11563
11564         LIBS="$cf_pkgconfig_libs $LIBS"
11565         :
11566 else
11567
11568         echo "$as_me:11568: checking for XextCreateExtension in -lXext" >&5
11569 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11570 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11571   echo $ECHO_N "(cached) $ECHO_C" >&6
11572 else
11573   ac_check_lib_save_LIBS=$LIBS
11574 LIBS="-lXext  $LIBS"
11575 cat >conftest.$ac_ext <<_ACEOF
11576 #line 11576 "configure"
11577 #include "confdefs.h"
11578
11579 /* Override any gcc2 internal prototype to avoid an error.  */
11580 #ifdef __cplusplus
11581 extern "C"
11582 #endif
11583 /* We use char because int might match the return type of a gcc2
11584    builtin and then its argument prototype would still apply.  */
11585 char XextCreateExtension ();
11586 int
11587 main ()
11588 {
11589 XextCreateExtension ();
11590   ;
11591   return 0;
11592 }
11593 _ACEOF
11594 rm -f conftest.$ac_objext conftest$ac_exeext
11595 if { (eval echo "$as_me:11595: \"$ac_link\"") >&5
11596   (eval $ac_link) 2>&5
11597   ac_status=$?
11598   echo "$as_me:11598: \$? = $ac_status" >&5
11599   (exit $ac_status); } &&
11600          { ac_try='test -s conftest$ac_exeext'
11601   { (eval echo "$as_me:11601: \"$ac_try\"") >&5
11602   (eval $ac_try) 2>&5
11603   ac_status=$?
11604   echo "$as_me:11604: \$? = $ac_status" >&5
11605   (exit $ac_status); }; }; then
11606   ac_cv_lib_Xext_XextCreateExtension=yes
11607 else
11608   echo "$as_me: failed program was:" >&5
11609 cat conftest.$ac_ext >&5
11610 ac_cv_lib_Xext_XextCreateExtension=no
11611 fi
11612 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11613 LIBS=$ac_check_lib_save_LIBS
11614 fi
11615 echo "$as_me:11615: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11616 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11617 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11618   LIBS="-lXext $LIBS"
11619 fi
11620
11621 fi
11622
11623 cf_have_X_LIBS=no
11624
11625 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11626         test -n "$verbose" && echo "    found package xt" 1>&6
11627
11628 echo "${as_me:-configure}:11628: testing found package xt ..." 1>&5
11629
11630         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11631         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11632         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11633
11634 echo "${as_me:-configure}:11634: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11635
11636         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11637
11638 echo "${as_me:-configure}:11638: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11639
11640 cf_fix_cppflags=no
11641 cf_new_cflags=
11642 cf_new_cppflags=
11643 cf_new_extra_cppflags=
11644
11645 for cf_add_cflags in $cf_pkgconfig_incs
11646 do
11647 case $cf_fix_cppflags in
11648 no)
11649         case $cf_add_cflags in #(vi
11650         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11651                 case $cf_add_cflags in
11652                 -D*)
11653                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11654
11655                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11656                                 && test -z "${cf_tst_cflags}" \
11657                                 && cf_fix_cppflags=yes
11658
11659                         if test $cf_fix_cppflags = yes ; then
11660                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11661                                 continue
11662                         elif test "${cf_tst_cflags}" = "\"'" ; then
11663                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11664                                 continue
11665                         fi
11666                         ;;
11667                 esac
11668                 case "$CPPFLAGS" in
11669                 *$cf_add_cflags) #(vi
11670                         ;;
11671                 *) #(vi
11672                         case $cf_add_cflags in #(vi
11673                         -D*)
11674                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11675
11676 CPPFLAGS=`echo "$CPPFLAGS" | \
11677         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11678                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11679
11680                                 ;;
11681                         esac
11682                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11683                         ;;
11684                 esac
11685                 ;;
11686         *)
11687                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11688                 ;;
11689         esac
11690         ;;
11691 yes)
11692         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11693
11694         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11695
11696         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11697                 && test -z "${cf_tst_cflags}" \
11698                 && cf_fix_cppflags=no
11699         ;;
11700 esac
11701 done
11702
11703 if test -n "$cf_new_cflags" ; then
11704
11705         CFLAGS="$CFLAGS $cf_new_cflags"
11706 fi
11707
11708 if test -n "$cf_new_cppflags" ; then
11709
11710         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11711 fi
11712
11713 if test -n "$cf_new_extra_cppflags" ; then
11714
11715         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11716 fi
11717
11718         LIBS="$cf_pkgconfig_libs $LIBS"
11719
11720         case "x$LIBS" in #(vi
11721         *-lX11*) #(vi
11722                 ;;
11723         *)
11724 # we have an "xt" package, but it may omit Xt's dependency on X11
11725 echo "$as_me:11725: checking for usable X dependency" >&5
11726 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11727 if test "${cf_cv_xt_x11_compat+set}" = set; then
11728   echo $ECHO_N "(cached) $ECHO_C" >&6
11729 else
11730
11731 cat >conftest.$ac_ext <<_ACEOF
11732 #line 11732 "configure"
11733 #include "confdefs.h"
11734
11735 #include <X11/Xlib.h>
11736
11737 int
11738 main ()
11739 {
11740
11741         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11742         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11743         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11744         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11745
11746   ;
11747   return 0;
11748 }
11749 _ACEOF
11750 rm -f conftest.$ac_objext conftest$ac_exeext
11751 if { (eval echo "$as_me:11751: \"$ac_link\"") >&5
11752   (eval $ac_link) 2>&5
11753   ac_status=$?
11754   echo "$as_me:11754: \$? = $ac_status" >&5
11755   (exit $ac_status); } &&
11756          { ac_try='test -s conftest$ac_exeext'
11757   { (eval echo "$as_me:11757: \"$ac_try\"") >&5
11758   (eval $ac_try) 2>&5
11759   ac_status=$?
11760   echo "$as_me:11760: \$? = $ac_status" >&5
11761   (exit $ac_status); }; }; then
11762   cf_cv_xt_x11_compat=yes
11763 else
11764   echo "$as_me: failed program was:" >&5
11765 cat conftest.$ac_ext >&5
11766 cf_cv_xt_x11_compat=no
11767 fi
11768 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11769 fi
11770 echo "$as_me:11770: result: $cf_cv_xt_x11_compat" >&5
11771 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11772                 if test "$cf_cv_xt_x11_compat" = no
11773                 then
11774                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11775
11776 echo "${as_me:-configure}:11776: testing work around broken X11 dependency ..." 1>&5
11777
11778                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11779
11780 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11781         test -n "$verbose" && echo "    found package x11" 1>&6
11782
11783 echo "${as_me:-configure}:11783: testing found package x11 ..." 1>&5
11784
11785         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11786         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11787         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11788
11789 echo "${as_me:-configure}:11789: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11790
11791         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11792
11793 echo "${as_me:-configure}:11793: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11794
11795 cf_fix_cppflags=no
11796 cf_new_cflags=
11797 cf_new_cppflags=
11798 cf_new_extra_cppflags=
11799
11800 for cf_add_cflags in $cf_pkgconfig_incs
11801 do
11802 case $cf_fix_cppflags in
11803 no)
11804         case $cf_add_cflags in #(vi
11805         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11806                 case $cf_add_cflags in
11807                 -D*)
11808                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11809
11810                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11811                                 && test -z "${cf_tst_cflags}" \
11812                                 && cf_fix_cppflags=yes
11813
11814                         if test $cf_fix_cppflags = yes ; then
11815                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11816                                 continue
11817                         elif test "${cf_tst_cflags}" = "\"'" ; then
11818                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11819                                 continue
11820                         fi
11821                         ;;
11822                 esac
11823                 case "$CPPFLAGS" in
11824                 *$cf_add_cflags) #(vi
11825                         ;;
11826                 *) #(vi
11827                         case $cf_add_cflags in #(vi
11828                         -D*)
11829                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11830
11831 CPPFLAGS=`echo "$CPPFLAGS" | \
11832         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11833                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11834
11835                                 ;;
11836                         esac
11837                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11838                         ;;
11839                 esac
11840                 ;;
11841         *)
11842                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11843                 ;;
11844         esac
11845         ;;
11846 yes)
11847         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11848
11849         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11850
11851         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11852                 && test -z "${cf_tst_cflags}" \
11853                 && cf_fix_cppflags=no
11854         ;;
11855 esac
11856 done
11857
11858 if test -n "$cf_new_cflags" ; then
11859
11860         CFLAGS="$CFLAGS $cf_new_cflags"
11861 fi
11862
11863 if test -n "$cf_new_cppflags" ; then
11864
11865         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11866 fi
11867
11868 if test -n "$cf_new_extra_cppflags" ; then
11869
11870         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11871 fi
11872
11873         LIBS="$cf_pkgconfig_libs $LIBS"
11874         :
11875 else
11876
11877 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11878
11879 echo "${as_me:-configure}:11879: testing ...before $LIBS ..." 1>&5
11880
11881 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11882 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11883
11884 echo "${as_me:-configure}:11884: testing ...after  $LIBS ..." 1>&5
11885
11886 fi
11887
11888                 fi
11889                 ;;
11890         esac
11891
11892 echo "$as_me:11892: checking for usable X Toolkit package" >&5
11893 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11894 if test "${cf_cv_xt_ice_compat+set}" = set; then
11895   echo $ECHO_N "(cached) $ECHO_C" >&6
11896 else
11897
11898 cat >conftest.$ac_ext <<_ACEOF
11899 #line 11899 "configure"
11900 #include "confdefs.h"
11901
11902 #include <X11/Shell.h>
11903
11904 int
11905 main ()
11906 {
11907 int num = IceConnectionNumber(0)
11908
11909   ;
11910   return 0;
11911 }
11912 _ACEOF
11913 rm -f conftest.$ac_objext conftest$ac_exeext
11914 if { (eval echo "$as_me:11914: \"$ac_link\"") >&5
11915   (eval $ac_link) 2>&5
11916   ac_status=$?
11917   echo "$as_me:11917: \$? = $ac_status" >&5
11918   (exit $ac_status); } &&
11919          { ac_try='test -s conftest$ac_exeext'
11920   { (eval echo "$as_me:11920: \"$ac_try\"") >&5
11921   (eval $ac_try) 2>&5
11922   ac_status=$?
11923   echo "$as_me:11923: \$? = $ac_status" >&5
11924   (exit $ac_status); }; }; then
11925   cf_cv_xt_ice_compat=yes
11926 else
11927   echo "$as_me: failed program was:" >&5
11928 cat conftest.$ac_ext >&5
11929 cf_cv_xt_ice_compat=no
11930 fi
11931 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11932 fi
11933 echo "$as_me:11933: result: $cf_cv_xt_ice_compat" >&5
11934 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11935
11936         if test "$cf_cv_xt_ice_compat" = no
11937         then
11938                 # workaround for broken ".pc" files used for X Toolkit.
11939                 case "x$X_PRE_LIBS" in #(vi
11940                 *-lICE*)
11941                         case "x$LIBS" in #(vi
11942                         *-lICE*) #(vi
11943                                 ;;
11944                         *)
11945                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11946
11947 echo "${as_me:-configure}:11947: testing work around broken ICE dependency ..." 1>&5
11948
11949 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11950         test -n "$verbose" && echo "    found package ice" 1>&6
11951
11952 echo "${as_me:-configure}:11952: testing found package ice ..." 1>&5
11953
11954         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11955         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11956         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11957
11958 echo "${as_me:-configure}:11958: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11959
11960         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11961
11962 echo "${as_me:-configure}:11962: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11963
11964 cf_fix_cppflags=no
11965 cf_new_cflags=
11966 cf_new_cppflags=
11967 cf_new_extra_cppflags=
11968
11969 for cf_add_cflags in $cf_pkgconfig_incs
11970 do
11971 case $cf_fix_cppflags in
11972 no)
11973         case $cf_add_cflags in #(vi
11974         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11975                 case $cf_add_cflags in
11976                 -D*)
11977                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11978
11979                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11980                                 && test -z "${cf_tst_cflags}" \
11981                                 && cf_fix_cppflags=yes
11982
11983                         if test $cf_fix_cppflags = yes ; then
11984                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11985                                 continue
11986                         elif test "${cf_tst_cflags}" = "\"'" ; then
11987                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11988                                 continue
11989                         fi
11990                         ;;
11991                 esac
11992                 case "$CPPFLAGS" in
11993                 *$cf_add_cflags) #(vi
11994                         ;;
11995                 *) #(vi
11996                         case $cf_add_cflags in #(vi
11997                         -D*)
11998                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11999
12000 CPPFLAGS=`echo "$CPPFLAGS" | \
12001         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12002                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12003
12004                                 ;;
12005                         esac
12006                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12007                         ;;
12008                 esac
12009                 ;;
12010         *)
12011                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12012                 ;;
12013         esac
12014         ;;
12015 yes)
12016         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12017
12018         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12019
12020         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12021                 && test -z "${cf_tst_cflags}" \
12022                 && cf_fix_cppflags=no
12023         ;;
12024 esac
12025 done
12026
12027 if test -n "$cf_new_cflags" ; then
12028
12029         CFLAGS="$CFLAGS $cf_new_cflags"
12030 fi
12031
12032 if test -n "$cf_new_cppflags" ; then
12033
12034         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12035 fi
12036
12037 if test -n "$cf_new_extra_cppflags" ; then
12038
12039         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12040 fi
12041
12042         LIBS="$cf_pkgconfig_libs $LIBS"
12043
12044 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12045         test -n "$verbose" && echo "    found package sm" 1>&6
12046
12047 echo "${as_me:-configure}:12047: testing found package sm ..." 1>&5
12048
12049         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12050         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12051         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12052
12053 echo "${as_me:-configure}:12053: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12054
12055         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12056
12057 echo "${as_me:-configure}:12057: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12058
12059 cf_fix_cppflags=no
12060 cf_new_cflags=
12061 cf_new_cppflags=
12062 cf_new_extra_cppflags=
12063
12064 for cf_add_cflags in $cf_pkgconfig_incs
12065 do
12066 case $cf_fix_cppflags in
12067 no)
12068         case $cf_add_cflags in #(vi
12069         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12070                 case $cf_add_cflags in
12071                 -D*)
12072                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12073
12074                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12075                                 && test -z "${cf_tst_cflags}" \
12076                                 && cf_fix_cppflags=yes
12077
12078                         if test $cf_fix_cppflags = yes ; then
12079                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12080                                 continue
12081                         elif test "${cf_tst_cflags}" = "\"'" ; then
12082                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12083                                 continue
12084                         fi
12085                         ;;
12086                 esac
12087                 case "$CPPFLAGS" in
12088                 *$cf_add_cflags) #(vi
12089                         ;;
12090                 *) #(vi
12091                         case $cf_add_cflags in #(vi
12092                         -D*)
12093                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12094
12095 CPPFLAGS=`echo "$CPPFLAGS" | \
12096         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12097                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12098
12099                                 ;;
12100                         esac
12101                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12102                         ;;
12103                 esac
12104                 ;;
12105         *)
12106                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12107                 ;;
12108         esac
12109         ;;
12110 yes)
12111         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12112
12113         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12114
12115         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12116                 && test -z "${cf_tst_cflags}" \
12117                 && cf_fix_cppflags=no
12118         ;;
12119 esac
12120 done
12121
12122 if test -n "$cf_new_cflags" ; then
12123
12124         CFLAGS="$CFLAGS $cf_new_cflags"
12125 fi
12126
12127 if test -n "$cf_new_cppflags" ; then
12128
12129         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12130 fi
12131
12132 if test -n "$cf_new_extra_cppflags" ; then
12133
12134         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12135 fi
12136
12137         LIBS="$cf_pkgconfig_libs $LIBS"
12138         :
12139 else
12140         :
12141 fi
12142
12143 else
12144
12145 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12146
12147 echo "${as_me:-configure}:12147: testing ...before $LIBS ..." 1>&5
12148
12149 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
12150 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12151
12152 echo "${as_me:-configure}:12152: testing ...after  $LIBS ..." 1>&5
12153
12154 fi
12155
12156                                 ;;
12157                         esac
12158                         ;;
12159                 esac
12160         fi
12161
12162         cf_have_X_LIBS=yes
12163
12164 else
12165
12166         LDFLAGS="$X_LIBS $LDFLAGS"
12167
12168 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12169
12170 echo "${as_me:-configure}:12170: testing checking additions to CFLAGS ..." 1>&5
12171
12172 cf_check_cflags="$CFLAGS"
12173 cf_check_cppflags="$CPPFLAGS"
12174
12175 cf_fix_cppflags=no
12176 cf_new_cflags=
12177 cf_new_cppflags=
12178 cf_new_extra_cppflags=
12179
12180 for cf_add_cflags in $X_CFLAGS
12181 do
12182 case $cf_fix_cppflags in
12183 no)
12184         case $cf_add_cflags in #(vi
12185         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12186                 case $cf_add_cflags in
12187                 -D*)
12188                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12189
12190                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12191                                 && test -z "${cf_tst_cflags}" \
12192                                 && cf_fix_cppflags=yes
12193
12194                         if test $cf_fix_cppflags = yes ; then
12195                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12196                                 continue
12197                         elif test "${cf_tst_cflags}" = "\"'" ; then
12198                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12199                                 continue
12200                         fi
12201                         ;;
12202                 esac
12203                 case "$CPPFLAGS" in
12204                 *$cf_add_cflags) #(vi
12205                         ;;
12206                 *) #(vi
12207                         case $cf_add_cflags in #(vi
12208                         -D*)
12209                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12210
12211 CPPFLAGS=`echo "$CPPFLAGS" | \
12212         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12213                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12214
12215                                 ;;
12216                         esac
12217                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12218                         ;;
12219                 esac
12220                 ;;
12221         *)
12222                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12223                 ;;
12224         esac
12225         ;;
12226 yes)
12227         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12228
12229         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12230
12231         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12232                 && test -z "${cf_tst_cflags}" \
12233                 && cf_fix_cppflags=no
12234         ;;
12235 esac
12236 done
12237
12238 if test -n "$cf_new_cflags" ; then
12239         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12240
12241 echo "${as_me:-configure}:12241: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12242
12243         CFLAGS="$CFLAGS $cf_new_cflags"
12244 fi
12245
12246 if test -n "$cf_new_cppflags" ; then
12247         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12248
12249 echo "${as_me:-configure}:12249: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12250
12251         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12252 fi
12253
12254 if test -n "$cf_new_extra_cppflags" ; then
12255         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12256
12257 echo "${as_me:-configure}:12257: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12258
12259         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12260 fi
12261
12262 if test "$cf_check_cflags" != "$CFLAGS" ; then
12263 cat >conftest.$ac_ext <<_ACEOF
12264 #line 12264 "configure"
12265 #include "confdefs.h"
12266 #include <stdio.h>
12267 int
12268 main ()
12269 {
12270 printf("Hello world");
12271   ;
12272   return 0;
12273 }
12274 _ACEOF
12275 rm -f conftest.$ac_objext conftest$ac_exeext
12276 if { (eval echo "$as_me:12276: \"$ac_link\"") >&5
12277   (eval $ac_link) 2>&5
12278   ac_status=$?
12279   echo "$as_me:12279: \$? = $ac_status" >&5
12280   (exit $ac_status); } &&
12281          { ac_try='test -s conftest$ac_exeext'
12282   { (eval echo "$as_me:12282: \"$ac_try\"") >&5
12283   (eval $ac_try) 2>&5
12284   ac_status=$?
12285   echo "$as_me:12285: \$? = $ac_status" >&5
12286   (exit $ac_status); }; }; then
12287   :
12288 else
12289   echo "$as_me: failed program was:" >&5
12290 cat conftest.$ac_ext >&5
12291 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12292
12293 echo "${as_me:-configure}:12293: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12294
12295          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12296                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12297
12298 echo "${as_me:-configure}:12298: testing but keeping change to \$CPPFLAGS ..." 1>&5
12299
12300          fi
12301          CFLAGS="$cf_check_flags"
12302 fi
12303 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12304 fi
12305
12306         echo "$as_me:12306: checking for XOpenDisplay" >&5
12307 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12308 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12309   echo $ECHO_N "(cached) $ECHO_C" >&6
12310 else
12311   cat >conftest.$ac_ext <<_ACEOF
12312 #line 12312 "configure"
12313 #include "confdefs.h"
12314 /* System header to define __stub macros and hopefully few prototypes,
12315     which can conflict with char XOpenDisplay (); below.  */
12316 #include <assert.h>
12317 /* Override any gcc2 internal prototype to avoid an error.  */
12318 #ifdef __cplusplus
12319 extern "C"
12320 #endif
12321 /* We use char because int might match the return type of a gcc2
12322    builtin and then its argument prototype would still apply.  */
12323 char XOpenDisplay ();
12324 char (*f) ();
12325
12326 int
12327 main ()
12328 {
12329 /* The GNU C library defines this for functions which it implements
12330     to always fail with ENOSYS.  Some functions are actually named
12331     something starting with __ and the normal name is an alias.  */
12332 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12333 choke me
12334 #else
12335 f = XOpenDisplay;
12336 #endif
12337
12338   ;
12339   return 0;
12340 }
12341 _ACEOF
12342 rm -f conftest.$ac_objext conftest$ac_exeext
12343 if { (eval echo "$as_me:12343: \"$ac_link\"") >&5
12344   (eval $ac_link) 2>&5
12345   ac_status=$?
12346   echo "$as_me:12346: \$? = $ac_status" >&5
12347   (exit $ac_status); } &&
12348          { ac_try='test -s conftest$ac_exeext'
12349   { (eval echo "$as_me:12349: \"$ac_try\"") >&5
12350   (eval $ac_try) 2>&5
12351   ac_status=$?
12352   echo "$as_me:12352: \$? = $ac_status" >&5
12353   (exit $ac_status); }; }; then
12354   ac_cv_func_XOpenDisplay=yes
12355 else
12356   echo "$as_me: failed program was:" >&5
12357 cat conftest.$ac_ext >&5
12358 ac_cv_func_XOpenDisplay=no
12359 fi
12360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12361 fi
12362 echo "$as_me:12362: result: $ac_cv_func_XOpenDisplay" >&5
12363 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12364 if test $ac_cv_func_XOpenDisplay = yes; then
12365   :
12366 else
12367
12368         echo "$as_me:12368: checking for XOpenDisplay in -lX11" >&5
12369 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12370 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12371   echo $ECHO_N "(cached) $ECHO_C" >&6
12372 else
12373   ac_check_lib_save_LIBS=$LIBS
12374 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12375 cat >conftest.$ac_ext <<_ACEOF
12376 #line 12376 "configure"
12377 #include "confdefs.h"
12378
12379 /* Override any gcc2 internal prototype to avoid an error.  */
12380 #ifdef __cplusplus
12381 extern "C"
12382 #endif
12383 /* We use char because int might match the return type of a gcc2
12384    builtin and then its argument prototype would still apply.  */
12385 char XOpenDisplay ();
12386 int
12387 main ()
12388 {
12389 XOpenDisplay ();
12390   ;
12391   return 0;
12392 }
12393 _ACEOF
12394 rm -f conftest.$ac_objext conftest$ac_exeext
12395 if { (eval echo "$as_me:12395: \"$ac_link\"") >&5
12396   (eval $ac_link) 2>&5
12397   ac_status=$?
12398   echo "$as_me:12398: \$? = $ac_status" >&5
12399   (exit $ac_status); } &&
12400          { ac_try='test -s conftest$ac_exeext'
12401   { (eval echo "$as_me:12401: \"$ac_try\"") >&5
12402   (eval $ac_try) 2>&5
12403   ac_status=$?
12404   echo "$as_me:12404: \$? = $ac_status" >&5
12405   (exit $ac_status); }; }; then
12406   ac_cv_lib_X11_XOpenDisplay=yes
12407 else
12408   echo "$as_me: failed program was:" >&5
12409 cat conftest.$ac_ext >&5
12410 ac_cv_lib_X11_XOpenDisplay=no
12411 fi
12412 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12413 LIBS=$ac_check_lib_save_LIBS
12414 fi
12415 echo "$as_me:12415: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12416 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12417 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12418   LIBS="-lX11 $LIBS"
12419 fi
12420
12421 fi
12422
12423         echo "$as_me:12423: checking for XtAppInitialize" >&5
12424 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12425 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12426   echo $ECHO_N "(cached) $ECHO_C" >&6
12427 else
12428   cat >conftest.$ac_ext <<_ACEOF
12429 #line 12429 "configure"
12430 #include "confdefs.h"
12431 /* System header to define __stub macros and hopefully few prototypes,
12432     which can conflict with char XtAppInitialize (); below.  */
12433 #include <assert.h>
12434 /* Override any gcc2 internal prototype to avoid an error.  */
12435 #ifdef __cplusplus
12436 extern "C"
12437 #endif
12438 /* We use char because int might match the return type of a gcc2
12439    builtin and then its argument prototype would still apply.  */
12440 char XtAppInitialize ();
12441 char (*f) ();
12442
12443 int
12444 main ()
12445 {
12446 /* The GNU C library defines this for functions which it implements
12447     to always fail with ENOSYS.  Some functions are actually named
12448     something starting with __ and the normal name is an alias.  */
12449 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12450 choke me
12451 #else
12452 f = XtAppInitialize;
12453 #endif
12454
12455   ;
12456   return 0;
12457 }
12458 _ACEOF
12459 rm -f conftest.$ac_objext conftest$ac_exeext
12460 if { (eval echo "$as_me:12460: \"$ac_link\"") >&5
12461   (eval $ac_link) 2>&5
12462   ac_status=$?
12463   echo "$as_me:12463: \$? = $ac_status" >&5
12464   (exit $ac_status); } &&
12465          { ac_try='test -s conftest$ac_exeext'
12466   { (eval echo "$as_me:12466: \"$ac_try\"") >&5
12467   (eval $ac_try) 2>&5
12468   ac_status=$?
12469   echo "$as_me:12469: \$? = $ac_status" >&5
12470   (exit $ac_status); }; }; then
12471   ac_cv_func_XtAppInitialize=yes
12472 else
12473   echo "$as_me: failed program was:" >&5
12474 cat conftest.$ac_ext >&5
12475 ac_cv_func_XtAppInitialize=no
12476 fi
12477 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12478 fi
12479 echo "$as_me:12479: result: $ac_cv_func_XtAppInitialize" >&5
12480 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12481 if test $ac_cv_func_XtAppInitialize = yes; then
12482   :
12483 else
12484
12485         echo "$as_me:12485: checking for XtAppInitialize in -lXt" >&5
12486 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12487 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12488   echo $ECHO_N "(cached) $ECHO_C" >&6
12489 else
12490   ac_check_lib_save_LIBS=$LIBS
12491 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12492 cat >conftest.$ac_ext <<_ACEOF
12493 #line 12493 "configure"
12494 #include "confdefs.h"
12495
12496 /* Override any gcc2 internal prototype to avoid an error.  */
12497 #ifdef __cplusplus
12498 extern "C"
12499 #endif
12500 /* We use char because int might match the return type of a gcc2
12501    builtin and then its argument prototype would still apply.  */
12502 char XtAppInitialize ();
12503 int
12504 main ()
12505 {
12506 XtAppInitialize ();
12507   ;
12508   return 0;
12509 }
12510 _ACEOF
12511 rm -f conftest.$ac_objext conftest$ac_exeext
12512 if { (eval echo "$as_me:12512: \"$ac_link\"") >&5
12513   (eval $ac_link) 2>&5
12514   ac_status=$?
12515   echo "$as_me:12515: \$? = $ac_status" >&5
12516   (exit $ac_status); } &&
12517          { ac_try='test -s conftest$ac_exeext'
12518   { (eval echo "$as_me:12518: \"$ac_try\"") >&5
12519   (eval $ac_try) 2>&5
12520   ac_status=$?
12521   echo "$as_me:12521: \$? = $ac_status" >&5
12522   (exit $ac_status); }; }; then
12523   ac_cv_lib_Xt_XtAppInitialize=yes
12524 else
12525   echo "$as_me: failed program was:" >&5
12526 cat conftest.$ac_ext >&5
12527 ac_cv_lib_Xt_XtAppInitialize=no
12528 fi
12529 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12530 LIBS=$ac_check_lib_save_LIBS
12531 fi
12532 echo "$as_me:12532: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12533 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12534 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12535   cat >>confdefs.h <<\EOF
12536 #define HAVE_LIBXT 1
12537 EOF
12538
12539                  cf_have_X_LIBS=Xt
12540                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12541 fi
12542
12543 fi
12544
12545 fi
12546
12547 if test $cf_have_X_LIBS = no ; then
12548         { echo "$as_me:12548: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12549 test program.  You will have to check and add the proper libraries by hand
12550 to makefile." >&5
12551 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12552 test program.  You will have to check and add the proper libraries by hand
12553 to makefile." >&2;}
12554 fi
12555
12556 cf_x_athena_root=$cf_x_athena
12557 cf_x_athena_inc=""
12558
12559 for cf_path in default \
12560         /usr/contrib/X11R6 \
12561         /usr/contrib/X11R5 \
12562         /usr/lib/X11R5 \
12563         /usr/local
12564 do
12565         if test -z "$cf_x_athena_inc" ; then
12566                 cf_save="$CPPFLAGS"
12567                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12568                 if test $cf_path != default ; then
12569                         CPPFLAGS="$cf_save -I$cf_path/include"
12570                         echo "$as_me:12570: checking for $cf_test in $cf_path" >&5
12571 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12572                 else
12573                         echo "$as_me:12573: checking for $cf_test" >&5
12574 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12575                 fi
12576                 cat >conftest.$ac_ext <<_ACEOF
12577 #line 12577 "configure"
12578 #include "confdefs.h"
12579
12580 #include <X11/Intrinsic.h>
12581 #include <$cf_test>
12582 int
12583 main ()
12584 {
12585
12586   ;
12587   return 0;
12588 }
12589 _ACEOF
12590 rm -f conftest.$ac_objext
12591 if { (eval echo "$as_me:12591: \"$ac_compile\"") >&5
12592   (eval $ac_compile) 2>&5
12593   ac_status=$?
12594   echo "$as_me:12594: \$? = $ac_status" >&5
12595   (exit $ac_status); } &&
12596          { ac_try='test -s conftest.$ac_objext'
12597   { (eval echo "$as_me:12597: \"$ac_try\"") >&5
12598   (eval $ac_try) 2>&5
12599   ac_status=$?
12600   echo "$as_me:12600: \$? = $ac_status" >&5
12601   (exit $ac_status); }; }; then
12602   cf_result=yes
12603 else
12604   echo "$as_me: failed program was:" >&5
12605 cat conftest.$ac_ext >&5
12606 cf_result=no
12607 fi
12608 rm -f conftest.$ac_objext conftest.$ac_ext
12609                 echo "$as_me:12609: result: $cf_result" >&5
12610 echo "${ECHO_T}$cf_result" >&6
12611                 if test "$cf_result" = yes ; then
12612                         cf_x_athena_inc=$cf_path
12613                         break
12614                 else
12615                         CPPFLAGS="$cf_save"
12616                 fi
12617         fi
12618 done
12619
12620 if test -z "$cf_x_athena_inc" ; then
12621         { echo "$as_me:12621: WARNING: Unable to successfully find Athena header files with test program" >&5
12622 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12623 elif test "$cf_x_athena_inc" != default ; then
12624         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12625 fi
12626
12627 cf_x_athena_root=$cf_x_athena
12628 cf_x_athena_lib=""
12629
12630 for cf_path in default \
12631         /usr/contrib/X11R6 \
12632         /usr/contrib/X11R5 \
12633         /usr/lib/X11R5 \
12634         /usr/local
12635 do
12636         for cf_lib in \
12637                 ${cf_x_athena_root} \
12638                 ${cf_x_athena_root}7 \
12639                 ${cf_x_athena_root}6
12640         do
12641         for cf_libs in \
12642                 "-l$cf_lib -lXmu" \
12643                 "-l$cf_lib -lXpm -lXmu" \
12644                 "-l${cf_lib}_s -lXmu_s"
12645         do
12646                 if test -z "$cf_x_athena_lib" ; then
12647                         cf_save="$LIBS"
12648                         cf_test=XawSimpleMenuAddGlobalActions
12649                         if test $cf_path != default ; then
12650                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12651                                 echo "$as_me:12651: checking for $cf_libs in $cf_path" >&5
12652 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12653                         else
12654                                 LIBS="$cf_libs $LIBS"
12655                                 echo "$as_me:12655: checking for $cf_test in $cf_libs" >&5
12656 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12657                         fi
12658                         cat >conftest.$ac_ext <<_ACEOF
12659 #line 12659 "configure"
12660 #include "confdefs.h"
12661
12662 #include <X11/Intrinsic.h>
12663 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12664
12665 int
12666 main ()
12667 {
12668
12669 $cf_test((XtAppContext) 0)
12670   ;
12671   return 0;
12672 }
12673 _ACEOF
12674 rm -f conftest.$ac_objext conftest$ac_exeext
12675 if { (eval echo "$as_me:12675: \"$ac_link\"") >&5
12676   (eval $ac_link) 2>&5
12677   ac_status=$?
12678   echo "$as_me:12678: \$? = $ac_status" >&5
12679   (exit $ac_status); } &&
12680          { ac_try='test -s conftest$ac_exeext'
12681   { (eval echo "$as_me:12681: \"$ac_try\"") >&5
12682   (eval $ac_try) 2>&5
12683   ac_status=$?
12684   echo "$as_me:12684: \$? = $ac_status" >&5
12685   (exit $ac_status); }; }; then
12686   cf_result=yes
12687 else
12688   echo "$as_me: failed program was:" >&5
12689 cat conftest.$ac_ext >&5
12690 cf_result=no
12691 fi
12692 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12693                         echo "$as_me:12693: result: $cf_result" >&5
12694 echo "${ECHO_T}$cf_result" >&6
12695                         if test "$cf_result" = yes ; then
12696                                 cf_x_athena_lib="$cf_libs"
12697                                 break
12698                         fi
12699                         LIBS="$cf_save"
12700                 fi
12701         done # cf_libs
12702                 test -n "$cf_x_athena_lib" && break
12703         done # cf_lib
12704 done
12705
12706 if test -z "$cf_x_athena_lib" ; then
12707         { { echo "$as_me:12707: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12708 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12709    { (exit 1); exit 1; }; }
12710 fi
12711
12712 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12713
12714 cat >>confdefs.h <<EOF
12715 #define $cf_x_athena_LIBS 1
12716 EOF
12717
12718 fi
12719
12720 if test -n "$ac_tool_prefix"; then
12721   for ac_prog in xcurses-config
12722   do
12723     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12724 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12725 echo "$as_me:12725: checking for $ac_word" >&5
12726 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12727 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12728   echo $ECHO_N "(cached) $ECHO_C" >&6
12729 else
12730   if test -n "$XCURSES_CONFIG"; then
12731   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12732 else
12733   ac_save_IFS=$IFS; IFS=$ac_path_separator
12734 ac_dummy="$PATH"
12735 for ac_dir in $ac_dummy; do
12736   IFS=$ac_save_IFS
12737   test -z "$ac_dir" && ac_dir=.
12738   $as_executable_p "$ac_dir/$ac_word" || continue
12739 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12740 echo "$as_me:12740: found $ac_dir/$ac_word" >&5
12741 break
12742 done
12743
12744 fi
12745 fi
12746 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12747 if test -n "$XCURSES_CONFIG"; then
12748   echo "$as_me:12748: result: $XCURSES_CONFIG" >&5
12749 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12750 else
12751   echo "$as_me:12751: result: no" >&5
12752 echo "${ECHO_T}no" >&6
12753 fi
12754
12755     test -n "$XCURSES_CONFIG" && break
12756   done
12757 fi
12758 if test -z "$XCURSES_CONFIG"; then
12759   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12760   for ac_prog in xcurses-config
12761 do
12762   # Extract the first word of "$ac_prog", so it can be a program name with args.
12763 set dummy $ac_prog; ac_word=$2
12764 echo "$as_me:12764: checking for $ac_word" >&5
12765 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12766 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12767   echo $ECHO_N "(cached) $ECHO_C" >&6
12768 else
12769   if test -n "$ac_ct_XCURSES_CONFIG"; then
12770   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12771 else
12772   ac_save_IFS=$IFS; IFS=$ac_path_separator
12773 ac_dummy="$PATH"
12774 for ac_dir in $ac_dummy; do
12775   IFS=$ac_save_IFS
12776   test -z "$ac_dir" && ac_dir=.
12777   $as_executable_p "$ac_dir/$ac_word" || continue
12778 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12779 echo "$as_me:12779: found $ac_dir/$ac_word" >&5
12780 break
12781 done
12782
12783 fi
12784 fi
12785 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12786 if test -n "$ac_ct_XCURSES_CONFIG"; then
12787   echo "$as_me:12787: result: $ac_ct_XCURSES_CONFIG" >&5
12788 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12789 else
12790   echo "$as_me:12790: result: no" >&5
12791 echo "${ECHO_T}no" >&6
12792 fi
12793
12794   test -n "$ac_ct_XCURSES_CONFIG" && break
12795 done
12796 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12797
12798   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12799 fi
12800
12801 if test "$XCURSES_CONFIG" != none ; then
12802
12803 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12804 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12805
12806 cf_cv_lib_XCurses=yes
12807
12808 else
12809
12810 LDFLAGS="$LDFLAGS $X_LIBS"
12811
12812 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12813
12814 echo "${as_me:-configure}:12814: testing checking additions to CFLAGS ..." 1>&5
12815
12816 cf_check_cflags="$CFLAGS"
12817 cf_check_cppflags="$CPPFLAGS"
12818
12819 cf_fix_cppflags=no
12820 cf_new_cflags=
12821 cf_new_cppflags=
12822 cf_new_extra_cppflags=
12823
12824 for cf_add_cflags in $X_CFLAGS
12825 do
12826 case $cf_fix_cppflags in
12827 no)
12828         case $cf_add_cflags in #(vi
12829         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12830                 case $cf_add_cflags in
12831                 -D*)
12832                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12833
12834                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12835                                 && test -z "${cf_tst_cflags}" \
12836                                 && cf_fix_cppflags=yes
12837
12838                         if test $cf_fix_cppflags = yes ; then
12839                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12840                                 continue
12841                         elif test "${cf_tst_cflags}" = "\"'" ; then
12842                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12843                                 continue
12844                         fi
12845                         ;;
12846                 esac
12847                 case "$CPPFLAGS" in
12848                 *$cf_add_cflags) #(vi
12849                         ;;
12850                 *) #(vi
12851                         case $cf_add_cflags in #(vi
12852                         -D*)
12853                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12854
12855 CPPFLAGS=`echo "$CPPFLAGS" | \
12856         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12857                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12858
12859                                 ;;
12860                         esac
12861                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12862                         ;;
12863                 esac
12864                 ;;
12865         *)
12866                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12867                 ;;
12868         esac
12869         ;;
12870 yes)
12871         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12872
12873         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12874
12875         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12876                 && test -z "${cf_tst_cflags}" \
12877                 && cf_fix_cppflags=no
12878         ;;
12879 esac
12880 done
12881
12882 if test -n "$cf_new_cflags" ; then
12883         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12884
12885 echo "${as_me:-configure}:12885: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12886
12887         CFLAGS="$CFLAGS $cf_new_cflags"
12888 fi
12889
12890 if test -n "$cf_new_cppflags" ; then
12891         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12892
12893 echo "${as_me:-configure}:12893: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12894
12895         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12896 fi
12897
12898 if test -n "$cf_new_extra_cppflags" ; then
12899         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12900
12901 echo "${as_me:-configure}:12901: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12902
12903         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12904 fi
12905
12906 if test "$cf_check_cflags" != "$CFLAGS" ; then
12907 cat >conftest.$ac_ext <<_ACEOF
12908 #line 12908 "configure"
12909 #include "confdefs.h"
12910 #include <stdio.h>
12911 int
12912 main ()
12913 {
12914 printf("Hello world");
12915   ;
12916   return 0;
12917 }
12918 _ACEOF
12919 rm -f conftest.$ac_objext conftest$ac_exeext
12920 if { (eval echo "$as_me:12920: \"$ac_link\"") >&5
12921   (eval $ac_link) 2>&5
12922   ac_status=$?
12923   echo "$as_me:12923: \$? = $ac_status" >&5
12924   (exit $ac_status); } &&
12925          { ac_try='test -s conftest$ac_exeext'
12926   { (eval echo "$as_me:12926: \"$ac_try\"") >&5
12927   (eval $ac_try) 2>&5
12928   ac_status=$?
12929   echo "$as_me:12929: \$? = $ac_status" >&5
12930   (exit $ac_status); }; }; then
12931   :
12932 else
12933   echo "$as_me: failed program was:" >&5
12934 cat conftest.$ac_ext >&5
12935 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12936
12937 echo "${as_me:-configure}:12937: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12938
12939          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12940                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12941
12942 echo "${as_me:-configure}:12942: testing but keeping change to \$CPPFLAGS ..." 1>&5
12943
12944          fi
12945          CFLAGS="$cf_check_flags"
12946 fi
12947 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12948 fi
12949
12950 echo "$as_me:12950: checking for XOpenDisplay in -lX11" >&5
12951 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12952 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12953   echo $ECHO_N "(cached) $ECHO_C" >&6
12954 else
12955   ac_check_lib_save_LIBS=$LIBS
12956 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12957 cat >conftest.$ac_ext <<_ACEOF
12958 #line 12958 "configure"
12959 #include "confdefs.h"
12960
12961 /* Override any gcc2 internal prototype to avoid an error.  */
12962 #ifdef __cplusplus
12963 extern "C"
12964 #endif
12965 /* We use char because int might match the return type of a gcc2
12966    builtin and then its argument prototype would still apply.  */
12967 char XOpenDisplay ();
12968 int
12969 main ()
12970 {
12971 XOpenDisplay ();
12972   ;
12973   return 0;
12974 }
12975 _ACEOF
12976 rm -f conftest.$ac_objext conftest$ac_exeext
12977 if { (eval echo "$as_me:12977: \"$ac_link\"") >&5
12978   (eval $ac_link) 2>&5
12979   ac_status=$?
12980   echo "$as_me:12980: \$? = $ac_status" >&5
12981   (exit $ac_status); } &&
12982          { ac_try='test -s conftest$ac_exeext'
12983   { (eval echo "$as_me:12983: \"$ac_try\"") >&5
12984   (eval $ac_try) 2>&5
12985   ac_status=$?
12986   echo "$as_me:12986: \$? = $ac_status" >&5
12987   (exit $ac_status); }; }; then
12988   ac_cv_lib_X11_XOpenDisplay=yes
12989 else
12990   echo "$as_me: failed program was:" >&5
12991 cat conftest.$ac_ext >&5
12992 ac_cv_lib_X11_XOpenDisplay=no
12993 fi
12994 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12995 LIBS=$ac_check_lib_save_LIBS
12996 fi
12997 echo "$as_me:12997: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12998 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12999 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
13000   LIBS="-lX11 $LIBS"
13001 fi
13002
13003 echo "$as_me:13003: checking for XCurses library" >&5
13004 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
13005 if test "${cf_cv_lib_XCurses+set}" = set; then
13006   echo $ECHO_N "(cached) $ECHO_C" >&6
13007 else
13008
13009 LIBS="-lXCurses $LIBS"
13010 cat >conftest.$ac_ext <<_ACEOF
13011 #line 13011 "configure"
13012 #include "confdefs.h"
13013
13014 #include <xcurses.h>
13015 char *XCursesProgramName = "test";
13016
13017 int
13018 main ()
13019 {
13020 XCursesExit();
13021   ;
13022   return 0;
13023 }
13024 _ACEOF
13025 rm -f conftest.$ac_objext conftest$ac_exeext
13026 if { (eval echo "$as_me:13026: \"$ac_link\"") >&5
13027   (eval $ac_link) 2>&5
13028   ac_status=$?
13029   echo "$as_me:13029: \$? = $ac_status" >&5
13030   (exit $ac_status); } &&
13031          { ac_try='test -s conftest$ac_exeext'
13032   { (eval echo "$as_me:13032: \"$ac_try\"") >&5
13033   (eval $ac_try) 2>&5
13034   ac_status=$?
13035   echo "$as_me:13035: \$? = $ac_status" >&5
13036   (exit $ac_status); }; }; then
13037   cf_cv_lib_XCurses=yes
13038 else
13039   echo "$as_me: failed program was:" >&5
13040 cat conftest.$ac_ext >&5
13041 cf_cv_lib_XCurses=no
13042 fi
13043 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13044
13045 fi
13046 echo "$as_me:13046: result: $cf_cv_lib_XCurses" >&5
13047 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13048
13049 fi
13050
13051 if test $cf_cv_lib_XCurses = yes ; then
13052         cat >>confdefs.h <<\EOF
13053 #define UNIX 1
13054 EOF
13055
13056         cat >>confdefs.h <<\EOF
13057 #define XCURSES 1
13058 EOF
13059
13060         echo "$as_me:13060: checking for xcurses.h" >&5
13061 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13062 if test "${ac_cv_header_xcurses_h+set}" = set; then
13063   echo $ECHO_N "(cached) $ECHO_C" >&6
13064 else
13065   cat >conftest.$ac_ext <<_ACEOF
13066 #line 13066 "configure"
13067 #include "confdefs.h"
13068 #include <xcurses.h>
13069 _ACEOF
13070 if { (eval echo "$as_me:13070: \"$ac_cpp conftest.$ac_ext\"") >&5
13071   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13072   ac_status=$?
13073   egrep -v '^ *\+' conftest.er1 >conftest.err
13074   rm -f conftest.er1
13075   cat conftest.err >&5
13076   echo "$as_me:13076: \$? = $ac_status" >&5
13077   (exit $ac_status); } >/dev/null; then
13078   if test -s conftest.err; then
13079     ac_cpp_err=$ac_c_preproc_warn_flag
13080   else
13081     ac_cpp_err=
13082   fi
13083 else
13084   ac_cpp_err=yes
13085 fi
13086 if test -z "$ac_cpp_err"; then
13087   ac_cv_header_xcurses_h=yes
13088 else
13089   echo "$as_me: failed program was:" >&5
13090   cat conftest.$ac_ext >&5
13091   ac_cv_header_xcurses_h=no
13092 fi
13093 rm -f conftest.err conftest.$ac_ext
13094 fi
13095 echo "$as_me:13095: result: $ac_cv_header_xcurses_h" >&5
13096 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13097 if test $ac_cv_header_xcurses_h = yes; then
13098   cat >>confdefs.h <<\EOF
13099 #define HAVE_XCURSES 1
13100 EOF
13101
13102 fi
13103
13104 else
13105         { { echo "$as_me:13105: error: Cannot link with XCurses" >&5
13106 echo "$as_me: error: Cannot link with XCurses" >&2;}
13107    { (exit 1); exit 1; }; }
13108 fi
13109
13110         ;;
13111 esac
13112
13113 case $cf_cv_screen in #(vi
13114 pdcurses) #(vi
13115         ;;
13116 *)
13117         # look for curses-related libraries
13118
13119 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13120 echo "$as_me:13120: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13121 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13122 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13123   echo $ECHO_N "(cached) $ECHO_C" >&6
13124 else
13125   ac_check_lib_save_LIBS=$LIBS
13126 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13127 cat >conftest.$ac_ext <<_ACEOF
13128 #line 13128 "configure"
13129 #include "confdefs.h"
13130
13131 /* Override any gcc2 internal prototype to avoid an error.  */
13132 #ifdef __cplusplus
13133 extern "C"
13134 #endif
13135 /* We use char because int might match the return type of a gcc2
13136    builtin and then its argument prototype would still apply.  */
13137 char new_panel ();
13138 int
13139 main ()
13140 {
13141 new_panel ();
13142   ;
13143   return 0;
13144 }
13145 _ACEOF
13146 rm -f conftest.$ac_objext conftest$ac_exeext
13147 if { (eval echo "$as_me:13147: \"$ac_link\"") >&5
13148   (eval $ac_link) 2>&5
13149   ac_status=$?
13150   echo "$as_me:13150: \$? = $ac_status" >&5
13151   (exit $ac_status); } &&
13152          { ac_try='test -s conftest$ac_exeext'
13153   { (eval echo "$as_me:13153: \"$ac_try\"") >&5
13154   (eval $ac_try) 2>&5
13155   ac_status=$?
13156   echo "$as_me:13156: \$? = $ac_status" >&5
13157   (exit $ac_status); }; }; then
13158   eval "$as_ac_Lib=yes"
13159 else
13160   echo "$as_me: failed program was:" >&5
13161 cat conftest.$ac_ext >&5
13162 eval "$as_ac_Lib=no"
13163 fi
13164 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13165 LIBS=$ac_check_lib_save_LIBS
13166 fi
13167 echo "$as_me:13167: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13168 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13169 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13170   cat >>confdefs.h <<EOF
13171 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
13172 EOF
13173
13174   LIBS="-lpanel$cf_cv_libtype $LIBS"
13175
13176 fi
13177
13178 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13179 echo "$as_me:13179: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13180 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13181 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13182   echo $ECHO_N "(cached) $ECHO_C" >&6
13183 else
13184   ac_check_lib_save_LIBS=$LIBS
13185 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13186 cat >conftest.$ac_ext <<_ACEOF
13187 #line 13187 "configure"
13188 #include "confdefs.h"
13189
13190 /* Override any gcc2 internal prototype to avoid an error.  */
13191 #ifdef __cplusplus
13192 extern "C"
13193 #endif
13194 /* We use char because int might match the return type of a gcc2
13195    builtin and then its argument prototype would still apply.  */
13196 char menu_driver ();
13197 int
13198 main ()
13199 {
13200 menu_driver ();
13201   ;
13202   return 0;
13203 }
13204 _ACEOF
13205 rm -f conftest.$ac_objext conftest$ac_exeext
13206 if { (eval echo "$as_me:13206: \"$ac_link\"") >&5
13207   (eval $ac_link) 2>&5
13208   ac_status=$?
13209   echo "$as_me:13209: \$? = $ac_status" >&5
13210   (exit $ac_status); } &&
13211          { ac_try='test -s conftest$ac_exeext'
13212   { (eval echo "$as_me:13212: \"$ac_try\"") >&5
13213   (eval $ac_try) 2>&5
13214   ac_status=$?
13215   echo "$as_me:13215: \$? = $ac_status" >&5
13216   (exit $ac_status); }; }; then
13217   eval "$as_ac_Lib=yes"
13218 else
13219   echo "$as_me: failed program was:" >&5
13220 cat conftest.$ac_ext >&5
13221 eval "$as_ac_Lib=no"
13222 fi
13223 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13224 LIBS=$ac_check_lib_save_LIBS
13225 fi
13226 echo "$as_me:13226: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13227 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13228 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13229   cat >>confdefs.h <<EOF
13230 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
13231 EOF
13232
13233   LIBS="-lmenu$cf_cv_libtype $LIBS"
13234
13235 fi
13236
13237 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13238 echo "$as_me:13238: checking for form_driver in -lform$cf_cv_libtype" >&5
13239 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13240 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13241   echo $ECHO_N "(cached) $ECHO_C" >&6
13242 else
13243   ac_check_lib_save_LIBS=$LIBS
13244 LIBS="-lform$cf_cv_libtype  $LIBS"
13245 cat >conftest.$ac_ext <<_ACEOF
13246 #line 13246 "configure"
13247 #include "confdefs.h"
13248
13249 /* Override any gcc2 internal prototype to avoid an error.  */
13250 #ifdef __cplusplus
13251 extern "C"
13252 #endif
13253 /* We use char because int might match the return type of a gcc2
13254    builtin and then its argument prototype would still apply.  */
13255 char form_driver ();
13256 int
13257 main ()
13258 {
13259 form_driver ();
13260   ;
13261   return 0;
13262 }
13263 _ACEOF
13264 rm -f conftest.$ac_objext conftest$ac_exeext
13265 if { (eval echo "$as_me:13265: \"$ac_link\"") >&5
13266   (eval $ac_link) 2>&5
13267   ac_status=$?
13268   echo "$as_me:13268: \$? = $ac_status" >&5
13269   (exit $ac_status); } &&
13270          { ac_try='test -s conftest$ac_exeext'
13271   { (eval echo "$as_me:13271: \"$ac_try\"") >&5
13272   (eval $ac_try) 2>&5
13273   ac_status=$?
13274   echo "$as_me:13274: \$? = $ac_status" >&5
13275   (exit $ac_status); }; }; then
13276   eval "$as_ac_Lib=yes"
13277 else
13278   echo "$as_me: failed program was:" >&5
13279 cat conftest.$ac_ext >&5
13280 eval "$as_ac_Lib=no"
13281 fi
13282 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13283 LIBS=$ac_check_lib_save_LIBS
13284 fi
13285 echo "$as_me:13285: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13286 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13287 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13288   cat >>confdefs.h <<EOF
13289 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
13290 EOF
13291
13292   LIBS="-lform$cf_cv_libtype $LIBS"
13293
13294 fi
13295
13296         # look for curses-related headers
13297
13298 for ac_header in \
13299                 nc_alloc.h \
13300                 nomacros.h \
13301                 form.h \
13302                 menu.h \
13303                 panel.h \
13304                 term_entry.h \
13305
13306 do
13307 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13308 echo "$as_me:13308: checking for $ac_header" >&5
13309 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13310 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13311   echo $ECHO_N "(cached) $ECHO_C" >&6
13312 else
13313   cat >conftest.$ac_ext <<_ACEOF
13314 #line 13314 "configure"
13315 #include "confdefs.h"
13316 #include <$ac_header>
13317 _ACEOF
13318 if { (eval echo "$as_me:13318: \"$ac_cpp conftest.$ac_ext\"") >&5
13319   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13320   ac_status=$?
13321   egrep -v '^ *\+' conftest.er1 >conftest.err
13322   rm -f conftest.er1
13323   cat conftest.err >&5
13324   echo "$as_me:13324: \$? = $ac_status" >&5
13325   (exit $ac_status); } >/dev/null; then
13326   if test -s conftest.err; then
13327     ac_cpp_err=$ac_c_preproc_warn_flag
13328   else
13329     ac_cpp_err=
13330   fi
13331 else
13332   ac_cpp_err=yes
13333 fi
13334 if test -z "$ac_cpp_err"; then
13335   eval "$as_ac_Header=yes"
13336 else
13337   echo "$as_me: failed program was:" >&5
13338   cat conftest.$ac_ext >&5
13339   eval "$as_ac_Header=no"
13340 fi
13341 rm -f conftest.err conftest.$ac_ext
13342 fi
13343 echo "$as_me:13343: result: `eval echo '${'$as_ac_Header'}'`" >&5
13344 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13345 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13346   cat >>confdefs.h <<EOF
13347 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13348 EOF
13349
13350 fi
13351 done
13352
13353         ;;
13354 esac
13355
13356 echo "$as_me:13356: checking return type of signal handlers" >&5
13357 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
13358 if test "${ac_cv_type_signal+set}" = set; then
13359   echo $ECHO_N "(cached) $ECHO_C" >&6
13360 else
13361   cat >conftest.$ac_ext <<_ACEOF
13362 #line 13362 "configure"
13363 #include "confdefs.h"
13364 #include <sys/types.h>
13365 #include <signal.h>
13366 #ifdef signal
13367 # undef signal
13368 #endif
13369 #ifdef __cplusplus
13370 extern "C" void (*signal (int, void (*)(int)))(int);
13371 #else
13372 void (*signal ()) ();
13373 #endif
13374
13375 int
13376 main ()
13377 {
13378 int i;
13379   ;
13380   return 0;
13381 }
13382 _ACEOF
13383 rm -f conftest.$ac_objext
13384 if { (eval echo "$as_me:13384: \"$ac_compile\"") >&5
13385   (eval $ac_compile) 2>&5
13386   ac_status=$?
13387   echo "$as_me:13387: \$? = $ac_status" >&5
13388   (exit $ac_status); } &&
13389          { ac_try='test -s conftest.$ac_objext'
13390   { (eval echo "$as_me:13390: \"$ac_try\"") >&5
13391   (eval $ac_try) 2>&5
13392   ac_status=$?
13393   echo "$as_me:13393: \$? = $ac_status" >&5
13394   (exit $ac_status); }; }; then
13395   ac_cv_type_signal=void
13396 else
13397   echo "$as_me: failed program was:" >&5
13398 cat conftest.$ac_ext >&5
13399 ac_cv_type_signal=int
13400 fi
13401 rm -f conftest.$ac_objext conftest.$ac_ext
13402 fi
13403 echo "$as_me:13403: result: $ac_cv_type_signal" >&5
13404 echo "${ECHO_T}$ac_cv_type_signal" >&6
13405
13406 cat >>confdefs.h <<EOF
13407 #define RETSIGTYPE $ac_cv_type_signal
13408 EOF
13409
13410 echo "$as_me:13410: checking for ANSI C header files" >&5
13411 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13412 if test "${ac_cv_header_stdc+set}" = set; then
13413   echo $ECHO_N "(cached) $ECHO_C" >&6
13414 else
13415   cat >conftest.$ac_ext <<_ACEOF
13416 #line 13416 "configure"
13417 #include "confdefs.h"
13418 #include <stdlib.h>
13419 #include <stdarg.h>
13420 #include <string.h>
13421 #include <float.h>
13422
13423 _ACEOF
13424 if { (eval echo "$as_me:13424: \"$ac_cpp conftest.$ac_ext\"") >&5
13425   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13426   ac_status=$?
13427   egrep -v '^ *\+' conftest.er1 >conftest.err
13428   rm -f conftest.er1
13429   cat conftest.err >&5
13430   echo "$as_me:13430: \$? = $ac_status" >&5
13431   (exit $ac_status); } >/dev/null; then
13432   if test -s conftest.err; then
13433     ac_cpp_err=$ac_c_preproc_warn_flag
13434   else
13435     ac_cpp_err=
13436   fi
13437 else
13438   ac_cpp_err=yes
13439 fi
13440 if test -z "$ac_cpp_err"; then
13441   ac_cv_header_stdc=yes
13442 else
13443   echo "$as_me: failed program was:" >&5
13444   cat conftest.$ac_ext >&5
13445   ac_cv_header_stdc=no
13446 fi
13447 rm -f conftest.err conftest.$ac_ext
13448
13449 if test $ac_cv_header_stdc = yes; then
13450   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13451   cat >conftest.$ac_ext <<_ACEOF
13452 #line 13452 "configure"
13453 #include "confdefs.h"
13454 #include <string.h>
13455
13456 _ACEOF
13457 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13458   egrep "memchr" >/dev/null 2>&1; then
13459   :
13460 else
13461   ac_cv_header_stdc=no
13462 fi
13463 rm -rf conftest*
13464
13465 fi
13466
13467 if test $ac_cv_header_stdc = yes; then
13468   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13469   cat >conftest.$ac_ext <<_ACEOF
13470 #line 13470 "configure"
13471 #include "confdefs.h"
13472 #include <stdlib.h>
13473
13474 _ACEOF
13475 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13476   egrep "free" >/dev/null 2>&1; then
13477   :
13478 else
13479   ac_cv_header_stdc=no
13480 fi
13481 rm -rf conftest*
13482
13483 fi
13484
13485 if test $ac_cv_header_stdc = yes; then
13486   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13487   if test "$cross_compiling" = yes; then
13488   :
13489 else
13490   cat >conftest.$ac_ext <<_ACEOF
13491 #line 13491 "configure"
13492 #include "confdefs.h"
13493 #include <ctype.h>
13494 #if ((' ' & 0x0FF) == 0x020)
13495 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13496 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13497 #else
13498 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13499                      || ('j' <= (c) && (c) <= 'r') \
13500                      || ('s' <= (c) && (c) <= 'z'))
13501 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13502 #endif
13503
13504 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13505 int
13506 main ()
13507 {
13508   int i;
13509   for (i = 0; i < 256; i++)
13510     if (XOR (islower (i), ISLOWER (i))
13511         || toupper (i) != TOUPPER (i))
13512       $ac_main_return(2);
13513   $ac_main_return (0);
13514 }
13515 _ACEOF
13516 rm -f conftest$ac_exeext
13517 if { (eval echo "$as_me:13517: \"$ac_link\"") >&5
13518   (eval $ac_link) 2>&5
13519   ac_status=$?
13520   echo "$as_me:13520: \$? = $ac_status" >&5
13521   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13522   { (eval echo "$as_me:13522: \"$ac_try\"") >&5
13523   (eval $ac_try) 2>&5
13524   ac_status=$?
13525   echo "$as_me:13525: \$? = $ac_status" >&5
13526   (exit $ac_status); }; }; then
13527   :
13528 else
13529   echo "$as_me: program exited with status $ac_status" >&5
13530 echo "$as_me: failed program was:" >&5
13531 cat conftest.$ac_ext >&5
13532 ac_cv_header_stdc=no
13533 fi
13534 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13535 fi
13536 fi
13537 fi
13538 echo "$as_me:13538: result: $ac_cv_header_stdc" >&5
13539 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13540 if test $ac_cv_header_stdc = yes; then
13541
13542 cat >>confdefs.h <<\EOF
13543 #define STDC_HEADERS 1
13544 EOF
13545
13546 fi
13547
13548 echo "$as_me:13548: checking whether time.h and sys/time.h may both be included" >&5
13549 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13550 if test "${ac_cv_header_time+set}" = set; then
13551   echo $ECHO_N "(cached) $ECHO_C" >&6
13552 else
13553   cat >conftest.$ac_ext <<_ACEOF
13554 #line 13554 "configure"
13555 #include "confdefs.h"
13556 #include <sys/types.h>
13557 #include <sys/time.h>
13558 #include <time.h>
13559
13560 int
13561 main ()
13562 {
13563 if ((struct tm *) 0)
13564 return 0;
13565   ;
13566   return 0;
13567 }
13568 _ACEOF
13569 rm -f conftest.$ac_objext
13570 if { (eval echo "$as_me:13570: \"$ac_compile\"") >&5
13571   (eval $ac_compile) 2>&5
13572   ac_status=$?
13573   echo "$as_me:13573: \$? = $ac_status" >&5
13574   (exit $ac_status); } &&
13575          { ac_try='test -s conftest.$ac_objext'
13576   { (eval echo "$as_me:13576: \"$ac_try\"") >&5
13577   (eval $ac_try) 2>&5
13578   ac_status=$?
13579   echo "$as_me:13579: \$? = $ac_status" >&5
13580   (exit $ac_status); }; }; then
13581   ac_cv_header_time=yes
13582 else
13583   echo "$as_me: failed program was:" >&5
13584 cat conftest.$ac_ext >&5
13585 ac_cv_header_time=no
13586 fi
13587 rm -f conftest.$ac_objext conftest.$ac_ext
13588 fi
13589 echo "$as_me:13589: result: $ac_cv_header_time" >&5
13590 echo "${ECHO_T}$ac_cv_header_time" >&6
13591 if test $ac_cv_header_time = yes; then
13592
13593 cat >>confdefs.h <<\EOF
13594 #define TIME_WITH_SYS_TIME 1
13595 EOF
13596
13597 fi
13598
13599 for ac_header in \
13600 getopt.h \
13601 locale.h \
13602 math.h \
13603 stdarg.h \
13604 sys/ioctl.h \
13605 sys/select.h \
13606 sys/time.h \
13607 termios.h \
13608 unistd.h \
13609
13610 do
13611 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13612 echo "$as_me:13612: checking for $ac_header" >&5
13613 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13614 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13615   echo $ECHO_N "(cached) $ECHO_C" >&6
13616 else
13617   cat >conftest.$ac_ext <<_ACEOF
13618 #line 13618 "configure"
13619 #include "confdefs.h"
13620 #include <$ac_header>
13621 _ACEOF
13622 if { (eval echo "$as_me:13622: \"$ac_cpp conftest.$ac_ext\"") >&5
13623   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13624   ac_status=$?
13625   egrep -v '^ *\+' conftest.er1 >conftest.err
13626   rm -f conftest.er1
13627   cat conftest.err >&5
13628   echo "$as_me:13628: \$? = $ac_status" >&5
13629   (exit $ac_status); } >/dev/null; then
13630   if test -s conftest.err; then
13631     ac_cpp_err=$ac_c_preproc_warn_flag
13632   else
13633     ac_cpp_err=
13634   fi
13635 else
13636   ac_cpp_err=yes
13637 fi
13638 if test -z "$ac_cpp_err"; then
13639   eval "$as_ac_Header=yes"
13640 else
13641   echo "$as_me: failed program was:" >&5
13642   cat conftest.$ac_ext >&5
13643   eval "$as_ac_Header=no"
13644 fi
13645 rm -f conftest.err conftest.$ac_ext
13646 fi
13647 echo "$as_me:13647: result: `eval echo '${'$as_ac_Header'}'`" >&5
13648 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13649 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13650   cat >>confdefs.h <<EOF
13651 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13652 EOF
13653
13654 fi
13655 done
13656
13657 for ac_header in unistd.h getopt.h
13658 do
13659 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13660 echo "$as_me:13660: checking for $ac_header" >&5
13661 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13662 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13663   echo $ECHO_N "(cached) $ECHO_C" >&6
13664 else
13665   cat >conftest.$ac_ext <<_ACEOF
13666 #line 13666 "configure"
13667 #include "confdefs.h"
13668 #include <$ac_header>
13669 _ACEOF
13670 if { (eval echo "$as_me:13670: \"$ac_cpp conftest.$ac_ext\"") >&5
13671   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13672   ac_status=$?
13673   egrep -v '^ *\+' conftest.er1 >conftest.err
13674   rm -f conftest.er1
13675   cat conftest.err >&5
13676   echo "$as_me:13676: \$? = $ac_status" >&5
13677   (exit $ac_status); } >/dev/null; then
13678   if test -s conftest.err; then
13679     ac_cpp_err=$ac_c_preproc_warn_flag
13680   else
13681     ac_cpp_err=
13682   fi
13683 else
13684   ac_cpp_err=yes
13685 fi
13686 if test -z "$ac_cpp_err"; then
13687   eval "$as_ac_Header=yes"
13688 else
13689   echo "$as_me: failed program was:" >&5
13690   cat conftest.$ac_ext >&5
13691   eval "$as_ac_Header=no"
13692 fi
13693 rm -f conftest.err conftest.$ac_ext
13694 fi
13695 echo "$as_me:13695: result: `eval echo '${'$as_ac_Header'}'`" >&5
13696 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13697 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13698   cat >>confdefs.h <<EOF
13699 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13700 EOF
13701
13702 fi
13703 done
13704
13705 echo "$as_me:13705: checking for header declaring getopt variables" >&5
13706 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13707 if test "${cf_cv_getopt_header+set}" = set; then
13708   echo $ECHO_N "(cached) $ECHO_C" >&6
13709 else
13710
13711 cf_cv_getopt_header=none
13712 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13713 do
13714 cat >conftest.$ac_ext <<_ACEOF
13715 #line 13715 "configure"
13716 #include "confdefs.h"
13717
13718 #include <$cf_header>
13719 int
13720 main ()
13721 {
13722 int x = optind; char *y = optarg
13723   ;
13724   return 0;
13725 }
13726 _ACEOF
13727 rm -f conftest.$ac_objext
13728 if { (eval echo "$as_me:13728: \"$ac_compile\"") >&5
13729   (eval $ac_compile) 2>&5
13730   ac_status=$?
13731   echo "$as_me:13731: \$? = $ac_status" >&5
13732   (exit $ac_status); } &&
13733          { ac_try='test -s conftest.$ac_objext'
13734   { (eval echo "$as_me:13734: \"$ac_try\"") >&5
13735   (eval $ac_try) 2>&5
13736   ac_status=$?
13737   echo "$as_me:13737: \$? = $ac_status" >&5
13738   (exit $ac_status); }; }; then
13739   cf_cv_getopt_header=$cf_header
13740  break
13741 else
13742   echo "$as_me: failed program was:" >&5
13743 cat conftest.$ac_ext >&5
13744 fi
13745 rm -f conftest.$ac_objext conftest.$ac_ext
13746 done
13747
13748 fi
13749 echo "$as_me:13749: result: $cf_cv_getopt_header" >&5
13750 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13751 if test $cf_cv_getopt_header != none ; then
13752         cat >>confdefs.h <<\EOF
13753 #define HAVE_GETOPT_HEADER 1
13754 EOF
13755
13756 fi
13757
13758 for ac_func in \
13759 gettimeofday \
13760 strdup \
13761
13762 do
13763 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13764 echo "$as_me:13764: checking for $ac_func" >&5
13765 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13766 if eval "test \"\${$as_ac_var+set}\" = set"; then
13767   echo $ECHO_N "(cached) $ECHO_C" >&6
13768 else
13769   cat >conftest.$ac_ext <<_ACEOF
13770 #line 13770 "configure"
13771 #include "confdefs.h"
13772 /* System header to define __stub macros and hopefully few prototypes,
13773     which can conflict with char $ac_func (); below.  */
13774 #include <assert.h>
13775 /* Override any gcc2 internal prototype to avoid an error.  */
13776 #ifdef __cplusplus
13777 extern "C"
13778 #endif
13779 /* We use char because int might match the return type of a gcc2
13780    builtin and then its argument prototype would still apply.  */
13781 char $ac_func ();
13782 char (*f) ();
13783
13784 int
13785 main ()
13786 {
13787 /* The GNU C library defines this for functions which it implements
13788     to always fail with ENOSYS.  Some functions are actually named
13789     something starting with __ and the normal name is an alias.  */
13790 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13791 choke me
13792 #else
13793 f = $ac_func;
13794 #endif
13795
13796   ;
13797   return 0;
13798 }
13799 _ACEOF
13800 rm -f conftest.$ac_objext conftest$ac_exeext
13801 if { (eval echo "$as_me:13801: \"$ac_link\"") >&5
13802   (eval $ac_link) 2>&5
13803   ac_status=$?
13804   echo "$as_me:13804: \$? = $ac_status" >&5
13805   (exit $ac_status); } &&
13806          { ac_try='test -s conftest$ac_exeext'
13807   { (eval echo "$as_me:13807: \"$ac_try\"") >&5
13808   (eval $ac_try) 2>&5
13809   ac_status=$?
13810   echo "$as_me:13810: \$? = $ac_status" >&5
13811   (exit $ac_status); }; }; then
13812   eval "$as_ac_var=yes"
13813 else
13814   echo "$as_me: failed program was:" >&5
13815 cat conftest.$ac_ext >&5
13816 eval "$as_ac_var=no"
13817 fi
13818 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13819 fi
13820 echo "$as_me:13820: result: `eval echo '${'$as_ac_var'}'`" >&5
13821 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13822 if test `eval echo '${'$as_ac_var'}'` = yes; then
13823   cat >>confdefs.h <<EOF
13824 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13825 EOF
13826
13827 fi
13828 done
13829
13830 if test "$cf_enable_widec" = yes; then
13831
13832 for ac_func in \
13833 mblen \
13834 mbrlen \
13835 mbrtowc \
13836 mbsrtowcs \
13837 mbstowcs \
13838 mbtowc \
13839 wcsrtombs \
13840 wcstombs \
13841
13842 do
13843 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13844 echo "$as_me:13844: checking for $ac_func" >&5
13845 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13846 if eval "test \"\${$as_ac_var+set}\" = set"; then
13847   echo $ECHO_N "(cached) $ECHO_C" >&6
13848 else
13849   cat >conftest.$ac_ext <<_ACEOF
13850 #line 13850 "configure"
13851 #include "confdefs.h"
13852 /* System header to define __stub macros and hopefully few prototypes,
13853     which can conflict with char $ac_func (); below.  */
13854 #include <assert.h>
13855 /* Override any gcc2 internal prototype to avoid an error.  */
13856 #ifdef __cplusplus
13857 extern "C"
13858 #endif
13859 /* We use char because int might match the return type of a gcc2
13860    builtin and then its argument prototype would still apply.  */
13861 char $ac_func ();
13862 char (*f) ();
13863
13864 int
13865 main ()
13866 {
13867 /* The GNU C library defines this for functions which it implements
13868     to always fail with ENOSYS.  Some functions are actually named
13869     something starting with __ and the normal name is an alias.  */
13870 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13871 choke me
13872 #else
13873 f = $ac_func;
13874 #endif
13875
13876   ;
13877   return 0;
13878 }
13879 _ACEOF
13880 rm -f conftest.$ac_objext conftest$ac_exeext
13881 if { (eval echo "$as_me:13881: \"$ac_link\"") >&5
13882   (eval $ac_link) 2>&5
13883   ac_status=$?
13884   echo "$as_me:13884: \$? = $ac_status" >&5
13885   (exit $ac_status); } &&
13886          { ac_try='test -s conftest$ac_exeext'
13887   { (eval echo "$as_me:13887: \"$ac_try\"") >&5
13888   (eval $ac_try) 2>&5
13889   ac_status=$?
13890   echo "$as_me:13890: \$? = $ac_status" >&5
13891   (exit $ac_status); }; }; then
13892   eval "$as_ac_var=yes"
13893 else
13894   echo "$as_me: failed program was:" >&5
13895 cat conftest.$ac_ext >&5
13896 eval "$as_ac_var=no"
13897 fi
13898 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13899 fi
13900 echo "$as_me:13900: result: `eval echo '${'$as_ac_var'}'`" >&5
13901 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13902 if test `eval echo '${'$as_ac_var'}'` = yes; then
13903   cat >>confdefs.h <<EOF
13904 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13905 EOF
13906
13907 fi
13908 done
13909
13910 fi
13911
13912 echo "$as_me:13912: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13913 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13914 if test "${cf_cv_need_xopen_extension+set}" = set; then
13915   echo $ECHO_N "(cached) $ECHO_C" >&6
13916 else
13917
13918 cat >conftest.$ac_ext <<_ACEOF
13919 #line 13919 "configure"
13920 #include "confdefs.h"
13921
13922 #include <stdlib.h>
13923 #include <${cf_cv_ncurses_header:-curses.h}>
13924 int
13925 main ()
13926 {
13927
13928 #if defined(NCURSES_VERSION_PATCH)
13929 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13930         make an error
13931 #endif
13932 #endif
13933         long x = winnstr(stdscr, "", 0);
13934         int x1, y1;
13935         getbegyx(stdscr, y1, x1)
13936   ;
13937   return 0;
13938 }
13939 _ACEOF
13940 rm -f conftest.$ac_objext conftest$ac_exeext
13941 if { (eval echo "$as_me:13941: \"$ac_link\"") >&5
13942   (eval $ac_link) 2>&5
13943   ac_status=$?
13944   echo "$as_me:13944: \$? = $ac_status" >&5
13945   (exit $ac_status); } &&
13946          { ac_try='test -s conftest$ac_exeext'
13947   { (eval echo "$as_me:13947: \"$ac_try\"") >&5
13948   (eval $ac_try) 2>&5
13949   ac_status=$?
13950   echo "$as_me:13950: \$? = $ac_status" >&5
13951   (exit $ac_status); }; }; then
13952   cf_cv_need_xopen_extension=no
13953 else
13954   echo "$as_me: failed program was:" >&5
13955 cat conftest.$ac_ext >&5
13956 cat >conftest.$ac_ext <<_ACEOF
13957 #line 13957 "configure"
13958 #include "confdefs.h"
13959
13960 #define _XOPEN_SOURCE_EXTENDED
13961 #include <stdlib.h>
13962 #include <${cf_cv_ncurses_header:-curses.h}>
13963 int
13964 main ()
13965 {
13966
13967 #ifdef NCURSES_VERSION
13968         cchar_t check;
13969         int check2 = curs_set((int)sizeof(check));
13970 #endif
13971         long x = winnstr(stdscr, "", 0);
13972         int x1, y1;
13973         getbegyx(stdscr, y1, x1)
13974   ;
13975   return 0;
13976 }
13977 _ACEOF
13978 rm -f conftest.$ac_objext conftest$ac_exeext
13979 if { (eval echo "$as_me:13979: \"$ac_link\"") >&5
13980   (eval $ac_link) 2>&5
13981   ac_status=$?
13982   echo "$as_me:13982: \$? = $ac_status" >&5
13983   (exit $ac_status); } &&
13984          { ac_try='test -s conftest$ac_exeext'
13985   { (eval echo "$as_me:13985: \"$ac_try\"") >&5
13986   (eval $ac_try) 2>&5
13987   ac_status=$?
13988   echo "$as_me:13988: \$? = $ac_status" >&5
13989   (exit $ac_status); }; }; then
13990   cf_cv_need_xopen_extension=yes
13991 else
13992   echo "$as_me: failed program was:" >&5
13993 cat conftest.$ac_ext >&5
13994 cf_cv_need_xopen_extension=unknown
13995 fi
13996 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13997 fi
13998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13999 fi
14000 echo "$as_me:14000: result: $cf_cv_need_xopen_extension" >&5
14001 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14002 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14003
14004 echo "$as_me:14004: checking for term.h" >&5
14005 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14006 if test "${cf_cv_term_header+set}" = set; then
14007   echo $ECHO_N "(cached) $ECHO_C" >&6
14008 else
14009
14010 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14011 # for <term.h> if we do not find the variant.
14012
14013 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14014
14015 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14016 */*)
14017         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14018         cf_header_list="$cf_header_item $cf_header_list"
14019         ;;
14020 esac
14021
14022 for cf_header in $cf_header_list
14023 do
14024         cat >conftest.$ac_ext <<_ACEOF
14025 #line 14025 "configure"
14026 #include "confdefs.h"
14027
14028 #include <${cf_cv_ncurses_header:-curses.h}>
14029 #include <${cf_header}>
14030 int
14031 main ()
14032 {
14033 WINDOW *x
14034   ;
14035   return 0;
14036 }
14037 _ACEOF
14038 rm -f conftest.$ac_objext
14039 if { (eval echo "$as_me:14039: \"$ac_compile\"") >&5
14040   (eval $ac_compile) 2>&5
14041   ac_status=$?
14042   echo "$as_me:14042: \$? = $ac_status" >&5
14043   (exit $ac_status); } &&
14044          { ac_try='test -s conftest.$ac_objext'
14045   { (eval echo "$as_me:14045: \"$ac_try\"") >&5
14046   (eval $ac_try) 2>&5
14047   ac_status=$?
14048   echo "$as_me:14048: \$? = $ac_status" >&5
14049   (exit $ac_status); }; }; then
14050   cf_cv_term_header=$cf_header
14051          break
14052 else
14053   echo "$as_me: failed program was:" >&5
14054 cat conftest.$ac_ext >&5
14055 cf_cv_term_header=no
14056 fi
14057 rm -f conftest.$ac_objext conftest.$ac_ext
14058 done
14059
14060 case $cf_cv_term_header in #(vi
14061 no)
14062         # If curses is ncurses, some packagers still mess it up by trying to make
14063         # us use GNU termcap.  This handles the most common case.
14064         for cf_header in ncurses/term.h ncursesw/term.h
14065         do
14066                 cat >conftest.$ac_ext <<_ACEOF
14067 #line 14067 "configure"
14068 #include "confdefs.h"
14069
14070 #include <${cf_cv_ncurses_header:-curses.h}>
14071 #ifdef NCURSES_VERSION
14072 #include <${cf_header}>
14073 #else
14074 make an error
14075 #endif
14076 int
14077 main ()
14078 {
14079 WINDOW *x
14080   ;
14081   return 0;
14082 }
14083 _ACEOF
14084 rm -f conftest.$ac_objext
14085 if { (eval echo "$as_me:14085: \"$ac_compile\"") >&5
14086   (eval $ac_compile) 2>&5
14087   ac_status=$?
14088   echo "$as_me:14088: \$? = $ac_status" >&5
14089   (exit $ac_status); } &&
14090          { ac_try='test -s conftest.$ac_objext'
14091   { (eval echo "$as_me:14091: \"$ac_try\"") >&5
14092   (eval $ac_try) 2>&5
14093   ac_status=$?
14094   echo "$as_me:14094: \$? = $ac_status" >&5
14095   (exit $ac_status); }; }; then
14096   cf_cv_term_header=$cf_header
14097                          break
14098 else
14099   echo "$as_me: failed program was:" >&5
14100 cat conftest.$ac_ext >&5
14101 cf_cv_term_header=no
14102 fi
14103 rm -f conftest.$ac_objext conftest.$ac_ext
14104         done
14105         ;;
14106 esac
14107
14108 fi
14109 echo "$as_me:14109: result: $cf_cv_term_header" >&5
14110 echo "${ECHO_T}$cf_cv_term_header" >&6
14111
14112 case $cf_cv_term_header in #(vi
14113 term.h) #(vi
14114         cat >>confdefs.h <<\EOF
14115 #define HAVE_TERM_H 1
14116 EOF
14117
14118         ;;
14119 ncurses/term.h) #(vi
14120         cat >>confdefs.h <<\EOF
14121 #define HAVE_NCURSES_TERM_H 1
14122 EOF
14123
14124         ;;
14125 ncursesw/term.h)
14126         cat >>confdefs.h <<\EOF
14127 #define HAVE_NCURSESW_TERM_H 1
14128 EOF
14129
14130         ;;
14131 esac
14132
14133 echo "$as_me:14133: checking for unctrl.h" >&5
14134 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14135 if test "${cf_cv_unctrl_header+set}" = set; then
14136   echo $ECHO_N "(cached) $ECHO_C" >&6
14137 else
14138
14139 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14140 # for <unctrl.h> if we do not find the variant.
14141
14142 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14143
14144 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14145 */*)
14146         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14147         cf_header_list="$cf_header_item $cf_header_list"
14148         ;;
14149 esac
14150
14151 for cf_header in $cf_header_list
14152 do
14153         cat >conftest.$ac_ext <<_ACEOF
14154 #line 14154 "configure"
14155 #include "confdefs.h"
14156
14157 #include <${cf_cv_ncurses_header:-curses.h}>
14158 #include <${cf_header}>
14159 int
14160 main ()
14161 {
14162 WINDOW *x
14163   ;
14164   return 0;
14165 }
14166 _ACEOF
14167 rm -f conftest.$ac_objext
14168 if { (eval echo "$as_me:14168: \"$ac_compile\"") >&5
14169   (eval $ac_compile) 2>&5
14170   ac_status=$?
14171   echo "$as_me:14171: \$? = $ac_status" >&5
14172   (exit $ac_status); } &&
14173          { ac_try='test -s conftest.$ac_objext'
14174   { (eval echo "$as_me:14174: \"$ac_try\"") >&5
14175   (eval $ac_try) 2>&5
14176   ac_status=$?
14177   echo "$as_me:14177: \$? = $ac_status" >&5
14178   (exit $ac_status); }; }; then
14179   cf_cv_unctrl_header=$cf_header
14180          break
14181 else
14182   echo "$as_me: failed program was:" >&5
14183 cat conftest.$ac_ext >&5
14184 cf_cv_unctrl_header=no
14185 fi
14186 rm -f conftest.$ac_objext conftest.$ac_ext
14187 done
14188
14189 case $cf_cv_unctrl_header in #(vi
14190 no)
14191         { echo "$as_me:14191: WARNING: unctrl.h header not found" >&5
14192 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14193         ;;
14194 esac
14195
14196 fi
14197 echo "$as_me:14197: result: $cf_cv_unctrl_header" >&5
14198 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14199
14200 case $cf_cv_unctrl_header in #(vi
14201 unctrl.h) #(vi
14202         cat >>confdefs.h <<\EOF
14203 #define HAVE_UNCTRL_H 1
14204 EOF
14205
14206         ;;
14207 ncurses/unctrl.h) #(vi
14208         cat >>confdefs.h <<\EOF
14209 #define HAVE_NCURSES_UNCTRL_H 1
14210 EOF
14211
14212         ;;
14213 ncursesw/unctrl.h)
14214         cat >>confdefs.h <<\EOF
14215 #define HAVE_NCURSESW_UNCTRL_H 1
14216 EOF
14217
14218         ;;
14219 esac
14220
14221 for cf_func in \
14222 assume_default_colors \
14223 chgat \
14224 color_set \
14225 filter \
14226 getbegx \
14227 getcurx \
14228 getmaxx \
14229 getnstr \
14230 getparx \
14231 getwin \
14232 mvvline \
14233 mvwvline \
14234 napms \
14235 putwin \
14236 resize_term \
14237 resizeterm \
14238 ripoffline \
14239 scr_dump \
14240 setupterm \
14241 slk_color \
14242 slk_init \
14243 termattrs \
14244 tgetent \
14245 tigetnum \
14246 tigetstr \
14247 typeahead \
14248 use_default_colors \
14249 use_screen \
14250 use_window \
14251 vsscanf \
14252 vw_printw \
14253 wchgat \
14254 winsstr \
14255 wresize \
14256 wsyncdown \
14257
14258 do
14259
14260 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14261
14262         echo "$as_me:14262: checking for ${cf_func}" >&5
14263 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14264
14265 echo "${as_me:-configure}:14265: testing ${cf_func} ..." 1>&5
14266
14267         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14268   echo $ECHO_N "(cached) $ECHO_C" >&6
14269 else
14270
14271                 eval cf_result='$ac_cv_func_'$cf_func
14272                 if test ".$cf_result" != ".no"; then
14273                         cat >conftest.$ac_ext <<_ACEOF
14274 #line 14274 "configure"
14275 #include "confdefs.h"
14276
14277 #ifdef HAVE_XCURSES
14278 #include <xcurses.h>
14279 char * XCursesProgramName = "test";
14280 #else
14281 #include <${cf_cv_ncurses_header:-curses.h}>
14282 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14283 #include <ncursesw/term.h>
14284 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14285 #include <ncurses/term.h>
14286 #elif defined(HAVE_TERM_H)
14287 #include <term.h>
14288 #endif
14289 #endif
14290
14291 int
14292 main ()
14293 {
14294
14295 #ifndef ${cf_func}
14296 long foo = (long)(&${cf_func});
14297 if (foo + 1234 > 5678)
14298         ${cf_cv_main_return:-return}(foo);
14299 #endif
14300
14301   ;
14302   return 0;
14303 }
14304 _ACEOF
14305 rm -f conftest.$ac_objext conftest$ac_exeext
14306 if { (eval echo "$as_me:14306: \"$ac_link\"") >&5
14307   (eval $ac_link) 2>&5
14308   ac_status=$?
14309   echo "$as_me:14309: \$? = $ac_status" >&5
14310   (exit $ac_status); } &&
14311          { ac_try='test -s conftest$ac_exeext'
14312   { (eval echo "$as_me:14312: \"$ac_try\"") >&5
14313   (eval $ac_try) 2>&5
14314   ac_status=$?
14315   echo "$as_me:14315: \$? = $ac_status" >&5
14316   (exit $ac_status); }; }; then
14317   cf_result=yes
14318 else
14319   echo "$as_me: failed program was:" >&5
14320 cat conftest.$ac_ext >&5
14321 cf_result=no
14322 fi
14323 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14324                 fi
14325                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14326
14327 fi
14328
14329         # use the computed/retrieved cache-value:
14330         eval 'cf_result=$cf_cv_func_'$cf_func
14331         echo "$as_me:14331: result: $cf_result" >&5
14332 echo "${ECHO_T}$cf_result" >&6
14333         if test $cf_result != no; then
14334                 cat >>confdefs.h <<EOF
14335 #define HAVE_${cf_tr_func} 1
14336 EOF
14337
14338         fi
14339 done
14340
14341 for cf_func in tputs
14342 do
14343
14344 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14345
14346         echo "$as_me:14346: checking for ${cf_func}" >&5
14347 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14348
14349 echo "${as_me:-configure}:14349: testing ${cf_func} ..." 1>&5
14350
14351         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14352   echo $ECHO_N "(cached) $ECHO_C" >&6
14353 else
14354
14355                 eval cf_result='$ac_cv_func_'$cf_func
14356                 if test ".$cf_result" != ".no"; then
14357                         cat >conftest.$ac_ext <<_ACEOF
14358 #line 14358 "configure"
14359 #include "confdefs.h"
14360
14361 #ifdef HAVE_XCURSES
14362 #include <xcurses.h>
14363 char * XCursesProgramName = "test";
14364 #else
14365 #include <${cf_cv_ncurses_header:-curses.h}>
14366 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14367 #include <ncursesw/term.h>
14368 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14369 #include <ncurses/term.h>
14370 #elif defined(HAVE_TERM_H)
14371 #include <term.h>
14372 #endif
14373 #endif
14374
14375 int
14376 main ()
14377 {
14378
14379 #ifndef ${cf_func}
14380 long foo = (long)(&${cf_func});
14381 if (foo + 1234 > 5678)
14382         ${cf_cv_main_return:-return}(foo);
14383 #endif
14384
14385   ;
14386   return 0;
14387 }
14388 _ACEOF
14389 rm -f conftest.$ac_objext conftest$ac_exeext
14390 if { (eval echo "$as_me:14390: \"$ac_link\"") >&5
14391   (eval $ac_link) 2>&5
14392   ac_status=$?
14393   echo "$as_me:14393: \$? = $ac_status" >&5
14394   (exit $ac_status); } &&
14395          { ac_try='test -s conftest$ac_exeext'
14396   { (eval echo "$as_me:14396: \"$ac_try\"") >&5
14397   (eval $ac_try) 2>&5
14398   ac_status=$?
14399   echo "$as_me:14399: \$? = $ac_status" >&5
14400   (exit $ac_status); }; }; then
14401   cf_result=yes
14402 else
14403   echo "$as_me: failed program was:" >&5
14404 cat conftest.$ac_ext >&5
14405 cf_result=no
14406 fi
14407 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14408                 fi
14409                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14410
14411 fi
14412
14413         # use the computed/retrieved cache-value:
14414         eval 'cf_result=$cf_cv_func_'$cf_func
14415         echo "$as_me:14415: result: $cf_result" >&5
14416 echo "${ECHO_T}$cf_result" >&6
14417         if test $cf_result != no; then
14418                 cat >>confdefs.h <<EOF
14419 #define HAVE_${cf_tr_func} 1
14420 EOF
14421
14422         fi
14423 done
14424
14425 if test x$cf_cv_func_tputs = xyes
14426 then
14427         cf_done=no
14428         for cf_arg in int char
14429         do
14430                 for cf_ret in int void
14431                 do
14432                         if test $cf_ret = void
14433                         then
14434                                 cf_return="/* nothing */"
14435                         else
14436                                 cf_return="return value"
14437                         fi
14438                         cat >conftest.$ac_ext <<_ACEOF
14439 #line 14439 "configure"
14440 #include "confdefs.h"
14441
14442 #include <${cf_cv_ncurses_header:-curses.h}>
14443 #include <$cf_cv_term_header>
14444
14445 static $cf_ret outc($cf_arg value) { $cf_return; }
14446
14447 int
14448 main ()
14449 {
14450
14451         tputs("hello", 0, outc);
14452         ${cf_cv_main_return:-return}(0);
14453
14454   ;
14455   return 0;
14456 }
14457 _ACEOF
14458 rm -f conftest.$ac_objext
14459 if { (eval echo "$as_me:14459: \"$ac_compile\"") >&5
14460   (eval $ac_compile) 2>&5
14461   ac_status=$?
14462   echo "$as_me:14462: \$? = $ac_status" >&5
14463   (exit $ac_status); } &&
14464          { ac_try='test -s conftest.$ac_objext'
14465   { (eval echo "$as_me:14465: \"$ac_try\"") >&5
14466   (eval $ac_try) 2>&5
14467   ac_status=$?
14468   echo "$as_me:14468: \$? = $ac_status" >&5
14469   (exit $ac_status); }; }; then
14470
14471                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14472
14473 echo "${as_me:-configure}:14473: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14474
14475                 cat >>confdefs.h <<EOF
14476 #define TPUTS_ARG               $cf_arg
14477 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14478 #define TPUTS_RETURN(value)     $cf_return
14479 EOF
14480                 cf_done=yes
14481                 break
14482
14483 else
14484   echo "$as_me: failed program was:" >&5
14485 cat conftest.$ac_ext >&5
14486 fi
14487 rm -f conftest.$ac_objext conftest.$ac_ext
14488                 done
14489                 test $cf_done = yes && break
14490         done
14491 fi
14492
14493 echo "$as_me:14493: checking for ncurses extended functions" >&5
14494 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14495 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14496   echo $ECHO_N "(cached) $ECHO_C" >&6
14497 else
14498
14499 cat >conftest.$ac_ext <<_ACEOF
14500 #line 14500 "configure"
14501 #include "confdefs.h"
14502
14503 #include <${cf_cv_ncurses_header:-curses.h}>
14504 int
14505 main ()
14506 {
14507
14508 int x = NCURSES_EXT_FUNCS
14509
14510   ;
14511   return 0;
14512 }
14513 _ACEOF
14514 rm -f conftest.$ac_objext
14515 if { (eval echo "$as_me:14515: \"$ac_compile\"") >&5
14516   (eval $ac_compile) 2>&5
14517   ac_status=$?
14518   echo "$as_me:14518: \$? = $ac_status" >&5
14519   (exit $ac_status); } &&
14520          { ac_try='test -s conftest.$ac_objext'
14521   { (eval echo "$as_me:14521: \"$ac_try\"") >&5
14522   (eval $ac_try) 2>&5
14523   ac_status=$?
14524   echo "$as_me:14524: \$? = $ac_status" >&5
14525   (exit $ac_status); }; }; then
14526   cf_cv_ncurses_ext_funcs=defined
14527 else
14528   echo "$as_me: failed program was:" >&5
14529 cat conftest.$ac_ext >&5
14530
14531 cat >conftest.$ac_ext <<_ACEOF
14532 #line 14532 "configure"
14533 #include "confdefs.h"
14534
14535 #include <${cf_cv_ncurses_header:-curses.h}>
14536 int
14537 main ()
14538 {
14539
14540         (void) assume_default_colors (0, 0);
14541         (void) curses_version ();
14542         (void) define_key (0, 0);
14543         (void) is_term_resized (0, 0);
14544         (void) key_defined (0);
14545         (void) keybound (0, 0);
14546         (void) keyok (0, 0);
14547         (void) resize_term (0, 0);
14548         (void) resizeterm (0, 0);
14549         (void) use_default_colors ();
14550         (void) use_extended_names (0);
14551         (void) wresize (0, 0, 0);
14552   ;
14553   return 0;
14554 }
14555 _ACEOF
14556 rm -f conftest.$ac_objext conftest$ac_exeext
14557 if { (eval echo "$as_me:14557: \"$ac_link\"") >&5
14558   (eval $ac_link) 2>&5
14559   ac_status=$?
14560   echo "$as_me:14560: \$? = $ac_status" >&5
14561   (exit $ac_status); } &&
14562          { ac_try='test -s conftest$ac_exeext'
14563   { (eval echo "$as_me:14563: \"$ac_try\"") >&5
14564   (eval $ac_try) 2>&5
14565   ac_status=$?
14566   echo "$as_me:14566: \$? = $ac_status" >&5
14567   (exit $ac_status); }; }; then
14568   cf_cv_ncurses_ext_funcs=yes
14569 else
14570   echo "$as_me: failed program was:" >&5
14571 cat conftest.$ac_ext >&5
14572 cf_cv_ncurses_ext_funcs=no
14573 fi
14574 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14575
14576 fi
14577 rm -f conftest.$ac_objext conftest.$ac_ext
14578
14579 fi
14580 echo "$as_me:14580: result: $cf_cv_ncurses_ext_funcs" >&5
14581 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14582 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14583 #define NCURSES_EXT_FUNCS 1
14584 EOF
14585
14586 if test "$cf_enable_widec" = yes
14587 then
14588         # workaround for systems with ncurses before 20111029, due to change of
14589         # feature test macro from _XPG5 to _XOPEN_SOURCE
14590         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14591         then
14592                 cf_define_xpg5=no
14593                 echo "$as_me:14593: checking if _XPG5 should be defined to enable wide-characters" >&5
14594 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14595
14596                 cat >conftest.$ac_ext <<_ACEOF
14597 #line 14597 "configure"
14598 #include "confdefs.h"
14599
14600 #include <${cf_cv_ncurses_header:-curses.h}>
14601 int
14602 main ()
14603 {
14604 int x = _XPG5
14605   ;
14606   return 0;
14607 }
14608 _ACEOF
14609 rm -f conftest.$ac_objext
14610 if { (eval echo "$as_me:14610: \"$ac_compile\"") >&5
14611   (eval $ac_compile) 2>&5
14612   ac_status=$?
14613   echo "$as_me:14613: \$? = $ac_status" >&5
14614   (exit $ac_status); } &&
14615          { ac_try='test -s conftest.$ac_objext'
14616   { (eval echo "$as_me:14616: \"$ac_try\"") >&5
14617   (eval $ac_try) 2>&5
14618   ac_status=$?
14619   echo "$as_me:14619: \$? = $ac_status" >&5
14620   (exit $ac_status); }; }; then
14621   :
14622 else
14623   echo "$as_me: failed program was:" >&5
14624 cat conftest.$ac_ext >&5
14625 cf_save_cppflags="$CPPFLAGS"
14626                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14627                          cat >conftest.$ac_ext <<_ACEOF
14628 #line 14628 "configure"
14629 #include "confdefs.h"
14630
14631 #include <${cf_cv_ncurses_header:-curses.h}>
14632 int
14633 main ()
14634 {
14635 int x = _XPG5
14636   ;
14637   return 0;
14638 }
14639 _ACEOF
14640 rm -f conftest.$ac_objext
14641 if { (eval echo "$as_me:14641: \"$ac_compile\"") >&5
14642   (eval $ac_compile) 2>&5
14643   ac_status=$?
14644   echo "$as_me:14644: \$? = $ac_status" >&5
14645   (exit $ac_status); } &&
14646          { ac_try='test -s conftest.$ac_objext'
14647   { (eval echo "$as_me:14647: \"$ac_try\"") >&5
14648   (eval $ac_try) 2>&5
14649   ac_status=$?
14650   echo "$as_me:14650: \$? = $ac_status" >&5
14651   (exit $ac_status); }; }; then
14652   cf_define_xpg5=yes
14653 else
14654   echo "$as_me: failed program was:" >&5
14655 cat conftest.$ac_ext >&5
14656 fi
14657 rm -f conftest.$ac_objext conftest.$ac_ext
14658                          CPPFLAGS="$cf_save_cppflags"
14659 fi
14660 rm -f conftest.$ac_objext conftest.$ac_ext
14661                 echo "$as_me:14661: result: $cf_define_xpg5" >&5
14662 echo "${ECHO_T}$cf_define_xpg5" >&6
14663
14664                 if test "$cf_define_xpg5" = yes
14665                 then
14666                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14667                 fi
14668         fi
14669
14670         echo "$as_me:14670: checking for wide-character functions" >&5
14671 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14672 if test "${cf_cv_widechar_funcs+set}" = set; then
14673   echo $ECHO_N "(cached) $ECHO_C" >&6
14674 else
14675
14676         cat >conftest.$ac_ext <<_ACEOF
14677 #line 14677 "configure"
14678 #include "confdefs.h"
14679
14680 #include <${cf_cv_ncurses_header:-curses.h}>
14681 int
14682 main ()
14683 {
14684
14685                 static wchar_t src_wchar[2];
14686                 static cchar_t dst_cchar;
14687                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14688
14689   ;
14690   return 0;
14691 }
14692 _ACEOF
14693 rm -f conftest.$ac_objext conftest$ac_exeext
14694 if { (eval echo "$as_me:14694: \"$ac_link\"") >&5
14695   (eval $ac_link) 2>&5
14696   ac_status=$?
14697   echo "$as_me:14697: \$? = $ac_status" >&5
14698   (exit $ac_status); } &&
14699          { ac_try='test -s conftest$ac_exeext'
14700   { (eval echo "$as_me:14700: \"$ac_try\"") >&5
14701   (eval $ac_try) 2>&5
14702   ac_status=$?
14703   echo "$as_me:14703: \$? = $ac_status" >&5
14704   (exit $ac_status); }; }; then
14705   cf_cv_widechar_funcs=yes
14706 else
14707   echo "$as_me: failed program was:" >&5
14708 cat conftest.$ac_ext >&5
14709 cf_cv_widechar_funcs=no
14710 fi
14711 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14712
14713 fi
14714 echo "$as_me:14714: result: $cf_cv_widechar_funcs" >&5
14715 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14716         if test "$cf_cv_widechar_funcs" != no ; then
14717                 cat >>confdefs.h <<\EOF
14718 #define USE_WIDEC_SUPPORT 1
14719 EOF
14720
14721         else
14722                 cat >>confdefs.h <<\EOF
14723 #define USE_WIDEC_SUPPORT 0
14724 EOF
14725
14726         fi
14727 else
14728         cat >>confdefs.h <<\EOF
14729 #define USE_WIDEC_SUPPORT 0
14730 EOF
14731
14732 fi
14733
14734 echo "$as_me:14734: checking if sys/time.h works with sys/select.h" >&5
14735 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14736 if test "${cf_cv_sys_time_select+set}" = set; then
14737   echo $ECHO_N "(cached) $ECHO_C" >&6
14738 else
14739
14740 cat >conftest.$ac_ext <<_ACEOF
14741 #line 14741 "configure"
14742 #include "confdefs.h"
14743
14744 #include <sys/types.h>
14745 #ifdef HAVE_SYS_TIME_H
14746 #include <sys/time.h>
14747 #endif
14748 #ifdef HAVE_SYS_SELECT_H
14749 #include <sys/select.h>
14750 #endif
14751
14752 int
14753 main ()
14754 {
14755
14756   ;
14757   return 0;
14758 }
14759 _ACEOF
14760 rm -f conftest.$ac_objext
14761 if { (eval echo "$as_me:14761: \"$ac_compile\"") >&5
14762   (eval $ac_compile) 2>&5
14763   ac_status=$?
14764   echo "$as_me:14764: \$? = $ac_status" >&5
14765   (exit $ac_status); } &&
14766          { ac_try='test -s conftest.$ac_objext'
14767   { (eval echo "$as_me:14767: \"$ac_try\"") >&5
14768   (eval $ac_try) 2>&5
14769   ac_status=$?
14770   echo "$as_me:14770: \$? = $ac_status" >&5
14771   (exit $ac_status); }; }; then
14772   cf_cv_sys_time_select=yes
14773 else
14774   echo "$as_me: failed program was:" >&5
14775 cat conftest.$ac_ext >&5
14776 cf_cv_sys_time_select=no
14777 fi
14778 rm -f conftest.$ac_objext conftest.$ac_ext
14779
14780 fi
14781
14782 echo "$as_me:14782: result: $cf_cv_sys_time_select" >&5
14783 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14784 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14785 #define HAVE_SYS_TIME_SELECT 1
14786 EOF
14787
14788 echo "$as_me:14788: checking for function curses_version" >&5
14789 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14790 if test "${cf_cv_func_curses_version+set}" = set; then
14791   echo $ECHO_N "(cached) $ECHO_C" >&6
14792 else
14793
14794 if test "$cross_compiling" = yes; then
14795   cf_cv_func_curses_version=unknown
14796 else
14797   cat >conftest.$ac_ext <<_ACEOF
14798 #line 14798 "configure"
14799 #include "confdefs.h"
14800
14801 #include <${cf_cv_ncurses_header:-curses.h}>
14802 int main()
14803 {
14804         char temp[1024];
14805         sprintf(temp, "%s\n", curses_version());
14806         ${cf_cv_main_return:-return}(0);
14807 }
14808
14809 _ACEOF
14810 rm -f conftest$ac_exeext
14811 if { (eval echo "$as_me:14811: \"$ac_link\"") >&5
14812   (eval $ac_link) 2>&5
14813   ac_status=$?
14814   echo "$as_me:14814: \$? = $ac_status" >&5
14815   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14816   { (eval echo "$as_me:14816: \"$ac_try\"") >&5
14817   (eval $ac_try) 2>&5
14818   ac_status=$?
14819   echo "$as_me:14819: \$? = $ac_status" >&5
14820   (exit $ac_status); }; }; then
14821   cf_cv_func_curses_version=yes
14822
14823 else
14824   echo "$as_me: program exited with status $ac_status" >&5
14825 echo "$as_me: failed program was:" >&5
14826 cat conftest.$ac_ext >&5
14827 cf_cv_func_curses_version=no
14828
14829 fi
14830 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14831 fi
14832 rm -f core
14833 fi
14834 echo "$as_me:14834: result: $cf_cv_func_curses_version" >&5
14835 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14836 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14837 #define HAVE_CURSES_VERSION 1
14838 EOF
14839
14840 echo "$as_me:14840: checking for ncurses wrap-prefix" >&5
14841 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14842
14843 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14844 if test "${with_ncurses_wrap_prefix+set}" = set; then
14845   withval="$with_ncurses_wrap_prefix"
14846   NCURSES_WRAP_PREFIX=$withval
14847 else
14848   NCURSES_WRAP_PREFIX=_nc_
14849 fi;
14850 echo "$as_me:14850: result: $NCURSES_WRAP_PREFIX" >&5
14851 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14852
14853 echo "$as_me:14853: checking for alternate character set array" >&5
14854 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14855 if test "${cf_cv_curses_acs_map+set}" = set; then
14856   echo $ECHO_N "(cached) $ECHO_C" >&6
14857 else
14858
14859 cf_cv_curses_acs_map=unknown
14860 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14861 do
14862 cat >conftest.$ac_ext <<_ACEOF
14863 #line 14863 "configure"
14864 #include "confdefs.h"
14865
14866 #include <${cf_cv_ncurses_header:-curses.h}>
14867
14868 int
14869 main ()
14870 {
14871
14872 $name['k'] = ACS_PLUS
14873
14874   ;
14875   return 0;
14876 }
14877 _ACEOF
14878 rm -f conftest.$ac_objext conftest$ac_exeext
14879 if { (eval echo "$as_me:14879: \"$ac_link\"") >&5
14880   (eval $ac_link) 2>&5
14881   ac_status=$?
14882   echo "$as_me:14882: \$? = $ac_status" >&5
14883   (exit $ac_status); } &&
14884          { ac_try='test -s conftest$ac_exeext'
14885   { (eval echo "$as_me:14885: \"$ac_try\"") >&5
14886   (eval $ac_try) 2>&5
14887   ac_status=$?
14888   echo "$as_me:14888: \$? = $ac_status" >&5
14889   (exit $ac_status); }; }; then
14890   cf_cv_curses_acs_map=$name; break
14891 else
14892   echo "$as_me: failed program was:" >&5
14893 cat conftest.$ac_ext >&5
14894 fi
14895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14896 done
14897
14898 fi
14899 echo "$as_me:14899: result: $cf_cv_curses_acs_map" >&5
14900 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14901
14902 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14903 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14904 EOF
14905
14906 if test "$cf_enable_widec" = yes; then
14907
14908 echo "$as_me:14908: checking for wide alternate character set array" >&5
14909 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14910 if test "${cf_cv_curses_wacs_map+set}" = set; then
14911   echo $ECHO_N "(cached) $ECHO_C" >&6
14912 else
14913
14914         cf_cv_curses_wacs_map=unknown
14915         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14916         do
14917         cat >conftest.$ac_ext <<_ACEOF
14918 #line 14918 "configure"
14919 #include "confdefs.h"
14920
14921 #ifndef _XOPEN_SOURCE_EXTENDED
14922 #define _XOPEN_SOURCE_EXTENDED
14923 #endif
14924 #include <${cf_cv_ncurses_header:-curses.h}>
14925 int
14926 main ()
14927 {
14928 void *foo = &($name['k'])
14929   ;
14930   return 0;
14931 }
14932 _ACEOF
14933 rm -f conftest.$ac_objext conftest$ac_exeext
14934 if { (eval echo "$as_me:14934: \"$ac_link\"") >&5
14935   (eval $ac_link) 2>&5
14936   ac_status=$?
14937   echo "$as_me:14937: \$? = $ac_status" >&5
14938   (exit $ac_status); } &&
14939          { ac_try='test -s conftest$ac_exeext'
14940   { (eval echo "$as_me:14940: \"$ac_try\"") >&5
14941   (eval $ac_try) 2>&5
14942   ac_status=$?
14943   echo "$as_me:14943: \$? = $ac_status" >&5
14944   (exit $ac_status); }; }; then
14945   cf_cv_curses_wacs_map=$name
14946          break
14947 else
14948   echo "$as_me: failed program was:" >&5
14949 cat conftest.$ac_ext >&5
14950 fi
14951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14952         done
14953 fi
14954 echo "$as_me:14954: result: $cf_cv_curses_wacs_map" >&5
14955 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14956
14957 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
14958 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14959 EOF
14960
14961 echo "$as_me:14961: checking for wide alternate character constants" >&5
14962 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14963 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14964   echo $ECHO_N "(cached) $ECHO_C" >&6
14965 else
14966
14967 cf_cv_curses_wacs_symbols=no
14968 if test "$cf_cv_curses_wacs_map" != unknown
14969 then
14970         cat >conftest.$ac_ext <<_ACEOF
14971 #line 14971 "configure"
14972 #include "confdefs.h"
14973
14974 #ifndef _XOPEN_SOURCE_EXTENDED
14975 #define _XOPEN_SOURCE_EXTENDED
14976 #endif
14977 #include <${cf_cv_ncurses_header:-curses.h}>
14978 int
14979 main ()
14980 {
14981 cchar_t *foo = WACS_PLUS;
14982          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
14983   ;
14984   return 0;
14985 }
14986 _ACEOF
14987 rm -f conftest.$ac_objext conftest$ac_exeext
14988 if { (eval echo "$as_me:14988: \"$ac_link\"") >&5
14989   (eval $ac_link) 2>&5
14990   ac_status=$?
14991   echo "$as_me:14991: \$? = $ac_status" >&5
14992   (exit $ac_status); } &&
14993          { ac_try='test -s conftest$ac_exeext'
14994   { (eval echo "$as_me:14994: \"$ac_try\"") >&5
14995   (eval $ac_try) 2>&5
14996   ac_status=$?
14997   echo "$as_me:14997: \$? = $ac_status" >&5
14998   (exit $ac_status); }; }; then
14999   cf_cv_curses_wacs_symbols=yes
15000 else
15001   echo "$as_me: failed program was:" >&5
15002 cat conftest.$ac_ext >&5
15003 fi
15004 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15005 else
15006         cat >conftest.$ac_ext <<_ACEOF
15007 #line 15007 "configure"
15008 #include "confdefs.h"
15009
15010 #ifndef _XOPEN_SOURCE_EXTENDED
15011 #define _XOPEN_SOURCE_EXTENDED
15012 #endif
15013 #include <${cf_cv_ncurses_header:-curses.h}>
15014 int
15015 main ()
15016 {
15017 cchar_t *foo = WACS_PLUS
15018   ;
15019   return 0;
15020 }
15021 _ACEOF
15022 rm -f conftest.$ac_objext conftest$ac_exeext
15023 if { (eval echo "$as_me:15023: \"$ac_link\"") >&5
15024   (eval $ac_link) 2>&5
15025   ac_status=$?
15026   echo "$as_me:15026: \$? = $ac_status" >&5
15027   (exit $ac_status); } &&
15028          { ac_try='test -s conftest$ac_exeext'
15029   { (eval echo "$as_me:15029: \"$ac_try\"") >&5
15030   (eval $ac_try) 2>&5
15031   ac_status=$?
15032   echo "$as_me:15032: \$? = $ac_status" >&5
15033   (exit $ac_status); }; }; then
15034   cf_cv_curses_wacs_symbols=yes
15035 else
15036   echo "$as_me: failed program was:" >&5
15037 cat conftest.$ac_ext >&5
15038 fi
15039 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15040 fi
15041
15042 fi
15043 echo "$as_me:15043: result: $cf_cv_curses_wacs_symbols" >&5
15044 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15045
15046 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
15047 #define CURSES_WACS_SYMBOLS 1
15048 EOF
15049
15050 fi
15051
15052 echo "$as_me:15052: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15053 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15054 cat >conftest.$ac_ext <<_ACEOF
15055 #line 15055 "configure"
15056 #include "confdefs.h"
15057
15058 #ifndef _XOPEN_SOURCE_EXTENDED
15059 #define _XOPEN_SOURCE_EXTENDED
15060 #endif
15061 #include <${cf_cv_ncurses_header:-curses.h}>
15062 int
15063 main ()
15064 {
15065
15066 attr_t foo
15067
15068   ;
15069   return 0;
15070 }
15071 _ACEOF
15072 rm -f conftest.$ac_objext
15073 if { (eval echo "$as_me:15073: \"$ac_compile\"") >&5
15074   (eval $ac_compile) 2>&5
15075   ac_status=$?
15076   echo "$as_me:15076: \$? = $ac_status" >&5
15077   (exit $ac_status); } &&
15078          { ac_try='test -s conftest.$ac_objext'
15079   { (eval echo "$as_me:15079: \"$ac_try\"") >&5
15080   (eval $ac_try) 2>&5
15081   ac_status=$?
15082   echo "$as_me:15082: \$? = $ac_status" >&5
15083   (exit $ac_status); }; }; then
15084   cf_result=yes
15085 else
15086   echo "$as_me: failed program was:" >&5
15087 cat conftest.$ac_ext >&5
15088 cf_result=no
15089 fi
15090 rm -f conftest.$ac_objext conftest.$ac_ext
15091 echo "$as_me:15091: result: $cf_result" >&5
15092 echo "${ECHO_T}$cf_result" >&6
15093 if test $cf_result = yes ; then
15094
15095 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15096
15097         cat >>confdefs.h <<EOF
15098 #define $cf_result 1
15099 EOF
15100
15101 else
15102         cat >>confdefs.h <<EOF
15103 #define attr_t long
15104 EOF
15105
15106 fi
15107
15108 if test "$cf_enable_widec" = yes; then
15109
15110 # This is needed on Tru64 5.0 to declare mbstate_t
15111 echo "$as_me:15111: checking if we must include wchar.h to declare mbstate_t" >&5
15112 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15113 if test "${cf_cv_mbstate_t+set}" = set; then
15114   echo $ECHO_N "(cached) $ECHO_C" >&6
15115 else
15116
15117 cat >conftest.$ac_ext <<_ACEOF
15118 #line 15118 "configure"
15119 #include "confdefs.h"
15120
15121 #include <stdlib.h>
15122 #include <stdarg.h>
15123 #include <stdio.h>
15124 #ifdef HAVE_LIBUTF8_H
15125 #include <libutf8.h>
15126 #endif
15127 int
15128 main ()
15129 {
15130 mbstate_t state
15131   ;
15132   return 0;
15133 }
15134 _ACEOF
15135 rm -f conftest.$ac_objext
15136 if { (eval echo "$as_me:15136: \"$ac_compile\"") >&5
15137   (eval $ac_compile) 2>&5
15138   ac_status=$?
15139   echo "$as_me:15139: \$? = $ac_status" >&5
15140   (exit $ac_status); } &&
15141          { ac_try='test -s conftest.$ac_objext'
15142   { (eval echo "$as_me:15142: \"$ac_try\"") >&5
15143   (eval $ac_try) 2>&5
15144   ac_status=$?
15145   echo "$as_me:15145: \$? = $ac_status" >&5
15146   (exit $ac_status); }; }; then
15147   cf_cv_mbstate_t=no
15148 else
15149   echo "$as_me: failed program was:" >&5
15150 cat conftest.$ac_ext >&5
15151 cat >conftest.$ac_ext <<_ACEOF
15152 #line 15152 "configure"
15153 #include "confdefs.h"
15154
15155 #include <stdlib.h>
15156 #include <stdarg.h>
15157 #include <stdio.h>
15158 #include <wchar.h>
15159 #ifdef HAVE_LIBUTF8_H
15160 #include <libutf8.h>
15161 #endif
15162 int
15163 main ()
15164 {
15165 mbstate_t value
15166   ;
15167   return 0;
15168 }
15169 _ACEOF
15170 rm -f conftest.$ac_objext
15171 if { (eval echo "$as_me:15171: \"$ac_compile\"") >&5
15172   (eval $ac_compile) 2>&5
15173   ac_status=$?
15174   echo "$as_me:15174: \$? = $ac_status" >&5
15175   (exit $ac_status); } &&
15176          { ac_try='test -s conftest.$ac_objext'
15177   { (eval echo "$as_me:15177: \"$ac_try\"") >&5
15178   (eval $ac_try) 2>&5
15179   ac_status=$?
15180   echo "$as_me:15180: \$? = $ac_status" >&5
15181   (exit $ac_status); }; }; then
15182   cf_cv_mbstate_t=yes
15183 else
15184   echo "$as_me: failed program was:" >&5
15185 cat conftest.$ac_ext >&5
15186 cf_cv_mbstate_t=unknown
15187 fi
15188 rm -f conftest.$ac_objext conftest.$ac_ext
15189 fi
15190 rm -f conftest.$ac_objext conftest.$ac_ext
15191 fi
15192 echo "$as_me:15192: result: $cf_cv_mbstate_t" >&5
15193 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15194
15195 if test "$cf_cv_mbstate_t" = yes ; then
15196         cat >>confdefs.h <<\EOF
15197 #define NEED_WCHAR_H 1
15198 EOF
15199
15200         NEED_WCHAR_H=1
15201 fi
15202
15203 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15204 if test "$cf_cv_mbstate_t" = unknown ; then
15205         NCURSES_MBSTATE_T=1
15206 fi
15207
15208 # if we find mbstate_t in either place, use substitution to provide a fallback.
15209 if test "$cf_cv_mbstate_t" != unknown ; then
15210         NCURSES_OK_MBSTATE_T=1
15211 fi
15212
15213 # This is needed on Tru64 5.0 to declare wchar_t
15214 echo "$as_me:15214: checking if we must include wchar.h to declare wchar_t" >&5
15215 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15216 if test "${cf_cv_wchar_t+set}" = set; then
15217   echo $ECHO_N "(cached) $ECHO_C" >&6
15218 else
15219
15220 cat >conftest.$ac_ext <<_ACEOF
15221 #line 15221 "configure"
15222 #include "confdefs.h"
15223
15224 #include <stdlib.h>
15225 #include <stdarg.h>
15226 #include <stdio.h>
15227 #ifdef HAVE_LIBUTF8_H
15228 #include <libutf8.h>
15229 #endif
15230 int
15231 main ()
15232 {
15233 wchar_t state
15234   ;
15235   return 0;
15236 }
15237 _ACEOF
15238 rm -f conftest.$ac_objext
15239 if { (eval echo "$as_me:15239: \"$ac_compile\"") >&5
15240   (eval $ac_compile) 2>&5
15241   ac_status=$?
15242   echo "$as_me:15242: \$? = $ac_status" >&5
15243   (exit $ac_status); } &&
15244          { ac_try='test -s conftest.$ac_objext'
15245   { (eval echo "$as_me:15245: \"$ac_try\"") >&5
15246   (eval $ac_try) 2>&5
15247   ac_status=$?
15248   echo "$as_me:15248: \$? = $ac_status" >&5
15249   (exit $ac_status); }; }; then
15250   cf_cv_wchar_t=no
15251 else
15252   echo "$as_me: failed program was:" >&5
15253 cat conftest.$ac_ext >&5
15254 cat >conftest.$ac_ext <<_ACEOF
15255 #line 15255 "configure"
15256 #include "confdefs.h"
15257
15258 #include <stdlib.h>
15259 #include <stdarg.h>
15260 #include <stdio.h>
15261 #include <wchar.h>
15262 #ifdef HAVE_LIBUTF8_H
15263 #include <libutf8.h>
15264 #endif
15265 int
15266 main ()
15267 {
15268 wchar_t value
15269   ;
15270   return 0;
15271 }
15272 _ACEOF
15273 rm -f conftest.$ac_objext
15274 if { (eval echo "$as_me:15274: \"$ac_compile\"") >&5
15275   (eval $ac_compile) 2>&5
15276   ac_status=$?
15277   echo "$as_me:15277: \$? = $ac_status" >&5
15278   (exit $ac_status); } &&
15279          { ac_try='test -s conftest.$ac_objext'
15280   { (eval echo "$as_me:15280: \"$ac_try\"") >&5
15281   (eval $ac_try) 2>&5
15282   ac_status=$?
15283   echo "$as_me:15283: \$? = $ac_status" >&5
15284   (exit $ac_status); }; }; then
15285   cf_cv_wchar_t=yes
15286 else
15287   echo "$as_me: failed program was:" >&5
15288 cat conftest.$ac_ext >&5
15289 cf_cv_wchar_t=unknown
15290 fi
15291 rm -f conftest.$ac_objext conftest.$ac_ext
15292 fi
15293 rm -f conftest.$ac_objext conftest.$ac_ext
15294 fi
15295 echo "$as_me:15295: result: $cf_cv_wchar_t" >&5
15296 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15297
15298 if test "$cf_cv_wchar_t" = yes ; then
15299         cat >>confdefs.h <<\EOF
15300 #define NEED_WCHAR_H 1
15301 EOF
15302
15303         NEED_WCHAR_H=1
15304 fi
15305
15306 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15307 if test "$cf_cv_wchar_t" = unknown ; then
15308         NCURSES_WCHAR_T=1
15309 fi
15310
15311 # if we find wchar_t in either place, use substitution to provide a fallback.
15312 if test "$cf_cv_wchar_t" != unknown ; then
15313         NCURSES_OK_WCHAR_T=1
15314 fi
15315
15316 # This is needed on Tru64 5.0 to declare wint_t
15317 echo "$as_me:15317: checking if we must include wchar.h to declare wint_t" >&5
15318 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15319 if test "${cf_cv_wint_t+set}" = set; then
15320   echo $ECHO_N "(cached) $ECHO_C" >&6
15321 else
15322
15323 cat >conftest.$ac_ext <<_ACEOF
15324 #line 15324 "configure"
15325 #include "confdefs.h"
15326
15327 #include <stdlib.h>
15328 #include <stdarg.h>
15329 #include <stdio.h>
15330 #ifdef HAVE_LIBUTF8_H
15331 #include <libutf8.h>
15332 #endif
15333 int
15334 main ()
15335 {
15336 wint_t state
15337   ;
15338   return 0;
15339 }
15340 _ACEOF
15341 rm -f conftest.$ac_objext
15342 if { (eval echo "$as_me:15342: \"$ac_compile\"") >&5
15343   (eval $ac_compile) 2>&5
15344   ac_status=$?
15345   echo "$as_me:15345: \$? = $ac_status" >&5
15346   (exit $ac_status); } &&
15347          { ac_try='test -s conftest.$ac_objext'
15348   { (eval echo "$as_me:15348: \"$ac_try\"") >&5
15349   (eval $ac_try) 2>&5
15350   ac_status=$?
15351   echo "$as_me:15351: \$? = $ac_status" >&5
15352   (exit $ac_status); }; }; then
15353   cf_cv_wint_t=no
15354 else
15355   echo "$as_me: failed program was:" >&5
15356 cat conftest.$ac_ext >&5
15357 cat >conftest.$ac_ext <<_ACEOF
15358 #line 15358 "configure"
15359 #include "confdefs.h"
15360
15361 #include <stdlib.h>
15362 #include <stdarg.h>
15363 #include <stdio.h>
15364 #include <wchar.h>
15365 #ifdef HAVE_LIBUTF8_H
15366 #include <libutf8.h>
15367 #endif
15368 int
15369 main ()
15370 {
15371 wint_t value
15372   ;
15373   return 0;
15374 }
15375 _ACEOF
15376 rm -f conftest.$ac_objext
15377 if { (eval echo "$as_me:15377: \"$ac_compile\"") >&5
15378   (eval $ac_compile) 2>&5
15379   ac_status=$?
15380   echo "$as_me:15380: \$? = $ac_status" >&5
15381   (exit $ac_status); } &&
15382          { ac_try='test -s conftest.$ac_objext'
15383   { (eval echo "$as_me:15383: \"$ac_try\"") >&5
15384   (eval $ac_try) 2>&5
15385   ac_status=$?
15386   echo "$as_me:15386: \$? = $ac_status" >&5
15387   (exit $ac_status); }; }; then
15388   cf_cv_wint_t=yes
15389 else
15390   echo "$as_me: failed program was:" >&5
15391 cat conftest.$ac_ext >&5
15392 cf_cv_wint_t=unknown
15393 fi
15394 rm -f conftest.$ac_objext conftest.$ac_ext
15395 fi
15396 rm -f conftest.$ac_objext conftest.$ac_ext
15397 fi
15398 echo "$as_me:15398: result: $cf_cv_wint_t" >&5
15399 echo "${ECHO_T}$cf_cv_wint_t" >&6
15400
15401 if test "$cf_cv_wint_t" = yes ; then
15402         cat >>confdefs.h <<\EOF
15403 #define NEED_WCHAR_H 1
15404 EOF
15405
15406         NEED_WCHAR_H=1
15407 fi
15408
15409 # if we do not find wint_t in either place, use substitution to provide a fallback.
15410 if test "$cf_cv_wint_t" = unknown ; then
15411         NCURSES_WINT_T=1
15412 fi
15413
15414 # if we find wint_t in either place, use substitution to provide a fallback.
15415 if test "$cf_cv_wint_t" != unknown ; then
15416         NCURSES_OK_WINT_T=1
15417 fi
15418
15419         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15420
15421 echo "$as_me:15421: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15422 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15423 cat >conftest.$ac_ext <<_ACEOF
15424 #line 15424 "configure"
15425 #include "confdefs.h"
15426
15427 #ifndef _XOPEN_SOURCE_EXTENDED
15428 #define _XOPEN_SOURCE_EXTENDED
15429 #endif
15430 #include <${cf_cv_ncurses_header:-curses.h}>
15431 int
15432 main ()
15433 {
15434
15435 mbstate_t foo
15436
15437   ;
15438   return 0;
15439 }
15440 _ACEOF
15441 rm -f conftest.$ac_objext
15442 if { (eval echo "$as_me:15442: \"$ac_compile\"") >&5
15443   (eval $ac_compile) 2>&5
15444   ac_status=$?
15445   echo "$as_me:15445: \$? = $ac_status" >&5
15446   (exit $ac_status); } &&
15447          { ac_try='test -s conftest.$ac_objext'
15448   { (eval echo "$as_me:15448: \"$ac_try\"") >&5
15449   (eval $ac_try) 2>&5
15450   ac_status=$?
15451   echo "$as_me:15451: \$? = $ac_status" >&5
15452   (exit $ac_status); }; }; then
15453   cf_result=yes
15454 else
15455   echo "$as_me: failed program was:" >&5
15456 cat conftest.$ac_ext >&5
15457 cf_result=no
15458 fi
15459 rm -f conftest.$ac_objext conftest.$ac_ext
15460 echo "$as_me:15460: result: $cf_result" >&5
15461 echo "${ECHO_T}$cf_result" >&6
15462 if test $cf_result = yes ; then
15463
15464 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15465
15466         cat >>confdefs.h <<EOF
15467 #define $cf_result 1
15468 EOF
15469
15470 else
15471         cat >>confdefs.h <<EOF
15472 #define mbstate_t long
15473 EOF
15474
15475 fi
15476
15477         fi
15478
15479         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15480
15481 echo "$as_me:15481: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15482 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15483 cat >conftest.$ac_ext <<_ACEOF
15484 #line 15484 "configure"
15485 #include "confdefs.h"
15486
15487 #ifndef _XOPEN_SOURCE_EXTENDED
15488 #define _XOPEN_SOURCE_EXTENDED
15489 #endif
15490 #include <${cf_cv_ncurses_header:-curses.h}>
15491 int
15492 main ()
15493 {
15494
15495 wchar_t foo
15496
15497   ;
15498   return 0;
15499 }
15500 _ACEOF
15501 rm -f conftest.$ac_objext
15502 if { (eval echo "$as_me:15502: \"$ac_compile\"") >&5
15503   (eval $ac_compile) 2>&5
15504   ac_status=$?
15505   echo "$as_me:15505: \$? = $ac_status" >&5
15506   (exit $ac_status); } &&
15507          { ac_try='test -s conftest.$ac_objext'
15508   { (eval echo "$as_me:15508: \"$ac_try\"") >&5
15509   (eval $ac_try) 2>&5
15510   ac_status=$?
15511   echo "$as_me:15511: \$? = $ac_status" >&5
15512   (exit $ac_status); }; }; then
15513   cf_result=yes
15514 else
15515   echo "$as_me: failed program was:" >&5
15516 cat conftest.$ac_ext >&5
15517 cf_result=no
15518 fi
15519 rm -f conftest.$ac_objext conftest.$ac_ext
15520 echo "$as_me:15520: result: $cf_result" >&5
15521 echo "${ECHO_T}$cf_result" >&6
15522 if test $cf_result = yes ; then
15523
15524 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15525
15526         cat >>confdefs.h <<EOF
15527 #define $cf_result 1
15528 EOF
15529
15530 else
15531         cat >>confdefs.h <<EOF
15532 #define wchar_t long
15533 EOF
15534
15535 fi
15536
15537         fi
15538
15539         if test "$NCURSES_OK_WINT_T" = 0 ; then
15540
15541 echo "$as_me:15541: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15542 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15543 cat >conftest.$ac_ext <<_ACEOF
15544 #line 15544 "configure"
15545 #include "confdefs.h"
15546
15547 #ifndef _XOPEN_SOURCE_EXTENDED
15548 #define _XOPEN_SOURCE_EXTENDED
15549 #endif
15550 #include <${cf_cv_ncurses_header:-curses.h}>
15551 int
15552 main ()
15553 {
15554
15555 wint_t foo
15556
15557   ;
15558   return 0;
15559 }
15560 _ACEOF
15561 rm -f conftest.$ac_objext
15562 if { (eval echo "$as_me:15562: \"$ac_compile\"") >&5
15563   (eval $ac_compile) 2>&5
15564   ac_status=$?
15565   echo "$as_me:15565: \$? = $ac_status" >&5
15566   (exit $ac_status); } &&
15567          { ac_try='test -s conftest.$ac_objext'
15568   { (eval echo "$as_me:15568: \"$ac_try\"") >&5
15569   (eval $ac_try) 2>&5
15570   ac_status=$?
15571   echo "$as_me:15571: \$? = $ac_status" >&5
15572   (exit $ac_status); }; }; then
15573   cf_result=yes
15574 else
15575   echo "$as_me: failed program was:" >&5
15576 cat conftest.$ac_ext >&5
15577 cf_result=no
15578 fi
15579 rm -f conftest.$ac_objext conftest.$ac_ext
15580 echo "$as_me:15580: result: $cf_result" >&5
15581 echo "${ECHO_T}$cf_result" >&6
15582 if test $cf_result = yes ; then
15583
15584 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15585
15586         cat >>confdefs.h <<EOF
15587 #define $cf_result 1
15588 EOF
15589
15590 else
15591         cat >>confdefs.h <<EOF
15592 #define wint_t long
15593 EOF
15594
15595 fi
15596
15597         fi
15598 fi
15599
15600 echo "$as_me:15600: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15601 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15602
15603 cat >conftest.$ac_ext <<_ACEOF
15604 #line 15604 "configure"
15605 #include "confdefs.h"
15606
15607 #ifdef HAVE_XCURSES
15608 #include <xcurses.h>
15609 char * XCursesProgramName = "test";
15610 #else
15611 #include <${cf_cv_ncurses_header:-curses.h}>
15612 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15613 #include <ncursesw/term.h>
15614 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15615 #include <ncurses/term.h>
15616 #elif defined(HAVE_TERM_H)
15617 #include <term.h>
15618 #endif
15619 #endif
15620
15621 int
15622 main ()
15623 {
15624
15625 void *foo = &(boolnames)
15626
15627   ;
15628   return 0;
15629 }
15630 _ACEOF
15631 rm -f conftest.$ac_objext
15632 if { (eval echo "$as_me:15632: \"$ac_compile\"") >&5
15633   (eval $ac_compile) 2>&5
15634   ac_status=$?
15635   echo "$as_me:15635: \$? = $ac_status" >&5
15636   (exit $ac_status); } &&
15637          { ac_try='test -s conftest.$ac_objext'
15638   { (eval echo "$as_me:15638: \"$ac_try\"") >&5
15639   (eval $ac_try) 2>&5
15640   ac_status=$?
15641   echo "$as_me:15641: \$? = $ac_status" >&5
15642   (exit $ac_status); }; }; then
15643   cf_result=yes
15644 else
15645   echo "$as_me: failed program was:" >&5
15646 cat conftest.$ac_ext >&5
15647 cf_result=no
15648 fi
15649 rm -f conftest.$ac_objext conftest.$ac_ext
15650 echo "$as_me:15650: result: $cf_result" >&5
15651 echo "${ECHO_T}$cf_result" >&6
15652
15653 if test $cf_result = yes ; then
15654
15655 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15656
15657         cat >>confdefs.h <<EOF
15658 #define $cf_result 1
15659 EOF
15660
15661 else
15662         echo "$as_me:15662: checking for data boolnames in library" >&5
15663 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15664         # BSD linkers insist on making weak linkage, but resolve at runtime.
15665         if test "$cross_compiling" = yes; then
15666
15667         # cross-compiling
15668         cat >conftest.$ac_ext <<_ACEOF
15669 #line 15669 "configure"
15670 #include "confdefs.h"
15671
15672 #ifdef HAVE_XCURSES
15673 #include <xcurses.h>
15674 char * XCursesProgramName = "test";
15675 #else
15676 #include <${cf_cv_ncurses_header:-curses.h}>
15677 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15678 #include <ncursesw/term.h>
15679 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15680 #include <ncurses/term.h>
15681 #elif defined(HAVE_TERM_H)
15682 #include <term.h>
15683 #endif
15684 #endif
15685
15686 extern char boolnames;
15687 int
15688 main ()
15689 {
15690
15691         do {
15692                 void *foo = &(boolnames);
15693                 ${cf_cv_main_return:-return}(foo == 0);
15694         } while (0)
15695
15696   ;
15697   return 0;
15698 }
15699 _ACEOF
15700 rm -f conftest.$ac_objext conftest$ac_exeext
15701 if { (eval echo "$as_me:15701: \"$ac_link\"") >&5
15702   (eval $ac_link) 2>&5
15703   ac_status=$?
15704   echo "$as_me:15704: \$? = $ac_status" >&5
15705   (exit $ac_status); } &&
15706          { ac_try='test -s conftest$ac_exeext'
15707   { (eval echo "$as_me:15707: \"$ac_try\"") >&5
15708   (eval $ac_try) 2>&5
15709   ac_status=$?
15710   echo "$as_me:15710: \$? = $ac_status" >&5
15711   (exit $ac_status); }; }; then
15712   cf_result=yes
15713 else
15714   echo "$as_me: failed program was:" >&5
15715 cat conftest.$ac_ext >&5
15716 cf_result=no
15717 fi
15718 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15719
15720 else
15721   cat >conftest.$ac_ext <<_ACEOF
15722 #line 15722 "configure"
15723 #include "confdefs.h"
15724
15725 #ifdef HAVE_XCURSES
15726 #include <xcurses.h>
15727 char * XCursesProgramName = "test";
15728 #else
15729 #include <${cf_cv_ncurses_header:-curses.h}>
15730 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15731 #include <ncursesw/term.h>
15732 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15733 #include <ncurses/term.h>
15734 #elif defined(HAVE_TERM_H)
15735 #include <term.h>
15736 #endif
15737 #endif
15738
15739 extern char boolnames;
15740 int main(void)
15741 {
15742         void *foo = &(boolnames);
15743         ${cf_cv_main_return:-return}(foo == 0);
15744 }
15745 _ACEOF
15746 rm -f conftest$ac_exeext
15747 if { (eval echo "$as_me:15747: \"$ac_link\"") >&5
15748   (eval $ac_link) 2>&5
15749   ac_status=$?
15750   echo "$as_me:15750: \$? = $ac_status" >&5
15751   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15752   { (eval echo "$as_me:15752: \"$ac_try\"") >&5
15753   (eval $ac_try) 2>&5
15754   ac_status=$?
15755   echo "$as_me:15755: \$? = $ac_status" >&5
15756   (exit $ac_status); }; }; then
15757   cf_result=yes
15758 else
15759   echo "$as_me: program exited with status $ac_status" >&5
15760 echo "$as_me: failed program was:" >&5
15761 cat conftest.$ac_ext >&5
15762 cf_result=no
15763 fi
15764 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15765 fi
15766         echo "$as_me:15766: result: $cf_result" >&5
15767 echo "${ECHO_T}$cf_result" >&6
15768         if test $cf_result = yes ; then
15769
15770 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15771
15772                 cat >>confdefs.h <<EOF
15773 #define $cf_result 1
15774 EOF
15775
15776         fi
15777 fi
15778
15779 echo "$as_me:15779: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15780 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15781
15782 cat >conftest.$ac_ext <<_ACEOF
15783 #line 15783 "configure"
15784 #include "confdefs.h"
15785
15786 #ifdef HAVE_XCURSES
15787 #include <xcurses.h>
15788 char * XCursesProgramName = "test";
15789 #else
15790 #include <${cf_cv_ncurses_header:-curses.h}>
15791 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15792 #include <ncursesw/term.h>
15793 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15794 #include <ncurses/term.h>
15795 #elif defined(HAVE_TERM_H)
15796 #include <term.h>
15797 #endif
15798 #endif
15799
15800 int
15801 main ()
15802 {
15803
15804 void *foo = &(boolfnames)
15805
15806   ;
15807   return 0;
15808 }
15809 _ACEOF
15810 rm -f conftest.$ac_objext
15811 if { (eval echo "$as_me:15811: \"$ac_compile\"") >&5
15812   (eval $ac_compile) 2>&5
15813   ac_status=$?
15814   echo "$as_me:15814: \$? = $ac_status" >&5
15815   (exit $ac_status); } &&
15816          { ac_try='test -s conftest.$ac_objext'
15817   { (eval echo "$as_me:15817: \"$ac_try\"") >&5
15818   (eval $ac_try) 2>&5
15819   ac_status=$?
15820   echo "$as_me:15820: \$? = $ac_status" >&5
15821   (exit $ac_status); }; }; then
15822   cf_result=yes
15823 else
15824   echo "$as_me: failed program was:" >&5
15825 cat conftest.$ac_ext >&5
15826 cf_result=no
15827 fi
15828 rm -f conftest.$ac_objext conftest.$ac_ext
15829 echo "$as_me:15829: result: $cf_result" >&5
15830 echo "${ECHO_T}$cf_result" >&6
15831
15832 if test $cf_result = yes ; then
15833
15834 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15835
15836         cat >>confdefs.h <<EOF
15837 #define $cf_result 1
15838 EOF
15839
15840 else
15841         echo "$as_me:15841: checking for data boolfnames in library" >&5
15842 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15843         # BSD linkers insist on making weak linkage, but resolve at runtime.
15844         if test "$cross_compiling" = yes; then
15845
15846         # cross-compiling
15847         cat >conftest.$ac_ext <<_ACEOF
15848 #line 15848 "configure"
15849 #include "confdefs.h"
15850
15851 #ifdef HAVE_XCURSES
15852 #include <xcurses.h>
15853 char * XCursesProgramName = "test";
15854 #else
15855 #include <${cf_cv_ncurses_header:-curses.h}>
15856 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15857 #include <ncursesw/term.h>
15858 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15859 #include <ncurses/term.h>
15860 #elif defined(HAVE_TERM_H)
15861 #include <term.h>
15862 #endif
15863 #endif
15864
15865 extern char boolfnames;
15866 int
15867 main ()
15868 {
15869
15870         do {
15871                 void *foo = &(boolfnames);
15872                 ${cf_cv_main_return:-return}(foo == 0);
15873         } while (0)
15874
15875   ;
15876   return 0;
15877 }
15878 _ACEOF
15879 rm -f conftest.$ac_objext conftest$ac_exeext
15880 if { (eval echo "$as_me:15880: \"$ac_link\"") >&5
15881   (eval $ac_link) 2>&5
15882   ac_status=$?
15883   echo "$as_me:15883: \$? = $ac_status" >&5
15884   (exit $ac_status); } &&
15885          { ac_try='test -s conftest$ac_exeext'
15886   { (eval echo "$as_me:15886: \"$ac_try\"") >&5
15887   (eval $ac_try) 2>&5
15888   ac_status=$?
15889   echo "$as_me:15889: \$? = $ac_status" >&5
15890   (exit $ac_status); }; }; then
15891   cf_result=yes
15892 else
15893   echo "$as_me: failed program was:" >&5
15894 cat conftest.$ac_ext >&5
15895 cf_result=no
15896 fi
15897 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15898
15899 else
15900   cat >conftest.$ac_ext <<_ACEOF
15901 #line 15901 "configure"
15902 #include "confdefs.h"
15903
15904 #ifdef HAVE_XCURSES
15905 #include <xcurses.h>
15906 char * XCursesProgramName = "test";
15907 #else
15908 #include <${cf_cv_ncurses_header:-curses.h}>
15909 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15910 #include <ncursesw/term.h>
15911 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15912 #include <ncurses/term.h>
15913 #elif defined(HAVE_TERM_H)
15914 #include <term.h>
15915 #endif
15916 #endif
15917
15918 extern char boolfnames;
15919 int main(void)
15920 {
15921         void *foo = &(boolfnames);
15922         ${cf_cv_main_return:-return}(foo == 0);
15923 }
15924 _ACEOF
15925 rm -f conftest$ac_exeext
15926 if { (eval echo "$as_me:15926: \"$ac_link\"") >&5
15927   (eval $ac_link) 2>&5
15928   ac_status=$?
15929   echo "$as_me:15929: \$? = $ac_status" >&5
15930   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15931   { (eval echo "$as_me:15931: \"$ac_try\"") >&5
15932   (eval $ac_try) 2>&5
15933   ac_status=$?
15934   echo "$as_me:15934: \$? = $ac_status" >&5
15935   (exit $ac_status); }; }; then
15936   cf_result=yes
15937 else
15938   echo "$as_me: program exited with status $ac_status" >&5
15939 echo "$as_me: failed program was:" >&5
15940 cat conftest.$ac_ext >&5
15941 cf_result=no
15942 fi
15943 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15944 fi
15945         echo "$as_me:15945: result: $cf_result" >&5
15946 echo "${ECHO_T}$cf_result" >&6
15947         if test $cf_result = yes ; then
15948
15949 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15950
15951                 cat >>confdefs.h <<EOF
15952 #define $cf_result 1
15953 EOF
15954
15955         fi
15956 fi
15957
15958 LD_RPATH_OPT=
15959 echo "$as_me:15959: checking for an rpath option" >&5
15960 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15961 case $cf_cv_system_name in #(vi
15962 irix*) #(vi
15963         if test "$GCC" = yes; then
15964                 LD_RPATH_OPT="-Wl,-rpath,"
15965         else
15966                 LD_RPATH_OPT="-rpath "
15967         fi
15968         ;;
15969 linux*|gnu*|k*bsd*-gnu) #(vi
15970         LD_RPATH_OPT="-Wl,-rpath,"
15971         ;;
15972 openbsd[2-9].*|mirbsd*) #(vi
15973         LD_RPATH_OPT="-Wl,-rpath,"
15974         ;;
15975 dragonfly*|freebsd*) #(vi
15976         LD_RPATH_OPT="-rpath "
15977         ;;
15978 netbsd*) #(vi
15979         LD_RPATH_OPT="-Wl,-rpath,"
15980         ;;
15981 osf*|mls+*) #(vi
15982         LD_RPATH_OPT="-rpath "
15983         ;;
15984 solaris2*) #(vi
15985         LD_RPATH_OPT="-R"
15986         ;;
15987 *)
15988         ;;
15989 esac
15990 echo "$as_me:15990: result: $LD_RPATH_OPT" >&5
15991 echo "${ECHO_T}$LD_RPATH_OPT" >&6
15992
15993 case "x$LD_RPATH_OPT" in #(vi
15994 x-R*)
15995         echo "$as_me:15995: checking if we need a space after rpath option" >&5
15996 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
15997         cf_save_LIBS="$LIBS"
15998         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
15999         cat >conftest.$ac_ext <<_ACEOF
16000 #line 16000 "configure"
16001 #include "confdefs.h"
16002
16003 int
16004 main ()
16005 {
16006
16007   ;
16008   return 0;
16009 }
16010 _ACEOF
16011 rm -f conftest.$ac_objext conftest$ac_exeext
16012 if { (eval echo "$as_me:16012: \"$ac_link\"") >&5
16013   (eval $ac_link) 2>&5
16014   ac_status=$?
16015   echo "$as_me:16015: \$? = $ac_status" >&5
16016   (exit $ac_status); } &&
16017          { ac_try='test -s conftest$ac_exeext'
16018   { (eval echo "$as_me:16018: \"$ac_try\"") >&5
16019   (eval $ac_try) 2>&5
16020   ac_status=$?
16021   echo "$as_me:16021: \$? = $ac_status" >&5
16022   (exit $ac_status); }; }; then
16023   cf_rpath_space=no
16024 else
16025   echo "$as_me: failed program was:" >&5
16026 cat conftest.$ac_ext >&5
16027 cf_rpath_space=yes
16028 fi
16029 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16030         LIBS="$cf_save_LIBS"
16031         echo "$as_me:16031: result: $cf_rpath_space" >&5
16032 echo "${ECHO_T}$cf_rpath_space" >&6
16033         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16034         ;;
16035 esac
16036
16037 echo "$as_me:16037: checking if rpath-hack should be disabled" >&5
16038 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16039
16040 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16041 if test "${enable_rpath_hack+set}" = set; then
16042   enableval="$enable_rpath_hack"
16043   test "$enableval" != no && enableval=yes
16044   if test "$enableval" != "yes" ; then
16045     cf_disable_rpath_hack=yes
16046   else
16047     cf_disable_rpath_hack=no
16048   fi
16049 else
16050   enableval=yes
16051   cf_disable_rpath_hack=no
16052
16053 fi;
16054 echo "$as_me:16054: result: $cf_disable_rpath_hack" >&5
16055 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16056 if test "$cf_disable_rpath_hack" = no ; then
16057
16058 echo "$as_me:16058: checking for updated LDFLAGS" >&5
16059 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16060 if test -n "$LD_RPATH_OPT" ; then
16061         echo "$as_me:16061: result: maybe" >&5
16062 echo "${ECHO_T}maybe" >&6
16063
16064         for ac_prog in ldd
16065 do
16066   # Extract the first word of "$ac_prog", so it can be a program name with args.
16067 set dummy $ac_prog; ac_word=$2
16068 echo "$as_me:16068: checking for $ac_word" >&5
16069 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16070 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16071   echo $ECHO_N "(cached) $ECHO_C" >&6
16072 else
16073   if test -n "$cf_ldd_prog"; then
16074   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16075 else
16076   ac_save_IFS=$IFS; IFS=$ac_path_separator
16077 ac_dummy="$PATH"
16078 for ac_dir in $ac_dummy; do
16079   IFS=$ac_save_IFS
16080   test -z "$ac_dir" && ac_dir=.
16081   $as_executable_p "$ac_dir/$ac_word" || continue
16082 ac_cv_prog_cf_ldd_prog="$ac_prog"
16083 echo "$as_me:16083: found $ac_dir/$ac_word" >&5
16084 break
16085 done
16086
16087 fi
16088 fi
16089 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16090 if test -n "$cf_ldd_prog"; then
16091   echo "$as_me:16091: result: $cf_ldd_prog" >&5
16092 echo "${ECHO_T}$cf_ldd_prog" >&6
16093 else
16094   echo "$as_me:16094: result: no" >&5
16095 echo "${ECHO_T}no" >&6
16096 fi
16097
16098   test -n "$cf_ldd_prog" && break
16099 done
16100 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16101
16102         cf_rpath_list="/usr/lib /lib"
16103         if test "$cf_ldd_prog" != no
16104         then
16105                 cf_rpath_oops=
16106
16107 cat >conftest.$ac_ext <<_ACEOF
16108 #line 16108 "configure"
16109 #include "confdefs.h"
16110 #include <stdio.h>
16111 int
16112 main ()
16113 {
16114 printf("Hello");
16115   ;
16116   return 0;
16117 }
16118 _ACEOF
16119 rm -f conftest.$ac_objext conftest$ac_exeext
16120 if { (eval echo "$as_me:16120: \"$ac_link\"") >&5
16121   (eval $ac_link) 2>&5
16122   ac_status=$?
16123   echo "$as_me:16123: \$? = $ac_status" >&5
16124   (exit $ac_status); } &&
16125          { ac_try='test -s conftest$ac_exeext'
16126   { (eval echo "$as_me:16126: \"$ac_try\"") >&5
16127   (eval $ac_try) 2>&5
16128   ac_status=$?
16129   echo "$as_me:16129: \$? = $ac_status" >&5
16130   (exit $ac_status); }; }; then
16131   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
16132                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
16133 else
16134   echo "$as_me: failed program was:" >&5
16135 cat conftest.$ac_ext >&5
16136 fi
16137 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16138
16139                 # If we passed the link-test, but get a "not found" on a given library,
16140                 # this could be due to inept reconfiguration of gcc to make it only
16141                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16142                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16143                 # /usr/local libraries.
16144                 if test -n "$cf_rpath_oops"
16145                 then
16146                         for cf_rpath_src in $cf_rpath_oops
16147                         do
16148                                 for cf_rpath_dir in \
16149                                         /usr/local \
16150                                         /usr/pkg \
16151                                         /opt/sfw
16152                                 do
16153                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16154                                         then
16155                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16156
16157 echo "${as_me:-configure}:16157: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16158
16159                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16160                                                 break
16161                                         fi
16162                                 done
16163                         done
16164                 fi
16165         fi
16166
16167         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16168
16169 echo "${as_me:-configure}:16169: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16170
16171 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16172
16173 echo "${as_me:-configure}:16173: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16174
16175 cf_rpath_dst=
16176 for cf_rpath_src in $LDFLAGS
16177 do
16178         case $cf_rpath_src in #(vi
16179         -L*) #(vi
16180
16181                 # check if this refers to a directory which we will ignore
16182                 cf_rpath_skip=no
16183                 if test -n "$cf_rpath_list"
16184                 then
16185                         for cf_rpath_item in $cf_rpath_list
16186                         do
16187                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16188                                 then
16189                                         cf_rpath_skip=yes
16190                                         break
16191                                 fi
16192                         done
16193                 fi
16194
16195                 if test "$cf_rpath_skip" = no
16196                 then
16197                         # transform the option
16198                         if test "$LD_RPATH_OPT" = "-R " ; then
16199                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16200                         else
16201                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16202                         fi
16203
16204                         # if we have not already added this, add it now
16205                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16206                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16207                         then
16208                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16209
16210 echo "${as_me:-configure}:16210: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16211
16212                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16213                         fi
16214                 fi
16215                 ;;
16216         esac
16217         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16218 done
16219 LDFLAGS=$cf_rpath_dst
16220
16221 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16222
16223 echo "${as_me:-configure}:16223: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16224
16225 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16226
16227 echo "${as_me:-configure}:16227: testing ...checking LIBS $LIBS ..." 1>&5
16228
16229 cf_rpath_dst=
16230 for cf_rpath_src in $LIBS
16231 do
16232         case $cf_rpath_src in #(vi
16233         -L*) #(vi
16234
16235                 # check if this refers to a directory which we will ignore
16236                 cf_rpath_skip=no
16237                 if test -n "$cf_rpath_list"
16238                 then
16239                         for cf_rpath_item in $cf_rpath_list
16240                         do
16241                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16242                                 then
16243                                         cf_rpath_skip=yes
16244                                         break
16245                                 fi
16246                         done
16247                 fi
16248
16249                 if test "$cf_rpath_skip" = no
16250                 then
16251                         # transform the option
16252                         if test "$LD_RPATH_OPT" = "-R " ; then
16253                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16254                         else
16255                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16256                         fi
16257
16258                         # if we have not already added this, add it now
16259                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16260                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16261                         then
16262                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16263
16264 echo "${as_me:-configure}:16264: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16265
16266                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16267                         fi
16268                 fi
16269                 ;;
16270         esac
16271         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16272 done
16273 LIBS=$cf_rpath_dst
16274
16275 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16276
16277 echo "${as_me:-configure}:16277: testing ...checked LIBS $LIBS ..." 1>&5
16278
16279         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16280
16281 echo "${as_me:-configure}:16281: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16282
16283 fi
16284
16285 fi
16286
16287 TEST_ARGS="$LIBS"
16288 LIBS=
16289
16290 ac_config_files="$ac_config_files Makefile"
16291 ac_config_commands="$ac_config_commands default"
16292 cat >confcache <<\_ACEOF
16293 # This file is a shell script that caches the results of configure
16294 # tests run on this system so they can be shared between configure
16295 # scripts and configure runs, see configure's option --config-cache.
16296 # It is not useful on other systems.  If it contains results you don't
16297 # want to keep, you may remove or edit it.
16298 #
16299 # config.status only pays attention to the cache file if you give it
16300 # the --recheck option to rerun configure.
16301 #
16302 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16303 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16304 # following values.
16305
16306 _ACEOF
16307
16308 # The following way of writing the cache mishandles newlines in values,
16309 # but we know of no workaround that is simple, portable, and efficient.
16310 # So, don't put newlines in cache variables' values.
16311 # Ultrix sh set writes to stderr and can't be redirected directly,
16312 # and sets the high bit in the cache file unless we assign to the vars.
16313 {
16314   (set) 2>&1 |
16315     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16316     *ac_space=\ *)
16317       # `set' does not quote correctly, so add quotes (double-quote
16318       # substitution turns \\\\ into \\, and sed turns \\ into \).
16319       sed -n \
16320         "s/'/'\\\\''/g;
16321           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16322       ;;
16323     *)
16324       # `set' quotes correctly as required by POSIX, so do not add quotes.
16325       sed -n \
16326         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16327       ;;
16328     esac;
16329 } |
16330   sed '
16331      t clear
16332      : clear
16333      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16334      t end
16335      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16336      : end' >>confcache
16337 if cmp -s $cache_file confcache; then :; else
16338   if test -w $cache_file; then
16339     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16340     cat confcache >$cache_file
16341   else
16342     echo "not updating unwritable cache $cache_file"
16343   fi
16344 fi
16345 rm -f confcache
16346
16347 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16348 # Let make expand exec_prefix.
16349 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16350
16351 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16352 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16353 # trailing colons and then remove the whole line if VPATH becomes empty
16354 # (actually we leave an empty line to preserve line numbers).
16355 if test "x$srcdir" = x.; then
16356   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16357 s/:*\$(srcdir):*/:/;
16358 s/:*\${srcdir}:*/:/;
16359 s/:*@srcdir@:*/:/;
16360 s/^\([^=]*=[    ]*\):*/\1/;
16361 s/:*$//;
16362 s/^[^=]*=[      ]*$//;
16363 }'
16364 fi
16365
16366 DEFS=-DHAVE_CONFIG_H
16367
16368 : ${CONFIG_STATUS=./config.status}
16369 ac_clean_files_save=$ac_clean_files
16370 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16371 { echo "$as_me:16371: creating $CONFIG_STATUS" >&5
16372 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16373 cat >$CONFIG_STATUS <<_ACEOF
16374 #! $SHELL
16375 # Generated automatically by configure.
16376 # Run this file to recreate the current configuration.
16377 # Compiler output produced by configure, useful for debugging
16378 # configure, is in config.log if it exists.
16379
16380 debug=false
16381 SHELL=\${CONFIG_SHELL-$SHELL}
16382 ac_cs_invocation="\$0 \$@"
16383
16384 _ACEOF
16385
16386 cat >>$CONFIG_STATUS <<\_ACEOF
16387 # Be Bourne compatible
16388 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16389   emulate sh
16390   NULLCMD=:
16391 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16392   set -o posix
16393 fi
16394
16395 # Name of the executable.
16396 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16397
16398 if expr a : '\(a\)' >/dev/null 2>&1; then
16399   as_expr=expr
16400 else
16401   as_expr=false
16402 fi
16403
16404 rm -f conf$$ conf$$.exe conf$$.file
16405 echo >conf$$.file
16406 if ln -s conf$$.file conf$$ 2>/dev/null; then
16407   # We could just check for DJGPP; but this test a) works b) is more generic
16408   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16409   if test -f conf$$.exe; then
16410     # Don't use ln at all; we don't have any links
16411     as_ln_s='cp -p'
16412   else
16413     as_ln_s='ln -s'
16414   fi
16415 elif ln conf$$.file conf$$ 2>/dev/null; then
16416   as_ln_s=ln
16417 else
16418   as_ln_s='cp -p'
16419 fi
16420 rm -f conf$$ conf$$.exe conf$$.file
16421
16422 as_executable_p="test -f"
16423
16424 # Support unset when possible.
16425 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16426   as_unset=unset
16427 else
16428   as_unset=false
16429 fi
16430
16431 # NLS nuisances.
16432 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16433 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16434 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16435 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16436 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16437 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16438 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16439 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16440
16441 # IFS
16442 # We need space, tab and new line, in precisely that order.
16443 as_nl='
16444 '
16445 IFS="   $as_nl"
16446
16447 # CDPATH.
16448 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16449
16450 exec 6>&1
16451
16452 _ACEOF
16453
16454 # Files that config.status was made for.
16455 if test -n "$ac_config_files"; then
16456   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16457 fi
16458
16459 if test -n "$ac_config_headers"; then
16460   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16461 fi
16462
16463 if test -n "$ac_config_links"; then
16464   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16465 fi
16466
16467 if test -n "$ac_config_commands"; then
16468   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16469 fi
16470
16471 cat >>$CONFIG_STATUS <<\EOF
16472
16473 ac_cs_usage="\
16474 \`$as_me' instantiates files from templates according to the
16475 current configuration.
16476
16477 Usage: $0 [OPTIONS] [FILE]...
16478
16479   -h, --help       print this help, then exit
16480   -V, --version    print version number, then exit
16481   -d, --debug      don't remove temporary files
16482       --recheck    update $as_me by reconfiguring in the same conditions
16483   --file=FILE[:TEMPLATE]
16484                    instantiate the configuration file FILE
16485   --header=FILE[:TEMPLATE]
16486                    instantiate the configuration header FILE
16487
16488 Configuration files:
16489 $config_files
16490
16491 Configuration headers:
16492 $config_headers
16493
16494 Configuration commands:
16495 $config_commands
16496
16497 Report bugs to <dickey@invisible-island.net>."
16498 EOF
16499
16500 cat >>$CONFIG_STATUS <<EOF
16501 ac_cs_version="\\
16502 config.status
16503 configured by $0, generated by GNU Autoconf 2.52.20101002,
16504   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16505
16506 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16507 Free Software Foundation, Inc.
16508 This config.status script is free software; the Free Software Foundation
16509 gives unlimited permission to copy, distribute and modify it."
16510 srcdir=$srcdir
16511 INSTALL="$INSTALL"
16512 EOF
16513
16514 cat >>$CONFIG_STATUS <<\EOF
16515 # If no file are specified by the user, then we need to provide default
16516 # value.  By we need to know if files were specified by the user.
16517 ac_need_defaults=:
16518 while test $# != 0
16519 do
16520   case $1 in
16521   --*=*)
16522     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16523     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16524     shift
16525     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16526     shift
16527     ;;
16528   -*);;
16529   *) # This is not an option, so the user has probably given explicit
16530      # arguments.
16531      ac_need_defaults=false;;
16532   esac
16533
16534   case $1 in
16535   # Handling of the options.
16536 EOF
16537 cat >>$CONFIG_STATUS <<EOF
16538   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16539     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16540     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16541 EOF
16542 cat >>$CONFIG_STATUS <<\EOF
16543   --version | --vers* | -V )
16544     echo "$ac_cs_version"; exit 0 ;;
16545   --he | --h)
16546     # Conflict between --help and --header
16547     { { echo "$as_me:16547: error: ambiguous option: $1
16548 Try \`$0 --help' for more information." >&5
16549 echo "$as_me: error: ambiguous option: $1
16550 Try \`$0 --help' for more information." >&2;}
16551    { (exit 1); exit 1; }; };;
16552   --help | --hel | -h )
16553     echo "$ac_cs_usage"; exit 0 ;;
16554   --debug | --d* | -d )
16555     debug=: ;;
16556   --file | --fil | --fi | --f )
16557     shift
16558     CONFIG_FILES="$CONFIG_FILES $1"
16559     ac_need_defaults=false;;
16560   --header | --heade | --head | --hea )
16561     shift
16562     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16563     ac_need_defaults=false;;
16564
16565   # This is an error.
16566   -*) { { echo "$as_me:16566: error: unrecognized option: $1
16567 Try \`$0 --help' for more information." >&5
16568 echo "$as_me: error: unrecognized option: $1
16569 Try \`$0 --help' for more information." >&2;}
16570    { (exit 1); exit 1; }; } ;;
16571
16572   *) ac_config_targets="$ac_config_targets $1" ;;
16573
16574   esac
16575   shift
16576 done
16577
16578 exec 5>>config.log
16579 cat >&5 << _ACEOF
16580
16581 ## ----------------------- ##
16582 ## Running config.status.  ##
16583 ## ----------------------- ##
16584
16585 This file was extended by $as_me 2.52.20101002, executed with
16586   CONFIG_FILES    = $CONFIG_FILES
16587   CONFIG_HEADERS  = $CONFIG_HEADERS
16588   CONFIG_LINKS    = $CONFIG_LINKS
16589   CONFIG_COMMANDS = $CONFIG_COMMANDS
16590   > $ac_cs_invocation
16591 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16592
16593 _ACEOF
16594 EOF
16595
16596 cat >>$CONFIG_STATUS <<EOF
16597 #
16598 # INIT-COMMANDS section.
16599 #
16600
16601 AWK="$AWK"
16602 ECHO_LD="$ECHO_LD"
16603
16604 EOF
16605
16606 cat >>$CONFIG_STATUS <<\EOF
16607 for ac_config_target in $ac_config_targets
16608 do
16609   case "$ac_config_target" in
16610   # Handling of arguments.
16611   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16612   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16613   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16614   *) { { echo "$as_me:16614: error: invalid argument: $ac_config_target" >&5
16615 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16616    { (exit 1); exit 1; }; };;
16617   esac
16618 done
16619
16620 # If the user did not use the arguments to specify the items to instantiate,
16621 # then the envvar interface is used.  Set only those that are not.
16622 # We use the long form for the default assignment because of an extremely
16623 # bizarre bug on SunOS 4.1.3.
16624 if $ac_need_defaults; then
16625   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16626   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16627   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16628 fi
16629
16630 # Create a temporary directory, and hook for its removal unless debugging.
16631 $debug ||
16632 {
16633   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16634   trap '{ (exit 1); exit 1; }' 1 2 13 15
16635 }
16636
16637 # Create a (secure) tmp directory for tmp files.
16638 : ${TMPDIR=/tmp}
16639 {
16640   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16641   test -n "$tmp" && test -d "$tmp"
16642 }  ||
16643 {
16644   tmp=$TMPDIR/cs$$-$RANDOM
16645   (umask 077 && mkdir $tmp)
16646 } ||
16647 {
16648    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16649    { (exit 1); exit 1; }
16650 }
16651
16652 EOF
16653
16654 cat >>$CONFIG_STATUS <<EOF
16655
16656 #
16657 # CONFIG_FILES section.
16658 #
16659
16660 # No need to generate the scripts if there are no CONFIG_FILES.
16661 # This happens for instance when ./config.status config.h
16662 if test -n "\$CONFIG_FILES"; then
16663   # Protect against being on the right side of a sed subst in config.status.
16664   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16665    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16666 s,@SHELL@,$SHELL,;t t
16667 s,@exec_prefix@,$exec_prefix,;t t
16668 s,@prefix@,$prefix,;t t
16669 s,@program_transform_name@,$program_transform_name,;t t
16670 s,@bindir@,$bindir,;t t
16671 s,@sbindir@,$sbindir,;t t
16672 s,@libexecdir@,$libexecdir,;t t
16673 s,@datadir@,$datadir,;t t
16674 s,@sysconfdir@,$sysconfdir,;t t
16675 s,@sharedstatedir@,$sharedstatedir,;t t
16676 s,@localstatedir@,$localstatedir,;t t
16677 s,@libdir@,$libdir,;t t
16678 s,@includedir@,$includedir,;t t
16679 s,@oldincludedir@,$oldincludedir,;t t
16680 s,@infodir@,$infodir,;t t
16681 s,@mandir@,$mandir,;t t
16682 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16683 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16684 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16685 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16686 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16687 s,@build_alias@,$build_alias,;t t
16688 s,@host_alias@,$host_alias,;t t
16689 s,@target_alias@,$target_alias,;t t
16690 s,@ECHO_C@,$ECHO_C,;t t
16691 s,@ECHO_N@,$ECHO_N,;t t
16692 s,@ECHO_T@,$ECHO_T,;t t
16693 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16694 s,@DEFS@,$DEFS,;t t
16695 s,@LIBS@,$LIBS,;t t
16696 s,@build@,$build,;t t
16697 s,@build_cpu@,$build_cpu,;t t
16698 s,@build_vendor@,$build_vendor,;t t
16699 s,@build_os@,$build_os,;t t
16700 s,@host@,$host,;t t
16701 s,@host_cpu@,$host_cpu,;t t
16702 s,@host_vendor@,$host_vendor,;t t
16703 s,@host_os@,$host_os,;t t
16704 s,@SET_MAKE@,$SET_MAKE,;t t
16705 s,@CC@,$CC,;t t
16706 s,@CFLAGS@,$CFLAGS,;t t
16707 s,@LDFLAGS@,$LDFLAGS,;t t
16708 s,@CPPFLAGS@,$CPPFLAGS,;t t
16709 s,@ac_ct_CC@,$ac_ct_CC,;t t
16710 s,@EXEEXT@,$EXEEXT,;t t
16711 s,@OBJEXT@,$OBJEXT,;t t
16712 s,@CPP@,$CPP,;t t
16713 s,@AWK@,$AWK,;t t
16714 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16715 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16716 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16717 s,@LINT@,$LINT,;t t
16718 s,@LINT_OPTS@,$LINT_OPTS,;t t
16719 s,@CTAGS@,$CTAGS,;t t
16720 s,@ETAGS@,$ETAGS,;t t
16721 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16722 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16723 s,@MATH_LIB@,$MATH_LIB,;t t
16724 s,@top_builddir@,$top_builddir,;t t
16725 s,@CC_G_OPT@,$CC_G_OPT,;t t
16726 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16727 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16728 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16729 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16730 s,@LD@,$LD,;t t
16731 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16732 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16733 s,@LD_MODEL@,$LD_MODEL,;t t
16734 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16735 s,@LIBTOOL@,$LIBTOOL,;t t
16736 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16737 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16738 s,@LIB_LINK@,$LIB_LINK,;t t
16739 s,@LINK_TESTS@,$LINK_TESTS,;t t
16740 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16741 s,@PTHREAD@,$PTHREAD,;t t
16742 s,@TEST_ARGS@,$TEST_ARGS,;t t
16743 s,@TEST_DEPS@,$TEST_DEPS,;t t
16744 s,@TEST_LIBS@,$TEST_LIBS,;t t
16745 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16746 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16747 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16748 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16749 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16750 s,@ECHO_LT@,$ECHO_LT,;t t
16751 s,@ECHO_LD@,$ECHO_LD,;t t
16752 s,@RULE_CC@,$RULE_CC,;t t
16753 s,@SHOW_CC@,$SHOW_CC,;t t
16754 s,@ECHO_CC@,$ECHO_CC,;t t
16755 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16756 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16757 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16758 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16759 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16760 s,@X_CFLAGS@,$X_CFLAGS,;t t
16761 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16762 s,@X_LIBS@,$X_LIBS,;t t
16763 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16764 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16765 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16766 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16767 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16768 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16769 CEOF
16770
16771 EOF
16772
16773   cat >>$CONFIG_STATUS <<\EOF
16774   # Split the substitutions into bite-sized pieces for seds with
16775   # small command number limits, like on Digital OSF/1 and HP-UX.
16776   ac_max_sed_lines=48
16777   ac_sed_frag=1 # Number of current file.
16778   ac_beg=1 # First line for current file.
16779   ac_end=$ac_max_sed_lines # Line after last line for current file.
16780   ac_more_lines=:
16781   ac_sed_cmds=
16782   while $ac_more_lines; do
16783     if test $ac_beg -gt 1; then
16784       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16785     else
16786       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16787     fi
16788     if test ! -s $tmp/subs.frag; then
16789       ac_more_lines=false
16790     else
16791       # The purpose of the label and of the branching condition is to
16792       # speed up the sed processing (if there are no `@' at all, there
16793       # is no need to browse any of the substitutions).
16794       # These are the two extra sed commands mentioned above.
16795       (echo ':t
16796   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16797       if test -z "$ac_sed_cmds"; then
16798         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16799       else
16800         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16801       fi
16802       ac_sed_frag=`expr $ac_sed_frag + 1`
16803       ac_beg=$ac_end
16804       ac_end=`expr $ac_end + $ac_max_sed_lines`
16805     fi
16806   done
16807   if test -z "$ac_sed_cmds"; then
16808     ac_sed_cmds=cat
16809   fi
16810 fi # test -n "$CONFIG_FILES"
16811
16812 EOF
16813 cat >>$CONFIG_STATUS <<\EOF
16814 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16815   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16816   case $ac_file in
16817   - | *:- | *:-:* ) # input from stdin
16818         cat >$tmp/stdin
16819         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16820         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16821   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16822         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16823   * )   ac_file_in=$ac_file.in ;;
16824   esac
16825
16826   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16827   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16828          X"$ac_file" : 'X\(//\)[^/]' \| \
16829          X"$ac_file" : 'X\(//\)$' \| \
16830          X"$ac_file" : 'X\(/\)' \| \
16831          .     : '\(.\)' 2>/dev/null ||
16832 echo X"$ac_file" |
16833     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16834           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16835           /^X\(\/\/\)$/{ s//\1/; q; }
16836           /^X\(\/\).*/{ s//\1/; q; }
16837           s/.*/./; q'`
16838   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16839     { case "$ac_dir" in
16840   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16841   *)                      as_incr_dir=.;;
16842 esac
16843 as_dummy="$ac_dir"
16844 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16845   case $as_mkdir_dir in
16846     # Skip DOS drivespec
16847     ?:) as_incr_dir=$as_mkdir_dir ;;
16848     *)
16849       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16850       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16851     ;;
16852   esac
16853 done; }
16854
16855     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16856     # A "../" for each directory in $ac_dir_suffix.
16857     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16858   else
16859     ac_dir_suffix= ac_dots=
16860   fi
16861
16862   case $srcdir in
16863   .)  ac_srcdir=.
16864       if test -z "$ac_dots"; then
16865          ac_top_srcdir=.
16866       else
16867          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16868       fi ;;
16869   [\\/]* | ?:[\\/]* )
16870       ac_srcdir=$srcdir$ac_dir_suffix;
16871       ac_top_srcdir=$srcdir ;;
16872   *) # Relative path.
16873     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16874     ac_top_srcdir=$ac_dots$srcdir ;;
16875   esac
16876
16877   case $INSTALL in
16878   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16879   *) ac_INSTALL=$ac_dots$INSTALL ;;
16880   esac
16881
16882   if test x"$ac_file" != x-; then
16883     { echo "$as_me:16883: creating $ac_file" >&5
16884 echo "$as_me: creating $ac_file" >&6;}
16885     rm -f "$ac_file"
16886   fi
16887   # Let's still pretend it is `configure' which instantiates (i.e., don't
16888   # use $as_me), people would be surprised to read:
16889   #    /* config.h.  Generated automatically by config.status.  */
16890   configure_input="Generated automatically from `echo $ac_file_in |
16891                                                  sed 's,.*/,,'` by configure."
16892
16893   # First look for the input files in the build tree, otherwise in the
16894   # src tree.
16895   ac_file_inputs=`IFS=:
16896     for f in $ac_file_in; do
16897       case $f in
16898       -) echo $tmp/stdin ;;
16899       [\\/$]*)
16900          # Absolute (can't be DOS-style, as IFS=:)
16901          test -f "$f" || { { echo "$as_me:16901: error: cannot find input file: $f" >&5
16902 echo "$as_me: error: cannot find input file: $f" >&2;}
16903    { (exit 1); exit 1; }; }
16904          echo $f;;
16905       *) # Relative
16906          if test -f "$f"; then
16907            # Build tree
16908            echo $f
16909          elif test -f "$srcdir/$f"; then
16910            # Source tree
16911            echo $srcdir/$f
16912          else
16913            # /dev/null tree
16914            { { echo "$as_me:16914: error: cannot find input file: $f" >&5
16915 echo "$as_me: error: cannot find input file: $f" >&2;}
16916    { (exit 1); exit 1; }; }
16917          fi;;
16918       esac
16919     done` || { (exit 1); exit 1; }
16920 EOF
16921 cat >>$CONFIG_STATUS <<EOF
16922   sed "$ac_vpsub
16923 $extrasub
16924 EOF
16925 cat >>$CONFIG_STATUS <<\EOF
16926 :t
16927 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16928 s,@configure_input@,$configure_input,;t t
16929 s,@srcdir@,$ac_srcdir,;t t
16930 s,@top_srcdir@,$ac_top_srcdir,;t t
16931 s,@INSTALL@,$ac_INSTALL,;t t
16932 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16933   rm -f $tmp/stdin
16934   if test x"$ac_file" != x-; then
16935     mv $tmp/out $ac_file
16936   else
16937     cat $tmp/out
16938     rm -f $tmp/out
16939   fi
16940
16941 done
16942 EOF
16943 cat >>$CONFIG_STATUS <<\EOF
16944
16945 #
16946 # CONFIG_HEADER section.
16947 #
16948
16949 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16950 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16951 #
16952 # ac_d sets the value in "#define NAME VALUE" lines.
16953 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16954 ac_dB='[        ].*$,\1#\2'
16955 ac_dC=' '
16956 ac_dD=',;t'
16957 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16958 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16959 ac_iB='\([      ]\),\1#\2define\3'
16960 ac_iC=' '
16961 ac_iD='\4,;t'
16962 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16963 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16964 ac_uB='$,\1#\2define\3'
16965 ac_uC=' '
16966 ac_uD=',;t'
16967
16968 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16969   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16970   case $ac_file in
16971   - | *:- | *:-:* ) # input from stdin
16972         cat >$tmp/stdin
16973         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16974         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16975   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16976         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16977   * )   ac_file_in=$ac_file.in ;;
16978   esac
16979
16980   test x"$ac_file" != x- && { echo "$as_me:16980: creating $ac_file" >&5
16981 echo "$as_me: creating $ac_file" >&6;}
16982
16983   # First look for the input files in the build tree, otherwise in the
16984   # src tree.
16985   ac_file_inputs=`IFS=:
16986     for f in $ac_file_in; do
16987       case $f in
16988       -) echo $tmp/stdin ;;
16989       [\\/$]*)
16990          # Absolute (can't be DOS-style, as IFS=:)
16991          test -f "$f" || { { echo "$as_me:16991: error: cannot find input file: $f" >&5
16992 echo "$as_me: error: cannot find input file: $f" >&2;}
16993    { (exit 1); exit 1; }; }
16994          echo $f;;
16995       *) # Relative
16996          if test -f "$f"; then
16997            # Build tree
16998            echo $f
16999          elif test -f "$srcdir/$f"; then
17000            # Source tree
17001            echo $srcdir/$f
17002          else
17003            # /dev/null tree
17004            { { echo "$as_me:17004: error: cannot find input file: $f" >&5
17005 echo "$as_me: error: cannot find input file: $f" >&2;}
17006    { (exit 1); exit 1; }; }
17007          fi;;
17008       esac
17009     done` || { (exit 1); exit 1; }
17010   # Remove the trailing spaces.
17011   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17012
17013 EOF
17014
17015 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17016 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17017 # be either 'cat' or 'sort'.
17018 cat confdefs.h | uniq >conftest.vals
17019
17020 # Break up conftest.vals because some shells have a limit on
17021 # the size of here documents, and old seds have small limits too.
17022
17023 rm -f conftest.tail
17024 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17025 while grep . conftest.vals >/dev/null
17026 do
17027   # Write chunks of a limited-size here document to conftest.frag.
17028   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17029   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17030   echo 'CEOF' >> $CONFIG_STATUS
17031   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17032   rm -f conftest.vals
17033   mv conftest.tail conftest.vals
17034 done
17035 rm -f conftest.vals
17036
17037 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17038 # marker @DEFS@.
17039 echo '  cat >> conftest.edit <<CEOF
17040 /@DEFS@/r conftest.frag
17041 /@DEFS@/d
17042 CEOF
17043 sed -f conftest.edit $tmp/in > $tmp/out
17044 rm -f $tmp/in
17045 mv $tmp/out $tmp/in
17046 rm -f conftest.edit conftest.frag
17047 ' >> $CONFIG_STATUS
17048
17049 cat >>$CONFIG_STATUS <<\EOF
17050   # Let's still pretend it is `configure' which instantiates (i.e., don't
17051   # use $as_me), people would be surprised to read:
17052   #    /* config.h.  Generated automatically by config.status.  */
17053   if test x"$ac_file" = x-; then
17054     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17055   else
17056     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17057   fi
17058   cat $tmp/in >>$tmp/config.h
17059   rm -f $tmp/in
17060   if test x"$ac_file" != x-; then
17061     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17062       { echo "$as_me:17062: $ac_file is unchanged" >&5
17063 echo "$as_me: $ac_file is unchanged" >&6;}
17064     else
17065       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17066          X"$ac_file" : 'X\(//\)[^/]' \| \
17067          X"$ac_file" : 'X\(//\)$' \| \
17068          X"$ac_file" : 'X\(/\)' \| \
17069          .     : '\(.\)' 2>/dev/null ||
17070 echo X"$ac_file" |
17071     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17072           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17073           /^X\(\/\/\)$/{ s//\1/; q; }
17074           /^X\(\/\).*/{ s//\1/; q; }
17075           s/.*/./; q'`
17076       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17077         { case "$ac_dir" in
17078   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17079   *)                      as_incr_dir=.;;
17080 esac
17081 as_dummy="$ac_dir"
17082 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17083   case $as_mkdir_dir in
17084     # Skip DOS drivespec
17085     ?:) as_incr_dir=$as_mkdir_dir ;;
17086     *)
17087       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17088       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17089     ;;
17090   esac
17091 done; }
17092
17093       fi
17094       rm -f $ac_file
17095       mv $tmp/config.h $ac_file
17096     fi
17097   else
17098     cat $tmp/config.h
17099     rm -f $tmp/config.h
17100   fi
17101 done
17102 EOF
17103 cat >>$CONFIG_STATUS <<\EOF
17104 #
17105 # CONFIG_COMMANDS section.
17106 #
17107 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17108   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17109   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17110
17111   case $ac_dest in
17112     default )
17113
17114 for cf_dir in .
17115 do
17116         if test ! -d $srcdir/$cf_dir; then
17117                 continue
17118         elif test -f $srcdir/$cf_dir/programs; then
17119                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17120         fi
17121 done
17122
17123         cat >>Makefile <<TEST_EOF
17124
17125 # These rules are generated so we do not rely on suffix rules, which do not
17126 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17127 # some, and the '\$x' confuses others).
17128 TEST_EOF
17129
17130 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17131 for N in $LIST
17132 do
17133         cat >>Makefile <<TEST_EOF
17134
17135 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17136         \$(srcdir)/test.priv.h \\
17137         ncurses_cfg.h
17138         @echo compiling $N; \$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17139 TEST_EOF
17140 done
17141
17142 if test -f ../config.guess && test -f ../config.sub
17143 then
17144         cat >>Makefile <<TEST_EOF
17145
17146 # if we used CF_INHERIT for getting these files, we can remove them
17147 distclean::
17148         rm -f config.guess config.sub
17149 TEST_EOF
17150 fi
17151  ;;
17152   esac
17153 done
17154 EOF
17155
17156 cat >>$CONFIG_STATUS <<\EOF
17157
17158 { (exit 0); exit 0; }
17159 EOF
17160 chmod +x $CONFIG_STATUS
17161 ac_clean_files=$ac_clean_files_save
17162
17163 # configure is writing to config.log, and then calls config.status.
17164 # config.status does its own redirection, appending to config.log.
17165 # Unfortunately, on DOS this fails, as config.log is still kept open
17166 # by configure, so config.status won't be able to write to it; its
17167 # output is simply discarded.  So we exec the FD to /dev/null,
17168 # effectively closing config.log, so it can be properly (re)opened and
17169 # appended to by config.status.  When coming back to configure, we
17170 # need to make the FD available again.
17171 if test "$no_create" != yes; then
17172   ac_cs_success=:
17173   exec 5>/dev/null
17174   $SHELL $CONFIG_STATUS || ac_cs_success=false
17175   exec 5>>config.log
17176   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17177   # would make configure fail if this is the last instruction.
17178   $ac_cs_success || { (exit 1); exit 1; }
17179 fi
17180