]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20120331
[ncurses.git] / test / configure
1 #! /bin/sh
2 # Guess values for system-dependent variables and create Makefiles.
3 # Generated by Autoconf 2.52.20120310.
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
657   --with-ncurses          use ncurses-libraries
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.20120310.  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         cf_XOPEN_SOURCE=
2927         ;;
2928 freebsd*|dragonfly*) #(vi
2929         # 5.x headers associate
2930         #       _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
2931         #       _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
2932         cf_POSIX_C_SOURCE=200112L
2933         cf_XOPEN_SOURCE=600
2934         cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
2935         ;;
2936 hpux11*) #(vi
2937         cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
2938         ;;
2939 hpux*) #(vi
2940         cf_xopen_source="-D_HPUX_SOURCE"
2941         ;;
2942 irix[56].*) #(vi
2943         cf_xopen_source="-D_SGI_SOURCE"
2944         cf_XOPEN_SOURCE=
2945         ;;
2946 linux*|gnu*|mint*|k*bsd*-gnu) #(vi
2947
2948 echo "$as_me:2948: checking if we must define _GNU_SOURCE" >&5
2949 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6
2950 if test "${cf_cv_gnu_source+set}" = set; then
2951   echo $ECHO_N "(cached) $ECHO_C" >&6
2952 else
2953
2954 cat >conftest.$ac_ext <<_ACEOF
2955 #line 2955 "configure"
2956 #include "confdefs.h"
2957 #include <sys/types.h>
2958 int
2959 main ()
2960 {
2961
2962 #ifndef _XOPEN_SOURCE
2963 make an error
2964 #endif
2965   ;
2966   return 0;
2967 }
2968 _ACEOF
2969 rm -f conftest.$ac_objext
2970 if { (eval echo "$as_me:2970: \"$ac_compile\"") >&5
2971   (eval $ac_compile) 2>&5
2972   ac_status=$?
2973   echo "$as_me:2973: \$? = $ac_status" >&5
2974   (exit $ac_status); } &&
2975          { ac_try='test -s conftest.$ac_objext'
2976   { (eval echo "$as_me:2976: \"$ac_try\"") >&5
2977   (eval $ac_try) 2>&5
2978   ac_status=$?
2979   echo "$as_me:2979: \$? = $ac_status" >&5
2980   (exit $ac_status); }; }; then
2981   cf_cv_gnu_source=no
2982 else
2983   echo "$as_me: failed program was:" >&5
2984 cat conftest.$ac_ext >&5
2985 cf_save="$CPPFLAGS"
2986          CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
2987          cat >conftest.$ac_ext <<_ACEOF
2988 #line 2988 "configure"
2989 #include "confdefs.h"
2990 #include <sys/types.h>
2991 int
2992 main ()
2993 {
2994
2995 #ifdef _XOPEN_SOURCE
2996 make an error
2997 #endif
2998   ;
2999   return 0;
3000 }
3001 _ACEOF
3002 rm -f conftest.$ac_objext
3003 if { (eval echo "$as_me:3003: \"$ac_compile\"") >&5
3004   (eval $ac_compile) 2>&5
3005   ac_status=$?
3006   echo "$as_me:3006: \$? = $ac_status" >&5
3007   (exit $ac_status); } &&
3008          { ac_try='test -s conftest.$ac_objext'
3009   { (eval echo "$as_me:3009: \"$ac_try\"") >&5
3010   (eval $ac_try) 2>&5
3011   ac_status=$?
3012   echo "$as_me:3012: \$? = $ac_status" >&5
3013   (exit $ac_status); }; }; then
3014   cf_cv_gnu_source=no
3015 else
3016   echo "$as_me: failed program was:" >&5
3017 cat conftest.$ac_ext >&5
3018 cf_cv_gnu_source=yes
3019 fi
3020 rm -f conftest.$ac_objext conftest.$ac_ext
3021         CPPFLAGS="$cf_save"
3022
3023 fi
3024 rm -f conftest.$ac_objext conftest.$ac_ext
3025
3026 fi
3027 echo "$as_me:3027: result: $cf_cv_gnu_source" >&5
3028 echo "${ECHO_T}$cf_cv_gnu_source" >&6
3029 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
3030
3031         ;;
3032 mirbsd*) #(vi
3033         # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
3034         cf_XOPEN_SOURCE=
3035
3036 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3037
3038 cf_save_CFLAGS="$CFLAGS"
3039 cf_save_CPPFLAGS="$CPPFLAGS"
3040
3041 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3042         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3043                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3044
3045 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3046         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3047                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3048
3049 echo "$as_me:3049: checking if we should define _POSIX_C_SOURCE" >&5
3050 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3051 if test "${cf_cv_posix_c_source+set}" = set; then
3052   echo $ECHO_N "(cached) $ECHO_C" >&6
3053 else
3054
3055 echo "${as_me:-configure}:3055: testing if the symbol is already defined go no further ..." 1>&5
3056
3057         cat >conftest.$ac_ext <<_ACEOF
3058 #line 3058 "configure"
3059 #include "confdefs.h"
3060 #include <sys/types.h>
3061 int
3062 main ()
3063 {
3064
3065 #ifndef _POSIX_C_SOURCE
3066 make an error
3067 #endif
3068   ;
3069   return 0;
3070 }
3071 _ACEOF
3072 rm -f conftest.$ac_objext
3073 if { (eval echo "$as_me:3073: \"$ac_compile\"") >&5
3074   (eval $ac_compile) 2>&5
3075   ac_status=$?
3076   echo "$as_me:3076: \$? = $ac_status" >&5
3077   (exit $ac_status); } &&
3078          { ac_try='test -s conftest.$ac_objext'
3079   { (eval echo "$as_me:3079: \"$ac_try\"") >&5
3080   (eval $ac_try) 2>&5
3081   ac_status=$?
3082   echo "$as_me:3082: \$? = $ac_status" >&5
3083   (exit $ac_status); }; }; then
3084   cf_cv_posix_c_source=no
3085 else
3086   echo "$as_me: failed program was:" >&5
3087 cat conftest.$ac_ext >&5
3088 cf_want_posix_source=no
3089          case .$cf_POSIX_C_SOURCE in #(vi
3090          .[12]??*) #(vi
3091                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3092                 ;;
3093          .2) #(vi
3094                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3095                 cf_want_posix_source=yes
3096                 ;;
3097          .*)
3098                 cf_want_posix_source=yes
3099                 ;;
3100          esac
3101          if test "$cf_want_posix_source" = yes ; then
3102                 cat >conftest.$ac_ext <<_ACEOF
3103 #line 3103 "configure"
3104 #include "confdefs.h"
3105 #include <sys/types.h>
3106 int
3107 main ()
3108 {
3109
3110 #ifdef _POSIX_SOURCE
3111 make an error
3112 #endif
3113   ;
3114   return 0;
3115 }
3116 _ACEOF
3117 rm -f conftest.$ac_objext
3118 if { (eval echo "$as_me:3118: \"$ac_compile\"") >&5
3119   (eval $ac_compile) 2>&5
3120   ac_status=$?
3121   echo "$as_me:3121: \$? = $ac_status" >&5
3122   (exit $ac_status); } &&
3123          { ac_try='test -s conftest.$ac_objext'
3124   { (eval echo "$as_me:3124: \"$ac_try\"") >&5
3125   (eval $ac_try) 2>&5
3126   ac_status=$?
3127   echo "$as_me:3127: \$? = $ac_status" >&5
3128   (exit $ac_status); }; }; then
3129   :
3130 else
3131   echo "$as_me: failed program was:" >&5
3132 cat conftest.$ac_ext >&5
3133 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3134 fi
3135 rm -f conftest.$ac_objext conftest.$ac_ext
3136          fi
3137
3138 echo "${as_me:-configure}:3138: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3139
3140          CFLAGS="$cf_trim_CFLAGS"
3141          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3142
3143 echo "${as_me:-configure}:3143: testing if the second compile does not leave our definition intact error ..." 1>&5
3144
3145          cat >conftest.$ac_ext <<_ACEOF
3146 #line 3146 "configure"
3147 #include "confdefs.h"
3148 #include <sys/types.h>
3149 int
3150 main ()
3151 {
3152
3153 #ifndef _POSIX_C_SOURCE
3154 make an error
3155 #endif
3156   ;
3157   return 0;
3158 }
3159 _ACEOF
3160 rm -f conftest.$ac_objext
3161 if { (eval echo "$as_me:3161: \"$ac_compile\"") >&5
3162   (eval $ac_compile) 2>&5
3163   ac_status=$?
3164   echo "$as_me:3164: \$? = $ac_status" >&5
3165   (exit $ac_status); } &&
3166          { ac_try='test -s conftest.$ac_objext'
3167   { (eval echo "$as_me:3167: \"$ac_try\"") >&5
3168   (eval $ac_try) 2>&5
3169   ac_status=$?
3170   echo "$as_me:3170: \$? = $ac_status" >&5
3171   (exit $ac_status); }; }; then
3172   :
3173 else
3174   echo "$as_me: failed program was:" >&5
3175 cat conftest.$ac_ext >&5
3176 cf_cv_posix_c_source=no
3177 fi
3178 rm -f conftest.$ac_objext conftest.$ac_ext
3179          CFLAGS="$cf_save_CFLAGS"
3180          CPPFLAGS="$cf_save_CPPFLAGS"
3181
3182 fi
3183 rm -f conftest.$ac_objext conftest.$ac_ext
3184
3185 fi
3186 echo "$as_me:3186: result: $cf_cv_posix_c_source" >&5
3187 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3188
3189 if test "$cf_cv_posix_c_source" != no ; then
3190         CFLAGS="$cf_trim_CFLAGS"
3191         CPPFLAGS="$cf_trim_CPPFLAGS"
3192
3193 cf_fix_cppflags=no
3194 cf_new_cflags=
3195 cf_new_cppflags=
3196 cf_new_extra_cppflags=
3197
3198 for cf_add_cflags in $cf_cv_posix_c_source
3199 do
3200 case $cf_fix_cppflags in
3201 no)
3202         case $cf_add_cflags in #(vi
3203         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3204                 case $cf_add_cflags in
3205                 -D*)
3206                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3207
3208                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3209                                 && test -z "${cf_tst_cflags}" \
3210                                 && cf_fix_cppflags=yes
3211
3212                         if test $cf_fix_cppflags = yes ; then
3213                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3214                                 continue
3215                         elif test "${cf_tst_cflags}" = "\"'" ; then
3216                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3217                                 continue
3218                         fi
3219                         ;;
3220                 esac
3221                 case "$CPPFLAGS" in
3222                 *$cf_add_cflags) #(vi
3223                         ;;
3224                 *) #(vi
3225                         case $cf_add_cflags in #(vi
3226                         -D*)
3227                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3228
3229 CPPFLAGS=`echo "$CPPFLAGS" | \
3230         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3231                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3232
3233                                 ;;
3234                         esac
3235                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3236                         ;;
3237                 esac
3238                 ;;
3239         *)
3240                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3241                 ;;
3242         esac
3243         ;;
3244 yes)
3245         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3246
3247         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3248
3249         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3250                 && test -z "${cf_tst_cflags}" \
3251                 && cf_fix_cppflags=no
3252         ;;
3253 esac
3254 done
3255
3256 if test -n "$cf_new_cflags" ; then
3257
3258         CFLAGS="$CFLAGS $cf_new_cflags"
3259 fi
3260
3261 if test -n "$cf_new_cppflags" ; then
3262
3263         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3264 fi
3265
3266 if test -n "$cf_new_extra_cppflags" ; then
3267
3268         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3269 fi
3270
3271 fi
3272
3273         ;;
3274 netbsd*) #(vi
3275         cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
3276         ;;
3277 openbsd[4-9]*) #(vi
3278         # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
3279         cf_xopen_source="-D_BSD_SOURCE"
3280         cf_XOPEN_SOURCE=600
3281         ;;
3282 openbsd*) #(vi
3283         # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
3284         ;;
3285 osf[45]*) #(vi
3286         cf_xopen_source="-D_OSF_SOURCE"
3287         ;;
3288 nto-qnx*) #(vi
3289         cf_xopen_source="-D_QNX_SOURCE"
3290         ;;
3291 sco*) #(vi
3292         # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
3293         ;;
3294 solaris2.*) #(vi
3295         cf_xopen_source="-D__EXTENSIONS__"
3296         ;;
3297 *)
3298
3299 echo "$as_me:3299: checking if we should define _XOPEN_SOURCE" >&5
3300 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3301 if test "${cf_cv_xopen_source+set}" = set; then
3302   echo $ECHO_N "(cached) $ECHO_C" >&6
3303 else
3304
3305         cat >conftest.$ac_ext <<_ACEOF
3306 #line 3306 "configure"
3307 #include "confdefs.h"
3308
3309 #include <stdlib.h>
3310 #include <string.h>
3311 #include <sys/types.h>
3312
3313 int
3314 main ()
3315 {
3316
3317 #ifndef _XOPEN_SOURCE
3318 make an error
3319 #endif
3320   ;
3321   return 0;
3322 }
3323 _ACEOF
3324 rm -f conftest.$ac_objext
3325 if { (eval echo "$as_me:3325: \"$ac_compile\"") >&5
3326   (eval $ac_compile) 2>&5
3327   ac_status=$?
3328   echo "$as_me:3328: \$? = $ac_status" >&5
3329   (exit $ac_status); } &&
3330          { ac_try='test -s conftest.$ac_objext'
3331   { (eval echo "$as_me:3331: \"$ac_try\"") >&5
3332   (eval $ac_try) 2>&5
3333   ac_status=$?
3334   echo "$as_me:3334: \$? = $ac_status" >&5
3335   (exit $ac_status); }; }; then
3336   cf_cv_xopen_source=no
3337 else
3338   echo "$as_me: failed program was:" >&5
3339 cat conftest.$ac_ext >&5
3340 cf_save="$CPPFLAGS"
3341          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3342          cat >conftest.$ac_ext <<_ACEOF
3343 #line 3343 "configure"
3344 #include "confdefs.h"
3345
3346 #include <stdlib.h>
3347 #include <string.h>
3348 #include <sys/types.h>
3349
3350 int
3351 main ()
3352 {
3353
3354 #ifdef _XOPEN_SOURCE
3355 make an error
3356 #endif
3357   ;
3358   return 0;
3359 }
3360 _ACEOF
3361 rm -f conftest.$ac_objext
3362 if { (eval echo "$as_me:3362: \"$ac_compile\"") >&5
3363   (eval $ac_compile) 2>&5
3364   ac_status=$?
3365   echo "$as_me:3365: \$? = $ac_status" >&5
3366   (exit $ac_status); } &&
3367          { ac_try='test -s conftest.$ac_objext'
3368   { (eval echo "$as_me:3368: \"$ac_try\"") >&5
3369   (eval $ac_try) 2>&5
3370   ac_status=$?
3371   echo "$as_me:3371: \$? = $ac_status" >&5
3372   (exit $ac_status); }; }; then
3373   cf_cv_xopen_source=no
3374 else
3375   echo "$as_me: failed program was:" >&5
3376 cat conftest.$ac_ext >&5
3377 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3378 fi
3379 rm -f conftest.$ac_objext conftest.$ac_ext
3380         CPPFLAGS="$cf_save"
3381
3382 fi
3383 rm -f conftest.$ac_objext conftest.$ac_ext
3384
3385 fi
3386 echo "$as_me:3386: result: $cf_cv_xopen_source" >&5
3387 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3388
3389 if test "$cf_cv_xopen_source" != no ; then
3390
3391 CFLAGS=`echo "$CFLAGS" | \
3392         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3393                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3394
3395 CPPFLAGS=`echo "$CPPFLAGS" | \
3396         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3397                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3398
3399         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3400
3401 cf_fix_cppflags=no
3402 cf_new_cflags=
3403 cf_new_cppflags=
3404 cf_new_extra_cppflags=
3405
3406 for cf_add_cflags in $cf_temp_xopen_source
3407 do
3408 case $cf_fix_cppflags in
3409 no)
3410         case $cf_add_cflags in #(vi
3411         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3412                 case $cf_add_cflags in
3413                 -D*)
3414                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3415
3416                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3417                                 && test -z "${cf_tst_cflags}" \
3418                                 && cf_fix_cppflags=yes
3419
3420                         if test $cf_fix_cppflags = yes ; then
3421                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3422                                 continue
3423                         elif test "${cf_tst_cflags}" = "\"'" ; then
3424                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3425                                 continue
3426                         fi
3427                         ;;
3428                 esac
3429                 case "$CPPFLAGS" in
3430                 *$cf_add_cflags) #(vi
3431                         ;;
3432                 *) #(vi
3433                         case $cf_add_cflags in #(vi
3434                         -D*)
3435                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3436
3437 CPPFLAGS=`echo "$CPPFLAGS" | \
3438         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3439                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3440
3441                                 ;;
3442                         esac
3443                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3444                         ;;
3445                 esac
3446                 ;;
3447         *)
3448                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3449                 ;;
3450         esac
3451         ;;
3452 yes)
3453         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3454
3455         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3456
3457         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3458                 && test -z "${cf_tst_cflags}" \
3459                 && cf_fix_cppflags=no
3460         ;;
3461 esac
3462 done
3463
3464 if test -n "$cf_new_cflags" ; then
3465
3466         CFLAGS="$CFLAGS $cf_new_cflags"
3467 fi
3468
3469 if test -n "$cf_new_cppflags" ; then
3470
3471         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3472 fi
3473
3474 if test -n "$cf_new_extra_cppflags" ; then
3475
3476         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3477 fi
3478
3479 fi
3480
3481 cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE
3482
3483 cf_save_CFLAGS="$CFLAGS"
3484 cf_save_CPPFLAGS="$CPPFLAGS"
3485
3486 cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \
3487         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3488                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3489
3490 cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \
3491         sed     -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?[         ]/ /g' \
3492                 -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^     ]*\)\?$//g'`
3493
3494 echo "$as_me:3494: checking if we should define _POSIX_C_SOURCE" >&5
3495 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6
3496 if test "${cf_cv_posix_c_source+set}" = set; then
3497   echo $ECHO_N "(cached) $ECHO_C" >&6
3498 else
3499
3500 echo "${as_me:-configure}:3500: testing if the symbol is already defined go no further ..." 1>&5
3501
3502         cat >conftest.$ac_ext <<_ACEOF
3503 #line 3503 "configure"
3504 #include "confdefs.h"
3505 #include <sys/types.h>
3506 int
3507 main ()
3508 {
3509
3510 #ifndef _POSIX_C_SOURCE
3511 make an error
3512 #endif
3513   ;
3514   return 0;
3515 }
3516 _ACEOF
3517 rm -f conftest.$ac_objext
3518 if { (eval echo "$as_me:3518: \"$ac_compile\"") >&5
3519   (eval $ac_compile) 2>&5
3520   ac_status=$?
3521   echo "$as_me:3521: \$? = $ac_status" >&5
3522   (exit $ac_status); } &&
3523          { ac_try='test -s conftest.$ac_objext'
3524   { (eval echo "$as_me:3524: \"$ac_try\"") >&5
3525   (eval $ac_try) 2>&5
3526   ac_status=$?
3527   echo "$as_me:3527: \$? = $ac_status" >&5
3528   (exit $ac_status); }; }; then
3529   cf_cv_posix_c_source=no
3530 else
3531   echo "$as_me: failed program was:" >&5
3532 cat conftest.$ac_ext >&5
3533 cf_want_posix_source=no
3534          case .$cf_POSIX_C_SOURCE in #(vi
3535          .[12]??*) #(vi
3536                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3537                 ;;
3538          .2) #(vi
3539                 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3540                 cf_want_posix_source=yes
3541                 ;;
3542          .*)
3543                 cf_want_posix_source=yes
3544                 ;;
3545          esac
3546          if test "$cf_want_posix_source" = yes ; then
3547                 cat >conftest.$ac_ext <<_ACEOF
3548 #line 3548 "configure"
3549 #include "confdefs.h"
3550 #include <sys/types.h>
3551 int
3552 main ()
3553 {
3554
3555 #ifdef _POSIX_SOURCE
3556 make an error
3557 #endif
3558   ;
3559   return 0;
3560 }
3561 _ACEOF
3562 rm -f conftest.$ac_objext
3563 if { (eval echo "$as_me:3563: \"$ac_compile\"") >&5
3564   (eval $ac_compile) 2>&5
3565   ac_status=$?
3566   echo "$as_me:3566: \$? = $ac_status" >&5
3567   (exit $ac_status); } &&
3568          { ac_try='test -s conftest.$ac_objext'
3569   { (eval echo "$as_me:3569: \"$ac_try\"") >&5
3570   (eval $ac_try) 2>&5
3571   ac_status=$?
3572   echo "$as_me:3572: \$? = $ac_status" >&5
3573   (exit $ac_status); }; }; then
3574   :
3575 else
3576   echo "$as_me: failed program was:" >&5
3577 cat conftest.$ac_ext >&5
3578 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE"
3579 fi
3580 rm -f conftest.$ac_objext conftest.$ac_ext
3581          fi
3582
3583 echo "${as_me:-configure}:3583: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5
3584
3585          CFLAGS="$cf_trim_CFLAGS"
3586          CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source"
3587
3588 echo "${as_me:-configure}:3588: testing if the second compile does not leave our definition intact error ..." 1>&5
3589
3590          cat >conftest.$ac_ext <<_ACEOF
3591 #line 3591 "configure"
3592 #include "confdefs.h"
3593 #include <sys/types.h>
3594 int
3595 main ()
3596 {
3597
3598 #ifndef _POSIX_C_SOURCE
3599 make an error
3600 #endif
3601   ;
3602   return 0;
3603 }
3604 _ACEOF
3605 rm -f conftest.$ac_objext
3606 if { (eval echo "$as_me:3606: \"$ac_compile\"") >&5
3607   (eval $ac_compile) 2>&5
3608   ac_status=$?
3609   echo "$as_me:3609: \$? = $ac_status" >&5
3610   (exit $ac_status); } &&
3611          { ac_try='test -s conftest.$ac_objext'
3612   { (eval echo "$as_me:3612: \"$ac_try\"") >&5
3613   (eval $ac_try) 2>&5
3614   ac_status=$?
3615   echo "$as_me:3615: \$? = $ac_status" >&5
3616   (exit $ac_status); }; }; then
3617   :
3618 else
3619   echo "$as_me: failed program was:" >&5
3620 cat conftest.$ac_ext >&5
3621 cf_cv_posix_c_source=no
3622 fi
3623 rm -f conftest.$ac_objext conftest.$ac_ext
3624          CFLAGS="$cf_save_CFLAGS"
3625          CPPFLAGS="$cf_save_CPPFLAGS"
3626
3627 fi
3628 rm -f conftest.$ac_objext conftest.$ac_ext
3629
3630 fi
3631 echo "$as_me:3631: result: $cf_cv_posix_c_source" >&5
3632 echo "${ECHO_T}$cf_cv_posix_c_source" >&6
3633
3634 if test "$cf_cv_posix_c_source" != no ; then
3635         CFLAGS="$cf_trim_CFLAGS"
3636         CPPFLAGS="$cf_trim_CPPFLAGS"
3637
3638 cf_fix_cppflags=no
3639 cf_new_cflags=
3640 cf_new_cppflags=
3641 cf_new_extra_cppflags=
3642
3643 for cf_add_cflags in $cf_cv_posix_c_source
3644 do
3645 case $cf_fix_cppflags in
3646 no)
3647         case $cf_add_cflags in #(vi
3648         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3649                 case $cf_add_cflags in
3650                 -D*)
3651                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3652
3653                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3654                                 && test -z "${cf_tst_cflags}" \
3655                                 && cf_fix_cppflags=yes
3656
3657                         if test $cf_fix_cppflags = yes ; then
3658                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3659                                 continue
3660                         elif test "${cf_tst_cflags}" = "\"'" ; then
3661                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3662                                 continue
3663                         fi
3664                         ;;
3665                 esac
3666                 case "$CPPFLAGS" in
3667                 *$cf_add_cflags) #(vi
3668                         ;;
3669                 *) #(vi
3670                         case $cf_add_cflags in #(vi
3671                         -D*)
3672                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3673
3674 CPPFLAGS=`echo "$CPPFLAGS" | \
3675         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3676                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3677
3678                                 ;;
3679                         esac
3680                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3681                         ;;
3682                 esac
3683                 ;;
3684         *)
3685                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3686                 ;;
3687         esac
3688         ;;
3689 yes)
3690         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3691
3692         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3693
3694         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3695                 && test -z "${cf_tst_cflags}" \
3696                 && cf_fix_cppflags=no
3697         ;;
3698 esac
3699 done
3700
3701 if test -n "$cf_new_cflags" ; then
3702
3703         CFLAGS="$CFLAGS $cf_new_cflags"
3704 fi
3705
3706 if test -n "$cf_new_cppflags" ; then
3707
3708         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3709 fi
3710
3711 if test -n "$cf_new_extra_cppflags" ; then
3712
3713         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3714 fi
3715
3716 fi
3717
3718         ;;
3719 esac
3720
3721 if test -n "$cf_xopen_source" ; then
3722
3723 cf_fix_cppflags=no
3724 cf_new_cflags=
3725 cf_new_cppflags=
3726 cf_new_extra_cppflags=
3727
3728 for cf_add_cflags in $cf_xopen_source
3729 do
3730 case $cf_fix_cppflags in
3731 no)
3732         case $cf_add_cflags in #(vi
3733         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3734                 case $cf_add_cflags in
3735                 -D*)
3736                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
3737
3738                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3739                                 && test -z "${cf_tst_cflags}" \
3740                                 && cf_fix_cppflags=yes
3741
3742                         if test $cf_fix_cppflags = yes ; then
3743                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3744                                 continue
3745                         elif test "${cf_tst_cflags}" = "\"'" ; then
3746                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3747                                 continue
3748                         fi
3749                         ;;
3750                 esac
3751                 case "$CPPFLAGS" in
3752                 *$cf_add_cflags) #(vi
3753                         ;;
3754                 *) #(vi
3755                         case $cf_add_cflags in #(vi
3756                         -D*)
3757                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
3758
3759 CPPFLAGS=`echo "$CPPFLAGS" | \
3760         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
3761                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
3762
3763                                 ;;
3764                         esac
3765                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
3766                         ;;
3767                 esac
3768                 ;;
3769         *)
3770                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
3771                 ;;
3772         esac
3773         ;;
3774 yes)
3775         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
3776
3777         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
3778
3779         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
3780                 && test -z "${cf_tst_cflags}" \
3781                 && cf_fix_cppflags=no
3782         ;;
3783 esac
3784 done
3785
3786 if test -n "$cf_new_cflags" ; then
3787
3788         CFLAGS="$CFLAGS $cf_new_cflags"
3789 fi
3790
3791 if test -n "$cf_new_cppflags" ; then
3792
3793         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
3794 fi
3795
3796 if test -n "$cf_new_extra_cppflags" ; then
3797
3798         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
3799 fi
3800
3801 fi
3802
3803 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
3804         echo "$as_me:3804: checking if _XOPEN_SOURCE really is set" >&5
3805 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
3806         cat >conftest.$ac_ext <<_ACEOF
3807 #line 3807 "configure"
3808 #include "confdefs.h"
3809 #include <stdlib.h>
3810 int
3811 main ()
3812 {
3813
3814 #ifndef _XOPEN_SOURCE
3815 make an error
3816 #endif
3817   ;
3818   return 0;
3819 }
3820 _ACEOF
3821 rm -f conftest.$ac_objext
3822 if { (eval echo "$as_me:3822: \"$ac_compile\"") >&5
3823   (eval $ac_compile) 2>&5
3824   ac_status=$?
3825   echo "$as_me:3825: \$? = $ac_status" >&5
3826   (exit $ac_status); } &&
3827          { ac_try='test -s conftest.$ac_objext'
3828   { (eval echo "$as_me:3828: \"$ac_try\"") >&5
3829   (eval $ac_try) 2>&5
3830   ac_status=$?
3831   echo "$as_me:3831: \$? = $ac_status" >&5
3832   (exit $ac_status); }; }; then
3833   cf_XOPEN_SOURCE_set=yes
3834 else
3835   echo "$as_me: failed program was:" >&5
3836 cat conftest.$ac_ext >&5
3837 cf_XOPEN_SOURCE_set=no
3838 fi
3839 rm -f conftest.$ac_objext conftest.$ac_ext
3840         echo "$as_me:3840: result: $cf_XOPEN_SOURCE_set" >&5
3841 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
3842         if test $cf_XOPEN_SOURCE_set = yes
3843         then
3844                 cat >conftest.$ac_ext <<_ACEOF
3845 #line 3845 "configure"
3846 #include "confdefs.h"
3847 #include <stdlib.h>
3848 int
3849 main ()
3850 {
3851
3852 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
3853 make an error
3854 #endif
3855   ;
3856   return 0;
3857 }
3858 _ACEOF
3859 rm -f conftest.$ac_objext
3860 if { (eval echo "$as_me:3860: \"$ac_compile\"") >&5
3861   (eval $ac_compile) 2>&5
3862   ac_status=$?
3863   echo "$as_me:3863: \$? = $ac_status" >&5
3864   (exit $ac_status); } &&
3865          { ac_try='test -s conftest.$ac_objext'
3866   { (eval echo "$as_me:3866: \"$ac_try\"") >&5
3867   (eval $ac_try) 2>&5
3868   ac_status=$?
3869   echo "$as_me:3869: \$? = $ac_status" >&5
3870   (exit $ac_status); }; }; then
3871   cf_XOPEN_SOURCE_set_ok=yes
3872 else
3873   echo "$as_me: failed program was:" >&5
3874 cat conftest.$ac_ext >&5
3875 cf_XOPEN_SOURCE_set_ok=no
3876 fi
3877 rm -f conftest.$ac_objext conftest.$ac_ext
3878                 if test $cf_XOPEN_SOURCE_set_ok = no
3879                 then
3880                         { echo "$as_me:3880: WARNING: _XOPEN_SOURCE is lower than requested" >&5
3881 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
3882                 fi
3883         else
3884
3885 echo "$as_me:3885: checking if we should define _XOPEN_SOURCE" >&5
3886 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
3887 if test "${cf_cv_xopen_source+set}" = set; then
3888   echo $ECHO_N "(cached) $ECHO_C" >&6
3889 else
3890
3891         cat >conftest.$ac_ext <<_ACEOF
3892 #line 3892 "configure"
3893 #include "confdefs.h"
3894
3895 #include <stdlib.h>
3896 #include <string.h>
3897 #include <sys/types.h>
3898
3899 int
3900 main ()
3901 {
3902
3903 #ifndef _XOPEN_SOURCE
3904 make an error
3905 #endif
3906   ;
3907   return 0;
3908 }
3909 _ACEOF
3910 rm -f conftest.$ac_objext
3911 if { (eval echo "$as_me:3911: \"$ac_compile\"") >&5
3912   (eval $ac_compile) 2>&5
3913   ac_status=$?
3914   echo "$as_me:3914: \$? = $ac_status" >&5
3915   (exit $ac_status); } &&
3916          { ac_try='test -s conftest.$ac_objext'
3917   { (eval echo "$as_me:3917: \"$ac_try\"") >&5
3918   (eval $ac_try) 2>&5
3919   ac_status=$?
3920   echo "$as_me:3920: \$? = $ac_status" >&5
3921   (exit $ac_status); }; }; then
3922   cf_cv_xopen_source=no
3923 else
3924   echo "$as_me: failed program was:" >&5
3925 cat conftest.$ac_ext >&5
3926 cf_save="$CPPFLAGS"
3927          CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
3928          cat >conftest.$ac_ext <<_ACEOF
3929 #line 3929 "configure"
3930 #include "confdefs.h"
3931
3932 #include <stdlib.h>
3933 #include <string.h>
3934 #include <sys/types.h>
3935
3936 int
3937 main ()
3938 {
3939
3940 #ifdef _XOPEN_SOURCE
3941 make an error
3942 #endif
3943   ;
3944   return 0;
3945 }
3946 _ACEOF
3947 rm -f conftest.$ac_objext
3948 if { (eval echo "$as_me:3948: \"$ac_compile\"") >&5
3949   (eval $ac_compile) 2>&5
3950   ac_status=$?
3951   echo "$as_me:3951: \$? = $ac_status" >&5
3952   (exit $ac_status); } &&
3953          { ac_try='test -s conftest.$ac_objext'
3954   { (eval echo "$as_me:3954: \"$ac_try\"") >&5
3955   (eval $ac_try) 2>&5
3956   ac_status=$?
3957   echo "$as_me:3957: \$? = $ac_status" >&5
3958   (exit $ac_status); }; }; then
3959   cf_cv_xopen_source=no
3960 else
3961   echo "$as_me: failed program was:" >&5
3962 cat conftest.$ac_ext >&5
3963 cf_cv_xopen_source=$cf_XOPEN_SOURCE
3964 fi
3965 rm -f conftest.$ac_objext conftest.$ac_ext
3966         CPPFLAGS="$cf_save"
3967
3968 fi
3969 rm -f conftest.$ac_objext conftest.$ac_ext
3970
3971 fi
3972 echo "$as_me:3972: result: $cf_cv_xopen_source" >&5
3973 echo "${ECHO_T}$cf_cv_xopen_source" >&6
3974
3975 if test "$cf_cv_xopen_source" != no ; then
3976
3977 CFLAGS=`echo "$CFLAGS" | \
3978         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3979                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3980
3981 CPPFLAGS=`echo "$CPPFLAGS" | \
3982         sed     -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?[         ]/ /g' \
3983                 -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^       ]*\)\?$//g'`
3984
3985         cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
3986
3987 cf_fix_cppflags=no
3988 cf_new_cflags=
3989 cf_new_cppflags=
3990 cf_new_extra_cppflags=
3991
3992 for cf_add_cflags in $cf_temp_xopen_source
3993 do
3994 case $cf_fix_cppflags in
3995 no)
3996         case $cf_add_cflags in #(vi
3997         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
3998                 case $cf_add_cflags in
3999                 -D*)
4000                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4001
4002                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4003                                 && test -z "${cf_tst_cflags}" \
4004                                 && cf_fix_cppflags=yes
4005
4006                         if test $cf_fix_cppflags = yes ; then
4007                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4008                                 continue
4009                         elif test "${cf_tst_cflags}" = "\"'" ; then
4010                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4011                                 continue
4012                         fi
4013                         ;;
4014                 esac
4015                 case "$CPPFLAGS" in
4016                 *$cf_add_cflags) #(vi
4017                         ;;
4018                 *) #(vi
4019                         case $cf_add_cflags in #(vi
4020                         -D*)
4021                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4022
4023 CPPFLAGS=`echo "$CPPFLAGS" | \
4024         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4025                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4026
4027                                 ;;
4028                         esac
4029                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4030                         ;;
4031                 esac
4032                 ;;
4033         *)
4034                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4035                 ;;
4036         esac
4037         ;;
4038 yes)
4039         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4040
4041         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4042
4043         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4044                 && test -z "${cf_tst_cflags}" \
4045                 && cf_fix_cppflags=no
4046         ;;
4047 esac
4048 done
4049
4050 if test -n "$cf_new_cflags" ; then
4051
4052         CFLAGS="$CFLAGS $cf_new_cflags"
4053 fi
4054
4055 if test -n "$cf_new_cppflags" ; then
4056
4057         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4058 fi
4059
4060 if test -n "$cf_new_extra_cppflags" ; then
4061
4062         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4063 fi
4064
4065 fi
4066
4067         fi
4068 fi
4069
4070 echo "$as_me:4070: checking for $CC option to accept ANSI C" >&5
4071 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
4072 if test "${ac_cv_prog_cc_stdc+set}" = set; then
4073   echo $ECHO_N "(cached) $ECHO_C" >&6
4074 else
4075   ac_cv_prog_cc_stdc=no
4076 ac_save_CC=$CC
4077 cat >conftest.$ac_ext <<_ACEOF
4078 #line 4078 "configure"
4079 #include "confdefs.h"
4080 #include <stdarg.h>
4081 #include <stdio.h>
4082 #include <sys/types.h>
4083 #include <sys/stat.h>
4084 /* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
4085 struct buf { int x; };
4086 FILE * (*rcsopen) (struct buf *, struct stat *, int);
4087 static char *e (p, i)
4088      char **p;
4089      int i;
4090 {
4091   return p[i];
4092 }
4093 static char *f (char * (*g) (char **, int), char **p, ...)
4094 {
4095   char *s;
4096   va_list v;
4097   va_start (v,p);
4098   s = g (p, va_arg (v,int));
4099   va_end (v);
4100   return s;
4101 }
4102 int test (int i, double x);
4103 struct s1 {int (*f) (int a);};
4104 struct s2 {int (*f) (double a);};
4105 int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
4106 int argc;
4107 char **argv;
4108 int
4109 main ()
4110 {
4111 return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
4112   ;
4113   return 0;
4114 }
4115 _ACEOF
4116 # Don't try gcc -ansi; that turns off useful extensions and
4117 # breaks some systems' header files.
4118 # AIX                   -qlanglvl=ansi
4119 # Ultrix and OSF/1      -std1
4120 # HP-UX 10.20 and later -Ae
4121 # HP-UX older versions  -Aa -D_HPUX_SOURCE
4122 # SVR4                  -Xc -D__EXTENSIONS__
4123 for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
4124 do
4125   CC="$ac_save_CC $ac_arg"
4126   rm -f conftest.$ac_objext
4127 if { (eval echo "$as_me:4127: \"$ac_compile\"") >&5
4128   (eval $ac_compile) 2>&5
4129   ac_status=$?
4130   echo "$as_me:4130: \$? = $ac_status" >&5
4131   (exit $ac_status); } &&
4132          { ac_try='test -s conftest.$ac_objext'
4133   { (eval echo "$as_me:4133: \"$ac_try\"") >&5
4134   (eval $ac_try) 2>&5
4135   ac_status=$?
4136   echo "$as_me:4136: \$? = $ac_status" >&5
4137   (exit $ac_status); }; }; then
4138   ac_cv_prog_cc_stdc=$ac_arg
4139 break
4140 else
4141   echo "$as_me: failed program was:" >&5
4142 cat conftest.$ac_ext >&5
4143 fi
4144 rm -f conftest.$ac_objext
4145 done
4146 rm -f conftest.$ac_ext conftest.$ac_objext
4147 CC=$ac_save_CC
4148
4149 fi
4150
4151 case "x$ac_cv_prog_cc_stdc" in
4152   x|xno)
4153     echo "$as_me:4153: result: none needed" >&5
4154 echo "${ECHO_T}none needed" >&6 ;;
4155   *)
4156     echo "$as_me:4156: result: $ac_cv_prog_cc_stdc" >&5
4157 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
4158     CC="$CC $ac_cv_prog_cc_stdc" ;;
4159 esac
4160
4161 echo "$as_me:4161: checking for an ANSI C-conforming const" >&5
4162 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
4163 if test "${ac_cv_c_const+set}" = set; then
4164   echo $ECHO_N "(cached) $ECHO_C" >&6
4165 else
4166   cat >conftest.$ac_ext <<_ACEOF
4167 #line 4167 "configure"
4168 #include "confdefs.h"
4169
4170 int
4171 main ()
4172 {
4173 /* FIXME: Include the comments suggested by Paul. */
4174 #ifndef __cplusplus
4175   /* Ultrix mips cc rejects this.  */
4176   typedef int charset[2];
4177   const charset x;
4178   /* SunOS 4.1.1 cc rejects this.  */
4179   char const *const *ccp;
4180   char **p;
4181   /* NEC SVR4.0.2 mips cc rejects this.  */
4182   struct point {int x, y;};
4183   static struct point const zero = {0,0};
4184   /* AIX XL C 1.02.0.0 rejects this.
4185      It does not let you subtract one const X* pointer from another in
4186      an arm of an if-expression whose if-part is not a constant
4187      expression */
4188   const char *g = "string";
4189   ccp = &g + (g ? g-g : 0);
4190   /* HPUX 7.0 cc rejects these. */
4191   ++ccp;
4192   p = (char**) ccp;
4193   ccp = (char const *const *) p;
4194   { /* SCO 3.2v4 cc rejects this.  */
4195     char *t;
4196     char const *s = 0 ? (char *) 0 : (char const *) 0;
4197
4198     *t++ = 0;
4199   }
4200   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
4201     int x[] = {25, 17};
4202     const int *foo = &x[0];
4203     ++foo;
4204   }
4205   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
4206     typedef const int *iptr;
4207     iptr p = 0;
4208     ++p;
4209   }
4210   { /* AIX XL C 1.02.0.0 rejects this saying
4211        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
4212     struct s { int j; const int *ap[3]; };
4213     struct s *b; b->j = 5;
4214   }
4215   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
4216     const int foo = 10;
4217   }
4218 #endif
4219
4220   ;
4221   return 0;
4222 }
4223 _ACEOF
4224 rm -f conftest.$ac_objext
4225 if { (eval echo "$as_me:4225: \"$ac_compile\"") >&5
4226   (eval $ac_compile) 2>&5
4227   ac_status=$?
4228   echo "$as_me:4228: \$? = $ac_status" >&5
4229   (exit $ac_status); } &&
4230          { ac_try='test -s conftest.$ac_objext'
4231   { (eval echo "$as_me:4231: \"$ac_try\"") >&5
4232   (eval $ac_try) 2>&5
4233   ac_status=$?
4234   echo "$as_me:4234: \$? = $ac_status" >&5
4235   (exit $ac_status); }; }; then
4236   ac_cv_c_const=yes
4237 else
4238   echo "$as_me: failed program was:" >&5
4239 cat conftest.$ac_ext >&5
4240 ac_cv_c_const=no
4241 fi
4242 rm -f conftest.$ac_objext conftest.$ac_ext
4243 fi
4244 echo "$as_me:4244: result: $ac_cv_c_const" >&5
4245 echo "${ECHO_T}$ac_cv_c_const" >&6
4246 if test $ac_cv_c_const = no; then
4247
4248 cat >>confdefs.h <<\EOF
4249 #define const
4250 EOF
4251
4252 fi
4253
4254 echo "$as_me:4254: checking for signal global datatype" >&5
4255 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6
4256 if test "${cf_cv_sig_atomic_t+set}" = set; then
4257   echo $ECHO_N "(cached) $ECHO_C" >&6
4258 else
4259
4260         for cf_type in \
4261                 "volatile sig_atomic_t" \
4262                 "sig_atomic_t" \
4263                 "int"
4264         do
4265         cat >conftest.$ac_ext <<_ACEOF
4266 #line 4266 "configure"
4267 #include "confdefs.h"
4268
4269 #include <sys/types.h>
4270 #include <signal.h>
4271 #include <stdio.h>
4272
4273 extern $cf_type x;
4274 $cf_type x;
4275 static void handler(int sig)
4276 {
4277         x = 5;
4278 }
4279 int
4280 main ()
4281 {
4282 signal(SIGINT, handler);
4283                  x = 1
4284   ;
4285   return 0;
4286 }
4287 _ACEOF
4288 rm -f conftest.$ac_objext
4289 if { (eval echo "$as_me:4289: \"$ac_compile\"") >&5
4290   (eval $ac_compile) 2>&5
4291   ac_status=$?
4292   echo "$as_me:4292: \$? = $ac_status" >&5
4293   (exit $ac_status); } &&
4294          { ac_try='test -s conftest.$ac_objext'
4295   { (eval echo "$as_me:4295: \"$ac_try\"") >&5
4296   (eval $ac_try) 2>&5
4297   ac_status=$?
4298   echo "$as_me:4298: \$? = $ac_status" >&5
4299   (exit $ac_status); }; }; then
4300   cf_cv_sig_atomic_t=$cf_type
4301 else
4302   echo "$as_me: failed program was:" >&5
4303 cat conftest.$ac_ext >&5
4304 cf_cv_sig_atomic_t=no
4305 fi
4306 rm -f conftest.$ac_objext conftest.$ac_ext
4307                 test "$cf_cv_sig_atomic_t" != no && break
4308         done
4309
4310 fi
4311
4312 echo "$as_me:4312: result: $cf_cv_sig_atomic_t" >&5
4313 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6
4314 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <<EOF
4315 #define SIG_ATOMIC_T $cf_cv_sig_atomic_t
4316 EOF
4317
4318 echo "$as_me:4318: checking if you want to see long compiling messages" >&5
4319 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6
4320
4321 # Check whether --enable-echo or --disable-echo was given.
4322 if test "${enable_echo+set}" = set; then
4323   enableval="$enable_echo"
4324   test "$enableval" != no && enableval=yes
4325   if test "$enableval" != "yes" ; then
4326
4327     ECHO_LT='--silent'
4328     ECHO_LD='@echo linking $@;'
4329     RULE_CC='@echo compiling $<'
4330     SHOW_CC='@echo compiling $@'
4331     ECHO_CC='@'
4332
4333   else
4334
4335     ECHO_LT=''
4336     ECHO_LD=''
4337     RULE_CC=''
4338     SHOW_CC=''
4339     ECHO_CC=''
4340
4341   fi
4342 else
4343   enableval=yes
4344
4345     ECHO_LT=''
4346     ECHO_LD=''
4347     RULE_CC=''
4348     SHOW_CC=''
4349     ECHO_CC=''
4350
4351 fi;
4352 echo "$as_me:4352: result: $enableval" >&5
4353 echo "${ECHO_T}$enableval" >&6
4354
4355 GCC_VERSION=none
4356 if test "$GCC" = yes ; then
4357         echo "$as_me:4357: checking version of $CC" >&5
4358 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6
4359         GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`"
4360         test -z "$GCC_VERSION" && GCC_VERSION=unknown
4361         echo "$as_me:4361: result: $GCC_VERSION" >&5
4362 echo "${ECHO_T}$GCC_VERSION" >&6
4363 fi
4364
4365 if ( test "$GCC" = yes || test "$GXX" = yes )
4366 then
4367 echo "$as_me:4367: checking if you want to turn on gcc warnings" >&5
4368 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6
4369
4370 # Check whether --enable-warnings or --disable-warnings was given.
4371 if test "${enable_warnings+set}" = set; then
4372   enableval="$enable_warnings"
4373   test "$enableval" != yes && enableval=no
4374   if test "$enableval" != "no" ; then
4375     with_warnings=yes
4376   else
4377     with_warnings=no
4378   fi
4379 else
4380   enableval=no
4381   with_warnings=no
4382
4383 fi;
4384 echo "$as_me:4384: result: $with_warnings" >&5
4385 echo "${ECHO_T}$with_warnings" >&6
4386 if test "$with_warnings" = "yes"
4387 then
4388
4389 if test "$GCC" = yes
4390 then
4391 cat > conftest.i <<EOF
4392 #ifndef GCC_PRINTF
4393 #define GCC_PRINTF 0
4394 #endif
4395 #ifndef GCC_SCANF
4396 #define GCC_SCANF 0
4397 #endif
4398 #ifndef GCC_NORETURN
4399 #define GCC_NORETURN /* nothing */
4400 #endif
4401 #ifndef GCC_UNUSED
4402 #define GCC_UNUSED /* nothing */
4403 #endif
4404 EOF
4405 if test "$GCC" = yes
4406 then
4407         { echo "$as_me:4407: checking for $CC __attribute__ directives..." >&5
4408 echo "$as_me: checking for $CC __attribute__ directives..." >&6;}
4409 cat > conftest.$ac_ext <<EOF
4410 #line 4410 "${as_me:-configure}"
4411 #include "confdefs.h"
4412 #include "conftest.h"
4413 #include "conftest.i"
4414 #if     GCC_PRINTF
4415 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4416 #else
4417 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
4418 #endif
4419 #if     GCC_SCANF
4420 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4421 #else
4422 #define GCC_SCANFLIKE(fmt,var)  /*nothing*/
4423 #endif
4424 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
4425 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
4426 extern void foo(void) GCC_NORETURN;
4427 int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { return 0; }
4428 EOF
4429         cf_printf_attribute=no
4430         cf_scanf_attribute=no
4431         for cf_attribute in scanf printf unused noreturn
4432         do
4433
4434 cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4435
4436                 cf_directive="__attribute__(($cf_attribute))"
4437                 echo "checking for $CC $cf_directive" 1>&5
4438
4439                 case $cf_attribute in #(vi
4440                 printf) #(vi
4441                         cf_printf_attribute=yes
4442                         cat >conftest.h <<EOF
4443 #define GCC_$cf_ATTRIBUTE 1
4444 EOF
4445                         ;;
4446                 scanf) #(vi
4447                         cf_scanf_attribute=yes
4448                         cat >conftest.h <<EOF
4449 #define GCC_$cf_ATTRIBUTE 1
4450 EOF
4451                         ;;
4452                 *) #(vi
4453                         cat >conftest.h <<EOF
4454 #define GCC_$cf_ATTRIBUTE $cf_directive
4455 EOF
4456                         ;;
4457                 esac
4458
4459                 if { (eval echo "$as_me:4459: \"$ac_compile\"") >&5
4460   (eval $ac_compile) 2>&5
4461   ac_status=$?
4462   echo "$as_me:4462: \$? = $ac_status" >&5
4463   (exit $ac_status); }; then
4464                         test -n "$verbose" && echo "$as_me:4464: result: ... $cf_attribute" >&5
4465 echo "${ECHO_T}... $cf_attribute" >&6
4466                         cat conftest.h >>confdefs.h
4467                         case $cf_attribute in #(vi
4468                         printf) #(vi
4469                                 if test "$cf_printf_attribute" = no ; then
4470                                         cat >>confdefs.h <<EOF
4471 #define GCC_PRINTFLIKE(fmt,var) /* nothing */
4472 EOF
4473                                 else
4474                                         cat >>confdefs.h <<EOF
4475 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
4476 EOF
4477                                 fi
4478                                 ;;
4479                         scanf) #(vi
4480                                 if test "$cf_scanf_attribute" = no ; then
4481                                         cat >>confdefs.h <<EOF
4482 #define GCC_SCANFLIKE(fmt,var) /* nothing */
4483 EOF
4484                                 else
4485                                         cat >>confdefs.h <<EOF
4486 #define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,fmt,var)))
4487 EOF
4488                                 fi
4489                                 ;;
4490                         esac
4491                 fi
4492         done
4493 else
4494         fgrep define conftest.i >>confdefs.h
4495 fi
4496 rm -rf conftest*
4497 fi
4498
4499 INTEL_COMPILER=no
4500
4501 if test "$GCC" = yes ; then
4502         case $host_os in
4503         linux*|gnu*)
4504                 echo "$as_me:4504: checking if this is really Intel C compiler" >&5
4505 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6
4506                 cf_save_CFLAGS="$CFLAGS"
4507                 CFLAGS="$CFLAGS -no-gcc"
4508                 cat >conftest.$ac_ext <<_ACEOF
4509 #line 4509 "configure"
4510 #include "confdefs.h"
4511
4512 int
4513 main ()
4514 {
4515
4516 #ifdef __INTEL_COMPILER
4517 #else
4518 make an error
4519 #endif
4520
4521   ;
4522   return 0;
4523 }
4524 _ACEOF
4525 rm -f conftest.$ac_objext
4526 if { (eval echo "$as_me:4526: \"$ac_compile\"") >&5
4527   (eval $ac_compile) 2>&5
4528   ac_status=$?
4529   echo "$as_me:4529: \$? = $ac_status" >&5
4530   (exit $ac_status); } &&
4531          { ac_try='test -s conftest.$ac_objext'
4532   { (eval echo "$as_me:4532: \"$ac_try\"") >&5
4533   (eval $ac_try) 2>&5
4534   ac_status=$?
4535   echo "$as_me:4535: \$? = $ac_status" >&5
4536   (exit $ac_status); }; }; then
4537   INTEL_COMPILER=yes
4538 cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc"
4539
4540 else
4541   echo "$as_me: failed program was:" >&5
4542 cat conftest.$ac_ext >&5
4543 fi
4544 rm -f conftest.$ac_objext conftest.$ac_ext
4545                 CFLAGS="$cf_save_CFLAGS"
4546                 echo "$as_me:4546: result: $INTEL_COMPILER" >&5
4547 echo "${ECHO_T}$INTEL_COMPILER" >&6
4548                 ;;
4549         esac
4550 fi
4551
4552 cat > conftest.$ac_ext <<EOF
4553 #line 4553 "${as_me:-configure}"
4554 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4555 EOF
4556
4557 if test "$INTEL_COMPILER" = yes
4558 then
4559 # The "-wdXXX" options suppress warnings:
4560 # remark #1419: external declaration in primary source file
4561 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4562 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4563 # remark #193: zero used for undefined preprocessing identifier
4564 # remark #593: variable "curs_sb_left_arrow" was set but never used
4565 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4566 # remark #869: parameter "tw" was never referenced
4567 # remark #981: operands are evaluated in unspecified order
4568 # warning #279: controlling expression is constant
4569
4570         { echo "$as_me:4570: checking for $CC warning options..." >&5
4571 echo "$as_me: checking for $CC warning options..." >&6;}
4572         cf_save_CFLAGS="$CFLAGS"
4573         EXTRA_CFLAGS="-Wall"
4574         for cf_opt in \
4575                 wd1419 \
4576                 wd1683 \
4577                 wd1684 \
4578                 wd193 \
4579                 wd593 \
4580                 wd279 \
4581                 wd810 \
4582                 wd869 \
4583                 wd981
4584         do
4585                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4586                 if { (eval echo "$as_me:4586: \"$ac_compile\"") >&5
4587   (eval $ac_compile) 2>&5
4588   ac_status=$?
4589   echo "$as_me:4589: \$? = $ac_status" >&5
4590   (exit $ac_status); }; then
4591                         test -n "$verbose" && echo "$as_me:4591: result: ... -$cf_opt" >&5
4592 echo "${ECHO_T}... -$cf_opt" >&6
4593                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4594                 fi
4595         done
4596         CFLAGS="$cf_save_CFLAGS"
4597
4598 elif test "$GCC" = yes
4599 then
4600         { echo "$as_me:4600: checking for $CC warning options..." >&5
4601 echo "$as_me: checking for $CC warning options..." >&6;}
4602         cf_save_CFLAGS="$CFLAGS"
4603         EXTRA_CFLAGS=
4604         cf_warn_CONST=""
4605         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4606         for cf_opt in W Wall \
4607                 Wbad-function-cast \
4608                 Wcast-align \
4609                 Wcast-qual \
4610                 Winline \
4611                 Wmissing-declarations \
4612                 Wmissing-prototypes \
4613                 Wnested-externs \
4614                 Wpointer-arith \
4615                 Wshadow \
4616                 Wstrict-prototypes \
4617                 Wundef $cf_warn_CONST
4618         do
4619                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4620                 if { (eval echo "$as_me:4620: \"$ac_compile\"") >&5
4621   (eval $ac_compile) 2>&5
4622   ac_status=$?
4623   echo "$as_me:4623: \$? = $ac_status" >&5
4624   (exit $ac_status); }; then
4625                         test -n "$verbose" && echo "$as_me:4625: result: ... -$cf_opt" >&5
4626 echo "${ECHO_T}... -$cf_opt" >&6
4627                         case $cf_opt in #(vi
4628                         Wcast-qual) #(vi
4629                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4630                                 ;;
4631                         Winline) #(vi
4632                                 case $GCC_VERSION in
4633                                 [34].*)
4634                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4635
4636 echo "${as_me:-configure}:4636: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4637
4638                                         continue;;
4639                                 esac
4640                                 ;;
4641                         Wpointer-arith) #(vi
4642                                 case $GCC_VERSION in
4643                                 [12].*)
4644                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4645
4646 echo "${as_me:-configure}:4646: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4647
4648                                         continue;;
4649                                 esac
4650                                 ;;
4651                         esac
4652                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4653                 fi
4654         done
4655         CFLAGS="$cf_save_CFLAGS"
4656 fi
4657 rm -rf conftest*
4658
4659 fi
4660 fi
4661
4662 echo "$as_me:4662: checking if you want to use dmalloc for testing" >&5
4663 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4664
4665 # Check whether --with-dmalloc or --without-dmalloc was given.
4666 if test "${with_dmalloc+set}" = set; then
4667   withval="$with_dmalloc"
4668   cat >>confdefs.h <<\EOF
4669 #define USE_DMALLOC 1
4670 EOF
4671
4672         : ${with_cflags:=-g}
4673         : ${with_no_leaks:=yes}
4674          with_dmalloc=yes
4675 else
4676   with_dmalloc=
4677 fi;
4678 echo "$as_me:4678: result: ${with_dmalloc:-no}" >&5
4679 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4680
4681 case .$with_cflags in #(vi
4682 .*-g*)
4683         case .$CFLAGS in #(vi
4684         .*-g*) #(vi
4685                 ;;
4686         *)
4687
4688 cf_fix_cppflags=no
4689 cf_new_cflags=
4690 cf_new_cppflags=
4691 cf_new_extra_cppflags=
4692
4693 for cf_add_cflags in -g
4694 do
4695 case $cf_fix_cppflags in
4696 no)
4697         case $cf_add_cflags in #(vi
4698         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4699                 case $cf_add_cflags in
4700                 -D*)
4701                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4702
4703                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4704                                 && test -z "${cf_tst_cflags}" \
4705                                 && cf_fix_cppflags=yes
4706
4707                         if test $cf_fix_cppflags = yes ; then
4708                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4709                                 continue
4710                         elif test "${cf_tst_cflags}" = "\"'" ; then
4711                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4712                                 continue
4713                         fi
4714                         ;;
4715                 esac
4716                 case "$CPPFLAGS" in
4717                 *$cf_add_cflags) #(vi
4718                         ;;
4719                 *) #(vi
4720                         case $cf_add_cflags in #(vi
4721                         -D*)
4722                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4723
4724 CPPFLAGS=`echo "$CPPFLAGS" | \
4725         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4726                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4727
4728                                 ;;
4729                         esac
4730                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4731                         ;;
4732                 esac
4733                 ;;
4734         *)
4735                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4736                 ;;
4737         esac
4738         ;;
4739 yes)
4740         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4741
4742         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4743
4744         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4745                 && test -z "${cf_tst_cflags}" \
4746                 && cf_fix_cppflags=no
4747         ;;
4748 esac
4749 done
4750
4751 if test -n "$cf_new_cflags" ; then
4752
4753         CFLAGS="$CFLAGS $cf_new_cflags"
4754 fi
4755
4756 if test -n "$cf_new_cppflags" ; then
4757
4758         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4759 fi
4760
4761 if test -n "$cf_new_extra_cppflags" ; then
4762
4763         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4764 fi
4765
4766                 ;;
4767         esac
4768         ;;
4769 esac
4770
4771 if test "$with_dmalloc" = yes ; then
4772         echo "$as_me:4772: checking for dmalloc.h" >&5
4773 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4774 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4775   echo $ECHO_N "(cached) $ECHO_C" >&6
4776 else
4777   cat >conftest.$ac_ext <<_ACEOF
4778 #line 4778 "configure"
4779 #include "confdefs.h"
4780 #include <dmalloc.h>
4781 _ACEOF
4782 if { (eval echo "$as_me:4782: \"$ac_cpp conftest.$ac_ext\"") >&5
4783   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4784   ac_status=$?
4785   egrep -v '^ *\+' conftest.er1 >conftest.err
4786   rm -f conftest.er1
4787   cat conftest.err >&5
4788   echo "$as_me:4788: \$? = $ac_status" >&5
4789   (exit $ac_status); } >/dev/null; then
4790   if test -s conftest.err; then
4791     ac_cpp_err=$ac_c_preproc_warn_flag
4792   else
4793     ac_cpp_err=
4794   fi
4795 else
4796   ac_cpp_err=yes
4797 fi
4798 if test -z "$ac_cpp_err"; then
4799   ac_cv_header_dmalloc_h=yes
4800 else
4801   echo "$as_me: failed program was:" >&5
4802   cat conftest.$ac_ext >&5
4803   ac_cv_header_dmalloc_h=no
4804 fi
4805 rm -f conftest.err conftest.$ac_ext
4806 fi
4807 echo "$as_me:4807: result: $ac_cv_header_dmalloc_h" >&5
4808 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4809 if test $ac_cv_header_dmalloc_h = yes; then
4810
4811 echo "$as_me:4811: checking for dmalloc_debug in -ldmalloc" >&5
4812 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4813 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4814   echo $ECHO_N "(cached) $ECHO_C" >&6
4815 else
4816   ac_check_lib_save_LIBS=$LIBS
4817 LIBS="-ldmalloc  $LIBS"
4818 cat >conftest.$ac_ext <<_ACEOF
4819 #line 4819 "configure"
4820 #include "confdefs.h"
4821
4822 /* Override any gcc2 internal prototype to avoid an error.  */
4823 #ifdef __cplusplus
4824 extern "C"
4825 #endif
4826 /* We use char because int might match the return type of a gcc2
4827    builtin and then its argument prototype would still apply.  */
4828 char dmalloc_debug ();
4829 int
4830 main ()
4831 {
4832 dmalloc_debug ();
4833   ;
4834   return 0;
4835 }
4836 _ACEOF
4837 rm -f conftest.$ac_objext conftest$ac_exeext
4838 if { (eval echo "$as_me:4838: \"$ac_link\"") >&5
4839   (eval $ac_link) 2>&5
4840   ac_status=$?
4841   echo "$as_me:4841: \$? = $ac_status" >&5
4842   (exit $ac_status); } &&
4843          { ac_try='test -s conftest$ac_exeext'
4844   { (eval echo "$as_me:4844: \"$ac_try\"") >&5
4845   (eval $ac_try) 2>&5
4846   ac_status=$?
4847   echo "$as_me:4847: \$? = $ac_status" >&5
4848   (exit $ac_status); }; }; then
4849   ac_cv_lib_dmalloc_dmalloc_debug=yes
4850 else
4851   echo "$as_me: failed program was:" >&5
4852 cat conftest.$ac_ext >&5
4853 ac_cv_lib_dmalloc_dmalloc_debug=no
4854 fi
4855 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4856 LIBS=$ac_check_lib_save_LIBS
4857 fi
4858 echo "$as_me:4858: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4859 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4860 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4861   cat >>confdefs.h <<EOF
4862 #define HAVE_LIBDMALLOC 1
4863 EOF
4864
4865   LIBS="-ldmalloc $LIBS"
4866
4867 fi
4868
4869 fi
4870
4871 fi
4872
4873 echo "$as_me:4873: checking if you want to use dbmalloc for testing" >&5
4874 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4875
4876 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4877 if test "${with_dbmalloc+set}" = set; then
4878   withval="$with_dbmalloc"
4879   cat >>confdefs.h <<\EOF
4880 #define USE_DBMALLOC 1
4881 EOF
4882
4883         : ${with_cflags:=-g}
4884         : ${with_no_leaks:=yes}
4885          with_dbmalloc=yes
4886 else
4887   with_dbmalloc=
4888 fi;
4889 echo "$as_me:4889: result: ${with_dbmalloc:-no}" >&5
4890 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4891
4892 case .$with_cflags in #(vi
4893 .*-g*)
4894         case .$CFLAGS in #(vi
4895         .*-g*) #(vi
4896                 ;;
4897         *)
4898
4899 cf_fix_cppflags=no
4900 cf_new_cflags=
4901 cf_new_cppflags=
4902 cf_new_extra_cppflags=
4903
4904 for cf_add_cflags in -g
4905 do
4906 case $cf_fix_cppflags in
4907 no)
4908         case $cf_add_cflags in #(vi
4909         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4910                 case $cf_add_cflags in
4911                 -D*)
4912                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4913
4914                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4915                                 && test -z "${cf_tst_cflags}" \
4916                                 && cf_fix_cppflags=yes
4917
4918                         if test $cf_fix_cppflags = yes ; then
4919                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4920                                 continue
4921                         elif test "${cf_tst_cflags}" = "\"'" ; then
4922                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4923                                 continue
4924                         fi
4925                         ;;
4926                 esac
4927                 case "$CPPFLAGS" in
4928                 *$cf_add_cflags) #(vi
4929                         ;;
4930                 *) #(vi
4931                         case $cf_add_cflags in #(vi
4932                         -D*)
4933                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4934
4935 CPPFLAGS=`echo "$CPPFLAGS" | \
4936         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4937                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4938
4939                                 ;;
4940                         esac
4941                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4942                         ;;
4943                 esac
4944                 ;;
4945         *)
4946                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4947                 ;;
4948         esac
4949         ;;
4950 yes)
4951         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4952
4953         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4954
4955         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4956                 && test -z "${cf_tst_cflags}" \
4957                 && cf_fix_cppflags=no
4958         ;;
4959 esac
4960 done
4961
4962 if test -n "$cf_new_cflags" ; then
4963
4964         CFLAGS="$CFLAGS $cf_new_cflags"
4965 fi
4966
4967 if test -n "$cf_new_cppflags" ; then
4968
4969         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4970 fi
4971
4972 if test -n "$cf_new_extra_cppflags" ; then
4973
4974         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4975 fi
4976
4977                 ;;
4978         esac
4979         ;;
4980 esac
4981
4982 if test "$with_dbmalloc" = yes ; then
4983         echo "$as_me:4983: checking for dbmalloc.h" >&5
4984 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
4985 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
4986   echo $ECHO_N "(cached) $ECHO_C" >&6
4987 else
4988   cat >conftest.$ac_ext <<_ACEOF
4989 #line 4989 "configure"
4990 #include "confdefs.h"
4991 #include <dbmalloc.h>
4992 _ACEOF
4993 if { (eval echo "$as_me:4993: \"$ac_cpp conftest.$ac_ext\"") >&5
4994   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4995   ac_status=$?
4996   egrep -v '^ *\+' conftest.er1 >conftest.err
4997   rm -f conftest.er1
4998   cat conftest.err >&5
4999   echo "$as_me:4999: \$? = $ac_status" >&5
5000   (exit $ac_status); } >/dev/null; then
5001   if test -s conftest.err; then
5002     ac_cpp_err=$ac_c_preproc_warn_flag
5003   else
5004     ac_cpp_err=
5005   fi
5006 else
5007   ac_cpp_err=yes
5008 fi
5009 if test -z "$ac_cpp_err"; then
5010   ac_cv_header_dbmalloc_h=yes
5011 else
5012   echo "$as_me: failed program was:" >&5
5013   cat conftest.$ac_ext >&5
5014   ac_cv_header_dbmalloc_h=no
5015 fi
5016 rm -f conftest.err conftest.$ac_ext
5017 fi
5018 echo "$as_me:5018: result: $ac_cv_header_dbmalloc_h" >&5
5019 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
5020 if test $ac_cv_header_dbmalloc_h = yes; then
5021
5022 echo "$as_me:5022: checking for debug_malloc in -ldbmalloc" >&5
5023 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
5024 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
5025   echo $ECHO_N "(cached) $ECHO_C" >&6
5026 else
5027   ac_check_lib_save_LIBS=$LIBS
5028 LIBS="-ldbmalloc  $LIBS"
5029 cat >conftest.$ac_ext <<_ACEOF
5030 #line 5030 "configure"
5031 #include "confdefs.h"
5032
5033 /* Override any gcc2 internal prototype to avoid an error.  */
5034 #ifdef __cplusplus
5035 extern "C"
5036 #endif
5037 /* We use char because int might match the return type of a gcc2
5038    builtin and then its argument prototype would still apply.  */
5039 char debug_malloc ();
5040 int
5041 main ()
5042 {
5043 debug_malloc ();
5044   ;
5045   return 0;
5046 }
5047 _ACEOF
5048 rm -f conftest.$ac_objext conftest$ac_exeext
5049 if { (eval echo "$as_me:5049: \"$ac_link\"") >&5
5050   (eval $ac_link) 2>&5
5051   ac_status=$?
5052   echo "$as_me:5052: \$? = $ac_status" >&5
5053   (exit $ac_status); } &&
5054          { ac_try='test -s conftest$ac_exeext'
5055   { (eval echo "$as_me:5055: \"$ac_try\"") >&5
5056   (eval $ac_try) 2>&5
5057   ac_status=$?
5058   echo "$as_me:5058: \$? = $ac_status" >&5
5059   (exit $ac_status); }; }; then
5060   ac_cv_lib_dbmalloc_debug_malloc=yes
5061 else
5062   echo "$as_me: failed program was:" >&5
5063 cat conftest.$ac_ext >&5
5064 ac_cv_lib_dbmalloc_debug_malloc=no
5065 fi
5066 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5067 LIBS=$ac_check_lib_save_LIBS
5068 fi
5069 echo "$as_me:5069: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
5070 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
5071 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
5072   cat >>confdefs.h <<EOF
5073 #define HAVE_LIBDBMALLOC 1
5074 EOF
5075
5076   LIBS="-ldbmalloc $LIBS"
5077
5078 fi
5079
5080 fi
5081
5082 fi
5083
5084 echo "$as_me:5084: checking if you want to use valgrind for testing" >&5
5085 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
5086
5087 # Check whether --with-valgrind or --without-valgrind was given.
5088 if test "${with_valgrind+set}" = set; then
5089   withval="$with_valgrind"
5090   cat >>confdefs.h <<\EOF
5091 #define USE_VALGRIND 1
5092 EOF
5093
5094         : ${with_cflags:=-g}
5095         : ${with_no_leaks:=yes}
5096          with_valgrind=yes
5097 else
5098   with_valgrind=
5099 fi;
5100 echo "$as_me:5100: result: ${with_valgrind:-no}" >&5
5101 echo "${ECHO_T}${with_valgrind:-no}" >&6
5102
5103 case .$with_cflags in #(vi
5104 .*-g*)
5105         case .$CFLAGS in #(vi
5106         .*-g*) #(vi
5107                 ;;
5108         *)
5109
5110 cf_fix_cppflags=no
5111 cf_new_cflags=
5112 cf_new_cppflags=
5113 cf_new_extra_cppflags=
5114
5115 for cf_add_cflags in -g
5116 do
5117 case $cf_fix_cppflags in
5118 no)
5119         case $cf_add_cflags in #(vi
5120         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5121                 case $cf_add_cflags in
5122                 -D*)
5123                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5124
5125                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5126                                 && test -z "${cf_tst_cflags}" \
5127                                 && cf_fix_cppflags=yes
5128
5129                         if test $cf_fix_cppflags = yes ; then
5130                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5131                                 continue
5132                         elif test "${cf_tst_cflags}" = "\"'" ; then
5133                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5134                                 continue
5135                         fi
5136                         ;;
5137                 esac
5138                 case "$CPPFLAGS" in
5139                 *$cf_add_cflags) #(vi
5140                         ;;
5141                 *) #(vi
5142                         case $cf_add_cflags in #(vi
5143                         -D*)
5144                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5145
5146 CPPFLAGS=`echo "$CPPFLAGS" | \
5147         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5148                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5149
5150                                 ;;
5151                         esac
5152                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5153                         ;;
5154                 esac
5155                 ;;
5156         *)
5157                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5158                 ;;
5159         esac
5160         ;;
5161 yes)
5162         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5163
5164         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5165
5166         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5167                 && test -z "${cf_tst_cflags}" \
5168                 && cf_fix_cppflags=no
5169         ;;
5170 esac
5171 done
5172
5173 if test -n "$cf_new_cflags" ; then
5174
5175         CFLAGS="$CFLAGS $cf_new_cflags"
5176 fi
5177
5178 if test -n "$cf_new_cppflags" ; then
5179
5180         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5181 fi
5182
5183 if test -n "$cf_new_extra_cppflags" ; then
5184
5185         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5186 fi
5187
5188                 ;;
5189         esac
5190         ;;
5191 esac
5192
5193 echo "$as_me:5193: checking if you want to perform memory-leak testing" >&5
5194 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
5195
5196 # Check whether --enable-leaks or --disable-leaks was given.
5197 if test "${enable_leaks+set}" = set; then
5198   enableval="$enable_leaks"
5199   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
5200 else
5201   : ${with_no_leaks:=no}
5202 fi;
5203 echo "$as_me:5203: result: $with_no_leaks" >&5
5204 echo "${ECHO_T}$with_no_leaks" >&6
5205
5206 if test "$with_no_leaks" = yes ; then
5207         cat >>confdefs.h <<\EOF
5208 #define NO_LEAKS 1
5209 EOF
5210
5211         cat >>confdefs.h <<\EOF
5212 #define YY_NO_LEAKS 1
5213 EOF
5214
5215 fi
5216
5217 echo "$as_me:5217: checking if you want to check for wide-character functions" >&5
5218 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5219
5220 # Check whether --enable-widec or --disable-widec was given.
5221 if test "${enable_widec+set}" = set; then
5222   enableval="$enable_widec"
5223   test "$enableval" != no && enableval=yes
5224   if test "$enableval" != "yes" ; then
5225     cf_enable_widec=no
5226   else
5227     cf_enable_widec=yes
5228   fi
5229 else
5230   enableval=yes
5231   cf_enable_widec=yes
5232
5233 fi;
5234 echo "$as_me:5234: result: $cf_enable_widec" >&5
5235 echo "${ECHO_T}$cf_enable_widec" >&6
5236
5237 echo "$as_me:5237: checking for specific curses-directory" >&5
5238 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5239
5240 # Check whether --with-curses-dir or --without-curses-dir was given.
5241 if test "${with_curses_dir+set}" = set; then
5242   withval="$with_curses_dir"
5243   cf_cv_curses_dir=$withval
5244 else
5245   cf_cv_curses_dir=no
5246 fi;
5247 echo "$as_me:5247: result: $cf_cv_curses_dir" >&5
5248 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5249
5250 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5251 then
5252
5253 if test "x$prefix" != xNONE; then
5254   cf_path_syntax="$prefix"
5255 else
5256   cf_path_syntax="$ac_default_prefix"
5257 fi
5258
5259 case ".$withval" in #(vi
5260 .\$\(*\)*|.\'*\'*) #(vi
5261   ;;
5262 ..|./*|.\\*) #(vi
5263   ;;
5264 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5265   ;;
5266 .\${*prefix}*) #(vi
5267   eval withval="$withval"
5268   case ".$withval" in #(vi
5269   .NONE/*)
5270     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5271     ;;
5272   esac
5273   ;; #(vi
5274 .no|.NONE/*)
5275   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5276   ;;
5277 *)
5278   { { echo "$as_me:5278: error: expected a pathname, not \"$withval\"" >&5
5279 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5280    { (exit 1); exit 1; }; }
5281   ;;
5282 esac
5283
5284         if test -d "$cf_cv_curses_dir"
5285         then
5286
5287 if test -n "$cf_cv_curses_dir/include" ; then
5288   for cf_add_incdir in $cf_cv_curses_dir/include
5289   do
5290         while test $cf_add_incdir != /usr/include
5291         do
5292           if test -d $cf_add_incdir
5293           then
5294                 cf_have_incdir=no
5295                 if test -n "$CFLAGS$CPPFLAGS" ; then
5296                   # a loop is needed to ensure we can add subdirs of existing dirs
5297                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5298                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5299                           cf_have_incdir=yes; break
5300                         fi
5301                   done
5302                 fi
5303
5304                 if test "$cf_have_incdir" = no ; then
5305                   if test "$cf_add_incdir" = /usr/local/include ; then
5306                         if test "$GCC" = yes
5307                         then
5308                           cf_save_CPPFLAGS=$CPPFLAGS
5309                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5310                           cat >conftest.$ac_ext <<_ACEOF
5311 #line 5311 "configure"
5312 #include "confdefs.h"
5313 #include <stdio.h>
5314 int
5315 main ()
5316 {
5317 printf("Hello")
5318   ;
5319   return 0;
5320 }
5321 _ACEOF
5322 rm -f conftest.$ac_objext
5323 if { (eval echo "$as_me:5323: \"$ac_compile\"") >&5
5324   (eval $ac_compile) 2>&5
5325   ac_status=$?
5326   echo "$as_me:5326: \$? = $ac_status" >&5
5327   (exit $ac_status); } &&
5328          { ac_try='test -s conftest.$ac_objext'
5329   { (eval echo "$as_me:5329: \"$ac_try\"") >&5
5330   (eval $ac_try) 2>&5
5331   ac_status=$?
5332   echo "$as_me:5332: \$? = $ac_status" >&5
5333   (exit $ac_status); }; }; then
5334   :
5335 else
5336   echo "$as_me: failed program was:" >&5
5337 cat conftest.$ac_ext >&5
5338 cf_have_incdir=yes
5339 fi
5340 rm -f conftest.$ac_objext conftest.$ac_ext
5341                           CPPFLAGS=$cf_save_CPPFLAGS
5342                         fi
5343                   fi
5344                 fi
5345
5346                 if test "$cf_have_incdir" = no ; then
5347                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5348
5349 echo "${as_me:-configure}:5349: testing adding $cf_add_incdir to include-path ..." 1>&5
5350
5351                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5352
5353                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5354                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5355                   cf_add_incdir="$cf_top_incdir"
5356                 else
5357                   break
5358                 fi
5359           fi
5360         done
5361   done
5362 fi
5363
5364 if test -n "$cf_cv_curses_dir/lib" ; then
5365   for cf_add_libdir in $cf_cv_curses_dir/lib
5366   do
5367     if test $cf_add_libdir = /usr/lib ; then
5368       :
5369     elif test -d $cf_add_libdir
5370     then
5371       cf_have_libdir=no
5372       if test -n "$LDFLAGS$LIBS" ; then
5373         # a loop is needed to ensure we can add subdirs of existing dirs
5374         for cf_test_libdir in $LDFLAGS $LIBS ; do
5375           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5376             cf_have_libdir=yes; break
5377           fi
5378         done
5379       fi
5380       if test "$cf_have_libdir" = no ; then
5381         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5382
5383 echo "${as_me:-configure}:5383: testing adding $cf_add_libdir to library-path ..." 1>&5
5384
5385         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5386       fi
5387     fi
5388   done
5389 fi
5390
5391         fi
5392 fi
5393
5394 cf_cv_screen=curses
5395
5396 echo "$as_me:5396: checking for specified curses library type" >&5
5397 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5398
5399 # Check whether --with-ncursesw or --without-ncursesw was given.
5400 if test "${with_ncursesw+set}" = set; then
5401   withval="$with_ncursesw"
5402   cf_cv_screen=ncursesw
5403 else
5404
5405 # Check whether --with-ncurses or --without-ncurses was given.
5406 if test "${with_ncurses+set}" = set; then
5407   withval="$with_ncurses"
5408   cf_cv_screen=ncurses
5409 else
5410
5411 # Check whether --with-pdcurses or --without-pdcurses was given.
5412 if test "${with_pdcurses+set}" = set; then
5413   withval="$with_pdcurses"
5414   cf_cv_screen=pdcurses
5415 else
5416
5417 # Check whether --with-curses-colr or --without-curses-colr was given.
5418 if test "${with_curses_colr+set}" = set; then
5419   withval="$with_curses_colr"
5420   cf_cv_screen=curses_colr
5421 else
5422
5423 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5424 if test "${with_curses_5lib+set}" = set; then
5425   withval="$with_curses_5lib"
5426   cf_cv_screen=curses_5lib
5427 fi;
5428 fi;
5429 fi;
5430 fi;
5431 fi;
5432
5433 echo "$as_me:5433: result: $cf_cv_screen" >&5
5434 echo "${ECHO_T}$cf_cv_screen" >&6
5435
5436 case $cf_cv_screen in #(vi
5437 curses|curses_*) #(vi
5438
5439 echo "$as_me:5439: checking for extra include directories" >&5
5440 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5441 if test "${cf_cv_curses_incdir+set}" = set; then
5442   echo $ECHO_N "(cached) $ECHO_C" >&6
5443 else
5444
5445 cf_cv_curses_incdir=no
5446 case $host_os in #(vi
5447 hpux10.*) #(vi
5448         if test "x$cf_cv_screen" = "xcurses_colr"
5449         then
5450                 test -d /usr/include/curses_colr && \
5451                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5452         fi
5453         ;;
5454 sunos3*|sunos4*)
5455         if test "x$cf_cv_screen" = "xcurses_5lib"
5456         then
5457                 test -d /usr/5lib && \
5458                 test -d /usr/5include && \
5459                 cf_cv_curses_incdir="-I/usr/5include"
5460         fi
5461         ;;
5462 esac
5463
5464 fi
5465 echo "$as_me:5465: result: $cf_cv_curses_incdir" >&5
5466 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5467 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5468
5469 echo "$as_me:5469: checking if we have identified curses headers" >&5
5470 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5471 if test "${cf_cv_ncurses_header+set}" = set; then
5472   echo $ECHO_N "(cached) $ECHO_C" >&6
5473 else
5474
5475 cf_cv_ncurses_header=none
5476 for cf_header in  \
5477         ncurses.h \
5478         curses.h ncurses/ncurses.h ncurses/curses.h
5479 do
5480 cat >conftest.$ac_ext <<_ACEOF
5481 #line 5481 "configure"
5482 #include "confdefs.h"
5483 #include <${cf_header}>
5484 int
5485 main ()
5486 {
5487 initscr(); tgoto("?", 0,0)
5488   ;
5489   return 0;
5490 }
5491 _ACEOF
5492 rm -f conftest.$ac_objext
5493 if { (eval echo "$as_me:5493: \"$ac_compile\"") >&5
5494   (eval $ac_compile) 2>&5
5495   ac_status=$?
5496   echo "$as_me:5496: \$? = $ac_status" >&5
5497   (exit $ac_status); } &&
5498          { ac_try='test -s conftest.$ac_objext'
5499   { (eval echo "$as_me:5499: \"$ac_try\"") >&5
5500   (eval $ac_try) 2>&5
5501   ac_status=$?
5502   echo "$as_me:5502: \$? = $ac_status" >&5
5503   (exit $ac_status); }; }; then
5504   cf_cv_ncurses_header=$cf_header; break
5505 else
5506   echo "$as_me: failed program was:" >&5
5507 cat conftest.$ac_ext >&5
5508 fi
5509 rm -f conftest.$ac_objext conftest.$ac_ext
5510 done
5511
5512 fi
5513 echo "$as_me:5513: result: $cf_cv_ncurses_header" >&5
5514 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5515
5516 if test "$cf_cv_ncurses_header" = none ; then
5517         { { echo "$as_me:5517: error: No curses header-files found" >&5
5518 echo "$as_me: error: No curses header-files found" >&2;}
5519    { (exit 1); exit 1; }; }
5520 fi
5521
5522 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5523
5524 for ac_header in $cf_cv_ncurses_header
5525 do
5526 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5527 echo "$as_me:5527: checking for $ac_header" >&5
5528 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5529 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5530   echo $ECHO_N "(cached) $ECHO_C" >&6
5531 else
5532   cat >conftest.$ac_ext <<_ACEOF
5533 #line 5533 "configure"
5534 #include "confdefs.h"
5535 #include <$ac_header>
5536 _ACEOF
5537 if { (eval echo "$as_me:5537: \"$ac_cpp conftest.$ac_ext\"") >&5
5538   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5539   ac_status=$?
5540   egrep -v '^ *\+' conftest.er1 >conftest.err
5541   rm -f conftest.er1
5542   cat conftest.err >&5
5543   echo "$as_me:5543: \$? = $ac_status" >&5
5544   (exit $ac_status); } >/dev/null; then
5545   if test -s conftest.err; then
5546     ac_cpp_err=$ac_c_preproc_warn_flag
5547   else
5548     ac_cpp_err=
5549   fi
5550 else
5551   ac_cpp_err=yes
5552 fi
5553 if test -z "$ac_cpp_err"; then
5554   eval "$as_ac_Header=yes"
5555 else
5556   echo "$as_me: failed program was:" >&5
5557   cat conftest.$ac_ext >&5
5558   eval "$as_ac_Header=no"
5559 fi
5560 rm -f conftest.err conftest.$ac_ext
5561 fi
5562 echo "$as_me:5562: result: `eval echo '${'$as_ac_Header'}'`" >&5
5563 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5564 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5565   cat >>confdefs.h <<EOF
5566 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5567 EOF
5568
5569 fi
5570 done
5571
5572 echo "$as_me:5572: checking for terminfo header" >&5
5573 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5574 if test "${cf_cv_term_header+set}" = set; then
5575   echo $ECHO_N "(cached) $ECHO_C" >&6
5576 else
5577
5578 case ${cf_cv_ncurses_header} in #(vi
5579 */ncurses.h|*/ncursesw.h) #(vi
5580         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5581         ;;
5582 *)
5583         cf_term_header=term.h
5584         ;;
5585 esac
5586
5587 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5588 do
5589 cat >conftest.$ac_ext <<_ACEOF
5590 #line 5590 "configure"
5591 #include "confdefs.h"
5592 #include <stdio.h>
5593 #include <${cf_cv_ncurses_header:-curses.h}>
5594 #include <$cf_test>
5595
5596 int
5597 main ()
5598 {
5599 int x = auto_left_margin
5600   ;
5601   return 0;
5602 }
5603 _ACEOF
5604 rm -f conftest.$ac_objext
5605 if { (eval echo "$as_me:5605: \"$ac_compile\"") >&5
5606   (eval $ac_compile) 2>&5
5607   ac_status=$?
5608   echo "$as_me:5608: \$? = $ac_status" >&5
5609   (exit $ac_status); } &&
5610          { ac_try='test -s conftest.$ac_objext'
5611   { (eval echo "$as_me:5611: \"$ac_try\"") >&5
5612   (eval $ac_try) 2>&5
5613   ac_status=$?
5614   echo "$as_me:5614: \$? = $ac_status" >&5
5615   (exit $ac_status); }; }; then
5616
5617         cf_cv_term_header="$cf_test"
5618 else
5619   echo "$as_me: failed program was:" >&5
5620 cat conftest.$ac_ext >&5
5621
5622         cf_cv_term_header=unknown
5623
5624 fi
5625 rm -f conftest.$ac_objext conftest.$ac_ext
5626         test "$cf_cv_term_header" != unknown && break
5627 done
5628
5629 fi
5630 echo "$as_me:5630: result: $cf_cv_term_header" >&5
5631 echo "${ECHO_T}$cf_cv_term_header" >&6
5632
5633 # Set definitions to allow ifdef'ing to accommodate subdirectories
5634
5635 case $cf_cv_term_header in # (vi
5636 *term.h)
5637         cat >>confdefs.h <<\EOF
5638 #define HAVE_TERM_H 1
5639 EOF
5640
5641         ;;
5642 esac
5643
5644 case $cf_cv_term_header in # (vi
5645 ncurses/term.h) #(vi
5646         cat >>confdefs.h <<\EOF
5647 #define HAVE_NCURSES_TERM_H 1
5648 EOF
5649
5650         ;;
5651 ncursesw/term.h)
5652         cat >>confdefs.h <<\EOF
5653 #define HAVE_NCURSESW_TERM_H 1
5654 EOF
5655
5656         ;;
5657 esac
5658
5659 echo "$as_me:5659: checking for ncurses version" >&5
5660 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5661 if test "${cf_cv_ncurses_version+set}" = set; then
5662   echo $ECHO_N "(cached) $ECHO_C" >&6
5663 else
5664
5665         cf_cv_ncurses_version=no
5666         cf_tempfile=out$$
5667         rm -f $cf_tempfile
5668         if test "$cross_compiling" = yes; then
5669
5670         # This will not work if the preprocessor splits the line after the
5671         # Autoconf token.  The 'unproto' program does that.
5672         cat > conftest.$ac_ext <<EOF
5673 #include <${cf_cv_ncurses_header:-curses.h}>
5674 #undef Autoconf
5675 #ifdef NCURSES_VERSION
5676 Autoconf NCURSES_VERSION
5677 #else
5678 #ifdef __NCURSES_H
5679 Autoconf "old"
5680 #endif
5681 ;
5682 #endif
5683 EOF
5684         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5685         { (eval echo "$as_me:5685: \"$cf_try\"") >&5
5686   (eval $cf_try) 2>&5
5687   ac_status=$?
5688   echo "$as_me:5688: \$? = $ac_status" >&5
5689   (exit $ac_status); }
5690         if test -f conftest.out ; then
5691                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5692                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5693                 rm -f conftest.out
5694         fi
5695
5696 else
5697   cat >conftest.$ac_ext <<_ACEOF
5698 #line 5698 "configure"
5699 #include "confdefs.h"
5700
5701 #include <${cf_cv_ncurses_header:-curses.h}>
5702 #include <stdio.h>
5703 int main()
5704 {
5705         FILE *fp = fopen("$cf_tempfile", "w");
5706 #ifdef NCURSES_VERSION
5707 # ifdef NCURSES_VERSION_PATCH
5708         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5709 # else
5710         fprintf(fp, "%s\n", NCURSES_VERSION);
5711 # endif
5712 #else
5713 # ifdef __NCURSES_H
5714         fprintf(fp, "old\n");
5715 # else
5716         make an error
5717 # endif
5718 #endif
5719         ${cf_cv_main_return:-return}(0);
5720 }
5721 _ACEOF
5722 rm -f conftest$ac_exeext
5723 if { (eval echo "$as_me:5723: \"$ac_link\"") >&5
5724   (eval $ac_link) 2>&5
5725   ac_status=$?
5726   echo "$as_me:5726: \$? = $ac_status" >&5
5727   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5728   { (eval echo "$as_me:5728: \"$ac_try\"") >&5
5729   (eval $ac_try) 2>&5
5730   ac_status=$?
5731   echo "$as_me:5731: \$? = $ac_status" >&5
5732   (exit $ac_status); }; }; then
5733
5734         cf_cv_ncurses_version=`cat $cf_tempfile`
5735 else
5736   echo "$as_me: program exited with status $ac_status" >&5
5737 echo "$as_me: failed program was:" >&5
5738 cat conftest.$ac_ext >&5
5739 fi
5740 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5741 fi
5742         rm -f $cf_tempfile
5743
5744 fi
5745 echo "$as_me:5745: result: $cf_cv_ncurses_version" >&5
5746 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5747 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5748 #define NCURSES 1
5749 EOF
5750
5751 echo "$as_me:5751: checking if we have identified curses libraries" >&5
5752 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5753 cat >conftest.$ac_ext <<_ACEOF
5754 #line 5754 "configure"
5755 #include "confdefs.h"
5756 #include <${cf_cv_ncurses_header:-curses.h}>
5757 int
5758 main ()
5759 {
5760 initscr(); tgoto("?", 0,0)
5761   ;
5762   return 0;
5763 }
5764 _ACEOF
5765 rm -f conftest.$ac_objext conftest$ac_exeext
5766 if { (eval echo "$as_me:5766: \"$ac_link\"") >&5
5767   (eval $ac_link) 2>&5
5768   ac_status=$?
5769   echo "$as_me:5769: \$? = $ac_status" >&5
5770   (exit $ac_status); } &&
5771          { ac_try='test -s conftest$ac_exeext'
5772   { (eval echo "$as_me:5772: \"$ac_try\"") >&5
5773   (eval $ac_try) 2>&5
5774   ac_status=$?
5775   echo "$as_me:5775: \$? = $ac_status" >&5
5776   (exit $ac_status); }; }; then
5777   cf_result=yes
5778 else
5779   echo "$as_me: failed program was:" >&5
5780 cat conftest.$ac_ext >&5
5781 cf_result=no
5782 fi
5783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5784 echo "$as_me:5784: result: $cf_result" >&5
5785 echo "${ECHO_T}$cf_result" >&6
5786
5787 if test "$cf_result" = no ; then
5788 case $host_os in #(vi
5789 freebsd*) #(vi
5790     echo "$as_me:5790: checking for tgoto in -lmytinfo" >&5
5791 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5792 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5793   echo $ECHO_N "(cached) $ECHO_C" >&6
5794 else
5795   ac_check_lib_save_LIBS=$LIBS
5796 LIBS="-lmytinfo  $LIBS"
5797 cat >conftest.$ac_ext <<_ACEOF
5798 #line 5798 "configure"
5799 #include "confdefs.h"
5800
5801 /* Override any gcc2 internal prototype to avoid an error.  */
5802 #ifdef __cplusplus
5803 extern "C"
5804 #endif
5805 /* We use char because int might match the return type of a gcc2
5806    builtin and then its argument prototype would still apply.  */
5807 char tgoto ();
5808 int
5809 main ()
5810 {
5811 tgoto ();
5812   ;
5813   return 0;
5814 }
5815 _ACEOF
5816 rm -f conftest.$ac_objext conftest$ac_exeext
5817 if { (eval echo "$as_me:5817: \"$ac_link\"") >&5
5818   (eval $ac_link) 2>&5
5819   ac_status=$?
5820   echo "$as_me:5820: \$? = $ac_status" >&5
5821   (exit $ac_status); } &&
5822          { ac_try='test -s conftest$ac_exeext'
5823   { (eval echo "$as_me:5823: \"$ac_try\"") >&5
5824   (eval $ac_try) 2>&5
5825   ac_status=$?
5826   echo "$as_me:5826: \$? = $ac_status" >&5
5827   (exit $ac_status); }; }; then
5828   ac_cv_lib_mytinfo_tgoto=yes
5829 else
5830   echo "$as_me: failed program was:" >&5
5831 cat conftest.$ac_ext >&5
5832 ac_cv_lib_mytinfo_tgoto=no
5833 fi
5834 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5835 LIBS=$ac_check_lib_save_LIBS
5836 fi
5837 echo "$as_me:5837: result: $ac_cv_lib_mytinfo_tgoto" >&5
5838 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5839 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5840   LIBS="-lmytinfo $LIBS"
5841 fi
5842
5843     ;;
5844 hpux10.*) #(vi
5845         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5846         # next (1998), and xcurses "newer" (2000).  There is no header file for
5847         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5848         # term.h) for cur_colr
5849         if test "x$cf_cv_screen" = "xcurses_colr"
5850         then
5851                 echo "$as_me:5851: checking for initscr in -lcur_colr" >&5
5852 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5853 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5854   echo $ECHO_N "(cached) $ECHO_C" >&6
5855 else
5856   ac_check_lib_save_LIBS=$LIBS
5857 LIBS="-lcur_colr  $LIBS"
5858 cat >conftest.$ac_ext <<_ACEOF
5859 #line 5859 "configure"
5860 #include "confdefs.h"
5861
5862 /* Override any gcc2 internal prototype to avoid an error.  */
5863 #ifdef __cplusplus
5864 extern "C"
5865 #endif
5866 /* We use char because int might match the return type of a gcc2
5867    builtin and then its argument prototype would still apply.  */
5868 char initscr ();
5869 int
5870 main ()
5871 {
5872 initscr ();
5873   ;
5874   return 0;
5875 }
5876 _ACEOF
5877 rm -f conftest.$ac_objext conftest$ac_exeext
5878 if { (eval echo "$as_me:5878: \"$ac_link\"") >&5
5879   (eval $ac_link) 2>&5
5880   ac_status=$?
5881   echo "$as_me:5881: \$? = $ac_status" >&5
5882   (exit $ac_status); } &&
5883          { ac_try='test -s conftest$ac_exeext'
5884   { (eval echo "$as_me:5884: \"$ac_try\"") >&5
5885   (eval $ac_try) 2>&5
5886   ac_status=$?
5887   echo "$as_me:5887: \$? = $ac_status" >&5
5888   (exit $ac_status); }; }; then
5889   ac_cv_lib_cur_colr_initscr=yes
5890 else
5891   echo "$as_me: failed program was:" >&5
5892 cat conftest.$ac_ext >&5
5893 ac_cv_lib_cur_colr_initscr=no
5894 fi
5895 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5896 LIBS=$ac_check_lib_save_LIBS
5897 fi
5898 echo "$as_me:5898: result: $ac_cv_lib_cur_colr_initscr" >&5
5899 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5900 if test $ac_cv_lib_cur_colr_initscr = yes; then
5901
5902                         LIBS="-lcur_colr $LIBS"
5903                         ac_cv_func_initscr=yes
5904
5905 else
5906
5907                 echo "$as_me:5907: checking for initscr in -lHcurses" >&5
5908 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5909 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5910   echo $ECHO_N "(cached) $ECHO_C" >&6
5911 else
5912   ac_check_lib_save_LIBS=$LIBS
5913 LIBS="-lHcurses  $LIBS"
5914 cat >conftest.$ac_ext <<_ACEOF
5915 #line 5915 "configure"
5916 #include "confdefs.h"
5917
5918 /* Override any gcc2 internal prototype to avoid an error.  */
5919 #ifdef __cplusplus
5920 extern "C"
5921 #endif
5922 /* We use char because int might match the return type of a gcc2
5923    builtin and then its argument prototype would still apply.  */
5924 char initscr ();
5925 int
5926 main ()
5927 {
5928 initscr ();
5929   ;
5930   return 0;
5931 }
5932 _ACEOF
5933 rm -f conftest.$ac_objext conftest$ac_exeext
5934 if { (eval echo "$as_me:5934: \"$ac_link\"") >&5
5935   (eval $ac_link) 2>&5
5936   ac_status=$?
5937   echo "$as_me:5937: \$? = $ac_status" >&5
5938   (exit $ac_status); } &&
5939          { ac_try='test -s conftest$ac_exeext'
5940   { (eval echo "$as_me:5940: \"$ac_try\"") >&5
5941   (eval $ac_try) 2>&5
5942   ac_status=$?
5943   echo "$as_me:5943: \$? = $ac_status" >&5
5944   (exit $ac_status); }; }; then
5945   ac_cv_lib_Hcurses_initscr=yes
5946 else
5947   echo "$as_me: failed program was:" >&5
5948 cat conftest.$ac_ext >&5
5949 ac_cv_lib_Hcurses_initscr=no
5950 fi
5951 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5952 LIBS=$ac_check_lib_save_LIBS
5953 fi
5954 echo "$as_me:5954: result: $ac_cv_lib_Hcurses_initscr" >&5
5955 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
5956 if test $ac_cv_lib_Hcurses_initscr = yes; then
5957
5958                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
5959                         LIBS="-lHcurses $LIBS"
5960                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
5961                         ac_cv_func_initscr=yes
5962
5963 fi
5964
5965 fi
5966
5967         fi
5968     ;;
5969 linux*)
5970         case `arch 2>/dev/null` in
5971         x86_64)
5972                 if test -d /lib64
5973                 then
5974
5975 if test -n "/lib64" ; then
5976   for cf_add_libdir in /lib64
5977   do
5978     if test $cf_add_libdir = /usr/lib ; then
5979       :
5980     elif test -d $cf_add_libdir
5981     then
5982       cf_have_libdir=no
5983       if test -n "$LDFLAGS$LIBS" ; then
5984         # a loop is needed to ensure we can add subdirs of existing dirs
5985         for cf_test_libdir in $LDFLAGS $LIBS ; do
5986           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5987             cf_have_libdir=yes; break
5988           fi
5989         done
5990       fi
5991       if test "$cf_have_libdir" = no ; then
5992         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5993
5994 echo "${as_me:-configure}:5994: testing adding $cf_add_libdir to library-path ..." 1>&5
5995
5996         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5997       fi
5998     fi
5999   done
6000 fi
6001
6002                 else
6003
6004 if test -n "/lib" ; then
6005   for cf_add_libdir in /lib
6006   do
6007     if test $cf_add_libdir = /usr/lib ; then
6008       :
6009     elif test -d $cf_add_libdir
6010     then
6011       cf_have_libdir=no
6012       if test -n "$LDFLAGS$LIBS" ; then
6013         # a loop is needed to ensure we can add subdirs of existing dirs
6014         for cf_test_libdir in $LDFLAGS $LIBS ; do
6015           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6016             cf_have_libdir=yes; break
6017           fi
6018         done
6019       fi
6020       if test "$cf_have_libdir" = no ; then
6021         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6022
6023 echo "${as_me:-configure}:6023: testing adding $cf_add_libdir to library-path ..." 1>&5
6024
6025         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6026       fi
6027     fi
6028   done
6029 fi
6030
6031                 fi
6032                 ;;
6033         *)
6034
6035 if test -n "/lib" ; then
6036   for cf_add_libdir in /lib
6037   do
6038     if test $cf_add_libdir = /usr/lib ; then
6039       :
6040     elif test -d $cf_add_libdir
6041     then
6042       cf_have_libdir=no
6043       if test -n "$LDFLAGS$LIBS" ; then
6044         # a loop is needed to ensure we can add subdirs of existing dirs
6045         for cf_test_libdir in $LDFLAGS $LIBS ; do
6046           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6047             cf_have_libdir=yes; break
6048           fi
6049         done
6050       fi
6051       if test "$cf_have_libdir" = no ; then
6052         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6053
6054 echo "${as_me:-configure}:6054: testing adding $cf_add_libdir to library-path ..." 1>&5
6055
6056         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6057       fi
6058     fi
6059   done
6060 fi
6061
6062                 ;;
6063         esac
6064     ;;
6065 sunos3*|sunos4*)
6066         if test "x$cf_cv_screen" = "xcurses_5lib"
6067         then
6068                 if test -d /usr/5lib ; then
6069
6070 if test -n "/usr/5lib" ; then
6071   for cf_add_libdir in /usr/5lib
6072   do
6073     if test $cf_add_libdir = /usr/lib ; then
6074       :
6075     elif test -d $cf_add_libdir
6076     then
6077       cf_have_libdir=no
6078       if test -n "$LDFLAGS$LIBS" ; then
6079         # a loop is needed to ensure we can add subdirs of existing dirs
6080         for cf_test_libdir in $LDFLAGS $LIBS ; do
6081           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6082             cf_have_libdir=yes; break
6083           fi
6084         done
6085       fi
6086       if test "$cf_have_libdir" = no ; then
6087         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6088
6089 echo "${as_me:-configure}:6089: testing adding $cf_add_libdir to library-path ..." 1>&5
6090
6091         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6092       fi
6093     fi
6094   done
6095 fi
6096
6097                         LIBS="-lcurses -ltermcap $LIBS"
6098                 fi
6099     fi
6100     ac_cv_func_initscr=yes
6101     ;;
6102 esac
6103
6104 if test ".$ac_cv_func_initscr" != .yes ; then
6105     cf_save_LIBS="$LIBS"
6106     cf_term_lib=""
6107     cf_curs_lib=""
6108
6109     if test ".${cf_cv_ncurses_version:-no}" != .no
6110     then
6111         cf_check_list="ncurses curses cursesX"
6112     else
6113         cf_check_list="cursesX curses ncurses"
6114     fi
6115
6116     # Check for library containing tgoto.  Do this before curses library
6117     # because it may be needed to link the test-case for initscr.
6118     echo "$as_me:6118: checking for tgoto" >&5
6119 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6120 if test "${ac_cv_func_tgoto+set}" = set; then
6121   echo $ECHO_N "(cached) $ECHO_C" >&6
6122 else
6123   cat >conftest.$ac_ext <<_ACEOF
6124 #line 6124 "configure"
6125 #include "confdefs.h"
6126 /* System header to define __stub macros and hopefully few prototypes,
6127     which can conflict with char tgoto (); below.  */
6128 #include <assert.h>
6129 /* Override any gcc2 internal prototype to avoid an error.  */
6130 #ifdef __cplusplus
6131 extern "C"
6132 #endif
6133 /* We use char because int might match the return type of a gcc2
6134    builtin and then its argument prototype would still apply.  */
6135 char tgoto ();
6136 char (*f) ();
6137
6138 int
6139 main ()
6140 {
6141 /* The GNU C library defines this for functions which it implements
6142     to always fail with ENOSYS.  Some functions are actually named
6143     something starting with __ and the normal name is an alias.  */
6144 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6145 choke me
6146 #else
6147 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6148 #endif
6149
6150   ;
6151   return 0;
6152 }
6153 _ACEOF
6154 rm -f conftest.$ac_objext conftest$ac_exeext
6155 if { (eval echo "$as_me:6155: \"$ac_link\"") >&5
6156   (eval $ac_link) 2>&5
6157   ac_status=$?
6158   echo "$as_me:6158: \$? = $ac_status" >&5
6159   (exit $ac_status); } &&
6160          { ac_try='test -s conftest$ac_exeext'
6161   { (eval echo "$as_me:6161: \"$ac_try\"") >&5
6162   (eval $ac_try) 2>&5
6163   ac_status=$?
6164   echo "$as_me:6164: \$? = $ac_status" >&5
6165   (exit $ac_status); }; }; then
6166   ac_cv_func_tgoto=yes
6167 else
6168   echo "$as_me: failed program was:" >&5
6169 cat conftest.$ac_ext >&5
6170 ac_cv_func_tgoto=no
6171 fi
6172 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6173 fi
6174 echo "$as_me:6174: result: $ac_cv_func_tgoto" >&5
6175 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6176 if test $ac_cv_func_tgoto = yes; then
6177   cf_term_lib=predefined
6178 else
6179
6180         for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
6181         do
6182             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6183 echo "$as_me:6183: checking for tgoto in -l$cf_term_lib" >&5
6184 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6185 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6186   echo $ECHO_N "(cached) $ECHO_C" >&6
6187 else
6188   ac_check_lib_save_LIBS=$LIBS
6189 LIBS="-l$cf_term_lib  $LIBS"
6190 cat >conftest.$ac_ext <<_ACEOF
6191 #line 6191 "configure"
6192 #include "confdefs.h"
6193
6194 /* Override any gcc2 internal prototype to avoid an error.  */
6195 #ifdef __cplusplus
6196 extern "C"
6197 #endif
6198 /* We use char because int might match the return type of a gcc2
6199    builtin and then its argument prototype would still apply.  */
6200 char tgoto ();
6201 int
6202 main ()
6203 {
6204 tgoto ();
6205   ;
6206   return 0;
6207 }
6208 _ACEOF
6209 rm -f conftest.$ac_objext conftest$ac_exeext
6210 if { (eval echo "$as_me:6210: \"$ac_link\"") >&5
6211   (eval $ac_link) 2>&5
6212   ac_status=$?
6213   echo "$as_me:6213: \$? = $ac_status" >&5
6214   (exit $ac_status); } &&
6215          { ac_try='test -s conftest$ac_exeext'
6216   { (eval echo "$as_me:6216: \"$ac_try\"") >&5
6217   (eval $ac_try) 2>&5
6218   ac_status=$?
6219   echo "$as_me:6219: \$? = $ac_status" >&5
6220   (exit $ac_status); }; }; then
6221   eval "$as_ac_Lib=yes"
6222 else
6223   echo "$as_me: failed program was:" >&5
6224 cat conftest.$ac_ext >&5
6225 eval "$as_ac_Lib=no"
6226 fi
6227 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6228 LIBS=$ac_check_lib_save_LIBS
6229 fi
6230 echo "$as_me:6230: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6231 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6232 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6233   break
6234 fi
6235
6236         done
6237
6238 fi
6239
6240     # Check for library containing initscr
6241     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6242         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6243     do
6244         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6245 echo "$as_me:6245: checking for initscr in -l$cf_curs_lib" >&5
6246 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6247 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6248   echo $ECHO_N "(cached) $ECHO_C" >&6
6249 else
6250   ac_check_lib_save_LIBS=$LIBS
6251 LIBS="-l$cf_curs_lib  $LIBS"
6252 cat >conftest.$ac_ext <<_ACEOF
6253 #line 6253 "configure"
6254 #include "confdefs.h"
6255
6256 /* Override any gcc2 internal prototype to avoid an error.  */
6257 #ifdef __cplusplus
6258 extern "C"
6259 #endif
6260 /* We use char because int might match the return type of a gcc2
6261    builtin and then its argument prototype would still apply.  */
6262 char initscr ();
6263 int
6264 main ()
6265 {
6266 initscr ();
6267   ;
6268   return 0;
6269 }
6270 _ACEOF
6271 rm -f conftest.$ac_objext conftest$ac_exeext
6272 if { (eval echo "$as_me:6272: \"$ac_link\"") >&5
6273   (eval $ac_link) 2>&5
6274   ac_status=$?
6275   echo "$as_me:6275: \$? = $ac_status" >&5
6276   (exit $ac_status); } &&
6277          { ac_try='test -s conftest$ac_exeext'
6278   { (eval echo "$as_me:6278: \"$ac_try\"") >&5
6279   (eval $ac_try) 2>&5
6280   ac_status=$?
6281   echo "$as_me:6281: \$? = $ac_status" >&5
6282   (exit $ac_status); }; }; then
6283   eval "$as_ac_Lib=yes"
6284 else
6285   echo "$as_me: failed program was:" >&5
6286 cat conftest.$ac_ext >&5
6287 eval "$as_ac_Lib=no"
6288 fi
6289 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6290 LIBS=$ac_check_lib_save_LIBS
6291 fi
6292 echo "$as_me:6292: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6293 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6294 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6295   break
6296 fi
6297
6298     done
6299     test $cf_curs_lib = unknown && { { echo "$as_me:6299: error: no curses library found" >&5
6300 echo "$as_me: error: no curses library found" >&2;}
6301    { (exit 1); exit 1; }; }
6302
6303     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6304     if test "$cf_term_lib" = unknown ; then
6305         echo "$as_me:6305: checking if we can link with $cf_curs_lib library" >&5
6306 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6307         cat >conftest.$ac_ext <<_ACEOF
6308 #line 6308 "configure"
6309 #include "confdefs.h"
6310 #include <${cf_cv_ncurses_header:-curses.h}>
6311 int
6312 main ()
6313 {
6314 initscr()
6315   ;
6316   return 0;
6317 }
6318 _ACEOF
6319 rm -f conftest.$ac_objext conftest$ac_exeext
6320 if { (eval echo "$as_me:6320: \"$ac_link\"") >&5
6321   (eval $ac_link) 2>&5
6322   ac_status=$?
6323   echo "$as_me:6323: \$? = $ac_status" >&5
6324   (exit $ac_status); } &&
6325          { ac_try='test -s conftest$ac_exeext'
6326   { (eval echo "$as_me:6326: \"$ac_try\"") >&5
6327   (eval $ac_try) 2>&5
6328   ac_status=$?
6329   echo "$as_me:6329: \$? = $ac_status" >&5
6330   (exit $ac_status); }; }; then
6331   cf_result=yes
6332 else
6333   echo "$as_me: failed program was:" >&5
6334 cat conftest.$ac_ext >&5
6335 cf_result=no
6336 fi
6337 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6338         echo "$as_me:6338: result: $cf_result" >&5
6339 echo "${ECHO_T}$cf_result" >&6
6340         test $cf_result = no && { { echo "$as_me:6340: error: Cannot link curses library" >&5
6341 echo "$as_me: error: Cannot link curses library" >&2;}
6342    { (exit 1); exit 1; }; }
6343     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6344         :
6345     elif test "$cf_term_lib" != predefined ; then
6346         echo "$as_me:6346: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6347 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6348         cat >conftest.$ac_ext <<_ACEOF
6349 #line 6349 "configure"
6350 #include "confdefs.h"
6351 #include <${cf_cv_ncurses_header:-curses.h}>
6352 int
6353 main ()
6354 {
6355 initscr(); tgoto((char *)0, 0, 0);
6356   ;
6357   return 0;
6358 }
6359 _ACEOF
6360 rm -f conftest.$ac_objext conftest$ac_exeext
6361 if { (eval echo "$as_me:6361: \"$ac_link\"") >&5
6362   (eval $ac_link) 2>&5
6363   ac_status=$?
6364   echo "$as_me:6364: \$? = $ac_status" >&5
6365   (exit $ac_status); } &&
6366          { ac_try='test -s conftest$ac_exeext'
6367   { (eval echo "$as_me:6367: \"$ac_try\"") >&5
6368   (eval $ac_try) 2>&5
6369   ac_status=$?
6370   echo "$as_me:6370: \$? = $ac_status" >&5
6371   (exit $ac_status); }; }; then
6372   cf_result=no
6373 else
6374   echo "$as_me: failed program was:" >&5
6375 cat conftest.$ac_ext >&5
6376
6377             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6378             cat >conftest.$ac_ext <<_ACEOF
6379 #line 6379 "configure"
6380 #include "confdefs.h"
6381 #include <${cf_cv_ncurses_header:-curses.h}>
6382 int
6383 main ()
6384 {
6385 initscr()
6386   ;
6387   return 0;
6388 }
6389 _ACEOF
6390 rm -f conftest.$ac_objext conftest$ac_exeext
6391 if { (eval echo "$as_me:6391: \"$ac_link\"") >&5
6392   (eval $ac_link) 2>&5
6393   ac_status=$?
6394   echo "$as_me:6394: \$? = $ac_status" >&5
6395   (exit $ac_status); } &&
6396          { ac_try='test -s conftest$ac_exeext'
6397   { (eval echo "$as_me:6397: \"$ac_try\"") >&5
6398   (eval $ac_try) 2>&5
6399   ac_status=$?
6400   echo "$as_me:6400: \$? = $ac_status" >&5
6401   (exit $ac_status); }; }; then
6402   cf_result=yes
6403 else
6404   echo "$as_me: failed program was:" >&5
6405 cat conftest.$ac_ext >&5
6406 cf_result=error
6407 fi
6408 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6409
6410 fi
6411 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6412         echo "$as_me:6412: result: $cf_result" >&5
6413 echo "${ECHO_T}$cf_result" >&6
6414     fi
6415 fi
6416 fi
6417
6418         ;;
6419 ncurses) #(vi
6420
6421 cf_ncuconfig_root=ncurses
6422
6423 echo "Looking for ${cf_ncuconfig_root}-config"
6424
6425 if test -n "$ac_tool_prefix"; then
6426   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6427   do
6428     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6429 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6430 echo "$as_me:6430: checking for $ac_word" >&5
6431 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6432 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6433   echo $ECHO_N "(cached) $ECHO_C" >&6
6434 else
6435   if test -n "$NCURSES_CONFIG"; then
6436   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6437 else
6438   ac_save_IFS=$IFS; IFS=$ac_path_separator
6439 ac_dummy="$PATH"
6440 for ac_dir in $ac_dummy; do
6441   IFS=$ac_save_IFS
6442   test -z "$ac_dir" && ac_dir=.
6443   $as_executable_p "$ac_dir/$ac_word" || continue
6444 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6445 echo "$as_me:6445: found $ac_dir/$ac_word" >&5
6446 break
6447 done
6448
6449 fi
6450 fi
6451 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6452 if test -n "$NCURSES_CONFIG"; then
6453   echo "$as_me:6453: result: $NCURSES_CONFIG" >&5
6454 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6455 else
6456   echo "$as_me:6456: result: no" >&5
6457 echo "${ECHO_T}no" >&6
6458 fi
6459
6460     test -n "$NCURSES_CONFIG" && break
6461   done
6462 fi
6463 if test -z "$NCURSES_CONFIG"; then
6464   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6465   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6466 do
6467   # Extract the first word of "$ac_prog", so it can be a program name with args.
6468 set dummy $ac_prog; ac_word=$2
6469 echo "$as_me:6469: checking for $ac_word" >&5
6470 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6471 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6472   echo $ECHO_N "(cached) $ECHO_C" >&6
6473 else
6474   if test -n "$ac_ct_NCURSES_CONFIG"; then
6475   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6476 else
6477   ac_save_IFS=$IFS; IFS=$ac_path_separator
6478 ac_dummy="$PATH"
6479 for ac_dir in $ac_dummy; do
6480   IFS=$ac_save_IFS
6481   test -z "$ac_dir" && ac_dir=.
6482   $as_executable_p "$ac_dir/$ac_word" || continue
6483 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6484 echo "$as_me:6484: found $ac_dir/$ac_word" >&5
6485 break
6486 done
6487
6488 fi
6489 fi
6490 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6491 if test -n "$ac_ct_NCURSES_CONFIG"; then
6492   echo "$as_me:6492: result: $ac_ct_NCURSES_CONFIG" >&5
6493 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6494 else
6495   echo "$as_me:6495: result: no" >&5
6496 echo "${ECHO_T}no" >&6
6497 fi
6498
6499   test -n "$ac_ct_NCURSES_CONFIG" && break
6500 done
6501 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6502
6503   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6504 fi
6505
6506 if test "$NCURSES_CONFIG" != none ; then
6507
6508 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6509 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6510
6511 # even with config script, some packages use no-override for curses.h
6512
6513 echo "$as_me:6513: checking if we have identified curses headers" >&5
6514 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6515 if test "${cf_cv_ncurses_header+set}" = set; then
6516   echo $ECHO_N "(cached) $ECHO_C" >&6
6517 else
6518
6519 cf_cv_ncurses_header=none
6520 for cf_header in  \
6521     ncurses/ncurses.h \
6522         ncurses/curses.h \
6523         ncurses.h \
6524         curses.h
6525 do
6526 cat >conftest.$ac_ext <<_ACEOF
6527 #line 6527 "configure"
6528 #include "confdefs.h"
6529 #include <${cf_header}>
6530 int
6531 main ()
6532 {
6533 initscr(); tgoto("?", 0,0)
6534   ;
6535   return 0;
6536 }
6537 _ACEOF
6538 rm -f conftest.$ac_objext
6539 if { (eval echo "$as_me:6539: \"$ac_compile\"") >&5
6540   (eval $ac_compile) 2>&5
6541   ac_status=$?
6542   echo "$as_me:6542: \$? = $ac_status" >&5
6543   (exit $ac_status); } &&
6544          { ac_try='test -s conftest.$ac_objext'
6545   { (eval echo "$as_me:6545: \"$ac_try\"") >&5
6546   (eval $ac_try) 2>&5
6547   ac_status=$?
6548   echo "$as_me:6548: \$? = $ac_status" >&5
6549   (exit $ac_status); }; }; then
6550   cf_cv_ncurses_header=$cf_header; break
6551 else
6552   echo "$as_me: failed program was:" >&5
6553 cat conftest.$ac_ext >&5
6554 fi
6555 rm -f conftest.$ac_objext conftest.$ac_ext
6556 done
6557
6558 fi
6559 echo "$as_me:6559: result: $cf_cv_ncurses_header" >&5
6560 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6561
6562 if test "$cf_cv_ncurses_header" = none ; then
6563         { { echo "$as_me:6563: error: No curses header-files found" >&5
6564 echo "$as_me: error: No curses header-files found" >&2;}
6565    { (exit 1); exit 1; }; }
6566 fi
6567
6568 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6569
6570 for ac_header in $cf_cv_ncurses_header
6571 do
6572 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6573 echo "$as_me:6573: checking for $ac_header" >&5
6574 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6575 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6576   echo $ECHO_N "(cached) $ECHO_C" >&6
6577 else
6578   cat >conftest.$ac_ext <<_ACEOF
6579 #line 6579 "configure"
6580 #include "confdefs.h"
6581 #include <$ac_header>
6582 _ACEOF
6583 if { (eval echo "$as_me:6583: \"$ac_cpp conftest.$ac_ext\"") >&5
6584   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6585   ac_status=$?
6586   egrep -v '^ *\+' conftest.er1 >conftest.err
6587   rm -f conftest.er1
6588   cat conftest.err >&5
6589   echo "$as_me:6589: \$? = $ac_status" >&5
6590   (exit $ac_status); } >/dev/null; then
6591   if test -s conftest.err; then
6592     ac_cpp_err=$ac_c_preproc_warn_flag
6593   else
6594     ac_cpp_err=
6595   fi
6596 else
6597   ac_cpp_err=yes
6598 fi
6599 if test -z "$ac_cpp_err"; then
6600   eval "$as_ac_Header=yes"
6601 else
6602   echo "$as_me: failed program was:" >&5
6603   cat conftest.$ac_ext >&5
6604   eval "$as_ac_Header=no"
6605 fi
6606 rm -f conftest.err conftest.$ac_ext
6607 fi
6608 echo "$as_me:6608: result: `eval echo '${'$as_ac_Header'}'`" >&5
6609 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6610 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6611   cat >>confdefs.h <<EOF
6612 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6613 EOF
6614
6615 fi
6616 done
6617
6618 cat >>confdefs.h <<\EOF
6619 #define NCURSES 1
6620 EOF
6621
6622 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6623
6624 cat >>confdefs.h <<EOF
6625 #define $cf_nculib_ROOT 1
6626 EOF
6627
6628 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6629
6630 else
6631
6632 cf_ncuhdr_root=ncurses
6633
6634 test -n "$cf_cv_curses_dir" && \
6635 test "$cf_cv_curses_dir" != "no" && { \
6636
6637 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6638   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6639   do
6640         while test $cf_add_incdir != /usr/include
6641         do
6642           if test -d $cf_add_incdir
6643           then
6644                 cf_have_incdir=no
6645                 if test -n "$CFLAGS$CPPFLAGS" ; then
6646                   # a loop is needed to ensure we can add subdirs of existing dirs
6647                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6648                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6649                           cf_have_incdir=yes; break
6650                         fi
6651                   done
6652                 fi
6653
6654                 if test "$cf_have_incdir" = no ; then
6655                   if test "$cf_add_incdir" = /usr/local/include ; then
6656                         if test "$GCC" = yes
6657                         then
6658                           cf_save_CPPFLAGS=$CPPFLAGS
6659                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6660                           cat >conftest.$ac_ext <<_ACEOF
6661 #line 6661 "configure"
6662 #include "confdefs.h"
6663 #include <stdio.h>
6664 int
6665 main ()
6666 {
6667 printf("Hello")
6668   ;
6669   return 0;
6670 }
6671 _ACEOF
6672 rm -f conftest.$ac_objext
6673 if { (eval echo "$as_me:6673: \"$ac_compile\"") >&5
6674   (eval $ac_compile) 2>&5
6675   ac_status=$?
6676   echo "$as_me:6676: \$? = $ac_status" >&5
6677   (exit $ac_status); } &&
6678          { ac_try='test -s conftest.$ac_objext'
6679   { (eval echo "$as_me:6679: \"$ac_try\"") >&5
6680   (eval $ac_try) 2>&5
6681   ac_status=$?
6682   echo "$as_me:6682: \$? = $ac_status" >&5
6683   (exit $ac_status); }; }; then
6684   :
6685 else
6686   echo "$as_me: failed program was:" >&5
6687 cat conftest.$ac_ext >&5
6688 cf_have_incdir=yes
6689 fi
6690 rm -f conftest.$ac_objext conftest.$ac_ext
6691                           CPPFLAGS=$cf_save_CPPFLAGS
6692                         fi
6693                   fi
6694                 fi
6695
6696                 if test "$cf_have_incdir" = no ; then
6697                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6698
6699 echo "${as_me:-configure}:6699: testing adding $cf_add_incdir to include-path ..." 1>&5
6700
6701                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6702
6703                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6704                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6705                   cf_add_incdir="$cf_top_incdir"
6706                 else
6707                   break
6708                 fi
6709           fi
6710         done
6711   done
6712 fi
6713
6714 }
6715
6716 echo "$as_me:6716: checking for $cf_ncuhdr_root header in include-path" >&5
6717 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6718 if test "${cf_cv_ncurses_h+set}" = set; then
6719   echo $ECHO_N "(cached) $ECHO_C" >&6
6720 else
6721
6722         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6723         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6724         for cf_header in $cf_header_list
6725         do
6726
6727         cat >conftest.$ac_ext <<_ACEOF
6728 #line 6728 "configure"
6729 #include "confdefs.h"
6730
6731 #include <$cf_header>
6732 int
6733 main ()
6734 {
6735
6736 #ifdef NCURSES_VERSION
6737
6738 printf("%s\n", NCURSES_VERSION);
6739 #else
6740 #ifdef __NCURSES_H
6741 printf("old\n");
6742 #else
6743         make an error
6744 #endif
6745 #endif
6746
6747   ;
6748   return 0;
6749 }
6750 _ACEOF
6751 rm -f conftest.$ac_objext
6752 if { (eval echo "$as_me:6752: \"$ac_compile\"") >&5
6753   (eval $ac_compile) 2>&5
6754   ac_status=$?
6755   echo "$as_me:6755: \$? = $ac_status" >&5
6756   (exit $ac_status); } &&
6757          { ac_try='test -s conftest.$ac_objext'
6758   { (eval echo "$as_me:6758: \"$ac_try\"") >&5
6759   (eval $ac_try) 2>&5
6760   ac_status=$?
6761   echo "$as_me:6761: \$? = $ac_status" >&5
6762   (exit $ac_status); }; }; then
6763   cf_cv_ncurses_h=$cf_header
6764
6765 else
6766   echo "$as_me: failed program was:" >&5
6767 cat conftest.$ac_ext >&5
6768 cf_cv_ncurses_h=no
6769 fi
6770 rm -f conftest.$ac_objext conftest.$ac_ext
6771
6772                 test "$cf_cv_ncurses_h" != no && break
6773         done
6774
6775 fi
6776 echo "$as_me:6776: result: $cf_cv_ncurses_h" >&5
6777 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6778
6779 if test "$cf_cv_ncurses_h" != no ; then
6780         cf_cv_ncurses_header=$cf_cv_ncurses_h
6781 else
6782
6783 echo "$as_me:6783: checking for $cf_ncuhdr_root include-path" >&5
6784 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6785 if test "${cf_cv_ncurses_h2+set}" = set; then
6786   echo $ECHO_N "(cached) $ECHO_C" >&6
6787 else
6788
6789         test -n "$verbose" && echo
6790
6791 cf_search=
6792
6793 # collect the current set of include-directories from compiler flags
6794 cf_header_path_list=""
6795 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6796         for cf_header_path in $CPPFLAGS $CFLAGS
6797         do
6798                 case $cf_header_path in #(vi
6799                 -I*)
6800                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6801
6802 test "$cf_header_path" != "NONE" && \
6803 test -d "$cf_header_path" && \
6804  {
6805         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6806         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6807         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6808         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6809         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6810         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"
6811 }
6812
6813                         cf_header_path_list="$cf_header_path_list $cf_search"
6814                         ;;
6815                 esac
6816         done
6817 fi
6818
6819 # add the variations for the package we are looking for
6820
6821 cf_search=
6822
6823 test "/usr" != "$prefix" && \
6824 test -d "/usr" && \
6825 (test $prefix = NONE || test "/usr" != "$prefix") && {
6826         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6827         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6828         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6829         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6830         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6831         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6832 }
6833
6834 test "$prefix" != "NONE" && \
6835 test -d "$prefix" && \
6836  {
6837         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6838         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6839         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6840         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6841         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6842         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6843 }
6844
6845 test "/usr/local" != "$prefix" && \
6846 test -d "/usr/local" && \
6847 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6848         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6849         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6850         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6851         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6852         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6853         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6854 }
6855
6856 test "/opt" != "$prefix" && \
6857 test -d "/opt" && \
6858 (test $prefix = NONE || test "/opt" != "$prefix") && {
6859         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6860         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6861         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6862         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6863         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6864         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6865 }
6866
6867 test "$HOME" != "$prefix" && \
6868 test -d "$HOME" && \
6869 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6870         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6871         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6872         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6873         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6874         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6875         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6876 }
6877
6878 test "$includedir" != NONE && \
6879 test "$includedir" != "/usr/include" && \
6880 test -d "$includedir" && {
6881         test -d $includedir &&    cf_search="$cf_search $includedir"
6882         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6883 }
6884
6885 test "$oldincludedir" != NONE && \
6886 test "$oldincludedir" != "/usr/include" && \
6887 test -d "$oldincludedir" && {
6888         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6889         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6890 }
6891
6892 cf_search="$cf_search $cf_header_path_list"
6893
6894         test -n "$verbose" && echo search path $cf_search
6895         cf_save2_CPPFLAGS="$CPPFLAGS"
6896         for cf_incdir in $cf_search
6897         do
6898
6899 if test -n "$cf_incdir" ; then
6900   for cf_add_incdir in $cf_incdir
6901   do
6902         while test $cf_add_incdir != /usr/include
6903         do
6904           if test -d $cf_add_incdir
6905           then
6906                 cf_have_incdir=no
6907                 if test -n "$CFLAGS$CPPFLAGS" ; then
6908                   # a loop is needed to ensure we can add subdirs of existing dirs
6909                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6910                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6911                           cf_have_incdir=yes; break
6912                         fi
6913                   done
6914                 fi
6915
6916                 if test "$cf_have_incdir" = no ; then
6917                   if test "$cf_add_incdir" = /usr/local/include ; then
6918                         if test "$GCC" = yes
6919                         then
6920                           cf_save_CPPFLAGS=$CPPFLAGS
6921                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6922                           cat >conftest.$ac_ext <<_ACEOF
6923 #line 6923 "configure"
6924 #include "confdefs.h"
6925 #include <stdio.h>
6926 int
6927 main ()
6928 {
6929 printf("Hello")
6930   ;
6931   return 0;
6932 }
6933 _ACEOF
6934 rm -f conftest.$ac_objext
6935 if { (eval echo "$as_me:6935: \"$ac_compile\"") >&5
6936   (eval $ac_compile) 2>&5
6937   ac_status=$?
6938   echo "$as_me:6938: \$? = $ac_status" >&5
6939   (exit $ac_status); } &&
6940          { ac_try='test -s conftest.$ac_objext'
6941   { (eval echo "$as_me:6941: \"$ac_try\"") >&5
6942   (eval $ac_try) 2>&5
6943   ac_status=$?
6944   echo "$as_me:6944: \$? = $ac_status" >&5
6945   (exit $ac_status); }; }; then
6946   :
6947 else
6948   echo "$as_me: failed program was:" >&5
6949 cat conftest.$ac_ext >&5
6950 cf_have_incdir=yes
6951 fi
6952 rm -f conftest.$ac_objext conftest.$ac_ext
6953                           CPPFLAGS=$cf_save_CPPFLAGS
6954                         fi
6955                   fi
6956                 fi
6957
6958                 if test "$cf_have_incdir" = no ; then
6959                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6960
6961 echo "${as_me:-configure}:6961: testing adding $cf_add_incdir to include-path ..." 1>&5
6962
6963                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6964
6965                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6966                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6967                   cf_add_incdir="$cf_top_incdir"
6968                 else
6969                   break
6970                 fi
6971           fi
6972         done
6973   done
6974 fi
6975
6976                 for cf_header in \
6977                         ncurses.h \
6978                         curses.h
6979                 do
6980
6981         cat >conftest.$ac_ext <<_ACEOF
6982 #line 6982 "configure"
6983 #include "confdefs.h"
6984
6985 #include <$cf_header>
6986 int
6987 main ()
6988 {
6989
6990 #ifdef NCURSES_VERSION
6991
6992 printf("%s\n", NCURSES_VERSION);
6993 #else
6994 #ifdef __NCURSES_H
6995 printf("old\n");
6996 #else
6997         make an error
6998 #endif
6999 #endif
7000
7001   ;
7002   return 0;
7003 }
7004 _ACEOF
7005 rm -f conftest.$ac_objext
7006 if { (eval echo "$as_me:7006: \"$ac_compile\"") >&5
7007   (eval $ac_compile) 2>&5
7008   ac_status=$?
7009   echo "$as_me:7009: \$? = $ac_status" >&5
7010   (exit $ac_status); } &&
7011          { ac_try='test -s conftest.$ac_objext'
7012   { (eval echo "$as_me:7012: \"$ac_try\"") >&5
7013   (eval $ac_try) 2>&5
7014   ac_status=$?
7015   echo "$as_me:7015: \$? = $ac_status" >&5
7016   (exit $ac_status); }; }; then
7017   cf_cv_ncurses_h2=$cf_header
7018
7019 else
7020   echo "$as_me: failed program was:" >&5
7021 cat conftest.$ac_ext >&5
7022 cf_cv_ncurses_h2=no
7023 fi
7024 rm -f conftest.$ac_objext conftest.$ac_ext
7025
7026                         if test "$cf_cv_ncurses_h2" != no ; then
7027                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7028                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7029                                 break
7030                         fi
7031                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7032                 done
7033                 CPPFLAGS="$cf_save2_CPPFLAGS"
7034                 test "$cf_cv_ncurses_h2" != no && break
7035         done
7036         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7036: error: not found" >&5
7037 echo "$as_me: error: not found" >&2;}
7038    { (exit 1); exit 1; }; }
7039
7040 fi
7041 echo "$as_me:7041: result: $cf_cv_ncurses_h2" >&5
7042 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7043
7044         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7045         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7046         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7047                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7048         fi
7049
7050 if test -n "$cf_1st_incdir" ; then
7051   for cf_add_incdir in $cf_1st_incdir
7052   do
7053         while test $cf_add_incdir != /usr/include
7054         do
7055           if test -d $cf_add_incdir
7056           then
7057                 cf_have_incdir=no
7058                 if test -n "$CFLAGS$CPPFLAGS" ; then
7059                   # a loop is needed to ensure we can add subdirs of existing dirs
7060                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7061                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7062                           cf_have_incdir=yes; break
7063                         fi
7064                   done
7065                 fi
7066
7067                 if test "$cf_have_incdir" = no ; then
7068                   if test "$cf_add_incdir" = /usr/local/include ; then
7069                         if test "$GCC" = yes
7070                         then
7071                           cf_save_CPPFLAGS=$CPPFLAGS
7072                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7073                           cat >conftest.$ac_ext <<_ACEOF
7074 #line 7074 "configure"
7075 #include "confdefs.h"
7076 #include <stdio.h>
7077 int
7078 main ()
7079 {
7080 printf("Hello")
7081   ;
7082   return 0;
7083 }
7084 _ACEOF
7085 rm -f conftest.$ac_objext
7086 if { (eval echo "$as_me:7086: \"$ac_compile\"") >&5
7087   (eval $ac_compile) 2>&5
7088   ac_status=$?
7089   echo "$as_me:7089: \$? = $ac_status" >&5
7090   (exit $ac_status); } &&
7091          { ac_try='test -s conftest.$ac_objext'
7092   { (eval echo "$as_me:7092: \"$ac_try\"") >&5
7093   (eval $ac_try) 2>&5
7094   ac_status=$?
7095   echo "$as_me:7095: \$? = $ac_status" >&5
7096   (exit $ac_status); }; }; then
7097   :
7098 else
7099   echo "$as_me: failed program was:" >&5
7100 cat conftest.$ac_ext >&5
7101 cf_have_incdir=yes
7102 fi
7103 rm -f conftest.$ac_objext conftest.$ac_ext
7104                           CPPFLAGS=$cf_save_CPPFLAGS
7105                         fi
7106                   fi
7107                 fi
7108
7109                 if test "$cf_have_incdir" = no ; then
7110                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7111
7112 echo "${as_me:-configure}:7112: testing adding $cf_add_incdir to include-path ..." 1>&5
7113
7114                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7115
7116                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7117                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7118                   cf_add_incdir="$cf_top_incdir"
7119                 else
7120                   break
7121                 fi
7122           fi
7123         done
7124   done
7125 fi
7126
7127 fi
7128
7129 # Set definitions to allow ifdef'ing for ncurses.h
7130
7131 case $cf_cv_ncurses_header in # (vi
7132 *ncurses.h)
7133         cat >>confdefs.h <<\EOF
7134 #define HAVE_NCURSES_H 1
7135 EOF
7136
7137         ;;
7138 esac
7139
7140 case $cf_cv_ncurses_header in # (vi
7141 ncurses/curses.h|ncurses/ncurses.h)
7142         cat >>confdefs.h <<\EOF
7143 #define HAVE_NCURSES_NCURSES_H 1
7144 EOF
7145
7146         ;;
7147 ncursesw/curses.h|ncursesw/ncurses.h)
7148         cat >>confdefs.h <<\EOF
7149 #define HAVE_NCURSESW_NCURSES_H 1
7150 EOF
7151
7152         ;;
7153 esac
7154
7155 echo "$as_me:7155: checking for terminfo header" >&5
7156 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7157 if test "${cf_cv_term_header+set}" = set; then
7158   echo $ECHO_N "(cached) $ECHO_C" >&6
7159 else
7160
7161 case ${cf_cv_ncurses_header} in #(vi
7162 */ncurses.h|*/ncursesw.h) #(vi
7163         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7164         ;;
7165 *)
7166         cf_term_header=term.h
7167         ;;
7168 esac
7169
7170 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7171 do
7172 cat >conftest.$ac_ext <<_ACEOF
7173 #line 7173 "configure"
7174 #include "confdefs.h"
7175 #include <stdio.h>
7176 #include <${cf_cv_ncurses_header:-curses.h}>
7177 #include <$cf_test>
7178
7179 int
7180 main ()
7181 {
7182 int x = auto_left_margin
7183   ;
7184   return 0;
7185 }
7186 _ACEOF
7187 rm -f conftest.$ac_objext
7188 if { (eval echo "$as_me:7188: \"$ac_compile\"") >&5
7189   (eval $ac_compile) 2>&5
7190   ac_status=$?
7191   echo "$as_me:7191: \$? = $ac_status" >&5
7192   (exit $ac_status); } &&
7193          { ac_try='test -s conftest.$ac_objext'
7194   { (eval echo "$as_me:7194: \"$ac_try\"") >&5
7195   (eval $ac_try) 2>&5
7196   ac_status=$?
7197   echo "$as_me:7197: \$? = $ac_status" >&5
7198   (exit $ac_status); }; }; then
7199
7200         cf_cv_term_header="$cf_test"
7201 else
7202   echo "$as_me: failed program was:" >&5
7203 cat conftest.$ac_ext >&5
7204
7205         cf_cv_term_header=unknown
7206
7207 fi
7208 rm -f conftest.$ac_objext conftest.$ac_ext
7209         test "$cf_cv_term_header" != unknown && break
7210 done
7211
7212 fi
7213 echo "$as_me:7213: result: $cf_cv_term_header" >&5
7214 echo "${ECHO_T}$cf_cv_term_header" >&6
7215
7216 # Set definitions to allow ifdef'ing to accommodate subdirectories
7217
7218 case $cf_cv_term_header in # (vi
7219 *term.h)
7220         cat >>confdefs.h <<\EOF
7221 #define HAVE_TERM_H 1
7222 EOF
7223
7224         ;;
7225 esac
7226
7227 case $cf_cv_term_header in # (vi
7228 ncurses/term.h) #(vi
7229         cat >>confdefs.h <<\EOF
7230 #define HAVE_NCURSES_TERM_H 1
7231 EOF
7232
7233         ;;
7234 ncursesw/term.h)
7235         cat >>confdefs.h <<\EOF
7236 #define HAVE_NCURSESW_TERM_H 1
7237 EOF
7238
7239         ;;
7240 esac
7241
7242 # some applications need this, but should check for NCURSES_VERSION
7243 cat >>confdefs.h <<\EOF
7244 #define NCURSES 1
7245 EOF
7246
7247 echo "$as_me:7247: checking for ncurses version" >&5
7248 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7249 if test "${cf_cv_ncurses_version+set}" = set; then
7250   echo $ECHO_N "(cached) $ECHO_C" >&6
7251 else
7252
7253         cf_cv_ncurses_version=no
7254         cf_tempfile=out$$
7255         rm -f $cf_tempfile
7256         if test "$cross_compiling" = yes; then
7257
7258         # This will not work if the preprocessor splits the line after the
7259         # Autoconf token.  The 'unproto' program does that.
7260         cat > conftest.$ac_ext <<EOF
7261 #include <${cf_cv_ncurses_header:-curses.h}>
7262 #undef Autoconf
7263 #ifdef NCURSES_VERSION
7264 Autoconf NCURSES_VERSION
7265 #else
7266 #ifdef __NCURSES_H
7267 Autoconf "old"
7268 #endif
7269 ;
7270 #endif
7271 EOF
7272         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7273         { (eval echo "$as_me:7273: \"$cf_try\"") >&5
7274   (eval $cf_try) 2>&5
7275   ac_status=$?
7276   echo "$as_me:7276: \$? = $ac_status" >&5
7277   (exit $ac_status); }
7278         if test -f conftest.out ; then
7279                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7280                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7281                 rm -f conftest.out
7282         fi
7283
7284 else
7285   cat >conftest.$ac_ext <<_ACEOF
7286 #line 7286 "configure"
7287 #include "confdefs.h"
7288
7289 #include <${cf_cv_ncurses_header:-curses.h}>
7290 #include <stdio.h>
7291 int main()
7292 {
7293         FILE *fp = fopen("$cf_tempfile", "w");
7294 #ifdef NCURSES_VERSION
7295 # ifdef NCURSES_VERSION_PATCH
7296         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7297 # else
7298         fprintf(fp, "%s\n", NCURSES_VERSION);
7299 # endif
7300 #else
7301 # ifdef __NCURSES_H
7302         fprintf(fp, "old\n");
7303 # else
7304         make an error
7305 # endif
7306 #endif
7307         ${cf_cv_main_return:-return}(0);
7308 }
7309 _ACEOF
7310 rm -f conftest$ac_exeext
7311 if { (eval echo "$as_me:7311: \"$ac_link\"") >&5
7312   (eval $ac_link) 2>&5
7313   ac_status=$?
7314   echo "$as_me:7314: \$? = $ac_status" >&5
7315   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7316   { (eval echo "$as_me:7316: \"$ac_try\"") >&5
7317   (eval $ac_try) 2>&5
7318   ac_status=$?
7319   echo "$as_me:7319: \$? = $ac_status" >&5
7320   (exit $ac_status); }; }; then
7321
7322         cf_cv_ncurses_version=`cat $cf_tempfile`
7323 else
7324   echo "$as_me: program exited with status $ac_status" >&5
7325 echo "$as_me: failed program was:" >&5
7326 cat conftest.$ac_ext >&5
7327 fi
7328 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7329 fi
7330         rm -f $cf_tempfile
7331
7332 fi
7333 echo "$as_me:7333: result: $cf_cv_ncurses_version" >&5
7334 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7335 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7336 #define NCURSES 1
7337 EOF
7338
7339 cf_nculib_root=ncurses
7340         # This works, except for the special case where we find gpm, but
7341         # ncurses is in a nonstandard location via $LIBS, and we really want
7342         # to link gpm.
7343 cf_ncurses_LIBS=""
7344 cf_ncurses_SAVE="$LIBS"
7345 echo "$as_me:7345: checking for Gpm_Open in -lgpm" >&5
7346 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7347 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7348   echo $ECHO_N "(cached) $ECHO_C" >&6
7349 else
7350   ac_check_lib_save_LIBS=$LIBS
7351 LIBS="-lgpm  $LIBS"
7352 cat >conftest.$ac_ext <<_ACEOF
7353 #line 7353 "configure"
7354 #include "confdefs.h"
7355
7356 /* Override any gcc2 internal prototype to avoid an error.  */
7357 #ifdef __cplusplus
7358 extern "C"
7359 #endif
7360 /* We use char because int might match the return type of a gcc2
7361    builtin and then its argument prototype would still apply.  */
7362 char Gpm_Open ();
7363 int
7364 main ()
7365 {
7366 Gpm_Open ();
7367   ;
7368   return 0;
7369 }
7370 _ACEOF
7371 rm -f conftest.$ac_objext conftest$ac_exeext
7372 if { (eval echo "$as_me:7372: \"$ac_link\"") >&5
7373   (eval $ac_link) 2>&5
7374   ac_status=$?
7375   echo "$as_me:7375: \$? = $ac_status" >&5
7376   (exit $ac_status); } &&
7377          { ac_try='test -s conftest$ac_exeext'
7378   { (eval echo "$as_me:7378: \"$ac_try\"") >&5
7379   (eval $ac_try) 2>&5
7380   ac_status=$?
7381   echo "$as_me:7381: \$? = $ac_status" >&5
7382   (exit $ac_status); }; }; then
7383   ac_cv_lib_gpm_Gpm_Open=yes
7384 else
7385   echo "$as_me: failed program was:" >&5
7386 cat conftest.$ac_ext >&5
7387 ac_cv_lib_gpm_Gpm_Open=no
7388 fi
7389 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7390 LIBS=$ac_check_lib_save_LIBS
7391 fi
7392 echo "$as_me:7392: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7393 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7394 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7395   echo "$as_me:7395: checking for initscr in -lgpm" >&5
7396 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7397 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7398   echo $ECHO_N "(cached) $ECHO_C" >&6
7399 else
7400   ac_check_lib_save_LIBS=$LIBS
7401 LIBS="-lgpm  $LIBS"
7402 cat >conftest.$ac_ext <<_ACEOF
7403 #line 7403 "configure"
7404 #include "confdefs.h"
7405
7406 /* Override any gcc2 internal prototype to avoid an error.  */
7407 #ifdef __cplusplus
7408 extern "C"
7409 #endif
7410 /* We use char because int might match the return type of a gcc2
7411    builtin and then its argument prototype would still apply.  */
7412 char initscr ();
7413 int
7414 main ()
7415 {
7416 initscr ();
7417   ;
7418   return 0;
7419 }
7420 _ACEOF
7421 rm -f conftest.$ac_objext conftest$ac_exeext
7422 if { (eval echo "$as_me:7422: \"$ac_link\"") >&5
7423   (eval $ac_link) 2>&5
7424   ac_status=$?
7425   echo "$as_me:7425: \$? = $ac_status" >&5
7426   (exit $ac_status); } &&
7427          { ac_try='test -s conftest$ac_exeext'
7428   { (eval echo "$as_me:7428: \"$ac_try\"") >&5
7429   (eval $ac_try) 2>&5
7430   ac_status=$?
7431   echo "$as_me:7431: \$? = $ac_status" >&5
7432   (exit $ac_status); }; }; then
7433   ac_cv_lib_gpm_initscr=yes
7434 else
7435   echo "$as_me: failed program was:" >&5
7436 cat conftest.$ac_ext >&5
7437 ac_cv_lib_gpm_initscr=no
7438 fi
7439 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7440 LIBS=$ac_check_lib_save_LIBS
7441 fi
7442 echo "$as_me:7442: result: $ac_cv_lib_gpm_initscr" >&5
7443 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7444 if test $ac_cv_lib_gpm_initscr = yes; then
7445   LIBS="$cf_ncurses_SAVE"
7446 else
7447   cf_ncurses_LIBS="-lgpm"
7448 fi
7449
7450 fi
7451
7452 case $host_os in #(vi
7453 freebsd*)
7454         # This is only necessary if you are linking against an obsolete
7455         # version of ncurses (but it should do no harm, since it's static).
7456         if test "$cf_nculib_root" = ncurses ; then
7457                 echo "$as_me:7457: checking for tgoto in -lmytinfo" >&5
7458 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7459 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7460   echo $ECHO_N "(cached) $ECHO_C" >&6
7461 else
7462   ac_check_lib_save_LIBS=$LIBS
7463 LIBS="-lmytinfo  $LIBS"
7464 cat >conftest.$ac_ext <<_ACEOF
7465 #line 7465 "configure"
7466 #include "confdefs.h"
7467
7468 /* Override any gcc2 internal prototype to avoid an error.  */
7469 #ifdef __cplusplus
7470 extern "C"
7471 #endif
7472 /* We use char because int might match the return type of a gcc2
7473    builtin and then its argument prototype would still apply.  */
7474 char tgoto ();
7475 int
7476 main ()
7477 {
7478 tgoto ();
7479   ;
7480   return 0;
7481 }
7482 _ACEOF
7483 rm -f conftest.$ac_objext conftest$ac_exeext
7484 if { (eval echo "$as_me:7484: \"$ac_link\"") >&5
7485   (eval $ac_link) 2>&5
7486   ac_status=$?
7487   echo "$as_me:7487: \$? = $ac_status" >&5
7488   (exit $ac_status); } &&
7489          { ac_try='test -s conftest$ac_exeext'
7490   { (eval echo "$as_me:7490: \"$ac_try\"") >&5
7491   (eval $ac_try) 2>&5
7492   ac_status=$?
7493   echo "$as_me:7493: \$? = $ac_status" >&5
7494   (exit $ac_status); }; }; then
7495   ac_cv_lib_mytinfo_tgoto=yes
7496 else
7497   echo "$as_me: failed program was:" >&5
7498 cat conftest.$ac_ext >&5
7499 ac_cv_lib_mytinfo_tgoto=no
7500 fi
7501 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7502 LIBS=$ac_check_lib_save_LIBS
7503 fi
7504 echo "$as_me:7504: result: $ac_cv_lib_mytinfo_tgoto" >&5
7505 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7506 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7507   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7508 fi
7509
7510         fi
7511         ;;
7512 esac
7513
7514 LIBS="$cf_ncurses_LIBS $LIBS"
7515
7516 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7517 then
7518         LIBS="-l$cf_nculib_root $LIBS"
7519 else
7520
7521         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7522         cf_libdir=""
7523         echo "$as_me:7523: checking for initscr" >&5
7524 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7525 if test "${ac_cv_func_initscr+set}" = set; then
7526   echo $ECHO_N "(cached) $ECHO_C" >&6
7527 else
7528   cat >conftest.$ac_ext <<_ACEOF
7529 #line 7529 "configure"
7530 #include "confdefs.h"
7531 /* System header to define __stub macros and hopefully few prototypes,
7532     which can conflict with char initscr (); below.  */
7533 #include <assert.h>
7534 /* Override any gcc2 internal prototype to avoid an error.  */
7535 #ifdef __cplusplus
7536 extern "C"
7537 #endif
7538 /* We use char because int might match the return type of a gcc2
7539    builtin and then its argument prototype would still apply.  */
7540 char initscr ();
7541 char (*f) ();
7542
7543 int
7544 main ()
7545 {
7546 /* The GNU C library defines this for functions which it implements
7547     to always fail with ENOSYS.  Some functions are actually named
7548     something starting with __ and the normal name is an alias.  */
7549 #if defined (__stub_initscr) || defined (__stub___initscr)
7550 choke me
7551 #else
7552 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7553 #endif
7554
7555   ;
7556   return 0;
7557 }
7558 _ACEOF
7559 rm -f conftest.$ac_objext conftest$ac_exeext
7560 if { (eval echo "$as_me:7560: \"$ac_link\"") >&5
7561   (eval $ac_link) 2>&5
7562   ac_status=$?
7563   echo "$as_me:7563: \$? = $ac_status" >&5
7564   (exit $ac_status); } &&
7565          { ac_try='test -s conftest$ac_exeext'
7566   { (eval echo "$as_me:7566: \"$ac_try\"") >&5
7567   (eval $ac_try) 2>&5
7568   ac_status=$?
7569   echo "$as_me:7569: \$? = $ac_status" >&5
7570   (exit $ac_status); }; }; then
7571   ac_cv_func_initscr=yes
7572 else
7573   echo "$as_me: failed program was:" >&5
7574 cat conftest.$ac_ext >&5
7575 ac_cv_func_initscr=no
7576 fi
7577 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7578 fi
7579 echo "$as_me:7579: result: $ac_cv_func_initscr" >&5
7580 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7581 if test $ac_cv_func_initscr = yes; then
7582   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7583 else
7584
7585                 cf_save_LIBS="$LIBS"
7586                 echo "$as_me:7586: checking for initscr in -l$cf_nculib_root" >&5
7587 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7588                 LIBS="-l$cf_nculib_root $LIBS"
7589                 cat >conftest.$ac_ext <<_ACEOF
7590 #line 7590 "configure"
7591 #include "confdefs.h"
7592 #include <${cf_cv_ncurses_header:-curses.h}>
7593 int
7594 main ()
7595 {
7596 initscr()
7597   ;
7598   return 0;
7599 }
7600 _ACEOF
7601 rm -f conftest.$ac_objext conftest$ac_exeext
7602 if { (eval echo "$as_me:7602: \"$ac_link\"") >&5
7603   (eval $ac_link) 2>&5
7604   ac_status=$?
7605   echo "$as_me:7605: \$? = $ac_status" >&5
7606   (exit $ac_status); } &&
7607          { ac_try='test -s conftest$ac_exeext'
7608   { (eval echo "$as_me:7608: \"$ac_try\"") >&5
7609   (eval $ac_try) 2>&5
7610   ac_status=$?
7611   echo "$as_me:7611: \$? = $ac_status" >&5
7612   (exit $ac_status); }; }; then
7613   echo "$as_me:7613: result: yes" >&5
7614 echo "${ECHO_T}yes" >&6
7615                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7616
7617 else
7618   echo "$as_me: failed program was:" >&5
7619 cat conftest.$ac_ext >&5
7620 echo "$as_me:7620: result: no" >&5
7621 echo "${ECHO_T}no" >&6
7622
7623 cf_search=
7624 cf_library_path_list=""
7625 if test -n "${LDFLAGS}${LIBS}" ; then
7626         for cf_library_path in $LDFLAGS $LIBS
7627         do
7628                 case $cf_library_path in #(vi
7629                 -L*)
7630                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7631
7632 test "$cf_library_path" != "NONE" && \
7633 test -d "$cf_library_path" && \
7634  {
7635         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7636         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7637         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7638         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7639         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7640         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"
7641 }
7642
7643                         cf_library_path_list="$cf_library_path_list $cf_search"
7644                         ;;
7645                 esac
7646         done
7647 fi
7648
7649 cf_search=
7650
7651 test "/usr" != "$prefix" && \
7652 test -d "/usr" && \
7653 (test $prefix = NONE || test "/usr" != "$prefix") && {
7654         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7655         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7656         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7657         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7658         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7659         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7660 }
7661
7662 test "$prefix" != "NONE" && \
7663 test -d "$prefix" && \
7664  {
7665         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7666         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7667         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7668         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7669         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7670         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7671 }
7672
7673 test "/usr/local" != "$prefix" && \
7674 test -d "/usr/local" && \
7675 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7676         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7677         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7678         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7679         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7680         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7681         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7682 }
7683
7684 test "/opt" != "$prefix" && \
7685 test -d "/opt" && \
7686 (test $prefix = NONE || test "/opt" != "$prefix") && {
7687         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7688         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7689         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7690         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7691         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7692         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7693 }
7694
7695 test "$HOME" != "$prefix" && \
7696 test -d "$HOME" && \
7697 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7698         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7699         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7700         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7701         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7702         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7703         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7704 }
7705
7706 cf_search="$cf_library_path_list $cf_search"
7707
7708                         for cf_libdir in $cf_search
7709                         do
7710                                 echo "$as_me:7710: checking for -l$cf_nculib_root in $cf_libdir" >&5
7711 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7712                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7713                                 cat >conftest.$ac_ext <<_ACEOF
7714 #line 7714 "configure"
7715 #include "confdefs.h"
7716 #include <${cf_cv_ncurses_header:-curses.h}>
7717 int
7718 main ()
7719 {
7720 initscr()
7721   ;
7722   return 0;
7723 }
7724 _ACEOF
7725 rm -f conftest.$ac_objext conftest$ac_exeext
7726 if { (eval echo "$as_me:7726: \"$ac_link\"") >&5
7727   (eval $ac_link) 2>&5
7728   ac_status=$?
7729   echo "$as_me:7729: \$? = $ac_status" >&5
7730   (exit $ac_status); } &&
7731          { ac_try='test -s conftest$ac_exeext'
7732   { (eval echo "$as_me:7732: \"$ac_try\"") >&5
7733   (eval $ac_try) 2>&5
7734   ac_status=$?
7735   echo "$as_me:7735: \$? = $ac_status" >&5
7736   (exit $ac_status); }; }; then
7737   echo "$as_me:7737: result: yes" >&5
7738 echo "${ECHO_T}yes" >&6
7739                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7740                                          break
7741 else
7742   echo "$as_me: failed program was:" >&5
7743 cat conftest.$ac_ext >&5
7744 echo "$as_me:7744: result: no" >&5
7745 echo "${ECHO_T}no" >&6
7746                                          LIBS="$cf_save_LIBS"
7747 fi
7748 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7749                         done
7750
7751 fi
7752 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7753
7754 fi
7755
7756 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7757
7758 if test $cf_found_library = no ; then
7759         { { echo "$as_me:7759: error: Cannot link $cf_nculib_root library" >&5
7760 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7761    { (exit 1); exit 1; }; }
7762 fi
7763
7764 fi
7765
7766 if test -n "$cf_ncurses_LIBS" ; then
7767         echo "$as_me:7767: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7768 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7769         cf_ncurses_SAVE="$LIBS"
7770         for p in $cf_ncurses_LIBS ; do
7771                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7772                 if test "$q" != "$LIBS" ; then
7773                         LIBS="$q"
7774                 fi
7775         done
7776         cat >conftest.$ac_ext <<_ACEOF
7777 #line 7777 "configure"
7778 #include "confdefs.h"
7779 #include <${cf_cv_ncurses_header:-curses.h}>
7780 int
7781 main ()
7782 {
7783 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7784   ;
7785   return 0;
7786 }
7787 _ACEOF
7788 rm -f conftest.$ac_objext conftest$ac_exeext
7789 if { (eval echo "$as_me:7789: \"$ac_link\"") >&5
7790   (eval $ac_link) 2>&5
7791   ac_status=$?
7792   echo "$as_me:7792: \$? = $ac_status" >&5
7793   (exit $ac_status); } &&
7794          { ac_try='test -s conftest$ac_exeext'
7795   { (eval echo "$as_me:7795: \"$ac_try\"") >&5
7796   (eval $ac_try) 2>&5
7797   ac_status=$?
7798   echo "$as_me:7798: \$? = $ac_status" >&5
7799   (exit $ac_status); }; }; then
7800   echo "$as_me:7800: result: yes" >&5
7801 echo "${ECHO_T}yes" >&6
7802 else
7803   echo "$as_me: failed program was:" >&5
7804 cat conftest.$ac_ext >&5
7805 echo "$as_me:7805: result: no" >&5
7806 echo "${ECHO_T}no" >&6
7807                  LIBS="$cf_ncurses_SAVE"
7808 fi
7809 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7810 fi
7811
7812 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7813
7814 cat >>confdefs.h <<EOF
7815 #define $cf_nculib_ROOT 1
7816 EOF
7817
7818 fi
7819
7820         ;;
7821 ncursesw) #(vi
7822
7823 echo "$as_me:7823: checking for multibyte character support" >&5
7824 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7825 if test "${cf_cv_utf8_lib+set}" = set; then
7826   echo $ECHO_N "(cached) $ECHO_C" >&6
7827 else
7828
7829         cf_save_LIBS="$LIBS"
7830         cat >conftest.$ac_ext <<_ACEOF
7831 #line 7831 "configure"
7832 #include "confdefs.h"
7833
7834 #include <stdlib.h>
7835 int
7836 main ()
7837 {
7838 putwc(0,0);
7839   ;
7840   return 0;
7841 }
7842 _ACEOF
7843 rm -f conftest.$ac_objext conftest$ac_exeext
7844 if { (eval echo "$as_me:7844: \"$ac_link\"") >&5
7845   (eval $ac_link) 2>&5
7846   ac_status=$?
7847   echo "$as_me:7847: \$? = $ac_status" >&5
7848   (exit $ac_status); } &&
7849          { ac_try='test -s conftest$ac_exeext'
7850   { (eval echo "$as_me:7850: \"$ac_try\"") >&5
7851   (eval $ac_try) 2>&5
7852   ac_status=$?
7853   echo "$as_me:7853: \$? = $ac_status" >&5
7854   (exit $ac_status); }; }; then
7855   cf_cv_utf8_lib=yes
7856 else
7857   echo "$as_me: failed program was:" >&5
7858 cat conftest.$ac_ext >&5
7859
7860 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7861 # will be set on completion of the AC_TRY_LINK below.
7862 cf_cv_header_path_utf8=
7863 cf_cv_library_path_utf8=
7864
7865 echo "${as_me:-configure}:7865: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7866
7867 cf_save_LIBS="$LIBS"
7868
7869 cat >conftest.$ac_ext <<_ACEOF
7870 #line 7870 "configure"
7871 #include "confdefs.h"
7872
7873 #include <libutf8.h>
7874 int
7875 main ()
7876 {
7877 putwc(0,0);
7878   ;
7879   return 0;
7880 }
7881 _ACEOF
7882 rm -f conftest.$ac_objext conftest$ac_exeext
7883 if { (eval echo "$as_me:7883: \"$ac_link\"") >&5
7884   (eval $ac_link) 2>&5
7885   ac_status=$?
7886   echo "$as_me:7886: \$? = $ac_status" >&5
7887   (exit $ac_status); } &&
7888          { ac_try='test -s conftest$ac_exeext'
7889   { (eval echo "$as_me:7889: \"$ac_try\"") >&5
7890   (eval $ac_try) 2>&5
7891   ac_status=$?
7892   echo "$as_me:7892: \$? = $ac_status" >&5
7893   (exit $ac_status); }; }; then
7894
7895         cf_cv_find_linkage_utf8=yes
7896         cf_cv_header_path_utf8=/usr/include
7897         cf_cv_library_path_utf8=/usr/lib
7898
7899 else
7900   echo "$as_me: failed program was:" >&5
7901 cat conftest.$ac_ext >&5
7902
7903 LIBS="-lutf8  $cf_save_LIBS"
7904
7905 cat >conftest.$ac_ext <<_ACEOF
7906 #line 7906 "configure"
7907 #include "confdefs.h"
7908
7909 #include <libutf8.h>
7910 int
7911 main ()
7912 {
7913 putwc(0,0);
7914   ;
7915   return 0;
7916 }
7917 _ACEOF
7918 rm -f conftest.$ac_objext conftest$ac_exeext
7919 if { (eval echo "$as_me:7919: \"$ac_link\"") >&5
7920   (eval $ac_link) 2>&5
7921   ac_status=$?
7922   echo "$as_me:7922: \$? = $ac_status" >&5
7923   (exit $ac_status); } &&
7924          { ac_try='test -s conftest$ac_exeext'
7925   { (eval echo "$as_me:7925: \"$ac_try\"") >&5
7926   (eval $ac_try) 2>&5
7927   ac_status=$?
7928   echo "$as_me:7928: \$? = $ac_status" >&5
7929   (exit $ac_status); }; }; then
7930
7931         cf_cv_find_linkage_utf8=yes
7932         cf_cv_header_path_utf8=/usr/include
7933         cf_cv_library_path_utf8=/usr/lib
7934         cf_cv_library_file_utf8="-lutf8"
7935
7936 else
7937   echo "$as_me: failed program was:" >&5
7938 cat conftest.$ac_ext >&5
7939
7940         cf_cv_find_linkage_utf8=no
7941         LIBS="$cf_save_LIBS"
7942
7943     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7944
7945 echo "${as_me:-configure}:7945: testing find linkage for utf8 library ..." 1>&5
7946
7947 echo "${as_me:-configure}:7947: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7948
7949     cf_save_CPPFLAGS="$CPPFLAGS"
7950     cf_test_CPPFLAGS="$CPPFLAGS"
7951
7952 cf_search=
7953
7954 # collect the current set of include-directories from compiler flags
7955 cf_header_path_list=""
7956 if test -n "${CFLAGS}${CPPFLAGS}" ; then
7957         for cf_header_path in $CPPFLAGS $CFLAGS
7958         do
7959                 case $cf_header_path in #(vi
7960                 -I*)
7961                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
7962
7963 test "$cf_header_path" != "NONE" && \
7964 test -d "$cf_header_path" && \
7965  {
7966         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
7967         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
7968         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
7969         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
7970         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
7971         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
7972 }
7973
7974                         cf_header_path_list="$cf_header_path_list $cf_search"
7975                         ;;
7976                 esac
7977         done
7978 fi
7979
7980 # add the variations for the package we are looking for
7981
7982 cf_search=
7983
7984 test "/usr" != "$prefix" && \
7985 test -d "/usr" && \
7986 (test $prefix = NONE || test "/usr" != "$prefix") && {
7987         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
7988         test -d /usr/include &&          cf_search="$cf_search /usr/include"
7989         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
7990         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
7991         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
7992         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
7993 }
7994
7995 test "$prefix" != "NONE" && \
7996 test -d "$prefix" && \
7997  {
7998         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
7999         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8000         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
8001         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
8002         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
8003         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8004 }
8005
8006 test "/usr/local" != "$prefix" && \
8007 test -d "/usr/local" && \
8008 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8009         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8010         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8011         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
8012         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
8013         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
8014         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
8015 }
8016
8017 test "/opt" != "$prefix" && \
8018 test -d "/opt" && \
8019 (test $prefix = NONE || test "/opt" != "$prefix") && {
8020         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8021         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8022         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
8023         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
8024         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
8025         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
8026 }
8027
8028 test "$HOME" != "$prefix" && \
8029 test -d "$HOME" && \
8030 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8031         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8032         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8033         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
8034         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
8035         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
8036         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
8037 }
8038
8039 test "$includedir" != NONE && \
8040 test "$includedir" != "/usr/include" && \
8041 test -d "$includedir" && {
8042         test -d $includedir &&    cf_search="$cf_search $includedir"
8043         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
8044 }
8045
8046 test "$oldincludedir" != NONE && \
8047 test "$oldincludedir" != "/usr/include" && \
8048 test -d "$oldincludedir" && {
8049         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8050         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
8051 }
8052
8053 cf_search="$cf_search $cf_header_path_list"
8054
8055     for cf_cv_header_path_utf8 in $cf_search
8056     do
8057       if test -d $cf_cv_header_path_utf8 ; then
8058         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8059
8060 echo "${as_me:-configure}:8060: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8061
8062         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
8063         cat >conftest.$ac_ext <<_ACEOF
8064 #line 8064 "configure"
8065 #include "confdefs.h"
8066
8067 #include <libutf8.h>
8068 int
8069 main ()
8070 {
8071 putwc(0,0);
8072   ;
8073   return 0;
8074 }
8075 _ACEOF
8076 rm -f conftest.$ac_objext
8077 if { (eval echo "$as_me:8077: \"$ac_compile\"") >&5
8078   (eval $ac_compile) 2>&5
8079   ac_status=$?
8080   echo "$as_me:8080: \$? = $ac_status" >&5
8081   (exit $ac_status); } &&
8082          { ac_try='test -s conftest.$ac_objext'
8083   { (eval echo "$as_me:8083: \"$ac_try\"") >&5
8084   (eval $ac_try) 2>&5
8085   ac_status=$?
8086   echo "$as_me:8086: \$? = $ac_status" >&5
8087   (exit $ac_status); }; }; then
8088
8089             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8090
8091 echo "${as_me:-configure}:8091: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8092
8093             cf_cv_find_linkage_utf8=maybe
8094             cf_test_CPPFLAGS="$CPPFLAGS"
8095             break
8096 else
8097   echo "$as_me: failed program was:" >&5
8098 cat conftest.$ac_ext >&5
8099
8100             CPPFLAGS="$cf_save_CPPFLAGS"
8101
8102 fi
8103 rm -f conftest.$ac_objext conftest.$ac_ext
8104       fi
8105     done
8106
8107     if test "$cf_cv_find_linkage_utf8" = maybe ; then
8108
8109 echo "${as_me:-configure}:8109: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8110
8111       cf_save_LIBS="$LIBS"
8112       cf_save_LDFLAGS="$LDFLAGS"
8113
8114       if test "$cf_cv_find_linkage_utf8" != yes ; then
8115
8116 cf_search=
8117 cf_library_path_list=""
8118 if test -n "${LDFLAGS}${LIBS}" ; then
8119         for cf_library_path in $LDFLAGS $LIBS
8120         do
8121                 case $cf_library_path in #(vi
8122                 -L*)
8123                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8124
8125 test "$cf_library_path" != "NONE" && \
8126 test -d "$cf_library_path" && \
8127  {
8128         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8129         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8130         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8131         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8132         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8133         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8134 }
8135
8136                         cf_library_path_list="$cf_library_path_list $cf_search"
8137                         ;;
8138                 esac
8139         done
8140 fi
8141
8142 cf_search=
8143
8144 test "/usr" != "$prefix" && \
8145 test -d "/usr" && \
8146 (test $prefix = NONE || test "/usr" != "$prefix") && {
8147         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8148         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8149         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
8150         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
8151         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
8152         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
8153 }
8154
8155 test "$prefix" != "NONE" && \
8156 test -d "$prefix" && \
8157  {
8158         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8159         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8160         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
8161         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8162         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
8163         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8164 }
8165
8166 test "/usr/local" != "$prefix" && \
8167 test -d "/usr/local" && \
8168 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8169         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8170         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8171         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
8172         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
8173         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
8174         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
8175 }
8176
8177 test "/opt" != "$prefix" && \
8178 test -d "/opt" && \
8179 (test $prefix = NONE || test "/opt" != "$prefix") && {
8180         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8181         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8182         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
8183         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
8184         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
8185         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
8186 }
8187
8188 test "$HOME" != "$prefix" && \
8189 test -d "$HOME" && \
8190 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8191         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8192         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8193         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8194         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8195         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8196         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8197 }
8198
8199 cf_search="$cf_library_path_list $cf_search"
8200
8201         for cf_cv_library_path_utf8 in $cf_search
8202         do
8203           if test -d $cf_cv_library_path_utf8 ; then
8204             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8205
8206 echo "${as_me:-configure}:8206: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8207
8208             CPPFLAGS="$cf_test_CPPFLAGS"
8209             LIBS="-lutf8  $cf_save_LIBS"
8210             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8211             cat >conftest.$ac_ext <<_ACEOF
8212 #line 8212 "configure"
8213 #include "confdefs.h"
8214
8215 #include <libutf8.h>
8216 int
8217 main ()
8218 {
8219 putwc(0,0);
8220   ;
8221   return 0;
8222 }
8223 _ACEOF
8224 rm -f conftest.$ac_objext conftest$ac_exeext
8225 if { (eval echo "$as_me:8225: \"$ac_link\"") >&5
8226   (eval $ac_link) 2>&5
8227   ac_status=$?
8228   echo "$as_me:8228: \$? = $ac_status" >&5
8229   (exit $ac_status); } &&
8230          { ac_try='test -s conftest$ac_exeext'
8231   { (eval echo "$as_me:8231: \"$ac_try\"") >&5
8232   (eval $ac_try) 2>&5
8233   ac_status=$?
8234   echo "$as_me:8234: \$? = $ac_status" >&5
8235   (exit $ac_status); }; }; then
8236
8237                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8238
8239 echo "${as_me:-configure}:8239: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8240
8241                 cf_cv_find_linkage_utf8=yes
8242                 cf_cv_library_file_utf8="-lutf8"
8243                 break
8244 else
8245   echo "$as_me: failed program was:" >&5
8246 cat conftest.$ac_ext >&5
8247
8248                 CPPFLAGS="$cf_save_CPPFLAGS"
8249                 LIBS="$cf_save_LIBS"
8250                 LDFLAGS="$cf_save_LDFLAGS"
8251
8252 fi
8253 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8254           fi
8255         done
8256         CPPFLAGS="$cf_save_CPPFLAGS"
8257         LDFLAGS="$cf_save_LDFLAGS"
8258       fi
8259
8260     else
8261       cf_cv_find_linkage_utf8=no
8262     fi
8263
8264 fi
8265 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8266
8267 fi
8268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8269
8270 LIBS="$cf_save_LIBS"
8271
8272 if test "$cf_cv_find_linkage_utf8" = yes ; then
8273 cf_cv_utf8_lib=add-on
8274 else
8275 cf_cv_utf8_lib=no
8276 fi
8277
8278 fi
8279 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8280 fi
8281 echo "$as_me:8281: result: $cf_cv_utf8_lib" >&5
8282 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8283
8284 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8285 # ncurses/ncursesw:
8286 if test "$cf_cv_utf8_lib" = "add-on" ; then
8287         cat >>confdefs.h <<\EOF
8288 #define HAVE_LIBUTF8_H 1
8289 EOF
8290
8291 if test -n "$cf_cv_header_path_utf8" ; then
8292   for cf_add_incdir in $cf_cv_header_path_utf8
8293   do
8294         while test $cf_add_incdir != /usr/include
8295         do
8296           if test -d $cf_add_incdir
8297           then
8298                 cf_have_incdir=no
8299                 if test -n "$CFLAGS$CPPFLAGS" ; then
8300                   # a loop is needed to ensure we can add subdirs of existing dirs
8301                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8302                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8303                           cf_have_incdir=yes; break
8304                         fi
8305                   done
8306                 fi
8307
8308                 if test "$cf_have_incdir" = no ; then
8309                   if test "$cf_add_incdir" = /usr/local/include ; then
8310                         if test "$GCC" = yes
8311                         then
8312                           cf_save_CPPFLAGS=$CPPFLAGS
8313                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8314                           cat >conftest.$ac_ext <<_ACEOF
8315 #line 8315 "configure"
8316 #include "confdefs.h"
8317 #include <stdio.h>
8318 int
8319 main ()
8320 {
8321 printf("Hello")
8322   ;
8323   return 0;
8324 }
8325 _ACEOF
8326 rm -f conftest.$ac_objext
8327 if { (eval echo "$as_me:8327: \"$ac_compile\"") >&5
8328   (eval $ac_compile) 2>&5
8329   ac_status=$?
8330   echo "$as_me:8330: \$? = $ac_status" >&5
8331   (exit $ac_status); } &&
8332          { ac_try='test -s conftest.$ac_objext'
8333   { (eval echo "$as_me:8333: \"$ac_try\"") >&5
8334   (eval $ac_try) 2>&5
8335   ac_status=$?
8336   echo "$as_me:8336: \$? = $ac_status" >&5
8337   (exit $ac_status); }; }; then
8338   :
8339 else
8340   echo "$as_me: failed program was:" >&5
8341 cat conftest.$ac_ext >&5
8342 cf_have_incdir=yes
8343 fi
8344 rm -f conftest.$ac_objext conftest.$ac_ext
8345                           CPPFLAGS=$cf_save_CPPFLAGS
8346                         fi
8347                   fi
8348                 fi
8349
8350                 if test "$cf_have_incdir" = no ; then
8351                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8352
8353 echo "${as_me:-configure}:8353: testing adding $cf_add_incdir to include-path ..." 1>&5
8354
8355                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8356
8357                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8358                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8359                   cf_add_incdir="$cf_top_incdir"
8360                 else
8361                   break
8362                 fi
8363           fi
8364         done
8365   done
8366 fi
8367
8368 if test -n "$cf_cv_library_path_utf8" ; then
8369   for cf_add_libdir in $cf_cv_library_path_utf8
8370   do
8371     if test $cf_add_libdir = /usr/lib ; then
8372       :
8373     elif test -d $cf_add_libdir
8374     then
8375       cf_have_libdir=no
8376       if test -n "$LDFLAGS$LIBS" ; then
8377         # a loop is needed to ensure we can add subdirs of existing dirs
8378         for cf_test_libdir in $LDFLAGS $LIBS ; do
8379           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8380             cf_have_libdir=yes; break
8381           fi
8382         done
8383       fi
8384       if test "$cf_have_libdir" = no ; then
8385         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8386
8387 echo "${as_me:-configure}:8387: testing adding $cf_add_libdir to library-path ..." 1>&5
8388
8389         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8390       fi
8391     fi
8392   done
8393 fi
8394
8395         LIBS="$cf_cv_library_file_utf8 $LIBS"
8396 fi
8397
8398 cf_ncuconfig_root=ncursesw
8399
8400 echo "Looking for ${cf_ncuconfig_root}-config"
8401
8402 if test -n "$ac_tool_prefix"; then
8403   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8404   do
8405     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8406 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8407 echo "$as_me:8407: checking for $ac_word" >&5
8408 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8409 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8410   echo $ECHO_N "(cached) $ECHO_C" >&6
8411 else
8412   if test -n "$NCURSES_CONFIG"; then
8413   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8414 else
8415   ac_save_IFS=$IFS; IFS=$ac_path_separator
8416 ac_dummy="$PATH"
8417 for ac_dir in $ac_dummy; do
8418   IFS=$ac_save_IFS
8419   test -z "$ac_dir" && ac_dir=.
8420   $as_executable_p "$ac_dir/$ac_word" || continue
8421 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8422 echo "$as_me:8422: found $ac_dir/$ac_word" >&5
8423 break
8424 done
8425
8426 fi
8427 fi
8428 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8429 if test -n "$NCURSES_CONFIG"; then
8430   echo "$as_me:8430: result: $NCURSES_CONFIG" >&5
8431 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8432 else
8433   echo "$as_me:8433: result: no" >&5
8434 echo "${ECHO_T}no" >&6
8435 fi
8436
8437     test -n "$NCURSES_CONFIG" && break
8438   done
8439 fi
8440 if test -z "$NCURSES_CONFIG"; then
8441   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8442   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8443 do
8444   # Extract the first word of "$ac_prog", so it can be a program name with args.
8445 set dummy $ac_prog; ac_word=$2
8446 echo "$as_me:8446: checking for $ac_word" >&5
8447 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8448 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8449   echo $ECHO_N "(cached) $ECHO_C" >&6
8450 else
8451   if test -n "$ac_ct_NCURSES_CONFIG"; then
8452   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8453 else
8454   ac_save_IFS=$IFS; IFS=$ac_path_separator
8455 ac_dummy="$PATH"
8456 for ac_dir in $ac_dummy; do
8457   IFS=$ac_save_IFS
8458   test -z "$ac_dir" && ac_dir=.
8459   $as_executable_p "$ac_dir/$ac_word" || continue
8460 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8461 echo "$as_me:8461: found $ac_dir/$ac_word" >&5
8462 break
8463 done
8464
8465 fi
8466 fi
8467 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8468 if test -n "$ac_ct_NCURSES_CONFIG"; then
8469   echo "$as_me:8469: result: $ac_ct_NCURSES_CONFIG" >&5
8470 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8471 else
8472   echo "$as_me:8472: result: no" >&5
8473 echo "${ECHO_T}no" >&6
8474 fi
8475
8476   test -n "$ac_ct_NCURSES_CONFIG" && break
8477 done
8478 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8479
8480   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8481 fi
8482
8483 if test "$NCURSES_CONFIG" != none ; then
8484
8485 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8486 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8487
8488 # even with config script, some packages use no-override for curses.h
8489
8490 echo "$as_me:8490: checking if we have identified curses headers" >&5
8491 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8492 if test "${cf_cv_ncurses_header+set}" = set; then
8493   echo $ECHO_N "(cached) $ECHO_C" >&6
8494 else
8495
8496 cf_cv_ncurses_header=none
8497 for cf_header in  \
8498     ncursesw/ncurses.h \
8499         ncursesw/curses.h \
8500         ncurses.h \
8501         curses.h
8502 do
8503 cat >conftest.$ac_ext <<_ACEOF
8504 #line 8504 "configure"
8505 #include "confdefs.h"
8506 #include <${cf_header}>
8507 int
8508 main ()
8509 {
8510 initscr(); tgoto("?", 0,0)
8511   ;
8512   return 0;
8513 }
8514 _ACEOF
8515 rm -f conftest.$ac_objext
8516 if { (eval echo "$as_me:8516: \"$ac_compile\"") >&5
8517   (eval $ac_compile) 2>&5
8518   ac_status=$?
8519   echo "$as_me:8519: \$? = $ac_status" >&5
8520   (exit $ac_status); } &&
8521          { ac_try='test -s conftest.$ac_objext'
8522   { (eval echo "$as_me:8522: \"$ac_try\"") >&5
8523   (eval $ac_try) 2>&5
8524   ac_status=$?
8525   echo "$as_me:8525: \$? = $ac_status" >&5
8526   (exit $ac_status); }; }; then
8527   cf_cv_ncurses_header=$cf_header; break
8528 else
8529   echo "$as_me: failed program was:" >&5
8530 cat conftest.$ac_ext >&5
8531 fi
8532 rm -f conftest.$ac_objext conftest.$ac_ext
8533 done
8534
8535 fi
8536 echo "$as_me:8536: result: $cf_cv_ncurses_header" >&5
8537 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8538
8539 if test "$cf_cv_ncurses_header" = none ; then
8540         { { echo "$as_me:8540: error: No curses header-files found" >&5
8541 echo "$as_me: error: No curses header-files found" >&2;}
8542    { (exit 1); exit 1; }; }
8543 fi
8544
8545 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8546
8547 for ac_header in $cf_cv_ncurses_header
8548 do
8549 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8550 echo "$as_me:8550: checking for $ac_header" >&5
8551 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8552 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8553   echo $ECHO_N "(cached) $ECHO_C" >&6
8554 else
8555   cat >conftest.$ac_ext <<_ACEOF
8556 #line 8556 "configure"
8557 #include "confdefs.h"
8558 #include <$ac_header>
8559 _ACEOF
8560 if { (eval echo "$as_me:8560: \"$ac_cpp conftest.$ac_ext\"") >&5
8561   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8562   ac_status=$?
8563   egrep -v '^ *\+' conftest.er1 >conftest.err
8564   rm -f conftest.er1
8565   cat conftest.err >&5
8566   echo "$as_me:8566: \$? = $ac_status" >&5
8567   (exit $ac_status); } >/dev/null; then
8568   if test -s conftest.err; then
8569     ac_cpp_err=$ac_c_preproc_warn_flag
8570   else
8571     ac_cpp_err=
8572   fi
8573 else
8574   ac_cpp_err=yes
8575 fi
8576 if test -z "$ac_cpp_err"; then
8577   eval "$as_ac_Header=yes"
8578 else
8579   echo "$as_me: failed program was:" >&5
8580   cat conftest.$ac_ext >&5
8581   eval "$as_ac_Header=no"
8582 fi
8583 rm -f conftest.err conftest.$ac_ext
8584 fi
8585 echo "$as_me:8585: result: `eval echo '${'$as_ac_Header'}'`" >&5
8586 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8587 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8588   cat >>confdefs.h <<EOF
8589 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8590 EOF
8591
8592 fi
8593 done
8594
8595 cat >>confdefs.h <<\EOF
8596 #define NCURSES 1
8597 EOF
8598
8599 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8600
8601 cat >>confdefs.h <<EOF
8602 #define $cf_nculib_ROOT 1
8603 EOF
8604
8605 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8606
8607 else
8608
8609 cf_ncuhdr_root=ncursesw
8610
8611 test -n "$cf_cv_curses_dir" && \
8612 test "$cf_cv_curses_dir" != "no" && { \
8613
8614 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8615   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8616   do
8617         while test $cf_add_incdir != /usr/include
8618         do
8619           if test -d $cf_add_incdir
8620           then
8621                 cf_have_incdir=no
8622                 if test -n "$CFLAGS$CPPFLAGS" ; then
8623                   # a loop is needed to ensure we can add subdirs of existing dirs
8624                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8625                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8626                           cf_have_incdir=yes; break
8627                         fi
8628                   done
8629                 fi
8630
8631                 if test "$cf_have_incdir" = no ; then
8632                   if test "$cf_add_incdir" = /usr/local/include ; then
8633                         if test "$GCC" = yes
8634                         then
8635                           cf_save_CPPFLAGS=$CPPFLAGS
8636                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8637                           cat >conftest.$ac_ext <<_ACEOF
8638 #line 8638 "configure"
8639 #include "confdefs.h"
8640 #include <stdio.h>
8641 int
8642 main ()
8643 {
8644 printf("Hello")
8645   ;
8646   return 0;
8647 }
8648 _ACEOF
8649 rm -f conftest.$ac_objext
8650 if { (eval echo "$as_me:8650: \"$ac_compile\"") >&5
8651   (eval $ac_compile) 2>&5
8652   ac_status=$?
8653   echo "$as_me:8653: \$? = $ac_status" >&5
8654   (exit $ac_status); } &&
8655          { ac_try='test -s conftest.$ac_objext'
8656   { (eval echo "$as_me:8656: \"$ac_try\"") >&5
8657   (eval $ac_try) 2>&5
8658   ac_status=$?
8659   echo "$as_me:8659: \$? = $ac_status" >&5
8660   (exit $ac_status); }; }; then
8661   :
8662 else
8663   echo "$as_me: failed program was:" >&5
8664 cat conftest.$ac_ext >&5
8665 cf_have_incdir=yes
8666 fi
8667 rm -f conftest.$ac_objext conftest.$ac_ext
8668                           CPPFLAGS=$cf_save_CPPFLAGS
8669                         fi
8670                   fi
8671                 fi
8672
8673                 if test "$cf_have_incdir" = no ; then
8674                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8675
8676 echo "${as_me:-configure}:8676: testing adding $cf_add_incdir to include-path ..." 1>&5
8677
8678                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8679
8680                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8681                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8682                   cf_add_incdir="$cf_top_incdir"
8683                 else
8684                   break
8685                 fi
8686           fi
8687         done
8688   done
8689 fi
8690
8691 }
8692
8693 echo "$as_me:8693: checking for $cf_ncuhdr_root header in include-path" >&5
8694 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8695 if test "${cf_cv_ncurses_h+set}" = set; then
8696   echo $ECHO_N "(cached) $ECHO_C" >&6
8697 else
8698
8699         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8700         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8701         for cf_header in $cf_header_list
8702         do
8703
8704         cat >conftest.$ac_ext <<_ACEOF
8705 #line 8705 "configure"
8706 #include "confdefs.h"
8707
8708 #define _XOPEN_SOURCE_EXTENDED
8709 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8710 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8711
8712 #include <$cf_header>
8713 int
8714 main ()
8715 {
8716
8717 #ifdef NCURSES_VERSION
8718
8719 #ifndef WACS_BSSB
8720         make an error
8721 #endif
8722
8723 printf("%s\n", NCURSES_VERSION);
8724 #else
8725 #ifdef __NCURSES_H
8726 printf("old\n");
8727 #else
8728         make an error
8729 #endif
8730 #endif
8731
8732   ;
8733   return 0;
8734 }
8735 _ACEOF
8736 rm -f conftest.$ac_objext
8737 if { (eval echo "$as_me:8737: \"$ac_compile\"") >&5
8738   (eval $ac_compile) 2>&5
8739   ac_status=$?
8740   echo "$as_me:8740: \$? = $ac_status" >&5
8741   (exit $ac_status); } &&
8742          { ac_try='test -s conftest.$ac_objext'
8743   { (eval echo "$as_me:8743: \"$ac_try\"") >&5
8744   (eval $ac_try) 2>&5
8745   ac_status=$?
8746   echo "$as_me:8746: \$? = $ac_status" >&5
8747   (exit $ac_status); }; }; then
8748   cf_cv_ncurses_h=$cf_header
8749
8750 else
8751   echo "$as_me: failed program was:" >&5
8752 cat conftest.$ac_ext >&5
8753 cf_cv_ncurses_h=no
8754 fi
8755 rm -f conftest.$ac_objext conftest.$ac_ext
8756
8757                 test "$cf_cv_ncurses_h" != no && break
8758         done
8759
8760 fi
8761 echo "$as_me:8761: result: $cf_cv_ncurses_h" >&5
8762 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8763
8764 if test "$cf_cv_ncurses_h" != no ; then
8765         cf_cv_ncurses_header=$cf_cv_ncurses_h
8766 else
8767
8768 echo "$as_me:8768: checking for $cf_ncuhdr_root include-path" >&5
8769 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8770 if test "${cf_cv_ncurses_h2+set}" = set; then
8771   echo $ECHO_N "(cached) $ECHO_C" >&6
8772 else
8773
8774         test -n "$verbose" && echo
8775
8776 cf_search=
8777
8778 # collect the current set of include-directories from compiler flags
8779 cf_header_path_list=""
8780 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8781         for cf_header_path in $CPPFLAGS $CFLAGS
8782         do
8783                 case $cf_header_path in #(vi
8784                 -I*)
8785                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8786
8787 test "$cf_header_path" != "NONE" && \
8788 test -d "$cf_header_path" && \
8789  {
8790         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8791         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8792         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8793         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8794         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8795         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"
8796 }
8797
8798                         cf_header_path_list="$cf_header_path_list $cf_search"
8799                         ;;
8800                 esac
8801         done
8802 fi
8803
8804 # add the variations for the package we are looking for
8805
8806 cf_search=
8807
8808 test "/usr" != "$prefix" && \
8809 test -d "/usr" && \
8810 (test $prefix = NONE || test "/usr" != "$prefix") && {
8811         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8812         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8813         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8814         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8815         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8816         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8817 }
8818
8819 test "$prefix" != "NONE" && \
8820 test -d "$prefix" && \
8821  {
8822         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8823         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8824         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8825         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8826         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8827         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8828 }
8829
8830 test "/usr/local" != "$prefix" && \
8831 test -d "/usr/local" && \
8832 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8833         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8834         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8835         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8836         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8837         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8838         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8839 }
8840
8841 test "/opt" != "$prefix" && \
8842 test -d "/opt" && \
8843 (test $prefix = NONE || test "/opt" != "$prefix") && {
8844         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8845         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8846         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8847         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8848         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8849         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8850 }
8851
8852 test "$HOME" != "$prefix" && \
8853 test -d "$HOME" && \
8854 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8855         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8856         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8857         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8858         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8859         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8860         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8861 }
8862
8863 test "$includedir" != NONE && \
8864 test "$includedir" != "/usr/include" && \
8865 test -d "$includedir" && {
8866         test -d $includedir &&    cf_search="$cf_search $includedir"
8867         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8868 }
8869
8870 test "$oldincludedir" != NONE && \
8871 test "$oldincludedir" != "/usr/include" && \
8872 test -d "$oldincludedir" && {
8873         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8874         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8875 }
8876
8877 cf_search="$cf_search $cf_header_path_list"
8878
8879         test -n "$verbose" && echo search path $cf_search
8880         cf_save2_CPPFLAGS="$CPPFLAGS"
8881         for cf_incdir in $cf_search
8882         do
8883
8884 if test -n "$cf_incdir" ; then
8885   for cf_add_incdir in $cf_incdir
8886   do
8887         while test $cf_add_incdir != /usr/include
8888         do
8889           if test -d $cf_add_incdir
8890           then
8891                 cf_have_incdir=no
8892                 if test -n "$CFLAGS$CPPFLAGS" ; then
8893                   # a loop is needed to ensure we can add subdirs of existing dirs
8894                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8895                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8896                           cf_have_incdir=yes; break
8897                         fi
8898                   done
8899                 fi
8900
8901                 if test "$cf_have_incdir" = no ; then
8902                   if test "$cf_add_incdir" = /usr/local/include ; then
8903                         if test "$GCC" = yes
8904                         then
8905                           cf_save_CPPFLAGS=$CPPFLAGS
8906                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8907                           cat >conftest.$ac_ext <<_ACEOF
8908 #line 8908 "configure"
8909 #include "confdefs.h"
8910 #include <stdio.h>
8911 int
8912 main ()
8913 {
8914 printf("Hello")
8915   ;
8916   return 0;
8917 }
8918 _ACEOF
8919 rm -f conftest.$ac_objext
8920 if { (eval echo "$as_me:8920: \"$ac_compile\"") >&5
8921   (eval $ac_compile) 2>&5
8922   ac_status=$?
8923   echo "$as_me:8923: \$? = $ac_status" >&5
8924   (exit $ac_status); } &&
8925          { ac_try='test -s conftest.$ac_objext'
8926   { (eval echo "$as_me:8926: \"$ac_try\"") >&5
8927   (eval $ac_try) 2>&5
8928   ac_status=$?
8929   echo "$as_me:8929: \$? = $ac_status" >&5
8930   (exit $ac_status); }; }; then
8931   :
8932 else
8933   echo "$as_me: failed program was:" >&5
8934 cat conftest.$ac_ext >&5
8935 cf_have_incdir=yes
8936 fi
8937 rm -f conftest.$ac_objext conftest.$ac_ext
8938                           CPPFLAGS=$cf_save_CPPFLAGS
8939                         fi
8940                   fi
8941                 fi
8942
8943                 if test "$cf_have_incdir" = no ; then
8944                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8945
8946 echo "${as_me:-configure}:8946: testing adding $cf_add_incdir to include-path ..." 1>&5
8947
8948                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8949
8950                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8951                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8952                   cf_add_incdir="$cf_top_incdir"
8953                 else
8954                   break
8955                 fi
8956           fi
8957         done
8958   done
8959 fi
8960
8961                 for cf_header in \
8962                         ncurses.h \
8963                         curses.h
8964                 do
8965
8966         cat >conftest.$ac_ext <<_ACEOF
8967 #line 8967 "configure"
8968 #include "confdefs.h"
8969
8970 #include <$cf_header>
8971 int
8972 main ()
8973 {
8974
8975 #ifdef NCURSES_VERSION
8976
8977 printf("%s\n", NCURSES_VERSION);
8978 #else
8979 #ifdef __NCURSES_H
8980 printf("old\n");
8981 #else
8982         make an error
8983 #endif
8984 #endif
8985
8986   ;
8987   return 0;
8988 }
8989 _ACEOF
8990 rm -f conftest.$ac_objext
8991 if { (eval echo "$as_me:8991: \"$ac_compile\"") >&5
8992   (eval $ac_compile) 2>&5
8993   ac_status=$?
8994   echo "$as_me:8994: \$? = $ac_status" >&5
8995   (exit $ac_status); } &&
8996          { ac_try='test -s conftest.$ac_objext'
8997   { (eval echo "$as_me:8997: \"$ac_try\"") >&5
8998   (eval $ac_try) 2>&5
8999   ac_status=$?
9000   echo "$as_me:9000: \$? = $ac_status" >&5
9001   (exit $ac_status); }; }; then
9002   cf_cv_ncurses_h2=$cf_header
9003
9004 else
9005   echo "$as_me: failed program was:" >&5
9006 cat conftest.$ac_ext >&5
9007 cf_cv_ncurses_h2=no
9008 fi
9009 rm -f conftest.$ac_objext conftest.$ac_ext
9010
9011                         if test "$cf_cv_ncurses_h2" != no ; then
9012                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9013                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9014                                 break
9015                         fi
9016                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9017                 done
9018                 CPPFLAGS="$cf_save2_CPPFLAGS"
9019                 test "$cf_cv_ncurses_h2" != no && break
9020         done
9021         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9021: error: not found" >&5
9022 echo "$as_me: error: not found" >&2;}
9023    { (exit 1); exit 1; }; }
9024
9025 fi
9026 echo "$as_me:9026: result: $cf_cv_ncurses_h2" >&5
9027 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9028
9029         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9030         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9031         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9032                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9033         fi
9034
9035 if test -n "$cf_1st_incdir" ; then
9036   for cf_add_incdir in $cf_1st_incdir
9037   do
9038         while test $cf_add_incdir != /usr/include
9039         do
9040           if test -d $cf_add_incdir
9041           then
9042                 cf_have_incdir=no
9043                 if test -n "$CFLAGS$CPPFLAGS" ; then
9044                   # a loop is needed to ensure we can add subdirs of existing dirs
9045                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9046                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9047                           cf_have_incdir=yes; break
9048                         fi
9049                   done
9050                 fi
9051
9052                 if test "$cf_have_incdir" = no ; then
9053                   if test "$cf_add_incdir" = /usr/local/include ; then
9054                         if test "$GCC" = yes
9055                         then
9056                           cf_save_CPPFLAGS=$CPPFLAGS
9057                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9058                           cat >conftest.$ac_ext <<_ACEOF
9059 #line 9059 "configure"
9060 #include "confdefs.h"
9061 #include <stdio.h>
9062 int
9063 main ()
9064 {
9065 printf("Hello")
9066   ;
9067   return 0;
9068 }
9069 _ACEOF
9070 rm -f conftest.$ac_objext
9071 if { (eval echo "$as_me:9071: \"$ac_compile\"") >&5
9072   (eval $ac_compile) 2>&5
9073   ac_status=$?
9074   echo "$as_me:9074: \$? = $ac_status" >&5
9075   (exit $ac_status); } &&
9076          { ac_try='test -s conftest.$ac_objext'
9077   { (eval echo "$as_me:9077: \"$ac_try\"") >&5
9078   (eval $ac_try) 2>&5
9079   ac_status=$?
9080   echo "$as_me:9080: \$? = $ac_status" >&5
9081   (exit $ac_status); }; }; then
9082   :
9083 else
9084   echo "$as_me: failed program was:" >&5
9085 cat conftest.$ac_ext >&5
9086 cf_have_incdir=yes
9087 fi
9088 rm -f conftest.$ac_objext conftest.$ac_ext
9089                           CPPFLAGS=$cf_save_CPPFLAGS
9090                         fi
9091                   fi
9092                 fi
9093
9094                 if test "$cf_have_incdir" = no ; then
9095                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9096
9097 echo "${as_me:-configure}:9097: testing adding $cf_add_incdir to include-path ..." 1>&5
9098
9099                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9100
9101                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9102                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9103                   cf_add_incdir="$cf_top_incdir"
9104                 else
9105                   break
9106                 fi
9107           fi
9108         done
9109   done
9110 fi
9111
9112 fi
9113
9114 # Set definitions to allow ifdef'ing for ncurses.h
9115
9116 case $cf_cv_ncurses_header in # (vi
9117 *ncurses.h)
9118         cat >>confdefs.h <<\EOF
9119 #define HAVE_NCURSES_H 1
9120 EOF
9121
9122         ;;
9123 esac
9124
9125 case $cf_cv_ncurses_header in # (vi
9126 ncurses/curses.h|ncurses/ncurses.h)
9127         cat >>confdefs.h <<\EOF
9128 #define HAVE_NCURSES_NCURSES_H 1
9129 EOF
9130
9131         ;;
9132 ncursesw/curses.h|ncursesw/ncurses.h)
9133         cat >>confdefs.h <<\EOF
9134 #define HAVE_NCURSESW_NCURSES_H 1
9135 EOF
9136
9137         ;;
9138 esac
9139
9140 echo "$as_me:9140: checking for terminfo header" >&5
9141 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9142 if test "${cf_cv_term_header+set}" = set; then
9143   echo $ECHO_N "(cached) $ECHO_C" >&6
9144 else
9145
9146 case ${cf_cv_ncurses_header} in #(vi
9147 */ncurses.h|*/ncursesw.h) #(vi
9148         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9149         ;;
9150 *)
9151         cf_term_header=term.h
9152         ;;
9153 esac
9154
9155 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9156 do
9157 cat >conftest.$ac_ext <<_ACEOF
9158 #line 9158 "configure"
9159 #include "confdefs.h"
9160 #include <stdio.h>
9161 #include <${cf_cv_ncurses_header:-curses.h}>
9162 #include <$cf_test>
9163
9164 int
9165 main ()
9166 {
9167 int x = auto_left_margin
9168   ;
9169   return 0;
9170 }
9171 _ACEOF
9172 rm -f conftest.$ac_objext
9173 if { (eval echo "$as_me:9173: \"$ac_compile\"") >&5
9174   (eval $ac_compile) 2>&5
9175   ac_status=$?
9176   echo "$as_me:9176: \$? = $ac_status" >&5
9177   (exit $ac_status); } &&
9178          { ac_try='test -s conftest.$ac_objext'
9179   { (eval echo "$as_me:9179: \"$ac_try\"") >&5
9180   (eval $ac_try) 2>&5
9181   ac_status=$?
9182   echo "$as_me:9182: \$? = $ac_status" >&5
9183   (exit $ac_status); }; }; then
9184
9185         cf_cv_term_header="$cf_test"
9186 else
9187   echo "$as_me: failed program was:" >&5
9188 cat conftest.$ac_ext >&5
9189
9190         cf_cv_term_header=unknown
9191
9192 fi
9193 rm -f conftest.$ac_objext conftest.$ac_ext
9194         test "$cf_cv_term_header" != unknown && break
9195 done
9196
9197 fi
9198 echo "$as_me:9198: result: $cf_cv_term_header" >&5
9199 echo "${ECHO_T}$cf_cv_term_header" >&6
9200
9201 # Set definitions to allow ifdef'ing to accommodate subdirectories
9202
9203 case $cf_cv_term_header in # (vi
9204 *term.h)
9205         cat >>confdefs.h <<\EOF
9206 #define HAVE_TERM_H 1
9207 EOF
9208
9209         ;;
9210 esac
9211
9212 case $cf_cv_term_header in # (vi
9213 ncurses/term.h) #(vi
9214         cat >>confdefs.h <<\EOF
9215 #define HAVE_NCURSES_TERM_H 1
9216 EOF
9217
9218         ;;
9219 ncursesw/term.h)
9220         cat >>confdefs.h <<\EOF
9221 #define HAVE_NCURSESW_TERM_H 1
9222 EOF
9223
9224         ;;
9225 esac
9226
9227 # some applications need this, but should check for NCURSES_VERSION
9228 cat >>confdefs.h <<\EOF
9229 #define NCURSES 1
9230 EOF
9231
9232 echo "$as_me:9232: checking for ncurses version" >&5
9233 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9234 if test "${cf_cv_ncurses_version+set}" = set; then
9235   echo $ECHO_N "(cached) $ECHO_C" >&6
9236 else
9237
9238         cf_cv_ncurses_version=no
9239         cf_tempfile=out$$
9240         rm -f $cf_tempfile
9241         if test "$cross_compiling" = yes; then
9242
9243         # This will not work if the preprocessor splits the line after the
9244         # Autoconf token.  The 'unproto' program does that.
9245         cat > conftest.$ac_ext <<EOF
9246 #include <${cf_cv_ncurses_header:-curses.h}>
9247 #undef Autoconf
9248 #ifdef NCURSES_VERSION
9249 Autoconf NCURSES_VERSION
9250 #else
9251 #ifdef __NCURSES_H
9252 Autoconf "old"
9253 #endif
9254 ;
9255 #endif
9256 EOF
9257         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9258         { (eval echo "$as_me:9258: \"$cf_try\"") >&5
9259   (eval $cf_try) 2>&5
9260   ac_status=$?
9261   echo "$as_me:9261: \$? = $ac_status" >&5
9262   (exit $ac_status); }
9263         if test -f conftest.out ; then
9264                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9265                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9266                 rm -f conftest.out
9267         fi
9268
9269 else
9270   cat >conftest.$ac_ext <<_ACEOF
9271 #line 9271 "configure"
9272 #include "confdefs.h"
9273
9274 #include <${cf_cv_ncurses_header:-curses.h}>
9275 #include <stdio.h>
9276 int main()
9277 {
9278         FILE *fp = fopen("$cf_tempfile", "w");
9279 #ifdef NCURSES_VERSION
9280 # ifdef NCURSES_VERSION_PATCH
9281         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9282 # else
9283         fprintf(fp, "%s\n", NCURSES_VERSION);
9284 # endif
9285 #else
9286 # ifdef __NCURSES_H
9287         fprintf(fp, "old\n");
9288 # else
9289         make an error
9290 # endif
9291 #endif
9292         ${cf_cv_main_return:-return}(0);
9293 }
9294 _ACEOF
9295 rm -f conftest$ac_exeext
9296 if { (eval echo "$as_me:9296: \"$ac_link\"") >&5
9297   (eval $ac_link) 2>&5
9298   ac_status=$?
9299   echo "$as_me:9299: \$? = $ac_status" >&5
9300   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9301   { (eval echo "$as_me:9301: \"$ac_try\"") >&5
9302   (eval $ac_try) 2>&5
9303   ac_status=$?
9304   echo "$as_me:9304: \$? = $ac_status" >&5
9305   (exit $ac_status); }; }; then
9306
9307         cf_cv_ncurses_version=`cat $cf_tempfile`
9308 else
9309   echo "$as_me: program exited with status $ac_status" >&5
9310 echo "$as_me: failed program was:" >&5
9311 cat conftest.$ac_ext >&5
9312 fi
9313 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9314 fi
9315         rm -f $cf_tempfile
9316
9317 fi
9318 echo "$as_me:9318: result: $cf_cv_ncurses_version" >&5
9319 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9320 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9321 #define NCURSES 1
9322 EOF
9323
9324 cf_nculib_root=ncursesw
9325         # This works, except for the special case where we find gpm, but
9326         # ncurses is in a nonstandard location via $LIBS, and we really want
9327         # to link gpm.
9328 cf_ncurses_LIBS=""
9329 cf_ncurses_SAVE="$LIBS"
9330 echo "$as_me:9330: checking for Gpm_Open in -lgpm" >&5
9331 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9332 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9333   echo $ECHO_N "(cached) $ECHO_C" >&6
9334 else
9335   ac_check_lib_save_LIBS=$LIBS
9336 LIBS="-lgpm  $LIBS"
9337 cat >conftest.$ac_ext <<_ACEOF
9338 #line 9338 "configure"
9339 #include "confdefs.h"
9340
9341 /* Override any gcc2 internal prototype to avoid an error.  */
9342 #ifdef __cplusplus
9343 extern "C"
9344 #endif
9345 /* We use char because int might match the return type of a gcc2
9346    builtin and then its argument prototype would still apply.  */
9347 char Gpm_Open ();
9348 int
9349 main ()
9350 {
9351 Gpm_Open ();
9352   ;
9353   return 0;
9354 }
9355 _ACEOF
9356 rm -f conftest.$ac_objext conftest$ac_exeext
9357 if { (eval echo "$as_me:9357: \"$ac_link\"") >&5
9358   (eval $ac_link) 2>&5
9359   ac_status=$?
9360   echo "$as_me:9360: \$? = $ac_status" >&5
9361   (exit $ac_status); } &&
9362          { ac_try='test -s conftest$ac_exeext'
9363   { (eval echo "$as_me:9363: \"$ac_try\"") >&5
9364   (eval $ac_try) 2>&5
9365   ac_status=$?
9366   echo "$as_me:9366: \$? = $ac_status" >&5
9367   (exit $ac_status); }; }; then
9368   ac_cv_lib_gpm_Gpm_Open=yes
9369 else
9370   echo "$as_me: failed program was:" >&5
9371 cat conftest.$ac_ext >&5
9372 ac_cv_lib_gpm_Gpm_Open=no
9373 fi
9374 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9375 LIBS=$ac_check_lib_save_LIBS
9376 fi
9377 echo "$as_me:9377: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9378 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9379 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9380   echo "$as_me:9380: checking for initscr in -lgpm" >&5
9381 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9382 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9383   echo $ECHO_N "(cached) $ECHO_C" >&6
9384 else
9385   ac_check_lib_save_LIBS=$LIBS
9386 LIBS="-lgpm  $LIBS"
9387 cat >conftest.$ac_ext <<_ACEOF
9388 #line 9388 "configure"
9389 #include "confdefs.h"
9390
9391 /* Override any gcc2 internal prototype to avoid an error.  */
9392 #ifdef __cplusplus
9393 extern "C"
9394 #endif
9395 /* We use char because int might match the return type of a gcc2
9396    builtin and then its argument prototype would still apply.  */
9397 char initscr ();
9398 int
9399 main ()
9400 {
9401 initscr ();
9402   ;
9403   return 0;
9404 }
9405 _ACEOF
9406 rm -f conftest.$ac_objext conftest$ac_exeext
9407 if { (eval echo "$as_me:9407: \"$ac_link\"") >&5
9408   (eval $ac_link) 2>&5
9409   ac_status=$?
9410   echo "$as_me:9410: \$? = $ac_status" >&5
9411   (exit $ac_status); } &&
9412          { ac_try='test -s conftest$ac_exeext'
9413   { (eval echo "$as_me:9413: \"$ac_try\"") >&5
9414   (eval $ac_try) 2>&5
9415   ac_status=$?
9416   echo "$as_me:9416: \$? = $ac_status" >&5
9417   (exit $ac_status); }; }; then
9418   ac_cv_lib_gpm_initscr=yes
9419 else
9420   echo "$as_me: failed program was:" >&5
9421 cat conftest.$ac_ext >&5
9422 ac_cv_lib_gpm_initscr=no
9423 fi
9424 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9425 LIBS=$ac_check_lib_save_LIBS
9426 fi
9427 echo "$as_me:9427: result: $ac_cv_lib_gpm_initscr" >&5
9428 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9429 if test $ac_cv_lib_gpm_initscr = yes; then
9430   LIBS="$cf_ncurses_SAVE"
9431 else
9432   cf_ncurses_LIBS="-lgpm"
9433 fi
9434
9435 fi
9436
9437 case $host_os in #(vi
9438 freebsd*)
9439         # This is only necessary if you are linking against an obsolete
9440         # version of ncurses (but it should do no harm, since it's static).
9441         if test "$cf_nculib_root" = ncurses ; then
9442                 echo "$as_me:9442: checking for tgoto in -lmytinfo" >&5
9443 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9444 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9445   echo $ECHO_N "(cached) $ECHO_C" >&6
9446 else
9447   ac_check_lib_save_LIBS=$LIBS
9448 LIBS="-lmytinfo  $LIBS"
9449 cat >conftest.$ac_ext <<_ACEOF
9450 #line 9450 "configure"
9451 #include "confdefs.h"
9452
9453 /* Override any gcc2 internal prototype to avoid an error.  */
9454 #ifdef __cplusplus
9455 extern "C"
9456 #endif
9457 /* We use char because int might match the return type of a gcc2
9458    builtin and then its argument prototype would still apply.  */
9459 char tgoto ();
9460 int
9461 main ()
9462 {
9463 tgoto ();
9464   ;
9465   return 0;
9466 }
9467 _ACEOF
9468 rm -f conftest.$ac_objext conftest$ac_exeext
9469 if { (eval echo "$as_me:9469: \"$ac_link\"") >&5
9470   (eval $ac_link) 2>&5
9471   ac_status=$?
9472   echo "$as_me:9472: \$? = $ac_status" >&5
9473   (exit $ac_status); } &&
9474          { ac_try='test -s conftest$ac_exeext'
9475   { (eval echo "$as_me:9475: \"$ac_try\"") >&5
9476   (eval $ac_try) 2>&5
9477   ac_status=$?
9478   echo "$as_me:9478: \$? = $ac_status" >&5
9479   (exit $ac_status); }; }; then
9480   ac_cv_lib_mytinfo_tgoto=yes
9481 else
9482   echo "$as_me: failed program was:" >&5
9483 cat conftest.$ac_ext >&5
9484 ac_cv_lib_mytinfo_tgoto=no
9485 fi
9486 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9487 LIBS=$ac_check_lib_save_LIBS
9488 fi
9489 echo "$as_me:9489: result: $ac_cv_lib_mytinfo_tgoto" >&5
9490 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9491 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9492   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9493 fi
9494
9495         fi
9496         ;;
9497 esac
9498
9499 LIBS="$cf_ncurses_LIBS $LIBS"
9500
9501 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9502 then
9503         LIBS="-l$cf_nculib_root $LIBS"
9504 else
9505
9506         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9507         cf_libdir=""
9508         echo "$as_me:9508: checking for initscr" >&5
9509 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9510 if test "${ac_cv_func_initscr+set}" = set; then
9511   echo $ECHO_N "(cached) $ECHO_C" >&6
9512 else
9513   cat >conftest.$ac_ext <<_ACEOF
9514 #line 9514 "configure"
9515 #include "confdefs.h"
9516 /* System header to define __stub macros and hopefully few prototypes,
9517     which can conflict with char initscr (); below.  */
9518 #include <assert.h>
9519 /* Override any gcc2 internal prototype to avoid an error.  */
9520 #ifdef __cplusplus
9521 extern "C"
9522 #endif
9523 /* We use char because int might match the return type of a gcc2
9524    builtin and then its argument prototype would still apply.  */
9525 char initscr ();
9526 char (*f) ();
9527
9528 int
9529 main ()
9530 {
9531 /* The GNU C library defines this for functions which it implements
9532     to always fail with ENOSYS.  Some functions are actually named
9533     something starting with __ and the normal name is an alias.  */
9534 #if defined (__stub_initscr) || defined (__stub___initscr)
9535 choke me
9536 #else
9537 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9538 #endif
9539
9540   ;
9541   return 0;
9542 }
9543 _ACEOF
9544 rm -f conftest.$ac_objext conftest$ac_exeext
9545 if { (eval echo "$as_me:9545: \"$ac_link\"") >&5
9546   (eval $ac_link) 2>&5
9547   ac_status=$?
9548   echo "$as_me:9548: \$? = $ac_status" >&5
9549   (exit $ac_status); } &&
9550          { ac_try='test -s conftest$ac_exeext'
9551   { (eval echo "$as_me:9551: \"$ac_try\"") >&5
9552   (eval $ac_try) 2>&5
9553   ac_status=$?
9554   echo "$as_me:9554: \$? = $ac_status" >&5
9555   (exit $ac_status); }; }; then
9556   ac_cv_func_initscr=yes
9557 else
9558   echo "$as_me: failed program was:" >&5
9559 cat conftest.$ac_ext >&5
9560 ac_cv_func_initscr=no
9561 fi
9562 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9563 fi
9564 echo "$as_me:9564: result: $ac_cv_func_initscr" >&5
9565 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9566 if test $ac_cv_func_initscr = yes; then
9567   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9568 else
9569
9570                 cf_save_LIBS="$LIBS"
9571                 echo "$as_me:9571: checking for initscr in -l$cf_nculib_root" >&5
9572 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9573                 LIBS="-l$cf_nculib_root $LIBS"
9574                 cat >conftest.$ac_ext <<_ACEOF
9575 #line 9575 "configure"
9576 #include "confdefs.h"
9577 #include <${cf_cv_ncurses_header:-curses.h}>
9578 int
9579 main ()
9580 {
9581 initscr()
9582   ;
9583   return 0;
9584 }
9585 _ACEOF
9586 rm -f conftest.$ac_objext conftest$ac_exeext
9587 if { (eval echo "$as_me:9587: \"$ac_link\"") >&5
9588   (eval $ac_link) 2>&5
9589   ac_status=$?
9590   echo "$as_me:9590: \$? = $ac_status" >&5
9591   (exit $ac_status); } &&
9592          { ac_try='test -s conftest$ac_exeext'
9593   { (eval echo "$as_me:9593: \"$ac_try\"") >&5
9594   (eval $ac_try) 2>&5
9595   ac_status=$?
9596   echo "$as_me:9596: \$? = $ac_status" >&5
9597   (exit $ac_status); }; }; then
9598   echo "$as_me:9598: result: yes" >&5
9599 echo "${ECHO_T}yes" >&6
9600                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9601
9602 else
9603   echo "$as_me: failed program was:" >&5
9604 cat conftest.$ac_ext >&5
9605 echo "$as_me:9605: result: no" >&5
9606 echo "${ECHO_T}no" >&6
9607
9608 cf_search=
9609 cf_library_path_list=""
9610 if test -n "${LDFLAGS}${LIBS}" ; then
9611         for cf_library_path in $LDFLAGS $LIBS
9612         do
9613                 case $cf_library_path in #(vi
9614                 -L*)
9615                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9616
9617 test "$cf_library_path" != "NONE" && \
9618 test -d "$cf_library_path" && \
9619  {
9620         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9621         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9622         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9623         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9624         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9625         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"
9626 }
9627
9628                         cf_library_path_list="$cf_library_path_list $cf_search"
9629                         ;;
9630                 esac
9631         done
9632 fi
9633
9634 cf_search=
9635
9636 test "/usr" != "$prefix" && \
9637 test -d "/usr" && \
9638 (test $prefix = NONE || test "/usr" != "$prefix") && {
9639         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9640         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9641         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9642         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9643         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9644         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9645 }
9646
9647 test "$prefix" != "NONE" && \
9648 test -d "$prefix" && \
9649  {
9650         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9651         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9652         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9653         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9654         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9655         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9656 }
9657
9658 test "/usr/local" != "$prefix" && \
9659 test -d "/usr/local" && \
9660 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9661         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9662         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9663         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9664         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9665         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9666         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9667 }
9668
9669 test "/opt" != "$prefix" && \
9670 test -d "/opt" && \
9671 (test $prefix = NONE || test "/opt" != "$prefix") && {
9672         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9673         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9674         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9675         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9676         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9677         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9678 }
9679
9680 test "$HOME" != "$prefix" && \
9681 test -d "$HOME" && \
9682 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9683         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9684         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9685         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9686         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9687         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9688         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9689 }
9690
9691 cf_search="$cf_library_path_list $cf_search"
9692
9693                         for cf_libdir in $cf_search
9694                         do
9695                                 echo "$as_me:9695: checking for -l$cf_nculib_root in $cf_libdir" >&5
9696 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9697                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9698                                 cat >conftest.$ac_ext <<_ACEOF
9699 #line 9699 "configure"
9700 #include "confdefs.h"
9701 #include <${cf_cv_ncurses_header:-curses.h}>
9702 int
9703 main ()
9704 {
9705 initscr()
9706   ;
9707   return 0;
9708 }
9709 _ACEOF
9710 rm -f conftest.$ac_objext conftest$ac_exeext
9711 if { (eval echo "$as_me:9711: \"$ac_link\"") >&5
9712   (eval $ac_link) 2>&5
9713   ac_status=$?
9714   echo "$as_me:9714: \$? = $ac_status" >&5
9715   (exit $ac_status); } &&
9716          { ac_try='test -s conftest$ac_exeext'
9717   { (eval echo "$as_me:9717: \"$ac_try\"") >&5
9718   (eval $ac_try) 2>&5
9719   ac_status=$?
9720   echo "$as_me:9720: \$? = $ac_status" >&5
9721   (exit $ac_status); }; }; then
9722   echo "$as_me:9722: result: yes" >&5
9723 echo "${ECHO_T}yes" >&6
9724                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9725                                          break
9726 else
9727   echo "$as_me: failed program was:" >&5
9728 cat conftest.$ac_ext >&5
9729 echo "$as_me:9729: result: no" >&5
9730 echo "${ECHO_T}no" >&6
9731                                          LIBS="$cf_save_LIBS"
9732 fi
9733 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9734                         done
9735
9736 fi
9737 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9738
9739 fi
9740
9741 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9742
9743 if test $cf_found_library = no ; then
9744         { { echo "$as_me:9744: error: Cannot link $cf_nculib_root library" >&5
9745 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9746    { (exit 1); exit 1; }; }
9747 fi
9748
9749 fi
9750
9751 if test -n "$cf_ncurses_LIBS" ; then
9752         echo "$as_me:9752: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9753 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9754         cf_ncurses_SAVE="$LIBS"
9755         for p in $cf_ncurses_LIBS ; do
9756                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9757                 if test "$q" != "$LIBS" ; then
9758                         LIBS="$q"
9759                 fi
9760         done
9761         cat >conftest.$ac_ext <<_ACEOF
9762 #line 9762 "configure"
9763 #include "confdefs.h"
9764 #include <${cf_cv_ncurses_header:-curses.h}>
9765 int
9766 main ()
9767 {
9768 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9769   ;
9770   return 0;
9771 }
9772 _ACEOF
9773 rm -f conftest.$ac_objext conftest$ac_exeext
9774 if { (eval echo "$as_me:9774: \"$ac_link\"") >&5
9775   (eval $ac_link) 2>&5
9776   ac_status=$?
9777   echo "$as_me:9777: \$? = $ac_status" >&5
9778   (exit $ac_status); } &&
9779          { ac_try='test -s conftest$ac_exeext'
9780   { (eval echo "$as_me:9780: \"$ac_try\"") >&5
9781   (eval $ac_try) 2>&5
9782   ac_status=$?
9783   echo "$as_me:9783: \$? = $ac_status" >&5
9784   (exit $ac_status); }; }; then
9785   echo "$as_me:9785: result: yes" >&5
9786 echo "${ECHO_T}yes" >&6
9787 else
9788   echo "$as_me: failed program was:" >&5
9789 cat conftest.$ac_ext >&5
9790 echo "$as_me:9790: result: no" >&5
9791 echo "${ECHO_T}no" >&6
9792                  LIBS="$cf_ncurses_SAVE"
9793 fi
9794 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9795 fi
9796
9797 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9798
9799 cat >>confdefs.h <<EOF
9800 #define $cf_nculib_ROOT 1
9801 EOF
9802
9803 fi
9804
9805         ;;
9806 pdcurses)
9807
9808 echo "$as_me:9808: checking if you want to use pkg-config" >&5
9809 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9810
9811 # Check whether --with-pkg-config or --without-pkg-config was given.
9812 if test "${with_pkg_config+set}" = set; then
9813   withval="$with_pkg_config"
9814   cf_pkg_config=$withval
9815 else
9816   cf_pkg_config=yes
9817 fi;
9818 echo "$as_me:9818: result: $cf_pkg_config" >&5
9819 echo "${ECHO_T}$cf_pkg_config" >&6
9820
9821 case $cf_pkg_config in #(vi
9822 no) #(vi
9823         PKG_CONFIG=none
9824         ;;
9825 yes) #(vi
9826
9827 if test -n "$ac_tool_prefix"; then
9828   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9829 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9830 echo "$as_me:9830: checking for $ac_word" >&5
9831 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9832 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9833   echo $ECHO_N "(cached) $ECHO_C" >&6
9834 else
9835   case $PKG_CONFIG in
9836   [\\/]* | ?:[\\/]*)
9837   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9838   ;;
9839   *)
9840   ac_save_IFS=$IFS; IFS=$ac_path_separator
9841 ac_dummy="$PATH"
9842 for ac_dir in $ac_dummy; do
9843   IFS=$ac_save_IFS
9844   test -z "$ac_dir" && ac_dir=.
9845   if $as_executable_p "$ac_dir/$ac_word"; then
9846    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9847    echo "$as_me:9847: found $ac_dir/$ac_word" >&5
9848    break
9849 fi
9850 done
9851
9852   ;;
9853 esac
9854 fi
9855 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9856
9857 if test -n "$PKG_CONFIG"; then
9858   echo "$as_me:9858: result: $PKG_CONFIG" >&5
9859 echo "${ECHO_T}$PKG_CONFIG" >&6
9860 else
9861   echo "$as_me:9861: result: no" >&5
9862 echo "${ECHO_T}no" >&6
9863 fi
9864
9865 fi
9866 if test -z "$ac_cv_path_PKG_CONFIG"; then
9867   ac_pt_PKG_CONFIG=$PKG_CONFIG
9868   # Extract the first word of "pkg-config", so it can be a program name with args.
9869 set dummy pkg-config; ac_word=$2
9870 echo "$as_me:9870: checking for $ac_word" >&5
9871 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9872 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9873   echo $ECHO_N "(cached) $ECHO_C" >&6
9874 else
9875   case $ac_pt_PKG_CONFIG in
9876   [\\/]* | ?:[\\/]*)
9877   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9878   ;;
9879   *)
9880   ac_save_IFS=$IFS; IFS=$ac_path_separator
9881 ac_dummy="$PATH"
9882 for ac_dir in $ac_dummy; do
9883   IFS=$ac_save_IFS
9884   test -z "$ac_dir" && ac_dir=.
9885   if $as_executable_p "$ac_dir/$ac_word"; then
9886    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9887    echo "$as_me:9887: found $ac_dir/$ac_word" >&5
9888    break
9889 fi
9890 done
9891
9892   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9893   ;;
9894 esac
9895 fi
9896 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9897
9898 if test -n "$ac_pt_PKG_CONFIG"; then
9899   echo "$as_me:9899: result: $ac_pt_PKG_CONFIG" >&5
9900 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9901 else
9902   echo "$as_me:9902: result: no" >&5
9903 echo "${ECHO_T}no" >&6
9904 fi
9905
9906   PKG_CONFIG=$ac_pt_PKG_CONFIG
9907 else
9908   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
9909 fi
9910
9911         ;;
9912 *)
9913         PKG_CONFIG=$withval
9914         ;;
9915 esac
9916
9917 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9918 if test "$PKG_CONFIG" != none ; then
9919
9920 if test "x$prefix" != xNONE; then
9921   cf_path_syntax="$prefix"
9922 else
9923   cf_path_syntax="$ac_default_prefix"
9924 fi
9925
9926 case ".$PKG_CONFIG" in #(vi
9927 .\$\(*\)*|.\'*\'*) #(vi
9928   ;;
9929 ..|./*|.\\*) #(vi
9930   ;;
9931 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9932   ;;
9933 .\${*prefix}*) #(vi
9934   eval PKG_CONFIG="$PKG_CONFIG"
9935   case ".$PKG_CONFIG" in #(vi
9936   .NONE/*)
9937     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9938     ;;
9939   esac
9940   ;; #(vi
9941 .no|.NONE/*)
9942   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9943   ;;
9944 *)
9945   { { echo "$as_me:9945: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
9946 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
9947    { (exit 1); exit 1; }; }
9948   ;;
9949 esac
9950
9951 fi
9952
9953 echo "$as_me:9953: checking for X" >&5
9954 echo $ECHO_N "checking for X... $ECHO_C" >&6
9955
9956 # Check whether --with-x or --without-x was given.
9957 if test "${with_x+set}" = set; then
9958   withval="$with_x"
9959
9960 fi;
9961 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
9962 if test "x$with_x" = xno; then
9963   # The user explicitly disabled X.
9964   have_x=disabled
9965 else
9966   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
9967     # Both variables are already set.
9968     have_x=yes
9969   else
9970     if test "${ac_cv_have_x+set}" = set; then
9971   echo $ECHO_N "(cached) $ECHO_C" >&6
9972 else
9973   # One or both of the vars are not set, and there is no cached value.
9974 ac_x_includes=no ac_x_libraries=no
9975 rm -fr conftest.dir
9976 if mkdir conftest.dir; then
9977   cd conftest.dir
9978   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
9979   cat >Imakefile <<'EOF'
9980 acfindx:
9981         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
9982 EOF
9983   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
9984     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
9985     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
9986     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
9987     for ac_extension in a so sl dylib dll; do
9988       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
9989          test -f $ac_im_libdir/libX11.$ac_extension; then
9990         ac_im_usrlibdir=$ac_im_libdir; break
9991       fi
9992     done
9993     # Screen out bogus values from the imake configuration.  They are
9994     # bogus both because they are the default anyway, and because
9995     # using them would break gcc on systems where it needs fixed includes.
9996     case $ac_im_incroot in
9997         /usr/include) ;;
9998         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
9999     esac
10000     case $ac_im_usrlibdir in
10001         /usr/lib | /lib) ;;
10002         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10003     esac
10004   fi
10005   cd ..
10006   rm -fr conftest.dir
10007 fi
10008
10009 # Standard set of common directories for X headers.
10010 # Check X11 before X11Rn because it is often a symlink to the current release.
10011 ac_x_header_dirs='
10012 /usr/X11/include
10013 /usr/X11R6/include
10014 /usr/X11R5/include
10015 /usr/X11R4/include
10016
10017 /usr/include/X11
10018 /usr/include/X11R6
10019 /usr/include/X11R5
10020 /usr/include/X11R4
10021
10022 /usr/local/X11/include
10023 /usr/local/X11R6/include
10024 /usr/local/X11R5/include
10025 /usr/local/X11R4/include
10026
10027 /usr/local/include/X11
10028 /usr/local/include/X11R6
10029 /usr/local/include/X11R5
10030 /usr/local/include/X11R4
10031
10032 /usr/X386/include
10033 /usr/x386/include
10034 /usr/XFree86/include/X11
10035
10036 /usr/include
10037 /usr/local/include
10038 /usr/unsupported/include
10039 /usr/athena/include
10040 /usr/local/x11r5/include
10041 /usr/lpp/Xamples/include
10042
10043 /usr/openwin/include
10044 /usr/openwin/share/include'
10045
10046 if test "$ac_x_includes" = no; then
10047   # Guess where to find include files, by looking for Intrinsic.h.
10048   # First, try using that file with no special directory specified.
10049   cat >conftest.$ac_ext <<_ACEOF
10050 #line 10050 "configure"
10051 #include "confdefs.h"
10052 #include <X11/Intrinsic.h>
10053 _ACEOF
10054 if { (eval echo "$as_me:10054: \"$ac_cpp conftest.$ac_ext\"") >&5
10055   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10056   ac_status=$?
10057   egrep -v '^ *\+' conftest.er1 >conftest.err
10058   rm -f conftest.er1
10059   cat conftest.err >&5
10060   echo "$as_me:10060: \$? = $ac_status" >&5
10061   (exit $ac_status); } >/dev/null; then
10062   if test -s conftest.err; then
10063     ac_cpp_err=$ac_c_preproc_warn_flag
10064   else
10065     ac_cpp_err=
10066   fi
10067 else
10068   ac_cpp_err=yes
10069 fi
10070 if test -z "$ac_cpp_err"; then
10071   # We can compile using X headers with no special include directory.
10072 ac_x_includes=
10073 else
10074   echo "$as_me: failed program was:" >&5
10075   cat conftest.$ac_ext >&5
10076   for ac_dir in $ac_x_header_dirs; do
10077   if test -r "$ac_dir/X11/Intrinsic.h"; then
10078     ac_x_includes=$ac_dir
10079     break
10080   fi
10081 done
10082 fi
10083 rm -f conftest.err conftest.$ac_ext
10084 fi # $ac_x_includes = no
10085
10086 if test "$ac_x_libraries" = no; then
10087   # Check for the libraries.
10088   # See if we find them without any special options.
10089   # Don't add to $LIBS permanently.
10090   ac_save_LIBS=$LIBS
10091   LIBS="-lXt $LIBS"
10092   cat >conftest.$ac_ext <<_ACEOF
10093 #line 10093 "configure"
10094 #include "confdefs.h"
10095 #include <X11/Intrinsic.h>
10096 int
10097 main ()
10098 {
10099 XtMalloc (0)
10100   ;
10101   return 0;
10102 }
10103 _ACEOF
10104 rm -f conftest.$ac_objext conftest$ac_exeext
10105 if { (eval echo "$as_me:10105: \"$ac_link\"") >&5
10106   (eval $ac_link) 2>&5
10107   ac_status=$?
10108   echo "$as_me:10108: \$? = $ac_status" >&5
10109   (exit $ac_status); } &&
10110          { ac_try='test -s conftest$ac_exeext'
10111   { (eval echo "$as_me:10111: \"$ac_try\"") >&5
10112   (eval $ac_try) 2>&5
10113   ac_status=$?
10114   echo "$as_me:10114: \$? = $ac_status" >&5
10115   (exit $ac_status); }; }; then
10116   LIBS=$ac_save_LIBS
10117 # We can link X programs with no special library path.
10118 ac_x_libraries=
10119 else
10120   echo "$as_me: failed program was:" >&5
10121 cat conftest.$ac_ext >&5
10122 LIBS=$ac_save_LIBS
10123 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10124 do
10125   # Don't even attempt the hair of trying to link an X program!
10126   for ac_extension in a so sl dylib dll; do
10127     if test -r $ac_dir/libXt.$ac_extension; then
10128       ac_x_libraries=$ac_dir
10129       break 2
10130     fi
10131   done
10132 done
10133 fi
10134 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10135 fi # $ac_x_libraries = no
10136
10137 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10138   # Didn't find X anywhere.  Cache the known absence of X.
10139   ac_cv_have_x="have_x=no"
10140 else
10141   # Record where we found X for the cache.
10142   ac_cv_have_x="have_x=yes \
10143                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10144 fi
10145 fi
10146
10147   fi
10148   eval "$ac_cv_have_x"
10149 fi # $with_x != no
10150
10151 if test "$have_x" != yes; then
10152   echo "$as_me:10152: result: $have_x" >&5
10153 echo "${ECHO_T}$have_x" >&6
10154   no_x=yes
10155 else
10156   # If each of the values was on the command line, it overrides each guess.
10157   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10158   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10159   # Update the cache value to reflect the command line values.
10160   ac_cv_have_x="have_x=yes \
10161                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10162   echo "$as_me:10162: result: libraries $x_libraries, headers $x_includes" >&5
10163 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10164 fi
10165
10166 if test "$no_x" = yes; then
10167   # Not all programs may use this symbol, but it does not hurt to define it.
10168
10169 cat >>confdefs.h <<\EOF
10170 #define X_DISPLAY_MISSING 1
10171 EOF
10172
10173   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10174 else
10175   if test -n "$x_includes"; then
10176     X_CFLAGS="$X_CFLAGS -I$x_includes"
10177   fi
10178
10179   # It would also be nice to do this for all -L options, not just this one.
10180   if test -n "$x_libraries"; then
10181     X_LIBS="$X_LIBS -L$x_libraries"
10182     # For Solaris; some versions of Sun CC require a space after -R and
10183     # others require no space.  Words are not sufficient . . . .
10184     case `(uname -sr) 2>/dev/null` in
10185     "SunOS 5"*)
10186       echo "$as_me:10186: checking whether -R must be followed by a space" >&5
10187 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10188       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10189       cat >conftest.$ac_ext <<_ACEOF
10190 #line 10190 "configure"
10191 #include "confdefs.h"
10192
10193 int
10194 main ()
10195 {
10196
10197   ;
10198   return 0;
10199 }
10200 _ACEOF
10201 rm -f conftest.$ac_objext conftest$ac_exeext
10202 if { (eval echo "$as_me:10202: \"$ac_link\"") >&5
10203   (eval $ac_link) 2>&5
10204   ac_status=$?
10205   echo "$as_me:10205: \$? = $ac_status" >&5
10206   (exit $ac_status); } &&
10207          { ac_try='test -s conftest$ac_exeext'
10208   { (eval echo "$as_me:10208: \"$ac_try\"") >&5
10209   (eval $ac_try) 2>&5
10210   ac_status=$?
10211   echo "$as_me:10211: \$? = $ac_status" >&5
10212   (exit $ac_status); }; }; then
10213   ac_R_nospace=yes
10214 else
10215   echo "$as_me: failed program was:" >&5
10216 cat conftest.$ac_ext >&5
10217 ac_R_nospace=no
10218 fi
10219 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10220       if test $ac_R_nospace = yes; then
10221         echo "$as_me:10221: result: no" >&5
10222 echo "${ECHO_T}no" >&6
10223         X_LIBS="$X_LIBS -R$x_libraries"
10224       else
10225         LIBS="$ac_xsave_LIBS -R $x_libraries"
10226         cat >conftest.$ac_ext <<_ACEOF
10227 #line 10227 "configure"
10228 #include "confdefs.h"
10229
10230 int
10231 main ()
10232 {
10233
10234   ;
10235   return 0;
10236 }
10237 _ACEOF
10238 rm -f conftest.$ac_objext conftest$ac_exeext
10239 if { (eval echo "$as_me:10239: \"$ac_link\"") >&5
10240   (eval $ac_link) 2>&5
10241   ac_status=$?
10242   echo "$as_me:10242: \$? = $ac_status" >&5
10243   (exit $ac_status); } &&
10244          { ac_try='test -s conftest$ac_exeext'
10245   { (eval echo "$as_me:10245: \"$ac_try\"") >&5
10246   (eval $ac_try) 2>&5
10247   ac_status=$?
10248   echo "$as_me:10248: \$? = $ac_status" >&5
10249   (exit $ac_status); }; }; then
10250   ac_R_space=yes
10251 else
10252   echo "$as_me: failed program was:" >&5
10253 cat conftest.$ac_ext >&5
10254 ac_R_space=no
10255 fi
10256 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10257         if test $ac_R_space = yes; then
10258           echo "$as_me:10258: result: yes" >&5
10259 echo "${ECHO_T}yes" >&6
10260           X_LIBS="$X_LIBS -R $x_libraries"
10261         else
10262           echo "$as_me:10262: result: neither works" >&5
10263 echo "${ECHO_T}neither works" >&6
10264         fi
10265       fi
10266       LIBS=$ac_xsave_LIBS
10267     esac
10268   fi
10269
10270   # Check for system-dependent libraries X programs must link with.
10271   # Do this before checking for the system-independent R6 libraries
10272   # (-lICE), since we may need -lsocket or whatever for X linking.
10273
10274   if test "$ISC" = yes; then
10275     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10276   else
10277     # Martyn Johnson says this is needed for Ultrix, if the X
10278     # libraries were built with DECnet support.  And Karl Berry says
10279     # the Alpha needs dnet_stub (dnet does not exist).
10280     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10281     cat >conftest.$ac_ext <<_ACEOF
10282 #line 10282 "configure"
10283 #include "confdefs.h"
10284
10285 /* Override any gcc2 internal prototype to avoid an error.  */
10286 #ifdef __cplusplus
10287 extern "C"
10288 #endif
10289 /* We use char because int might match the return type of a gcc2
10290    builtin and then its argument prototype would still apply.  */
10291 char XOpenDisplay ();
10292 int
10293 main ()
10294 {
10295 XOpenDisplay ();
10296   ;
10297   return 0;
10298 }
10299 _ACEOF
10300 rm -f conftest.$ac_objext conftest$ac_exeext
10301 if { (eval echo "$as_me:10301: \"$ac_link\"") >&5
10302   (eval $ac_link) 2>&5
10303   ac_status=$?
10304   echo "$as_me:10304: \$? = $ac_status" >&5
10305   (exit $ac_status); } &&
10306          { ac_try='test -s conftest$ac_exeext'
10307   { (eval echo "$as_me:10307: \"$ac_try\"") >&5
10308   (eval $ac_try) 2>&5
10309   ac_status=$?
10310   echo "$as_me:10310: \$? = $ac_status" >&5
10311   (exit $ac_status); }; }; then
10312   :
10313 else
10314   echo "$as_me: failed program was:" >&5
10315 cat conftest.$ac_ext >&5
10316 echo "$as_me:10316: checking for dnet_ntoa in -ldnet" >&5
10317 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10318 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10319   echo $ECHO_N "(cached) $ECHO_C" >&6
10320 else
10321   ac_check_lib_save_LIBS=$LIBS
10322 LIBS="-ldnet  $LIBS"
10323 cat >conftest.$ac_ext <<_ACEOF
10324 #line 10324 "configure"
10325 #include "confdefs.h"
10326
10327 /* Override any gcc2 internal prototype to avoid an error.  */
10328 #ifdef __cplusplus
10329 extern "C"
10330 #endif
10331 /* We use char because int might match the return type of a gcc2
10332    builtin and then its argument prototype would still apply.  */
10333 char dnet_ntoa ();
10334 int
10335 main ()
10336 {
10337 dnet_ntoa ();
10338   ;
10339   return 0;
10340 }
10341 _ACEOF
10342 rm -f conftest.$ac_objext conftest$ac_exeext
10343 if { (eval echo "$as_me:10343: \"$ac_link\"") >&5
10344   (eval $ac_link) 2>&5
10345   ac_status=$?
10346   echo "$as_me:10346: \$? = $ac_status" >&5
10347   (exit $ac_status); } &&
10348          { ac_try='test -s conftest$ac_exeext'
10349   { (eval echo "$as_me:10349: \"$ac_try\"") >&5
10350   (eval $ac_try) 2>&5
10351   ac_status=$?
10352   echo "$as_me:10352: \$? = $ac_status" >&5
10353   (exit $ac_status); }; }; then
10354   ac_cv_lib_dnet_dnet_ntoa=yes
10355 else
10356   echo "$as_me: failed program was:" >&5
10357 cat conftest.$ac_ext >&5
10358 ac_cv_lib_dnet_dnet_ntoa=no
10359 fi
10360 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10361 LIBS=$ac_check_lib_save_LIBS
10362 fi
10363 echo "$as_me:10363: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10364 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10365 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10366   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10367 fi
10368
10369     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10370       echo "$as_me:10370: checking for dnet_ntoa in -ldnet_stub" >&5
10371 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10372 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10373   echo $ECHO_N "(cached) $ECHO_C" >&6
10374 else
10375   ac_check_lib_save_LIBS=$LIBS
10376 LIBS="-ldnet_stub  $LIBS"
10377 cat >conftest.$ac_ext <<_ACEOF
10378 #line 10378 "configure"
10379 #include "confdefs.h"
10380
10381 /* Override any gcc2 internal prototype to avoid an error.  */
10382 #ifdef __cplusplus
10383 extern "C"
10384 #endif
10385 /* We use char because int might match the return type of a gcc2
10386    builtin and then its argument prototype would still apply.  */
10387 char dnet_ntoa ();
10388 int
10389 main ()
10390 {
10391 dnet_ntoa ();
10392   ;
10393   return 0;
10394 }
10395 _ACEOF
10396 rm -f conftest.$ac_objext conftest$ac_exeext
10397 if { (eval echo "$as_me:10397: \"$ac_link\"") >&5
10398   (eval $ac_link) 2>&5
10399   ac_status=$?
10400   echo "$as_me:10400: \$? = $ac_status" >&5
10401   (exit $ac_status); } &&
10402          { ac_try='test -s conftest$ac_exeext'
10403   { (eval echo "$as_me:10403: \"$ac_try\"") >&5
10404   (eval $ac_try) 2>&5
10405   ac_status=$?
10406   echo "$as_me:10406: \$? = $ac_status" >&5
10407   (exit $ac_status); }; }; then
10408   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10409 else
10410   echo "$as_me: failed program was:" >&5
10411 cat conftest.$ac_ext >&5
10412 ac_cv_lib_dnet_stub_dnet_ntoa=no
10413 fi
10414 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10415 LIBS=$ac_check_lib_save_LIBS
10416 fi
10417 echo "$as_me:10417: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10418 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10419 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10420   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10421 fi
10422
10423     fi
10424 fi
10425 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10426     LIBS="$ac_xsave_LIBS"
10427
10428     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10429     # to get the SysV transport functions.
10430     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10431     # needs -lnsl.
10432     # The nsl library prevents programs from opening the X display
10433     # on Irix 5.2, according to T.E. Dickey.
10434     # The functions gethostbyname, getservbyname, and inet_addr are
10435     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10436     echo "$as_me:10436: checking for gethostbyname" >&5
10437 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10438 if test "${ac_cv_func_gethostbyname+set}" = set; then
10439   echo $ECHO_N "(cached) $ECHO_C" >&6
10440 else
10441   cat >conftest.$ac_ext <<_ACEOF
10442 #line 10442 "configure"
10443 #include "confdefs.h"
10444 /* System header to define __stub macros and hopefully few prototypes,
10445     which can conflict with char gethostbyname (); below.  */
10446 #include <assert.h>
10447 /* Override any gcc2 internal prototype to avoid an error.  */
10448 #ifdef __cplusplus
10449 extern "C"
10450 #endif
10451 /* We use char because int might match the return type of a gcc2
10452    builtin and then its argument prototype would still apply.  */
10453 char gethostbyname ();
10454 char (*f) ();
10455
10456 int
10457 main ()
10458 {
10459 /* The GNU C library defines this for functions which it implements
10460     to always fail with ENOSYS.  Some functions are actually named
10461     something starting with __ and the normal name is an alias.  */
10462 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10463 choke me
10464 #else
10465 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10466 #endif
10467
10468   ;
10469   return 0;
10470 }
10471 _ACEOF
10472 rm -f conftest.$ac_objext conftest$ac_exeext
10473 if { (eval echo "$as_me:10473: \"$ac_link\"") >&5
10474   (eval $ac_link) 2>&5
10475   ac_status=$?
10476   echo "$as_me:10476: \$? = $ac_status" >&5
10477   (exit $ac_status); } &&
10478          { ac_try='test -s conftest$ac_exeext'
10479   { (eval echo "$as_me:10479: \"$ac_try\"") >&5
10480   (eval $ac_try) 2>&5
10481   ac_status=$?
10482   echo "$as_me:10482: \$? = $ac_status" >&5
10483   (exit $ac_status); }; }; then
10484   ac_cv_func_gethostbyname=yes
10485 else
10486   echo "$as_me: failed program was:" >&5
10487 cat conftest.$ac_ext >&5
10488 ac_cv_func_gethostbyname=no
10489 fi
10490 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10491 fi
10492 echo "$as_me:10492: result: $ac_cv_func_gethostbyname" >&5
10493 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10494
10495     if test $ac_cv_func_gethostbyname = no; then
10496       echo "$as_me:10496: checking for gethostbyname in -lnsl" >&5
10497 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10498 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10499   echo $ECHO_N "(cached) $ECHO_C" >&6
10500 else
10501   ac_check_lib_save_LIBS=$LIBS
10502 LIBS="-lnsl  $LIBS"
10503 cat >conftest.$ac_ext <<_ACEOF
10504 #line 10504 "configure"
10505 #include "confdefs.h"
10506
10507 /* Override any gcc2 internal prototype to avoid an error.  */
10508 #ifdef __cplusplus
10509 extern "C"
10510 #endif
10511 /* We use char because int might match the return type of a gcc2
10512    builtin and then its argument prototype would still apply.  */
10513 char gethostbyname ();
10514 int
10515 main ()
10516 {
10517 gethostbyname ();
10518   ;
10519   return 0;
10520 }
10521 _ACEOF
10522 rm -f conftest.$ac_objext conftest$ac_exeext
10523 if { (eval echo "$as_me:10523: \"$ac_link\"") >&5
10524   (eval $ac_link) 2>&5
10525   ac_status=$?
10526   echo "$as_me:10526: \$? = $ac_status" >&5
10527   (exit $ac_status); } &&
10528          { ac_try='test -s conftest$ac_exeext'
10529   { (eval echo "$as_me:10529: \"$ac_try\"") >&5
10530   (eval $ac_try) 2>&5
10531   ac_status=$?
10532   echo "$as_me:10532: \$? = $ac_status" >&5
10533   (exit $ac_status); }; }; then
10534   ac_cv_lib_nsl_gethostbyname=yes
10535 else
10536   echo "$as_me: failed program was:" >&5
10537 cat conftest.$ac_ext >&5
10538 ac_cv_lib_nsl_gethostbyname=no
10539 fi
10540 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10541 LIBS=$ac_check_lib_save_LIBS
10542 fi
10543 echo "$as_me:10543: result: $ac_cv_lib_nsl_gethostbyname" >&5
10544 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10545 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10546   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10547 fi
10548
10549       if test $ac_cv_lib_nsl_gethostbyname = no; then
10550         echo "$as_me:10550: checking for gethostbyname in -lbsd" >&5
10551 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10552 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10553   echo $ECHO_N "(cached) $ECHO_C" >&6
10554 else
10555   ac_check_lib_save_LIBS=$LIBS
10556 LIBS="-lbsd  $LIBS"
10557 cat >conftest.$ac_ext <<_ACEOF
10558 #line 10558 "configure"
10559 #include "confdefs.h"
10560
10561 /* Override any gcc2 internal prototype to avoid an error.  */
10562 #ifdef __cplusplus
10563 extern "C"
10564 #endif
10565 /* We use char because int might match the return type of a gcc2
10566    builtin and then its argument prototype would still apply.  */
10567 char gethostbyname ();
10568 int
10569 main ()
10570 {
10571 gethostbyname ();
10572   ;
10573   return 0;
10574 }
10575 _ACEOF
10576 rm -f conftest.$ac_objext conftest$ac_exeext
10577 if { (eval echo "$as_me:10577: \"$ac_link\"") >&5
10578   (eval $ac_link) 2>&5
10579   ac_status=$?
10580   echo "$as_me:10580: \$? = $ac_status" >&5
10581   (exit $ac_status); } &&
10582          { ac_try='test -s conftest$ac_exeext'
10583   { (eval echo "$as_me:10583: \"$ac_try\"") >&5
10584   (eval $ac_try) 2>&5
10585   ac_status=$?
10586   echo "$as_me:10586: \$? = $ac_status" >&5
10587   (exit $ac_status); }; }; then
10588   ac_cv_lib_bsd_gethostbyname=yes
10589 else
10590   echo "$as_me: failed program was:" >&5
10591 cat conftest.$ac_ext >&5
10592 ac_cv_lib_bsd_gethostbyname=no
10593 fi
10594 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10595 LIBS=$ac_check_lib_save_LIBS
10596 fi
10597 echo "$as_me:10597: result: $ac_cv_lib_bsd_gethostbyname" >&5
10598 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10599 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10600   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10601 fi
10602
10603       fi
10604     fi
10605
10606     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10607     # socket/setsockopt and other routines are undefined under SCO ODT
10608     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10609     # on later versions), says Simon Leinen: it contains gethostby*
10610     # variants that don't use the nameserver (or something).  -lsocket
10611     # must be given before -lnsl if both are needed.  We assume that
10612     # if connect needs -lnsl, so does gethostbyname.
10613     echo "$as_me:10613: checking for connect" >&5
10614 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10615 if test "${ac_cv_func_connect+set}" = set; then
10616   echo $ECHO_N "(cached) $ECHO_C" >&6
10617 else
10618   cat >conftest.$ac_ext <<_ACEOF
10619 #line 10619 "configure"
10620 #include "confdefs.h"
10621 /* System header to define __stub macros and hopefully few prototypes,
10622     which can conflict with char connect (); below.  */
10623 #include <assert.h>
10624 /* Override any gcc2 internal prototype to avoid an error.  */
10625 #ifdef __cplusplus
10626 extern "C"
10627 #endif
10628 /* We use char because int might match the return type of a gcc2
10629    builtin and then its argument prototype would still apply.  */
10630 char connect ();
10631 char (*f) ();
10632
10633 int
10634 main ()
10635 {
10636 /* The GNU C library defines this for functions which it implements
10637     to always fail with ENOSYS.  Some functions are actually named
10638     something starting with __ and the normal name is an alias.  */
10639 #if defined (__stub_connect) || defined (__stub___connect)
10640 choke me
10641 #else
10642 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10643 #endif
10644
10645   ;
10646   return 0;
10647 }
10648 _ACEOF
10649 rm -f conftest.$ac_objext conftest$ac_exeext
10650 if { (eval echo "$as_me:10650: \"$ac_link\"") >&5
10651   (eval $ac_link) 2>&5
10652   ac_status=$?
10653   echo "$as_me:10653: \$? = $ac_status" >&5
10654   (exit $ac_status); } &&
10655          { ac_try='test -s conftest$ac_exeext'
10656   { (eval echo "$as_me:10656: \"$ac_try\"") >&5
10657   (eval $ac_try) 2>&5
10658   ac_status=$?
10659   echo "$as_me:10659: \$? = $ac_status" >&5
10660   (exit $ac_status); }; }; then
10661   ac_cv_func_connect=yes
10662 else
10663   echo "$as_me: failed program was:" >&5
10664 cat conftest.$ac_ext >&5
10665 ac_cv_func_connect=no
10666 fi
10667 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10668 fi
10669 echo "$as_me:10669: result: $ac_cv_func_connect" >&5
10670 echo "${ECHO_T}$ac_cv_func_connect" >&6
10671
10672     if test $ac_cv_func_connect = no; then
10673       echo "$as_me:10673: checking for connect in -lsocket" >&5
10674 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10675 if test "${ac_cv_lib_socket_connect+set}" = set; then
10676   echo $ECHO_N "(cached) $ECHO_C" >&6
10677 else
10678   ac_check_lib_save_LIBS=$LIBS
10679 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10680 cat >conftest.$ac_ext <<_ACEOF
10681 #line 10681 "configure"
10682 #include "confdefs.h"
10683
10684 /* Override any gcc2 internal prototype to avoid an error.  */
10685 #ifdef __cplusplus
10686 extern "C"
10687 #endif
10688 /* We use char because int might match the return type of a gcc2
10689    builtin and then its argument prototype would still apply.  */
10690 char connect ();
10691 int
10692 main ()
10693 {
10694 connect ();
10695   ;
10696   return 0;
10697 }
10698 _ACEOF
10699 rm -f conftest.$ac_objext conftest$ac_exeext
10700 if { (eval echo "$as_me:10700: \"$ac_link\"") >&5
10701   (eval $ac_link) 2>&5
10702   ac_status=$?
10703   echo "$as_me:10703: \$? = $ac_status" >&5
10704   (exit $ac_status); } &&
10705          { ac_try='test -s conftest$ac_exeext'
10706   { (eval echo "$as_me:10706: \"$ac_try\"") >&5
10707   (eval $ac_try) 2>&5
10708   ac_status=$?
10709   echo "$as_me:10709: \$? = $ac_status" >&5
10710   (exit $ac_status); }; }; then
10711   ac_cv_lib_socket_connect=yes
10712 else
10713   echo "$as_me: failed program was:" >&5
10714 cat conftest.$ac_ext >&5
10715 ac_cv_lib_socket_connect=no
10716 fi
10717 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10718 LIBS=$ac_check_lib_save_LIBS
10719 fi
10720 echo "$as_me:10720: result: $ac_cv_lib_socket_connect" >&5
10721 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10722 if test $ac_cv_lib_socket_connect = yes; then
10723   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10724 fi
10725
10726     fi
10727
10728     # Guillermo Gomez says -lposix is necessary on A/UX.
10729     echo "$as_me:10729: checking for remove" >&5
10730 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10731 if test "${ac_cv_func_remove+set}" = set; then
10732   echo $ECHO_N "(cached) $ECHO_C" >&6
10733 else
10734   cat >conftest.$ac_ext <<_ACEOF
10735 #line 10735 "configure"
10736 #include "confdefs.h"
10737 /* System header to define __stub macros and hopefully few prototypes,
10738     which can conflict with char remove (); below.  */
10739 #include <assert.h>
10740 /* Override any gcc2 internal prototype to avoid an error.  */
10741 #ifdef __cplusplus
10742 extern "C"
10743 #endif
10744 /* We use char because int might match the return type of a gcc2
10745    builtin and then its argument prototype would still apply.  */
10746 char remove ();
10747 char (*f) ();
10748
10749 int
10750 main ()
10751 {
10752 /* The GNU C library defines this for functions which it implements
10753     to always fail with ENOSYS.  Some functions are actually named
10754     something starting with __ and the normal name is an alias.  */
10755 #if defined (__stub_remove) || defined (__stub___remove)
10756 choke me
10757 #else
10758 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10759 #endif
10760
10761   ;
10762   return 0;
10763 }
10764 _ACEOF
10765 rm -f conftest.$ac_objext conftest$ac_exeext
10766 if { (eval echo "$as_me:10766: \"$ac_link\"") >&5
10767   (eval $ac_link) 2>&5
10768   ac_status=$?
10769   echo "$as_me:10769: \$? = $ac_status" >&5
10770   (exit $ac_status); } &&
10771          { ac_try='test -s conftest$ac_exeext'
10772   { (eval echo "$as_me:10772: \"$ac_try\"") >&5
10773   (eval $ac_try) 2>&5
10774   ac_status=$?
10775   echo "$as_me:10775: \$? = $ac_status" >&5
10776   (exit $ac_status); }; }; then
10777   ac_cv_func_remove=yes
10778 else
10779   echo "$as_me: failed program was:" >&5
10780 cat conftest.$ac_ext >&5
10781 ac_cv_func_remove=no
10782 fi
10783 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10784 fi
10785 echo "$as_me:10785: result: $ac_cv_func_remove" >&5
10786 echo "${ECHO_T}$ac_cv_func_remove" >&6
10787
10788     if test $ac_cv_func_remove = no; then
10789       echo "$as_me:10789: checking for remove in -lposix" >&5
10790 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10791 if test "${ac_cv_lib_posix_remove+set}" = set; then
10792   echo $ECHO_N "(cached) $ECHO_C" >&6
10793 else
10794   ac_check_lib_save_LIBS=$LIBS
10795 LIBS="-lposix  $LIBS"
10796 cat >conftest.$ac_ext <<_ACEOF
10797 #line 10797 "configure"
10798 #include "confdefs.h"
10799
10800 /* Override any gcc2 internal prototype to avoid an error.  */
10801 #ifdef __cplusplus
10802 extern "C"
10803 #endif
10804 /* We use char because int might match the return type of a gcc2
10805    builtin and then its argument prototype would still apply.  */
10806 char remove ();
10807 int
10808 main ()
10809 {
10810 remove ();
10811   ;
10812   return 0;
10813 }
10814 _ACEOF
10815 rm -f conftest.$ac_objext conftest$ac_exeext
10816 if { (eval echo "$as_me:10816: \"$ac_link\"") >&5
10817   (eval $ac_link) 2>&5
10818   ac_status=$?
10819   echo "$as_me:10819: \$? = $ac_status" >&5
10820   (exit $ac_status); } &&
10821          { ac_try='test -s conftest$ac_exeext'
10822   { (eval echo "$as_me:10822: \"$ac_try\"") >&5
10823   (eval $ac_try) 2>&5
10824   ac_status=$?
10825   echo "$as_me:10825: \$? = $ac_status" >&5
10826   (exit $ac_status); }; }; then
10827   ac_cv_lib_posix_remove=yes
10828 else
10829   echo "$as_me: failed program was:" >&5
10830 cat conftest.$ac_ext >&5
10831 ac_cv_lib_posix_remove=no
10832 fi
10833 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10834 LIBS=$ac_check_lib_save_LIBS
10835 fi
10836 echo "$as_me:10836: result: $ac_cv_lib_posix_remove" >&5
10837 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10838 if test $ac_cv_lib_posix_remove = yes; then
10839   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10840 fi
10841
10842     fi
10843
10844     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10845     echo "$as_me:10845: checking for shmat" >&5
10846 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10847 if test "${ac_cv_func_shmat+set}" = set; then
10848   echo $ECHO_N "(cached) $ECHO_C" >&6
10849 else
10850   cat >conftest.$ac_ext <<_ACEOF
10851 #line 10851 "configure"
10852 #include "confdefs.h"
10853 /* System header to define __stub macros and hopefully few prototypes,
10854     which can conflict with char shmat (); below.  */
10855 #include <assert.h>
10856 /* Override any gcc2 internal prototype to avoid an error.  */
10857 #ifdef __cplusplus
10858 extern "C"
10859 #endif
10860 /* We use char because int might match the return type of a gcc2
10861    builtin and then its argument prototype would still apply.  */
10862 char shmat ();
10863 char (*f) ();
10864
10865 int
10866 main ()
10867 {
10868 /* The GNU C library defines this for functions which it implements
10869     to always fail with ENOSYS.  Some functions are actually named
10870     something starting with __ and the normal name is an alias.  */
10871 #if defined (__stub_shmat) || defined (__stub___shmat)
10872 choke me
10873 #else
10874 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10875 #endif
10876
10877   ;
10878   return 0;
10879 }
10880 _ACEOF
10881 rm -f conftest.$ac_objext conftest$ac_exeext
10882 if { (eval echo "$as_me:10882: \"$ac_link\"") >&5
10883   (eval $ac_link) 2>&5
10884   ac_status=$?
10885   echo "$as_me:10885: \$? = $ac_status" >&5
10886   (exit $ac_status); } &&
10887          { ac_try='test -s conftest$ac_exeext'
10888   { (eval echo "$as_me:10888: \"$ac_try\"") >&5
10889   (eval $ac_try) 2>&5
10890   ac_status=$?
10891   echo "$as_me:10891: \$? = $ac_status" >&5
10892   (exit $ac_status); }; }; then
10893   ac_cv_func_shmat=yes
10894 else
10895   echo "$as_me: failed program was:" >&5
10896 cat conftest.$ac_ext >&5
10897 ac_cv_func_shmat=no
10898 fi
10899 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10900 fi
10901 echo "$as_me:10901: result: $ac_cv_func_shmat" >&5
10902 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10903
10904     if test $ac_cv_func_shmat = no; then
10905       echo "$as_me:10905: checking for shmat in -lipc" >&5
10906 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10907 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10908   echo $ECHO_N "(cached) $ECHO_C" >&6
10909 else
10910   ac_check_lib_save_LIBS=$LIBS
10911 LIBS="-lipc  $LIBS"
10912 cat >conftest.$ac_ext <<_ACEOF
10913 #line 10913 "configure"
10914 #include "confdefs.h"
10915
10916 /* Override any gcc2 internal prototype to avoid an error.  */
10917 #ifdef __cplusplus
10918 extern "C"
10919 #endif
10920 /* We use char because int might match the return type of a gcc2
10921    builtin and then its argument prototype would still apply.  */
10922 char shmat ();
10923 int
10924 main ()
10925 {
10926 shmat ();
10927   ;
10928   return 0;
10929 }
10930 _ACEOF
10931 rm -f conftest.$ac_objext conftest$ac_exeext
10932 if { (eval echo "$as_me:10932: \"$ac_link\"") >&5
10933   (eval $ac_link) 2>&5
10934   ac_status=$?
10935   echo "$as_me:10935: \$? = $ac_status" >&5
10936   (exit $ac_status); } &&
10937          { ac_try='test -s conftest$ac_exeext'
10938   { (eval echo "$as_me:10938: \"$ac_try\"") >&5
10939   (eval $ac_try) 2>&5
10940   ac_status=$?
10941   echo "$as_me:10941: \$? = $ac_status" >&5
10942   (exit $ac_status); }; }; then
10943   ac_cv_lib_ipc_shmat=yes
10944 else
10945   echo "$as_me: failed program was:" >&5
10946 cat conftest.$ac_ext >&5
10947 ac_cv_lib_ipc_shmat=no
10948 fi
10949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10950 LIBS=$ac_check_lib_save_LIBS
10951 fi
10952 echo "$as_me:10952: result: $ac_cv_lib_ipc_shmat" >&5
10953 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
10954 if test $ac_cv_lib_ipc_shmat = yes; then
10955   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
10956 fi
10957
10958     fi
10959   fi
10960
10961   # Check for libraries that X11R6 Xt/Xaw programs need.
10962   ac_save_LDFLAGS=$LDFLAGS
10963   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
10964   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
10965   # check for ICE first), but we must link in the order -lSM -lICE or
10966   # we get undefined symbols.  So assume we have SM if we have ICE.
10967   # These have to be linked with before -lX11, unlike the other
10968   # libraries we check for below, so use a different variable.
10969   # John Interrante, Karl Berry
10970   echo "$as_me:10970: checking for IceConnectionNumber in -lICE" >&5
10971 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
10972 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
10973   echo $ECHO_N "(cached) $ECHO_C" >&6
10974 else
10975   ac_check_lib_save_LIBS=$LIBS
10976 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
10977 cat >conftest.$ac_ext <<_ACEOF
10978 #line 10978 "configure"
10979 #include "confdefs.h"
10980
10981 /* Override any gcc2 internal prototype to avoid an error.  */
10982 #ifdef __cplusplus
10983 extern "C"
10984 #endif
10985 /* We use char because int might match the return type of a gcc2
10986    builtin and then its argument prototype would still apply.  */
10987 char IceConnectionNumber ();
10988 int
10989 main ()
10990 {
10991 IceConnectionNumber ();
10992   ;
10993   return 0;
10994 }
10995 _ACEOF
10996 rm -f conftest.$ac_objext conftest$ac_exeext
10997 if { (eval echo "$as_me:10997: \"$ac_link\"") >&5
10998   (eval $ac_link) 2>&5
10999   ac_status=$?
11000   echo "$as_me:11000: \$? = $ac_status" >&5
11001   (exit $ac_status); } &&
11002          { ac_try='test -s conftest$ac_exeext'
11003   { (eval echo "$as_me:11003: \"$ac_try\"") >&5
11004   (eval $ac_try) 2>&5
11005   ac_status=$?
11006   echo "$as_me:11006: \$? = $ac_status" >&5
11007   (exit $ac_status); }; }; then
11008   ac_cv_lib_ICE_IceConnectionNumber=yes
11009 else
11010   echo "$as_me: failed program was:" >&5
11011 cat conftest.$ac_ext >&5
11012 ac_cv_lib_ICE_IceConnectionNumber=no
11013 fi
11014 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11015 LIBS=$ac_check_lib_save_LIBS
11016 fi
11017 echo "$as_me:11017: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11018 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11019 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11020   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11021 fi
11022
11023   LDFLAGS=$ac_save_LDFLAGS
11024
11025 fi
11026
11027 cf_x_athena=${cf_x_athena:-Xaw}
11028
11029 echo "$as_me:11029: checking if you want to link with Xaw 3d library" >&5
11030 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11031 withval=
11032
11033 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11034 if test "${with_Xaw3d+set}" = set; then
11035   withval="$with_Xaw3d"
11036
11037 fi;
11038 if test "$withval" = yes ; then
11039         cf_x_athena=Xaw3d
11040         echo "$as_me:11040: result: yes" >&5
11041 echo "${ECHO_T}yes" >&6
11042 else
11043         echo "$as_me:11043: result: no" >&5
11044 echo "${ECHO_T}no" >&6
11045 fi
11046
11047 echo "$as_me:11047: checking if you want to link with neXT Athena library" >&5
11048 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11049 withval=
11050
11051 # Check whether --with-neXtaw or --without-neXtaw was given.
11052 if test "${with_neXtaw+set}" = set; then
11053   withval="$with_neXtaw"
11054
11055 fi;
11056 if test "$withval" = yes ; then
11057         cf_x_athena=neXtaw
11058         echo "$as_me:11058: result: yes" >&5
11059 echo "${ECHO_T}yes" >&6
11060 else
11061         echo "$as_me:11061: result: no" >&5
11062 echo "${ECHO_T}no" >&6
11063 fi
11064
11065 echo "$as_me:11065: checking if you want to link with Athena-Plus library" >&5
11066 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11067 withval=
11068
11069 # Check whether --with-XawPlus or --without-XawPlus was given.
11070 if test "${with_XawPlus+set}" = set; then
11071   withval="$with_XawPlus"
11072
11073 fi;
11074 if test "$withval" = yes ; then
11075         cf_x_athena=XawPlus
11076         echo "$as_me:11076: result: yes" >&5
11077 echo "${ECHO_T}yes" >&6
11078 else
11079         echo "$as_me:11079: result: no" >&5
11080 echo "${ECHO_T}no" >&6
11081 fi
11082
11083 cf_x_athena_lib=""
11084
11085 if test "$PKG_CONFIG" != none ; then
11086         cf_athena_list=
11087         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11088         for cf_athena_pkg in \
11089                 $cf_athena_list \
11090                 ${cf_x_athena} \
11091                 ${cf_x_athena}-devel \
11092                 lib${cf_x_athena} \
11093                 lib${cf_x_athena}-devel
11094         do
11095
11096 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11097         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11098
11099 echo "${as_me:-configure}:11099: testing found package $cf_athena_pkg ..." 1>&5
11100
11101         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11102         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11103         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11104
11105 echo "${as_me:-configure}:11105: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11106
11107         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11108
11109 echo "${as_me:-configure}:11109: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11110
11111 cf_fix_cppflags=no
11112 cf_new_cflags=
11113 cf_new_cppflags=
11114 cf_new_extra_cppflags=
11115
11116 for cf_add_cflags in $cf_pkgconfig_incs
11117 do
11118 case $cf_fix_cppflags in
11119 no)
11120         case $cf_add_cflags in #(vi
11121         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11122                 case $cf_add_cflags in
11123                 -D*)
11124                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11125
11126                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11127                                 && test -z "${cf_tst_cflags}" \
11128                                 && cf_fix_cppflags=yes
11129
11130                         if test $cf_fix_cppflags = yes ; then
11131                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11132                                 continue
11133                         elif test "${cf_tst_cflags}" = "\"'" ; then
11134                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11135                                 continue
11136                         fi
11137                         ;;
11138                 esac
11139                 case "$CPPFLAGS" in
11140                 *$cf_add_cflags) #(vi
11141                         ;;
11142                 *) #(vi
11143                         case $cf_add_cflags in #(vi
11144                         -D*)
11145                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11146
11147 CPPFLAGS=`echo "$CPPFLAGS" | \
11148         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11149                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11150
11151                                 ;;
11152                         esac
11153                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11154                         ;;
11155                 esac
11156                 ;;
11157         *)
11158                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11159                 ;;
11160         esac
11161         ;;
11162 yes)
11163         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11164
11165         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11166
11167         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11168                 && test -z "${cf_tst_cflags}" \
11169                 && cf_fix_cppflags=no
11170         ;;
11171 esac
11172 done
11173
11174 if test -n "$cf_new_cflags" ; then
11175
11176         CFLAGS="$CFLAGS $cf_new_cflags"
11177 fi
11178
11179 if test -n "$cf_new_cppflags" ; then
11180
11181         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11182 fi
11183
11184 if test -n "$cf_new_extra_cppflags" ; then
11185
11186         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11187 fi
11188
11189         LIBS="$cf_pkgconfig_libs $LIBS"
11190
11191                         cf_x_athena_lib="$cf_pkgconfig_libs"
11192
11193 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11194
11195                         cat >>confdefs.h <<EOF
11196 #define $cf_x_athena_LIBS 1
11197 EOF
11198
11199 echo "$as_me:11199: checking for usable $cf_x_athena/Xmu package" >&5
11200 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11201 if test "${cf_cv_xaw_compat+set}" = set; then
11202   echo $ECHO_N "(cached) $ECHO_C" >&6
11203 else
11204
11205 cat >conftest.$ac_ext <<_ACEOF
11206 #line 11206 "configure"
11207 #include "confdefs.h"
11208
11209 #include <X11/Xmu/CharSet.h>
11210
11211 int
11212 main ()
11213 {
11214
11215 int check = XmuCompareISOLatin1("big", "small")
11216
11217   ;
11218   return 0;
11219 }
11220 _ACEOF
11221 rm -f conftest.$ac_objext conftest$ac_exeext
11222 if { (eval echo "$as_me:11222: \"$ac_link\"") >&5
11223   (eval $ac_link) 2>&5
11224   ac_status=$?
11225   echo "$as_me:11225: \$? = $ac_status" >&5
11226   (exit $ac_status); } &&
11227          { ac_try='test -s conftest$ac_exeext'
11228   { (eval echo "$as_me:11228: \"$ac_try\"") >&5
11229   (eval $ac_try) 2>&5
11230   ac_status=$?
11231   echo "$as_me:11231: \$? = $ac_status" >&5
11232   (exit $ac_status); }; }; then
11233   cf_cv_xaw_compat=yes
11234 else
11235   echo "$as_me: failed program was:" >&5
11236 cat conftest.$ac_ext >&5
11237 cf_cv_xaw_compat=no
11238 fi
11239 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11240 fi
11241 echo "$as_me:11241: result: $cf_cv_xaw_compat" >&5
11242 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11243
11244                         if test "$cf_cv_xaw_compat" = no
11245                         then
11246                                 # workaround for broken ".pc" files...
11247                                 case "$cf_x_athena_lib" in #(vi
11248                                 *-lXmu*) #(vi
11249                                         ;;
11250                                 *)
11251                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11252
11253 echo "${as_me:-configure}:11253: testing work around broken package ..." 1>&5
11254
11255 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11256         test -n "$verbose" && echo "    found package xmu" 1>&6
11257
11258 echo "${as_me:-configure}:11258: testing found package xmu ..." 1>&5
11259
11260         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11261         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11262         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11263
11264 echo "${as_me:-configure}:11264: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11265
11266         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11267
11268 echo "${as_me:-configure}:11268: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11269
11270 cf_fix_cppflags=no
11271 cf_new_cflags=
11272 cf_new_cppflags=
11273 cf_new_extra_cppflags=
11274
11275 for cf_add_cflags in $cf_pkgconfig_incs
11276 do
11277 case $cf_fix_cppflags in
11278 no)
11279         case $cf_add_cflags in #(vi
11280         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11281                 case $cf_add_cflags in
11282                 -D*)
11283                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11284
11285                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11286                                 && test -z "${cf_tst_cflags}" \
11287                                 && cf_fix_cppflags=yes
11288
11289                         if test $cf_fix_cppflags = yes ; then
11290                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11291                                 continue
11292                         elif test "${cf_tst_cflags}" = "\"'" ; then
11293                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11294                                 continue
11295                         fi
11296                         ;;
11297                 esac
11298                 case "$CPPFLAGS" in
11299                 *$cf_add_cflags) #(vi
11300                         ;;
11301                 *) #(vi
11302                         case $cf_add_cflags in #(vi
11303                         -D*)
11304                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11305
11306 CPPFLAGS=`echo "$CPPFLAGS" | \
11307         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11308                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11309
11310                                 ;;
11311                         esac
11312                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11313                         ;;
11314                 esac
11315                 ;;
11316         *)
11317                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11318                 ;;
11319         esac
11320         ;;
11321 yes)
11322         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11323
11324         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11325
11326         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11327                 && test -z "${cf_tst_cflags}" \
11328                 && cf_fix_cppflags=no
11329         ;;
11330 esac
11331 done
11332
11333 if test -n "$cf_new_cflags" ; then
11334
11335         CFLAGS="$CFLAGS $cf_new_cflags"
11336 fi
11337
11338 if test -n "$cf_new_cppflags" ; then
11339
11340         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11341 fi
11342
11343 if test -n "$cf_new_extra_cppflags" ; then
11344
11345         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11346 fi
11347
11348         LIBS="$cf_pkgconfig_libs $LIBS"
11349         :
11350 else
11351
11352 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11353
11354 echo "${as_me:-configure}:11354: testing ...before $LIBS ..." 1>&5
11355
11356 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11357 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11358
11359 echo "${as_me:-configure}:11359: testing ...after  $LIBS ..." 1>&5
11360
11361 fi
11362
11363                                         ;;
11364                                 esac
11365                         fi
11366
11367                         break
11368 else
11369         :
11370 fi
11371
11372         done
11373 fi
11374
11375 if test -z "$cf_x_athena_lib" ; then
11376
11377 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11378         test -n "$verbose" && echo "    found package Xext" 1>&6
11379
11380 echo "${as_me:-configure}:11380: testing found package Xext ..." 1>&5
11381
11382         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11383         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11384         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11385
11386 echo "${as_me:-configure}:11386: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11387
11388         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11389
11390 echo "${as_me:-configure}:11390: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11391
11392 cf_fix_cppflags=no
11393 cf_new_cflags=
11394 cf_new_cppflags=
11395 cf_new_extra_cppflags=
11396
11397 for cf_add_cflags in $cf_pkgconfig_incs
11398 do
11399 case $cf_fix_cppflags in
11400 no)
11401         case $cf_add_cflags in #(vi
11402         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11403                 case $cf_add_cflags in
11404                 -D*)
11405                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11406
11407                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11408                                 && test -z "${cf_tst_cflags}" \
11409                                 && cf_fix_cppflags=yes
11410
11411                         if test $cf_fix_cppflags = yes ; then
11412                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11413                                 continue
11414                         elif test "${cf_tst_cflags}" = "\"'" ; then
11415                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11416                                 continue
11417                         fi
11418                         ;;
11419                 esac
11420                 case "$CPPFLAGS" in
11421                 *$cf_add_cflags) #(vi
11422                         ;;
11423                 *) #(vi
11424                         case $cf_add_cflags in #(vi
11425                         -D*)
11426                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11427
11428 CPPFLAGS=`echo "$CPPFLAGS" | \
11429         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11430                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11431
11432                                 ;;
11433                         esac
11434                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11435                         ;;
11436                 esac
11437                 ;;
11438         *)
11439                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11440                 ;;
11441         esac
11442         ;;
11443 yes)
11444         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11445
11446         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11447
11448         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11449                 && test -z "${cf_tst_cflags}" \
11450                 && cf_fix_cppflags=no
11451         ;;
11452 esac
11453 done
11454
11455 if test -n "$cf_new_cflags" ; then
11456
11457         CFLAGS="$CFLAGS $cf_new_cflags"
11458 fi
11459
11460 if test -n "$cf_new_cppflags" ; then
11461
11462         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11463 fi
11464
11465 if test -n "$cf_new_extra_cppflags" ; then
11466
11467         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11468 fi
11469
11470         LIBS="$cf_pkgconfig_libs $LIBS"
11471         :
11472 else
11473
11474         echo "$as_me:11474: checking for XextCreateExtension in -lXext" >&5
11475 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11476 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11477   echo $ECHO_N "(cached) $ECHO_C" >&6
11478 else
11479   ac_check_lib_save_LIBS=$LIBS
11480 LIBS="-lXext  $LIBS"
11481 cat >conftest.$ac_ext <<_ACEOF
11482 #line 11482 "configure"
11483 #include "confdefs.h"
11484
11485 /* Override any gcc2 internal prototype to avoid an error.  */
11486 #ifdef __cplusplus
11487 extern "C"
11488 #endif
11489 /* We use char because int might match the return type of a gcc2
11490    builtin and then its argument prototype would still apply.  */
11491 char XextCreateExtension ();
11492 int
11493 main ()
11494 {
11495 XextCreateExtension ();
11496   ;
11497   return 0;
11498 }
11499 _ACEOF
11500 rm -f conftest.$ac_objext conftest$ac_exeext
11501 if { (eval echo "$as_me:11501: \"$ac_link\"") >&5
11502   (eval $ac_link) 2>&5
11503   ac_status=$?
11504   echo "$as_me:11504: \$? = $ac_status" >&5
11505   (exit $ac_status); } &&
11506          { ac_try='test -s conftest$ac_exeext'
11507   { (eval echo "$as_me:11507: \"$ac_try\"") >&5
11508   (eval $ac_try) 2>&5
11509   ac_status=$?
11510   echo "$as_me:11510: \$? = $ac_status" >&5
11511   (exit $ac_status); }; }; then
11512   ac_cv_lib_Xext_XextCreateExtension=yes
11513 else
11514   echo "$as_me: failed program was:" >&5
11515 cat conftest.$ac_ext >&5
11516 ac_cv_lib_Xext_XextCreateExtension=no
11517 fi
11518 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11519 LIBS=$ac_check_lib_save_LIBS
11520 fi
11521 echo "$as_me:11521: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11522 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11523 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11524   LIBS="-lXext $LIBS"
11525 fi
11526
11527 fi
11528
11529 cf_have_X_LIBS=no
11530
11531 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11532         test -n "$verbose" && echo "    found package xt" 1>&6
11533
11534 echo "${as_me:-configure}:11534: testing found package xt ..." 1>&5
11535
11536         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11537         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11538         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11539
11540 echo "${as_me:-configure}:11540: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11541
11542         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11543
11544 echo "${as_me:-configure}:11544: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11545
11546 cf_fix_cppflags=no
11547 cf_new_cflags=
11548 cf_new_cppflags=
11549 cf_new_extra_cppflags=
11550
11551 for cf_add_cflags in $cf_pkgconfig_incs
11552 do
11553 case $cf_fix_cppflags in
11554 no)
11555         case $cf_add_cflags in #(vi
11556         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11557                 case $cf_add_cflags in
11558                 -D*)
11559                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11560
11561                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11562                                 && test -z "${cf_tst_cflags}" \
11563                                 && cf_fix_cppflags=yes
11564
11565                         if test $cf_fix_cppflags = yes ; then
11566                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11567                                 continue
11568                         elif test "${cf_tst_cflags}" = "\"'" ; then
11569                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11570                                 continue
11571                         fi
11572                         ;;
11573                 esac
11574                 case "$CPPFLAGS" in
11575                 *$cf_add_cflags) #(vi
11576                         ;;
11577                 *) #(vi
11578                         case $cf_add_cflags in #(vi
11579                         -D*)
11580                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11581
11582 CPPFLAGS=`echo "$CPPFLAGS" | \
11583         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11584                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11585
11586                                 ;;
11587                         esac
11588                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11589                         ;;
11590                 esac
11591                 ;;
11592         *)
11593                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11594                 ;;
11595         esac
11596         ;;
11597 yes)
11598         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11599
11600         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11601
11602         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11603                 && test -z "${cf_tst_cflags}" \
11604                 && cf_fix_cppflags=no
11605         ;;
11606 esac
11607 done
11608
11609 if test -n "$cf_new_cflags" ; then
11610
11611         CFLAGS="$CFLAGS $cf_new_cflags"
11612 fi
11613
11614 if test -n "$cf_new_cppflags" ; then
11615
11616         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11617 fi
11618
11619 if test -n "$cf_new_extra_cppflags" ; then
11620
11621         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11622 fi
11623
11624         LIBS="$cf_pkgconfig_libs $LIBS"
11625
11626         case "x$LIBS" in #(vi
11627         *-lX11*) #(vi
11628                 ;;
11629         *)
11630 # we have an "xt" package, but it may omit Xt's dependency on X11
11631 echo "$as_me:11631: checking for usable X dependency" >&5
11632 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11633 if test "${cf_cv_xt_x11_compat+set}" = set; then
11634   echo $ECHO_N "(cached) $ECHO_C" >&6
11635 else
11636
11637 cat >conftest.$ac_ext <<_ACEOF
11638 #line 11638 "configure"
11639 #include "confdefs.h"
11640
11641 #include <X11/Xlib.h>
11642
11643 int
11644 main ()
11645 {
11646
11647         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11648         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11649         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11650         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11651
11652   ;
11653   return 0;
11654 }
11655 _ACEOF
11656 rm -f conftest.$ac_objext conftest$ac_exeext
11657 if { (eval echo "$as_me:11657: \"$ac_link\"") >&5
11658   (eval $ac_link) 2>&5
11659   ac_status=$?
11660   echo "$as_me:11660: \$? = $ac_status" >&5
11661   (exit $ac_status); } &&
11662          { ac_try='test -s conftest$ac_exeext'
11663   { (eval echo "$as_me:11663: \"$ac_try\"") >&5
11664   (eval $ac_try) 2>&5
11665   ac_status=$?
11666   echo "$as_me:11666: \$? = $ac_status" >&5
11667   (exit $ac_status); }; }; then
11668   cf_cv_xt_x11_compat=yes
11669 else
11670   echo "$as_me: failed program was:" >&5
11671 cat conftest.$ac_ext >&5
11672 cf_cv_xt_x11_compat=no
11673 fi
11674 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11675 fi
11676 echo "$as_me:11676: result: $cf_cv_xt_x11_compat" >&5
11677 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11678                 if test "$cf_cv_xt_x11_compat" = no
11679                 then
11680                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11681
11682 echo "${as_me:-configure}:11682: testing work around broken X11 dependency ..." 1>&5
11683
11684                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11685
11686 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11687         test -n "$verbose" && echo "    found package x11" 1>&6
11688
11689 echo "${as_me:-configure}:11689: testing found package x11 ..." 1>&5
11690
11691         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11692         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11693         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11694
11695 echo "${as_me:-configure}:11695: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11696
11697         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11698
11699 echo "${as_me:-configure}:11699: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11700
11701 cf_fix_cppflags=no
11702 cf_new_cflags=
11703 cf_new_cppflags=
11704 cf_new_extra_cppflags=
11705
11706 for cf_add_cflags in $cf_pkgconfig_incs
11707 do
11708 case $cf_fix_cppflags in
11709 no)
11710         case $cf_add_cflags in #(vi
11711         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11712                 case $cf_add_cflags in
11713                 -D*)
11714                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11715
11716                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11717                                 && test -z "${cf_tst_cflags}" \
11718                                 && cf_fix_cppflags=yes
11719
11720                         if test $cf_fix_cppflags = yes ; then
11721                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11722                                 continue
11723                         elif test "${cf_tst_cflags}" = "\"'" ; then
11724                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11725                                 continue
11726                         fi
11727                         ;;
11728                 esac
11729                 case "$CPPFLAGS" in
11730                 *$cf_add_cflags) #(vi
11731                         ;;
11732                 *) #(vi
11733                         case $cf_add_cflags in #(vi
11734                         -D*)
11735                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11736
11737 CPPFLAGS=`echo "$CPPFLAGS" | \
11738         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11739                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11740
11741                                 ;;
11742                         esac
11743                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11744                         ;;
11745                 esac
11746                 ;;
11747         *)
11748                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11749                 ;;
11750         esac
11751         ;;
11752 yes)
11753         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11754
11755         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11756
11757         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11758                 && test -z "${cf_tst_cflags}" \
11759                 && cf_fix_cppflags=no
11760         ;;
11761 esac
11762 done
11763
11764 if test -n "$cf_new_cflags" ; then
11765
11766         CFLAGS="$CFLAGS $cf_new_cflags"
11767 fi
11768
11769 if test -n "$cf_new_cppflags" ; then
11770
11771         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11772 fi
11773
11774 if test -n "$cf_new_extra_cppflags" ; then
11775
11776         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11777 fi
11778
11779         LIBS="$cf_pkgconfig_libs $LIBS"
11780         :
11781 else
11782
11783 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11784
11785 echo "${as_me:-configure}:11785: testing ...before $LIBS ..." 1>&5
11786
11787 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11788 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11789
11790 echo "${as_me:-configure}:11790: testing ...after  $LIBS ..." 1>&5
11791
11792 fi
11793
11794                 fi
11795                 ;;
11796         esac
11797
11798 echo "$as_me:11798: checking for usable X Toolkit package" >&5
11799 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11800 if test "${cf_cv_xt_ice_compat+set}" = set; then
11801   echo $ECHO_N "(cached) $ECHO_C" >&6
11802 else
11803
11804 cat >conftest.$ac_ext <<_ACEOF
11805 #line 11805 "configure"
11806 #include "confdefs.h"
11807
11808 #include <X11/Shell.h>
11809
11810 int
11811 main ()
11812 {
11813 int num = IceConnectionNumber(0)
11814
11815   ;
11816   return 0;
11817 }
11818 _ACEOF
11819 rm -f conftest.$ac_objext conftest$ac_exeext
11820 if { (eval echo "$as_me:11820: \"$ac_link\"") >&5
11821   (eval $ac_link) 2>&5
11822   ac_status=$?
11823   echo "$as_me:11823: \$? = $ac_status" >&5
11824   (exit $ac_status); } &&
11825          { ac_try='test -s conftest$ac_exeext'
11826   { (eval echo "$as_me:11826: \"$ac_try\"") >&5
11827   (eval $ac_try) 2>&5
11828   ac_status=$?
11829   echo "$as_me:11829: \$? = $ac_status" >&5
11830   (exit $ac_status); }; }; then
11831   cf_cv_xt_ice_compat=yes
11832 else
11833   echo "$as_me: failed program was:" >&5
11834 cat conftest.$ac_ext >&5
11835 cf_cv_xt_ice_compat=no
11836 fi
11837 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11838 fi
11839 echo "$as_me:11839: result: $cf_cv_xt_ice_compat" >&5
11840 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11841
11842         if test "$cf_cv_xt_ice_compat" = no
11843         then
11844                 # workaround for broken ".pc" files used for X Toolkit.
11845                 case "x$X_PRE_LIBS" in #(vi
11846                 *-lICE*)
11847                         case "x$LIBS" in #(vi
11848                         *-lICE*) #(vi
11849                                 ;;
11850                         *)
11851                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11852
11853 echo "${as_me:-configure}:11853: testing work around broken ICE dependency ..." 1>&5
11854
11855 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11856         test -n "$verbose" && echo "    found package ice" 1>&6
11857
11858 echo "${as_me:-configure}:11858: testing found package ice ..." 1>&5
11859
11860         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11861         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11862         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11863
11864 echo "${as_me:-configure}:11864: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11865
11866         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11867
11868 echo "${as_me:-configure}:11868: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11869
11870 cf_fix_cppflags=no
11871 cf_new_cflags=
11872 cf_new_cppflags=
11873 cf_new_extra_cppflags=
11874
11875 for cf_add_cflags in $cf_pkgconfig_incs
11876 do
11877 case $cf_fix_cppflags in
11878 no)
11879         case $cf_add_cflags in #(vi
11880         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11881                 case $cf_add_cflags in
11882                 -D*)
11883                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11884
11885                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11886                                 && test -z "${cf_tst_cflags}" \
11887                                 && cf_fix_cppflags=yes
11888
11889                         if test $cf_fix_cppflags = yes ; then
11890                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11891                                 continue
11892                         elif test "${cf_tst_cflags}" = "\"'" ; then
11893                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11894                                 continue
11895                         fi
11896                         ;;
11897                 esac
11898                 case "$CPPFLAGS" in
11899                 *$cf_add_cflags) #(vi
11900                         ;;
11901                 *) #(vi
11902                         case $cf_add_cflags in #(vi
11903                         -D*)
11904                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11905
11906 CPPFLAGS=`echo "$CPPFLAGS" | \
11907         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11908                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11909
11910                                 ;;
11911                         esac
11912                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11913                         ;;
11914                 esac
11915                 ;;
11916         *)
11917                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11918                 ;;
11919         esac
11920         ;;
11921 yes)
11922         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11923
11924         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11925
11926         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11927                 && test -z "${cf_tst_cflags}" \
11928                 && cf_fix_cppflags=no
11929         ;;
11930 esac
11931 done
11932
11933 if test -n "$cf_new_cflags" ; then
11934
11935         CFLAGS="$CFLAGS $cf_new_cflags"
11936 fi
11937
11938 if test -n "$cf_new_cppflags" ; then
11939
11940         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11941 fi
11942
11943 if test -n "$cf_new_extra_cppflags" ; then
11944
11945         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11946 fi
11947
11948         LIBS="$cf_pkgconfig_libs $LIBS"
11949
11950 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
11951         test -n "$verbose" && echo "    found package sm" 1>&6
11952
11953 echo "${as_me:-configure}:11953: testing found package sm ..." 1>&5
11954
11955         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
11956         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
11957         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
11958
11959 echo "${as_me:-configure}:11959: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11960
11961         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
11962
11963 echo "${as_me:-configure}:11963: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
11964
11965 cf_fix_cppflags=no
11966 cf_new_cflags=
11967 cf_new_cppflags=
11968 cf_new_extra_cppflags=
11969
11970 for cf_add_cflags in $cf_pkgconfig_incs
11971 do
11972 case $cf_fix_cppflags in
11973 no)
11974         case $cf_add_cflags in #(vi
11975         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11976                 case $cf_add_cflags in
11977                 -D*)
11978                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11979
11980                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11981                                 && test -z "${cf_tst_cflags}" \
11982                                 && cf_fix_cppflags=yes
11983
11984                         if test $cf_fix_cppflags = yes ; then
11985                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11986                                 continue
11987                         elif test "${cf_tst_cflags}" = "\"'" ; then
11988                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11989                                 continue
11990                         fi
11991                         ;;
11992                 esac
11993                 case "$CPPFLAGS" in
11994                 *$cf_add_cflags) #(vi
11995                         ;;
11996                 *) #(vi
11997                         case $cf_add_cflags in #(vi
11998                         -D*)
11999                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12000
12001 CPPFLAGS=`echo "$CPPFLAGS" | \
12002         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12003                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12004
12005                                 ;;
12006                         esac
12007                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12008                         ;;
12009                 esac
12010                 ;;
12011         *)
12012                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12013                 ;;
12014         esac
12015         ;;
12016 yes)
12017         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12018
12019         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12020
12021         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12022                 && test -z "${cf_tst_cflags}" \
12023                 && cf_fix_cppflags=no
12024         ;;
12025 esac
12026 done
12027
12028 if test -n "$cf_new_cflags" ; then
12029
12030         CFLAGS="$CFLAGS $cf_new_cflags"
12031 fi
12032
12033 if test -n "$cf_new_cppflags" ; then
12034
12035         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12036 fi
12037
12038 if test -n "$cf_new_extra_cppflags" ; then
12039
12040         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12041 fi
12042
12043         LIBS="$cf_pkgconfig_libs $LIBS"
12044         :
12045 else
12046         :
12047 fi
12048
12049 else
12050
12051 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12052
12053 echo "${as_me:-configure}:12053: testing ...before $LIBS ..." 1>&5
12054
12055 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
12056 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12057
12058 echo "${as_me:-configure}:12058: testing ...after  $LIBS ..." 1>&5
12059
12060 fi
12061
12062                                 ;;
12063                         esac
12064                         ;;
12065                 esac
12066         fi
12067
12068         cf_have_X_LIBS=yes
12069
12070 else
12071
12072         LDFLAGS="$X_LIBS $LDFLAGS"
12073
12074 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12075
12076 echo "${as_me:-configure}:12076: testing checking additions to CFLAGS ..." 1>&5
12077
12078 cf_check_cflags="$CFLAGS"
12079 cf_check_cppflags="$CPPFLAGS"
12080
12081 cf_fix_cppflags=no
12082 cf_new_cflags=
12083 cf_new_cppflags=
12084 cf_new_extra_cppflags=
12085
12086 for cf_add_cflags in $X_CFLAGS
12087 do
12088 case $cf_fix_cppflags in
12089 no)
12090         case $cf_add_cflags in #(vi
12091         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12092                 case $cf_add_cflags in
12093                 -D*)
12094                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12095
12096                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12097                                 && test -z "${cf_tst_cflags}" \
12098                                 && cf_fix_cppflags=yes
12099
12100                         if test $cf_fix_cppflags = yes ; then
12101                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12102                                 continue
12103                         elif test "${cf_tst_cflags}" = "\"'" ; then
12104                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12105                                 continue
12106                         fi
12107                         ;;
12108                 esac
12109                 case "$CPPFLAGS" in
12110                 *$cf_add_cflags) #(vi
12111                         ;;
12112                 *) #(vi
12113                         case $cf_add_cflags in #(vi
12114                         -D*)
12115                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12116
12117 CPPFLAGS=`echo "$CPPFLAGS" | \
12118         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12119                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12120
12121                                 ;;
12122                         esac
12123                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12124                         ;;
12125                 esac
12126                 ;;
12127         *)
12128                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12129                 ;;
12130         esac
12131         ;;
12132 yes)
12133         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12134
12135         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12136
12137         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12138                 && test -z "${cf_tst_cflags}" \
12139                 && cf_fix_cppflags=no
12140         ;;
12141 esac
12142 done
12143
12144 if test -n "$cf_new_cflags" ; then
12145         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12146
12147 echo "${as_me:-configure}:12147: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12148
12149         CFLAGS="$CFLAGS $cf_new_cflags"
12150 fi
12151
12152 if test -n "$cf_new_cppflags" ; then
12153         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12154
12155 echo "${as_me:-configure}:12155: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12156
12157         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12158 fi
12159
12160 if test -n "$cf_new_extra_cppflags" ; then
12161         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12162
12163 echo "${as_me:-configure}:12163: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12164
12165         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12166 fi
12167
12168 if test "$cf_check_cflags" != "$CFLAGS" ; then
12169 cat >conftest.$ac_ext <<_ACEOF
12170 #line 12170 "configure"
12171 #include "confdefs.h"
12172 #include <stdio.h>
12173 int
12174 main ()
12175 {
12176 printf("Hello world");
12177   ;
12178   return 0;
12179 }
12180 _ACEOF
12181 rm -f conftest.$ac_objext conftest$ac_exeext
12182 if { (eval echo "$as_me:12182: \"$ac_link\"") >&5
12183   (eval $ac_link) 2>&5
12184   ac_status=$?
12185   echo "$as_me:12185: \$? = $ac_status" >&5
12186   (exit $ac_status); } &&
12187          { ac_try='test -s conftest$ac_exeext'
12188   { (eval echo "$as_me:12188: \"$ac_try\"") >&5
12189   (eval $ac_try) 2>&5
12190   ac_status=$?
12191   echo "$as_me:12191: \$? = $ac_status" >&5
12192   (exit $ac_status); }; }; then
12193   :
12194 else
12195   echo "$as_me: failed program was:" >&5
12196 cat conftest.$ac_ext >&5
12197 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12198
12199 echo "${as_me:-configure}:12199: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12200
12201          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12202                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12203
12204 echo "${as_me:-configure}:12204: testing but keeping change to \$CPPFLAGS ..." 1>&5
12205
12206          fi
12207          CFLAGS="$cf_check_flags"
12208 fi
12209 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12210 fi
12211
12212         echo "$as_me:12212: checking for XOpenDisplay" >&5
12213 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12214 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12215   echo $ECHO_N "(cached) $ECHO_C" >&6
12216 else
12217   cat >conftest.$ac_ext <<_ACEOF
12218 #line 12218 "configure"
12219 #include "confdefs.h"
12220 /* System header to define __stub macros and hopefully few prototypes,
12221     which can conflict with char XOpenDisplay (); below.  */
12222 #include <assert.h>
12223 /* Override any gcc2 internal prototype to avoid an error.  */
12224 #ifdef __cplusplus
12225 extern "C"
12226 #endif
12227 /* We use char because int might match the return type of a gcc2
12228    builtin and then its argument prototype would still apply.  */
12229 char XOpenDisplay ();
12230 char (*f) ();
12231
12232 int
12233 main ()
12234 {
12235 /* The GNU C library defines this for functions which it implements
12236     to always fail with ENOSYS.  Some functions are actually named
12237     something starting with __ and the normal name is an alias.  */
12238 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12239 choke me
12240 #else
12241 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12242 #endif
12243
12244   ;
12245   return 0;
12246 }
12247 _ACEOF
12248 rm -f conftest.$ac_objext conftest$ac_exeext
12249 if { (eval echo "$as_me:12249: \"$ac_link\"") >&5
12250   (eval $ac_link) 2>&5
12251   ac_status=$?
12252   echo "$as_me:12252: \$? = $ac_status" >&5
12253   (exit $ac_status); } &&
12254          { ac_try='test -s conftest$ac_exeext'
12255   { (eval echo "$as_me:12255: \"$ac_try\"") >&5
12256   (eval $ac_try) 2>&5
12257   ac_status=$?
12258   echo "$as_me:12258: \$? = $ac_status" >&5
12259   (exit $ac_status); }; }; then
12260   ac_cv_func_XOpenDisplay=yes
12261 else
12262   echo "$as_me: failed program was:" >&5
12263 cat conftest.$ac_ext >&5
12264 ac_cv_func_XOpenDisplay=no
12265 fi
12266 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12267 fi
12268 echo "$as_me:12268: result: $ac_cv_func_XOpenDisplay" >&5
12269 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12270 if test $ac_cv_func_XOpenDisplay = yes; then
12271   :
12272 else
12273
12274         echo "$as_me:12274: checking for XOpenDisplay in -lX11" >&5
12275 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12276 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12277   echo $ECHO_N "(cached) $ECHO_C" >&6
12278 else
12279   ac_check_lib_save_LIBS=$LIBS
12280 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12281 cat >conftest.$ac_ext <<_ACEOF
12282 #line 12282 "configure"
12283 #include "confdefs.h"
12284
12285 /* Override any gcc2 internal prototype to avoid an error.  */
12286 #ifdef __cplusplus
12287 extern "C"
12288 #endif
12289 /* We use char because int might match the return type of a gcc2
12290    builtin and then its argument prototype would still apply.  */
12291 char XOpenDisplay ();
12292 int
12293 main ()
12294 {
12295 XOpenDisplay ();
12296   ;
12297   return 0;
12298 }
12299 _ACEOF
12300 rm -f conftest.$ac_objext conftest$ac_exeext
12301 if { (eval echo "$as_me:12301: \"$ac_link\"") >&5
12302   (eval $ac_link) 2>&5
12303   ac_status=$?
12304   echo "$as_me:12304: \$? = $ac_status" >&5
12305   (exit $ac_status); } &&
12306          { ac_try='test -s conftest$ac_exeext'
12307   { (eval echo "$as_me:12307: \"$ac_try\"") >&5
12308   (eval $ac_try) 2>&5
12309   ac_status=$?
12310   echo "$as_me:12310: \$? = $ac_status" >&5
12311   (exit $ac_status); }; }; then
12312   ac_cv_lib_X11_XOpenDisplay=yes
12313 else
12314   echo "$as_me: failed program was:" >&5
12315 cat conftest.$ac_ext >&5
12316 ac_cv_lib_X11_XOpenDisplay=no
12317 fi
12318 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12319 LIBS=$ac_check_lib_save_LIBS
12320 fi
12321 echo "$as_me:12321: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12322 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12323 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12324   LIBS="-lX11 $LIBS"
12325 fi
12326
12327 fi
12328
12329         echo "$as_me:12329: checking for XtAppInitialize" >&5
12330 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12331 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12332   echo $ECHO_N "(cached) $ECHO_C" >&6
12333 else
12334   cat >conftest.$ac_ext <<_ACEOF
12335 #line 12335 "configure"
12336 #include "confdefs.h"
12337 /* System header to define __stub macros and hopefully few prototypes,
12338     which can conflict with char XtAppInitialize (); below.  */
12339 #include <assert.h>
12340 /* Override any gcc2 internal prototype to avoid an error.  */
12341 #ifdef __cplusplus
12342 extern "C"
12343 #endif
12344 /* We use char because int might match the return type of a gcc2
12345    builtin and then its argument prototype would still apply.  */
12346 char XtAppInitialize ();
12347 char (*f) ();
12348
12349 int
12350 main ()
12351 {
12352 /* The GNU C library defines this for functions which it implements
12353     to always fail with ENOSYS.  Some functions are actually named
12354     something starting with __ and the normal name is an alias.  */
12355 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12356 choke me
12357 #else
12358 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12359 #endif
12360
12361   ;
12362   return 0;
12363 }
12364 _ACEOF
12365 rm -f conftest.$ac_objext conftest$ac_exeext
12366 if { (eval echo "$as_me:12366: \"$ac_link\"") >&5
12367   (eval $ac_link) 2>&5
12368   ac_status=$?
12369   echo "$as_me:12369: \$? = $ac_status" >&5
12370   (exit $ac_status); } &&
12371          { ac_try='test -s conftest$ac_exeext'
12372   { (eval echo "$as_me:12372: \"$ac_try\"") >&5
12373   (eval $ac_try) 2>&5
12374   ac_status=$?
12375   echo "$as_me:12375: \$? = $ac_status" >&5
12376   (exit $ac_status); }; }; then
12377   ac_cv_func_XtAppInitialize=yes
12378 else
12379   echo "$as_me: failed program was:" >&5
12380 cat conftest.$ac_ext >&5
12381 ac_cv_func_XtAppInitialize=no
12382 fi
12383 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12384 fi
12385 echo "$as_me:12385: result: $ac_cv_func_XtAppInitialize" >&5
12386 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12387 if test $ac_cv_func_XtAppInitialize = yes; then
12388   :
12389 else
12390
12391         echo "$as_me:12391: checking for XtAppInitialize in -lXt" >&5
12392 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12393 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12394   echo $ECHO_N "(cached) $ECHO_C" >&6
12395 else
12396   ac_check_lib_save_LIBS=$LIBS
12397 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12398 cat >conftest.$ac_ext <<_ACEOF
12399 #line 12399 "configure"
12400 #include "confdefs.h"
12401
12402 /* Override any gcc2 internal prototype to avoid an error.  */
12403 #ifdef __cplusplus
12404 extern "C"
12405 #endif
12406 /* We use char because int might match the return type of a gcc2
12407    builtin and then its argument prototype would still apply.  */
12408 char XtAppInitialize ();
12409 int
12410 main ()
12411 {
12412 XtAppInitialize ();
12413   ;
12414   return 0;
12415 }
12416 _ACEOF
12417 rm -f conftest.$ac_objext conftest$ac_exeext
12418 if { (eval echo "$as_me:12418: \"$ac_link\"") >&5
12419   (eval $ac_link) 2>&5
12420   ac_status=$?
12421   echo "$as_me:12421: \$? = $ac_status" >&5
12422   (exit $ac_status); } &&
12423          { ac_try='test -s conftest$ac_exeext'
12424   { (eval echo "$as_me:12424: \"$ac_try\"") >&5
12425   (eval $ac_try) 2>&5
12426   ac_status=$?
12427   echo "$as_me:12427: \$? = $ac_status" >&5
12428   (exit $ac_status); }; }; then
12429   ac_cv_lib_Xt_XtAppInitialize=yes
12430 else
12431   echo "$as_me: failed program was:" >&5
12432 cat conftest.$ac_ext >&5
12433 ac_cv_lib_Xt_XtAppInitialize=no
12434 fi
12435 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12436 LIBS=$ac_check_lib_save_LIBS
12437 fi
12438 echo "$as_me:12438: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12439 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12440 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12441   cat >>confdefs.h <<\EOF
12442 #define HAVE_LIBXT 1
12443 EOF
12444
12445                  cf_have_X_LIBS=Xt
12446                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12447 fi
12448
12449 fi
12450
12451 fi
12452
12453 if test $cf_have_X_LIBS = no ; then
12454         { echo "$as_me:12454: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12455 test program.  You will have to check and add the proper libraries by hand
12456 to makefile." >&5
12457 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12458 test program.  You will have to check and add the proper libraries by hand
12459 to makefile." >&2;}
12460 fi
12461
12462 cf_x_athena_root=$cf_x_athena
12463 cf_x_athena_inc=""
12464
12465 for cf_path in default \
12466         /usr/contrib/X11R6 \
12467         /usr/contrib/X11R5 \
12468         /usr/lib/X11R5 \
12469         /usr/local
12470 do
12471         if test -z "$cf_x_athena_inc" ; then
12472                 cf_save="$CPPFLAGS"
12473                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12474                 if test $cf_path != default ; then
12475                         CPPFLAGS="$cf_save -I$cf_path/include"
12476                         echo "$as_me:12476: checking for $cf_test in $cf_path" >&5
12477 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12478                 else
12479                         echo "$as_me:12479: checking for $cf_test" >&5
12480 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12481                 fi
12482                 cat >conftest.$ac_ext <<_ACEOF
12483 #line 12483 "configure"
12484 #include "confdefs.h"
12485
12486 #include <X11/Intrinsic.h>
12487 #include <$cf_test>
12488 int
12489 main ()
12490 {
12491
12492   ;
12493   return 0;
12494 }
12495 _ACEOF
12496 rm -f conftest.$ac_objext
12497 if { (eval echo "$as_me:12497: \"$ac_compile\"") >&5
12498   (eval $ac_compile) 2>&5
12499   ac_status=$?
12500   echo "$as_me:12500: \$? = $ac_status" >&5
12501   (exit $ac_status); } &&
12502          { ac_try='test -s conftest.$ac_objext'
12503   { (eval echo "$as_me:12503: \"$ac_try\"") >&5
12504   (eval $ac_try) 2>&5
12505   ac_status=$?
12506   echo "$as_me:12506: \$? = $ac_status" >&5
12507   (exit $ac_status); }; }; then
12508   cf_result=yes
12509 else
12510   echo "$as_me: failed program was:" >&5
12511 cat conftest.$ac_ext >&5
12512 cf_result=no
12513 fi
12514 rm -f conftest.$ac_objext conftest.$ac_ext
12515                 echo "$as_me:12515: result: $cf_result" >&5
12516 echo "${ECHO_T}$cf_result" >&6
12517                 if test "$cf_result" = yes ; then
12518                         cf_x_athena_inc=$cf_path
12519                         break
12520                 else
12521                         CPPFLAGS="$cf_save"
12522                 fi
12523         fi
12524 done
12525
12526 if test -z "$cf_x_athena_inc" ; then
12527         { echo "$as_me:12527: WARNING: Unable to successfully find Athena header files with test program" >&5
12528 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12529 elif test "$cf_x_athena_inc" != default ; then
12530         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12531 fi
12532
12533 cf_x_athena_root=$cf_x_athena
12534 cf_x_athena_lib=""
12535
12536 for cf_path in default \
12537         /usr/contrib/X11R6 \
12538         /usr/contrib/X11R5 \
12539         /usr/lib/X11R5 \
12540         /usr/local
12541 do
12542         for cf_lib in \
12543                 ${cf_x_athena_root} \
12544                 ${cf_x_athena_root}7 \
12545                 ${cf_x_athena_root}6
12546         do
12547         for cf_libs in \
12548                 "-l$cf_lib -lXmu" \
12549                 "-l$cf_lib -lXpm -lXmu" \
12550                 "-l${cf_lib}_s -lXmu_s"
12551         do
12552                 if test -z "$cf_x_athena_lib" ; then
12553                         cf_save="$LIBS"
12554                         cf_test=XawSimpleMenuAddGlobalActions
12555                         if test $cf_path != default ; then
12556                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12557                                 echo "$as_me:12557: checking for $cf_libs in $cf_path" >&5
12558 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12559                         else
12560                                 LIBS="$cf_libs $LIBS"
12561                                 echo "$as_me:12561: checking for $cf_test in $cf_libs" >&5
12562 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12563                         fi
12564                         cat >conftest.$ac_ext <<_ACEOF
12565 #line 12565 "configure"
12566 #include "confdefs.h"
12567
12568 #include <X11/Intrinsic.h>
12569 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12570
12571 int
12572 main ()
12573 {
12574
12575 $cf_test((XtAppContext) 0)
12576   ;
12577   return 0;
12578 }
12579 _ACEOF
12580 rm -f conftest.$ac_objext conftest$ac_exeext
12581 if { (eval echo "$as_me:12581: \"$ac_link\"") >&5
12582   (eval $ac_link) 2>&5
12583   ac_status=$?
12584   echo "$as_me:12584: \$? = $ac_status" >&5
12585   (exit $ac_status); } &&
12586          { ac_try='test -s conftest$ac_exeext'
12587   { (eval echo "$as_me:12587: \"$ac_try\"") >&5
12588   (eval $ac_try) 2>&5
12589   ac_status=$?
12590   echo "$as_me:12590: \$? = $ac_status" >&5
12591   (exit $ac_status); }; }; then
12592   cf_result=yes
12593 else
12594   echo "$as_me: failed program was:" >&5
12595 cat conftest.$ac_ext >&5
12596 cf_result=no
12597 fi
12598 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12599                         echo "$as_me:12599: result: $cf_result" >&5
12600 echo "${ECHO_T}$cf_result" >&6
12601                         if test "$cf_result" = yes ; then
12602                                 cf_x_athena_lib="$cf_libs"
12603                                 break
12604                         fi
12605                         LIBS="$cf_save"
12606                 fi
12607         done # cf_libs
12608                 test -n "$cf_x_athena_lib" && break
12609         done # cf_lib
12610 done
12611
12612 if test -z "$cf_x_athena_lib" ; then
12613         { { echo "$as_me:12613: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12614 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12615    { (exit 1); exit 1; }; }
12616 fi
12617
12618 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12619
12620 cat >>confdefs.h <<EOF
12621 #define $cf_x_athena_LIBS 1
12622 EOF
12623
12624 fi
12625
12626 if test -n "$ac_tool_prefix"; then
12627   for ac_prog in xcurses-config
12628   do
12629     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12630 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12631 echo "$as_me:12631: checking for $ac_word" >&5
12632 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12633 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12634   echo $ECHO_N "(cached) $ECHO_C" >&6
12635 else
12636   if test -n "$XCURSES_CONFIG"; then
12637   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12638 else
12639   ac_save_IFS=$IFS; IFS=$ac_path_separator
12640 ac_dummy="$PATH"
12641 for ac_dir in $ac_dummy; do
12642   IFS=$ac_save_IFS
12643   test -z "$ac_dir" && ac_dir=.
12644   $as_executable_p "$ac_dir/$ac_word" || continue
12645 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12646 echo "$as_me:12646: found $ac_dir/$ac_word" >&5
12647 break
12648 done
12649
12650 fi
12651 fi
12652 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12653 if test -n "$XCURSES_CONFIG"; then
12654   echo "$as_me:12654: result: $XCURSES_CONFIG" >&5
12655 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12656 else
12657   echo "$as_me:12657: result: no" >&5
12658 echo "${ECHO_T}no" >&6
12659 fi
12660
12661     test -n "$XCURSES_CONFIG" && break
12662   done
12663 fi
12664 if test -z "$XCURSES_CONFIG"; then
12665   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12666   for ac_prog in xcurses-config
12667 do
12668   # Extract the first word of "$ac_prog", so it can be a program name with args.
12669 set dummy $ac_prog; ac_word=$2
12670 echo "$as_me:12670: checking for $ac_word" >&5
12671 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12672 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12673   echo $ECHO_N "(cached) $ECHO_C" >&6
12674 else
12675   if test -n "$ac_ct_XCURSES_CONFIG"; then
12676   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12677 else
12678   ac_save_IFS=$IFS; IFS=$ac_path_separator
12679 ac_dummy="$PATH"
12680 for ac_dir in $ac_dummy; do
12681   IFS=$ac_save_IFS
12682   test -z "$ac_dir" && ac_dir=.
12683   $as_executable_p "$ac_dir/$ac_word" || continue
12684 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12685 echo "$as_me:12685: found $ac_dir/$ac_word" >&5
12686 break
12687 done
12688
12689 fi
12690 fi
12691 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12692 if test -n "$ac_ct_XCURSES_CONFIG"; then
12693   echo "$as_me:12693: result: $ac_ct_XCURSES_CONFIG" >&5
12694 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12695 else
12696   echo "$as_me:12696: result: no" >&5
12697 echo "${ECHO_T}no" >&6
12698 fi
12699
12700   test -n "$ac_ct_XCURSES_CONFIG" && break
12701 done
12702 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12703
12704   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12705 fi
12706
12707 if test "$XCURSES_CONFIG" != none ; then
12708
12709 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12710 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12711
12712 cf_cv_lib_XCurses=yes
12713
12714 else
12715
12716 LDFLAGS="$LDFLAGS $X_LIBS"
12717
12718 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12719
12720 echo "${as_me:-configure}:12720: testing checking additions to CFLAGS ..." 1>&5
12721
12722 cf_check_cflags="$CFLAGS"
12723 cf_check_cppflags="$CPPFLAGS"
12724
12725 cf_fix_cppflags=no
12726 cf_new_cflags=
12727 cf_new_cppflags=
12728 cf_new_extra_cppflags=
12729
12730 for cf_add_cflags in $X_CFLAGS
12731 do
12732 case $cf_fix_cppflags in
12733 no)
12734         case $cf_add_cflags in #(vi
12735         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12736                 case $cf_add_cflags in
12737                 -D*)
12738                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12739
12740                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12741                                 && test -z "${cf_tst_cflags}" \
12742                                 && cf_fix_cppflags=yes
12743
12744                         if test $cf_fix_cppflags = yes ; then
12745                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12746                                 continue
12747                         elif test "${cf_tst_cflags}" = "\"'" ; then
12748                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12749                                 continue
12750                         fi
12751                         ;;
12752                 esac
12753                 case "$CPPFLAGS" in
12754                 *$cf_add_cflags) #(vi
12755                         ;;
12756                 *) #(vi
12757                         case $cf_add_cflags in #(vi
12758                         -D*)
12759                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12760
12761 CPPFLAGS=`echo "$CPPFLAGS" | \
12762         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12763                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12764
12765                                 ;;
12766                         esac
12767                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12768                         ;;
12769                 esac
12770                 ;;
12771         *)
12772                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12773                 ;;
12774         esac
12775         ;;
12776 yes)
12777         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12778
12779         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12780
12781         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12782                 && test -z "${cf_tst_cflags}" \
12783                 && cf_fix_cppflags=no
12784         ;;
12785 esac
12786 done
12787
12788 if test -n "$cf_new_cflags" ; then
12789         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12790
12791 echo "${as_me:-configure}:12791: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12792
12793         CFLAGS="$CFLAGS $cf_new_cflags"
12794 fi
12795
12796 if test -n "$cf_new_cppflags" ; then
12797         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12798
12799 echo "${as_me:-configure}:12799: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12800
12801         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12802 fi
12803
12804 if test -n "$cf_new_extra_cppflags" ; then
12805         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12806
12807 echo "${as_me:-configure}:12807: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12808
12809         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12810 fi
12811
12812 if test "$cf_check_cflags" != "$CFLAGS" ; then
12813 cat >conftest.$ac_ext <<_ACEOF
12814 #line 12814 "configure"
12815 #include "confdefs.h"
12816 #include <stdio.h>
12817 int
12818 main ()
12819 {
12820 printf("Hello world");
12821   ;
12822   return 0;
12823 }
12824 _ACEOF
12825 rm -f conftest.$ac_objext conftest$ac_exeext
12826 if { (eval echo "$as_me:12826: \"$ac_link\"") >&5
12827   (eval $ac_link) 2>&5
12828   ac_status=$?
12829   echo "$as_me:12829: \$? = $ac_status" >&5
12830   (exit $ac_status); } &&
12831          { ac_try='test -s conftest$ac_exeext'
12832   { (eval echo "$as_me:12832: \"$ac_try\"") >&5
12833   (eval $ac_try) 2>&5
12834   ac_status=$?
12835   echo "$as_me:12835: \$? = $ac_status" >&5
12836   (exit $ac_status); }; }; then
12837   :
12838 else
12839   echo "$as_me: failed program was:" >&5
12840 cat conftest.$ac_ext >&5
12841 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12842
12843 echo "${as_me:-configure}:12843: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12844
12845          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12846                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12847
12848 echo "${as_me:-configure}:12848: testing but keeping change to \$CPPFLAGS ..." 1>&5
12849
12850          fi
12851          CFLAGS="$cf_check_flags"
12852 fi
12853 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12854 fi
12855
12856 echo "$as_me:12856: checking for XOpenDisplay in -lX11" >&5
12857 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12858 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12859   echo $ECHO_N "(cached) $ECHO_C" >&6
12860 else
12861   ac_check_lib_save_LIBS=$LIBS
12862 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12863 cat >conftest.$ac_ext <<_ACEOF
12864 #line 12864 "configure"
12865 #include "confdefs.h"
12866
12867 /* Override any gcc2 internal prototype to avoid an error.  */
12868 #ifdef __cplusplus
12869 extern "C"
12870 #endif
12871 /* We use char because int might match the return type of a gcc2
12872    builtin and then its argument prototype would still apply.  */
12873 char XOpenDisplay ();
12874 int
12875 main ()
12876 {
12877 XOpenDisplay ();
12878   ;
12879   return 0;
12880 }
12881 _ACEOF
12882 rm -f conftest.$ac_objext conftest$ac_exeext
12883 if { (eval echo "$as_me:12883: \"$ac_link\"") >&5
12884   (eval $ac_link) 2>&5
12885   ac_status=$?
12886   echo "$as_me:12886: \$? = $ac_status" >&5
12887   (exit $ac_status); } &&
12888          { ac_try='test -s conftest$ac_exeext'
12889   { (eval echo "$as_me:12889: \"$ac_try\"") >&5
12890   (eval $ac_try) 2>&5
12891   ac_status=$?
12892   echo "$as_me:12892: \$? = $ac_status" >&5
12893   (exit $ac_status); }; }; then
12894   ac_cv_lib_X11_XOpenDisplay=yes
12895 else
12896   echo "$as_me: failed program was:" >&5
12897 cat conftest.$ac_ext >&5
12898 ac_cv_lib_X11_XOpenDisplay=no
12899 fi
12900 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12901 LIBS=$ac_check_lib_save_LIBS
12902 fi
12903 echo "$as_me:12903: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12904 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12905 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12906   LIBS="-lX11 $LIBS"
12907 fi
12908
12909 echo "$as_me:12909: checking for XCurses library" >&5
12910 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12911 if test "${cf_cv_lib_XCurses+set}" = set; then
12912   echo $ECHO_N "(cached) $ECHO_C" >&6
12913 else
12914
12915 LIBS="-lXCurses $LIBS"
12916 cat >conftest.$ac_ext <<_ACEOF
12917 #line 12917 "configure"
12918 #include "confdefs.h"
12919
12920 #include <xcurses.h>
12921 char *XCursesProgramName = "test";
12922
12923 int
12924 main ()
12925 {
12926 XCursesExit();
12927   ;
12928   return 0;
12929 }
12930 _ACEOF
12931 rm -f conftest.$ac_objext conftest$ac_exeext
12932 if { (eval echo "$as_me:12932: \"$ac_link\"") >&5
12933   (eval $ac_link) 2>&5
12934   ac_status=$?
12935   echo "$as_me:12935: \$? = $ac_status" >&5
12936   (exit $ac_status); } &&
12937          { ac_try='test -s conftest$ac_exeext'
12938   { (eval echo "$as_me:12938: \"$ac_try\"") >&5
12939   (eval $ac_try) 2>&5
12940   ac_status=$?
12941   echo "$as_me:12941: \$? = $ac_status" >&5
12942   (exit $ac_status); }; }; then
12943   cf_cv_lib_XCurses=yes
12944 else
12945   echo "$as_me: failed program was:" >&5
12946 cat conftest.$ac_ext >&5
12947 cf_cv_lib_XCurses=no
12948 fi
12949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12950
12951 fi
12952 echo "$as_me:12952: result: $cf_cv_lib_XCurses" >&5
12953 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
12954
12955 fi
12956
12957 if test $cf_cv_lib_XCurses = yes ; then
12958         cat >>confdefs.h <<\EOF
12959 #define UNIX 1
12960 EOF
12961
12962         cat >>confdefs.h <<\EOF
12963 #define XCURSES 1
12964 EOF
12965
12966         echo "$as_me:12966: checking for xcurses.h" >&5
12967 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
12968 if test "${ac_cv_header_xcurses_h+set}" = set; then
12969   echo $ECHO_N "(cached) $ECHO_C" >&6
12970 else
12971   cat >conftest.$ac_ext <<_ACEOF
12972 #line 12972 "configure"
12973 #include "confdefs.h"
12974 #include <xcurses.h>
12975 _ACEOF
12976 if { (eval echo "$as_me:12976: \"$ac_cpp conftest.$ac_ext\"") >&5
12977   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
12978   ac_status=$?
12979   egrep -v '^ *\+' conftest.er1 >conftest.err
12980   rm -f conftest.er1
12981   cat conftest.err >&5
12982   echo "$as_me:12982: \$? = $ac_status" >&5
12983   (exit $ac_status); } >/dev/null; then
12984   if test -s conftest.err; then
12985     ac_cpp_err=$ac_c_preproc_warn_flag
12986   else
12987     ac_cpp_err=
12988   fi
12989 else
12990   ac_cpp_err=yes
12991 fi
12992 if test -z "$ac_cpp_err"; then
12993   ac_cv_header_xcurses_h=yes
12994 else
12995   echo "$as_me: failed program was:" >&5
12996   cat conftest.$ac_ext >&5
12997   ac_cv_header_xcurses_h=no
12998 fi
12999 rm -f conftest.err conftest.$ac_ext
13000 fi
13001 echo "$as_me:13001: result: $ac_cv_header_xcurses_h" >&5
13002 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13003 if test $ac_cv_header_xcurses_h = yes; then
13004   cat >>confdefs.h <<\EOF
13005 #define HAVE_XCURSES 1
13006 EOF
13007
13008 fi
13009
13010 else
13011         { { echo "$as_me:13011: error: Cannot link with XCurses" >&5
13012 echo "$as_me: error: Cannot link with XCurses" >&2;}
13013    { (exit 1); exit 1; }; }
13014 fi
13015
13016         ;;
13017 esac
13018
13019 case $cf_cv_screen in
13020 curses|curses_*)
13021
13022 echo "$as_me:13022: checking for NetBSD form.h" >&5
13023 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13024 if test "${cf_cv_netbsd_form_h+set}" = set; then
13025   echo $ECHO_N "(cached) $ECHO_C" >&6
13026 else
13027
13028 cat >conftest.$ac_ext <<_ACEOF
13029 #line 13029 "configure"
13030 #include "confdefs.h"
13031
13032 #include <${cf_cv_ncurses_header:-curses.h}>
13033 #include <form.h>
13034
13035 int
13036 main ()
13037 {
13038
13039         FORM *form;
13040         int y = current_field(form)->cursor_ypos;
13041         int x = current_field(form)->cursor_xpos;
13042
13043   ;
13044   return 0;
13045 }
13046 _ACEOF
13047 rm -f conftest.$ac_objext
13048 if { (eval echo "$as_me:13048: \"$ac_compile\"") >&5
13049   (eval $ac_compile) 2>&5
13050   ac_status=$?
13051   echo "$as_me:13051: \$? = $ac_status" >&5
13052   (exit $ac_status); } &&
13053          { ac_try='test -s conftest.$ac_objext'
13054   { (eval echo "$as_me:13054: \"$ac_try\"") >&5
13055   (eval $ac_try) 2>&5
13056   ac_status=$?
13057   echo "$as_me:13057: \$? = $ac_status" >&5
13058   (exit $ac_status); }; }; then
13059   cf_cv_netbsd_form_h=yes
13060
13061 else
13062   echo "$as_me: failed program was:" >&5
13063 cat conftest.$ac_ext >&5
13064 cf_cv_netbsd_form_h=no
13065 fi
13066 rm -f conftest.$ac_objext conftest.$ac_ext
13067
13068 fi
13069 echo "$as_me:13069: result: $cf_cv_netbsd_form_h" >&5
13070 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13071
13072 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
13073 #define HAVE_NETBSD_FORM_H 1
13074 EOF
13075
13076 echo "$as_me:13076: checking for NetBSD menu.h" >&5
13077 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13078 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13079   echo $ECHO_N "(cached) $ECHO_C" >&6
13080 else
13081
13082 cat >conftest.$ac_ext <<_ACEOF
13083 #line 13083 "configure"
13084 #include "confdefs.h"
13085
13086 #include <${cf_cv_ncurses_header:-curses.h}>
13087 #include <menu.h>
13088
13089 int
13090 main ()
13091 {
13092
13093         MENU *menu;
13094         int y = menu->max_item_width;
13095
13096   ;
13097   return 0;
13098 }
13099 _ACEOF
13100 rm -f conftest.$ac_objext
13101 if { (eval echo "$as_me:13101: \"$ac_compile\"") >&5
13102   (eval $ac_compile) 2>&5
13103   ac_status=$?
13104   echo "$as_me:13104: \$? = $ac_status" >&5
13105   (exit $ac_status); } &&
13106          { ac_try='test -s conftest.$ac_objext'
13107   { (eval echo "$as_me:13107: \"$ac_try\"") >&5
13108   (eval $ac_try) 2>&5
13109   ac_status=$?
13110   echo "$as_me:13110: \$? = $ac_status" >&5
13111   (exit $ac_status); }; }; then
13112   cf_cv_netbsd_menu_h=yes
13113
13114 else
13115   echo "$as_me: failed program was:" >&5
13116 cat conftest.$ac_ext >&5
13117 cf_cv_netbsd_menu_h=no
13118 fi
13119 rm -f conftest.$ac_objext conftest.$ac_ext
13120
13121 fi
13122 echo "$as_me:13122: result: $cf_cv_netbsd_menu_h" >&5
13123 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13124
13125 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
13126 #define HAVE_NETBSD_MENU_H 1
13127 EOF
13128
13129         ;;
13130 ncursesw)
13131         cf_cv_libtype=w
13132         ;;
13133 esac
13134
13135 case $cf_cv_screen in #(vi
13136 pdcurses) #(vi
13137         ;;
13138 *)
13139         # look for curses-related libraries
13140
13141 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13142 echo "$as_me:13142: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13143 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13144 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13145   echo $ECHO_N "(cached) $ECHO_C" >&6
13146 else
13147   ac_check_lib_save_LIBS=$LIBS
13148 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13149 cat >conftest.$ac_ext <<_ACEOF
13150 #line 13150 "configure"
13151 #include "confdefs.h"
13152
13153 /* Override any gcc2 internal prototype to avoid an error.  */
13154 #ifdef __cplusplus
13155 extern "C"
13156 #endif
13157 /* We use char because int might match the return type of a gcc2
13158    builtin and then its argument prototype would still apply.  */
13159 char new_panel ();
13160 int
13161 main ()
13162 {
13163 new_panel ();
13164   ;
13165   return 0;
13166 }
13167 _ACEOF
13168 rm -f conftest.$ac_objext conftest$ac_exeext
13169 if { (eval echo "$as_me:13169: \"$ac_link\"") >&5
13170   (eval $ac_link) 2>&5
13171   ac_status=$?
13172   echo "$as_me:13172: \$? = $ac_status" >&5
13173   (exit $ac_status); } &&
13174          { ac_try='test -s conftest$ac_exeext'
13175   { (eval echo "$as_me:13175: \"$ac_try\"") >&5
13176   (eval $ac_try) 2>&5
13177   ac_status=$?
13178   echo "$as_me:13178: \$? = $ac_status" >&5
13179   (exit $ac_status); }; }; then
13180   eval "$as_ac_Lib=yes"
13181 else
13182   echo "$as_me: failed program was:" >&5
13183 cat conftest.$ac_ext >&5
13184 eval "$as_ac_Lib=no"
13185 fi
13186 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13187 LIBS=$ac_check_lib_save_LIBS
13188 fi
13189 echo "$as_me:13189: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13190 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13191 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13192   cat >>confdefs.h <<EOF
13193 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
13194 EOF
13195
13196   LIBS="-lpanel$cf_cv_libtype $LIBS"
13197
13198 fi
13199
13200 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13201 echo "$as_me:13201: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13202 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13203 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13204   echo $ECHO_N "(cached) $ECHO_C" >&6
13205 else
13206   ac_check_lib_save_LIBS=$LIBS
13207 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13208 cat >conftest.$ac_ext <<_ACEOF
13209 #line 13209 "configure"
13210 #include "confdefs.h"
13211
13212 /* Override any gcc2 internal prototype to avoid an error.  */
13213 #ifdef __cplusplus
13214 extern "C"
13215 #endif
13216 /* We use char because int might match the return type of a gcc2
13217    builtin and then its argument prototype would still apply.  */
13218 char menu_driver ();
13219 int
13220 main ()
13221 {
13222 menu_driver ();
13223   ;
13224   return 0;
13225 }
13226 _ACEOF
13227 rm -f conftest.$ac_objext conftest$ac_exeext
13228 if { (eval echo "$as_me:13228: \"$ac_link\"") >&5
13229   (eval $ac_link) 2>&5
13230   ac_status=$?
13231   echo "$as_me:13231: \$? = $ac_status" >&5
13232   (exit $ac_status); } &&
13233          { ac_try='test -s conftest$ac_exeext'
13234   { (eval echo "$as_me:13234: \"$ac_try\"") >&5
13235   (eval $ac_try) 2>&5
13236   ac_status=$?
13237   echo "$as_me:13237: \$? = $ac_status" >&5
13238   (exit $ac_status); }; }; then
13239   eval "$as_ac_Lib=yes"
13240 else
13241   echo "$as_me: failed program was:" >&5
13242 cat conftest.$ac_ext >&5
13243 eval "$as_ac_Lib=no"
13244 fi
13245 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13246 LIBS=$ac_check_lib_save_LIBS
13247 fi
13248 echo "$as_me:13248: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13249 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13250 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13251   cat >>confdefs.h <<EOF
13252 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
13253 EOF
13254
13255   LIBS="-lmenu$cf_cv_libtype $LIBS"
13256
13257 fi
13258
13259 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13260 echo "$as_me:13260: checking for form_driver in -lform$cf_cv_libtype" >&5
13261 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13262 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13263   echo $ECHO_N "(cached) $ECHO_C" >&6
13264 else
13265   ac_check_lib_save_LIBS=$LIBS
13266 LIBS="-lform$cf_cv_libtype  $LIBS"
13267 cat >conftest.$ac_ext <<_ACEOF
13268 #line 13268 "configure"
13269 #include "confdefs.h"
13270
13271 /* Override any gcc2 internal prototype to avoid an error.  */
13272 #ifdef __cplusplus
13273 extern "C"
13274 #endif
13275 /* We use char because int might match the return type of a gcc2
13276    builtin and then its argument prototype would still apply.  */
13277 char form_driver ();
13278 int
13279 main ()
13280 {
13281 form_driver ();
13282   ;
13283   return 0;
13284 }
13285 _ACEOF
13286 rm -f conftest.$ac_objext conftest$ac_exeext
13287 if { (eval echo "$as_me:13287: \"$ac_link\"") >&5
13288   (eval $ac_link) 2>&5
13289   ac_status=$?
13290   echo "$as_me:13290: \$? = $ac_status" >&5
13291   (exit $ac_status); } &&
13292          { ac_try='test -s conftest$ac_exeext'
13293   { (eval echo "$as_me:13293: \"$ac_try\"") >&5
13294   (eval $ac_try) 2>&5
13295   ac_status=$?
13296   echo "$as_me:13296: \$? = $ac_status" >&5
13297   (exit $ac_status); }; }; then
13298   eval "$as_ac_Lib=yes"
13299 else
13300   echo "$as_me: failed program was:" >&5
13301 cat conftest.$ac_ext >&5
13302 eval "$as_ac_Lib=no"
13303 fi
13304 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13305 LIBS=$ac_check_lib_save_LIBS
13306 fi
13307 echo "$as_me:13307: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13308 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13309 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13310   cat >>confdefs.h <<EOF
13311 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
13312 EOF
13313
13314   LIBS="-lform$cf_cv_libtype $LIBS"
13315
13316 fi
13317
13318         # look for curses-related headers
13319
13320 for ac_header in \
13321                 nc_alloc.h \
13322                 nomacros.h \
13323                 form.h \
13324                 menu.h \
13325                 panel.h \
13326                 term_entry.h \
13327
13328 do
13329 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13330 echo "$as_me:13330: checking for $ac_header" >&5
13331 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13332 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13333   echo $ECHO_N "(cached) $ECHO_C" >&6
13334 else
13335   cat >conftest.$ac_ext <<_ACEOF
13336 #line 13336 "configure"
13337 #include "confdefs.h"
13338 #include <$ac_header>
13339 _ACEOF
13340 if { (eval echo "$as_me:13340: \"$ac_cpp conftest.$ac_ext\"") >&5
13341   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13342   ac_status=$?
13343   egrep -v '^ *\+' conftest.er1 >conftest.err
13344   rm -f conftest.er1
13345   cat conftest.err >&5
13346   echo "$as_me:13346: \$? = $ac_status" >&5
13347   (exit $ac_status); } >/dev/null; then
13348   if test -s conftest.err; then
13349     ac_cpp_err=$ac_c_preproc_warn_flag
13350   else
13351     ac_cpp_err=
13352   fi
13353 else
13354   ac_cpp_err=yes
13355 fi
13356 if test -z "$ac_cpp_err"; then
13357   eval "$as_ac_Header=yes"
13358 else
13359   echo "$as_me: failed program was:" >&5
13360   cat conftest.$ac_ext >&5
13361   eval "$as_ac_Header=no"
13362 fi
13363 rm -f conftest.err conftest.$ac_ext
13364 fi
13365 echo "$as_me:13365: result: `eval echo '${'$as_ac_Header'}'`" >&5
13366 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13367 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13368   cat >>confdefs.h <<EOF
13369 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13370 EOF
13371
13372 fi
13373 done
13374
13375         ;;
13376 esac
13377
13378 echo "$as_me:13378: checking return type of signal handlers" >&5
13379 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
13380 if test "${ac_cv_type_signal+set}" = set; then
13381   echo $ECHO_N "(cached) $ECHO_C" >&6
13382 else
13383   cat >conftest.$ac_ext <<_ACEOF
13384 #line 13384 "configure"
13385 #include "confdefs.h"
13386 #include <sys/types.h>
13387 #include <signal.h>
13388 #ifdef signal
13389 # undef signal
13390 #endif
13391 #ifdef __cplusplus
13392 extern "C" void (*signal (int, void (*)(int)))(int);
13393 #else
13394 void (*signal ()) ();
13395 #endif
13396
13397 int
13398 main ()
13399 {
13400 int i;
13401   ;
13402   return 0;
13403 }
13404 _ACEOF
13405 rm -f conftest.$ac_objext
13406 if { (eval echo "$as_me:13406: \"$ac_compile\"") >&5
13407   (eval $ac_compile) 2>&5
13408   ac_status=$?
13409   echo "$as_me:13409: \$? = $ac_status" >&5
13410   (exit $ac_status); } &&
13411          { ac_try='test -s conftest.$ac_objext'
13412   { (eval echo "$as_me:13412: \"$ac_try\"") >&5
13413   (eval $ac_try) 2>&5
13414   ac_status=$?
13415   echo "$as_me:13415: \$? = $ac_status" >&5
13416   (exit $ac_status); }; }; then
13417   ac_cv_type_signal=void
13418 else
13419   echo "$as_me: failed program was:" >&5
13420 cat conftest.$ac_ext >&5
13421 ac_cv_type_signal=int
13422 fi
13423 rm -f conftest.$ac_objext conftest.$ac_ext
13424 fi
13425 echo "$as_me:13425: result: $ac_cv_type_signal" >&5
13426 echo "${ECHO_T}$ac_cv_type_signal" >&6
13427
13428 cat >>confdefs.h <<EOF
13429 #define RETSIGTYPE $ac_cv_type_signal
13430 EOF
13431
13432 echo "$as_me:13432: checking for ANSI C header files" >&5
13433 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13434 if test "${ac_cv_header_stdc+set}" = set; then
13435   echo $ECHO_N "(cached) $ECHO_C" >&6
13436 else
13437   cat >conftest.$ac_ext <<_ACEOF
13438 #line 13438 "configure"
13439 #include "confdefs.h"
13440 #include <stdlib.h>
13441 #include <stdarg.h>
13442 #include <string.h>
13443 #include <float.h>
13444
13445 _ACEOF
13446 if { (eval echo "$as_me:13446: \"$ac_cpp conftest.$ac_ext\"") >&5
13447   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13448   ac_status=$?
13449   egrep -v '^ *\+' conftest.er1 >conftest.err
13450   rm -f conftest.er1
13451   cat conftest.err >&5
13452   echo "$as_me:13452: \$? = $ac_status" >&5
13453   (exit $ac_status); } >/dev/null; then
13454   if test -s conftest.err; then
13455     ac_cpp_err=$ac_c_preproc_warn_flag
13456   else
13457     ac_cpp_err=
13458   fi
13459 else
13460   ac_cpp_err=yes
13461 fi
13462 if test -z "$ac_cpp_err"; then
13463   ac_cv_header_stdc=yes
13464 else
13465   echo "$as_me: failed program was:" >&5
13466   cat conftest.$ac_ext >&5
13467   ac_cv_header_stdc=no
13468 fi
13469 rm -f conftest.err conftest.$ac_ext
13470
13471 if test $ac_cv_header_stdc = yes; then
13472   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13473   cat >conftest.$ac_ext <<_ACEOF
13474 #line 13474 "configure"
13475 #include "confdefs.h"
13476 #include <string.h>
13477
13478 _ACEOF
13479 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13480   egrep "memchr" >/dev/null 2>&1; then
13481   :
13482 else
13483   ac_cv_header_stdc=no
13484 fi
13485 rm -rf conftest*
13486
13487 fi
13488
13489 if test $ac_cv_header_stdc = yes; then
13490   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13491   cat >conftest.$ac_ext <<_ACEOF
13492 #line 13492 "configure"
13493 #include "confdefs.h"
13494 #include <stdlib.h>
13495
13496 _ACEOF
13497 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13498   egrep "free" >/dev/null 2>&1; then
13499   :
13500 else
13501   ac_cv_header_stdc=no
13502 fi
13503 rm -rf conftest*
13504
13505 fi
13506
13507 if test $ac_cv_header_stdc = yes; then
13508   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13509   if test "$cross_compiling" = yes; then
13510   :
13511 else
13512   cat >conftest.$ac_ext <<_ACEOF
13513 #line 13513 "configure"
13514 #include "confdefs.h"
13515 #include <ctype.h>
13516 #if ((' ' & 0x0FF) == 0x020)
13517 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13518 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13519 #else
13520 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13521                      || ('j' <= (c) && (c) <= 'r') \
13522                      || ('s' <= (c) && (c) <= 'z'))
13523 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13524 #endif
13525
13526 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13527 int
13528 main ()
13529 {
13530   int i;
13531   for (i = 0; i < 256; i++)
13532     if (XOR (islower (i), ISLOWER (i))
13533         || toupper (i) != TOUPPER (i))
13534       $ac_main_return(2);
13535   $ac_main_return (0);
13536 }
13537 _ACEOF
13538 rm -f conftest$ac_exeext
13539 if { (eval echo "$as_me:13539: \"$ac_link\"") >&5
13540   (eval $ac_link) 2>&5
13541   ac_status=$?
13542   echo "$as_me:13542: \$? = $ac_status" >&5
13543   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13544   { (eval echo "$as_me:13544: \"$ac_try\"") >&5
13545   (eval $ac_try) 2>&5
13546   ac_status=$?
13547   echo "$as_me:13547: \$? = $ac_status" >&5
13548   (exit $ac_status); }; }; then
13549   :
13550 else
13551   echo "$as_me: program exited with status $ac_status" >&5
13552 echo "$as_me: failed program was:" >&5
13553 cat conftest.$ac_ext >&5
13554 ac_cv_header_stdc=no
13555 fi
13556 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13557 fi
13558 fi
13559 fi
13560 echo "$as_me:13560: result: $ac_cv_header_stdc" >&5
13561 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13562 if test $ac_cv_header_stdc = yes; then
13563
13564 cat >>confdefs.h <<\EOF
13565 #define STDC_HEADERS 1
13566 EOF
13567
13568 fi
13569
13570 echo "$as_me:13570: checking whether time.h and sys/time.h may both be included" >&5
13571 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13572 if test "${ac_cv_header_time+set}" = set; then
13573   echo $ECHO_N "(cached) $ECHO_C" >&6
13574 else
13575   cat >conftest.$ac_ext <<_ACEOF
13576 #line 13576 "configure"
13577 #include "confdefs.h"
13578 #include <sys/types.h>
13579 #include <sys/time.h>
13580 #include <time.h>
13581
13582 int
13583 main ()
13584 {
13585 if ((struct tm *) 0)
13586 return 0;
13587   ;
13588   return 0;
13589 }
13590 _ACEOF
13591 rm -f conftest.$ac_objext
13592 if { (eval echo "$as_me:13592: \"$ac_compile\"") >&5
13593   (eval $ac_compile) 2>&5
13594   ac_status=$?
13595   echo "$as_me:13595: \$? = $ac_status" >&5
13596   (exit $ac_status); } &&
13597          { ac_try='test -s conftest.$ac_objext'
13598   { (eval echo "$as_me:13598: \"$ac_try\"") >&5
13599   (eval $ac_try) 2>&5
13600   ac_status=$?
13601   echo "$as_me:13601: \$? = $ac_status" >&5
13602   (exit $ac_status); }; }; then
13603   ac_cv_header_time=yes
13604 else
13605   echo "$as_me: failed program was:" >&5
13606 cat conftest.$ac_ext >&5
13607 ac_cv_header_time=no
13608 fi
13609 rm -f conftest.$ac_objext conftest.$ac_ext
13610 fi
13611 echo "$as_me:13611: result: $ac_cv_header_time" >&5
13612 echo "${ECHO_T}$ac_cv_header_time" >&6
13613 if test $ac_cv_header_time = yes; then
13614
13615 cat >>confdefs.h <<\EOF
13616 #define TIME_WITH_SYS_TIME 1
13617 EOF
13618
13619 fi
13620
13621 for ac_header in \
13622 getopt.h \
13623 locale.h \
13624 math.h \
13625 stdarg.h \
13626 sys/ioctl.h \
13627 sys/select.h \
13628 sys/time.h \
13629 termios.h \
13630 unistd.h \
13631
13632 do
13633 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13634 echo "$as_me:13634: checking for $ac_header" >&5
13635 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13636 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13637   echo $ECHO_N "(cached) $ECHO_C" >&6
13638 else
13639   cat >conftest.$ac_ext <<_ACEOF
13640 #line 13640 "configure"
13641 #include "confdefs.h"
13642 #include <$ac_header>
13643 _ACEOF
13644 if { (eval echo "$as_me:13644: \"$ac_cpp conftest.$ac_ext\"") >&5
13645   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13646   ac_status=$?
13647   egrep -v '^ *\+' conftest.er1 >conftest.err
13648   rm -f conftest.er1
13649   cat conftest.err >&5
13650   echo "$as_me:13650: \$? = $ac_status" >&5
13651   (exit $ac_status); } >/dev/null; then
13652   if test -s conftest.err; then
13653     ac_cpp_err=$ac_c_preproc_warn_flag
13654   else
13655     ac_cpp_err=
13656   fi
13657 else
13658   ac_cpp_err=yes
13659 fi
13660 if test -z "$ac_cpp_err"; then
13661   eval "$as_ac_Header=yes"
13662 else
13663   echo "$as_me: failed program was:" >&5
13664   cat conftest.$ac_ext >&5
13665   eval "$as_ac_Header=no"
13666 fi
13667 rm -f conftest.err conftest.$ac_ext
13668 fi
13669 echo "$as_me:13669: result: `eval echo '${'$as_ac_Header'}'`" >&5
13670 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13671 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13672   cat >>confdefs.h <<EOF
13673 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13674 EOF
13675
13676 fi
13677 done
13678
13679 for ac_header in unistd.h getopt.h
13680 do
13681 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13682 echo "$as_me:13682: checking for $ac_header" >&5
13683 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13684 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13685   echo $ECHO_N "(cached) $ECHO_C" >&6
13686 else
13687   cat >conftest.$ac_ext <<_ACEOF
13688 #line 13688 "configure"
13689 #include "confdefs.h"
13690 #include <$ac_header>
13691 _ACEOF
13692 if { (eval echo "$as_me:13692: \"$ac_cpp conftest.$ac_ext\"") >&5
13693   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13694   ac_status=$?
13695   egrep -v '^ *\+' conftest.er1 >conftest.err
13696   rm -f conftest.er1
13697   cat conftest.err >&5
13698   echo "$as_me:13698: \$? = $ac_status" >&5
13699   (exit $ac_status); } >/dev/null; then
13700   if test -s conftest.err; then
13701     ac_cpp_err=$ac_c_preproc_warn_flag
13702   else
13703     ac_cpp_err=
13704   fi
13705 else
13706   ac_cpp_err=yes
13707 fi
13708 if test -z "$ac_cpp_err"; then
13709   eval "$as_ac_Header=yes"
13710 else
13711   echo "$as_me: failed program was:" >&5
13712   cat conftest.$ac_ext >&5
13713   eval "$as_ac_Header=no"
13714 fi
13715 rm -f conftest.err conftest.$ac_ext
13716 fi
13717 echo "$as_me:13717: result: `eval echo '${'$as_ac_Header'}'`" >&5
13718 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13719 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13720   cat >>confdefs.h <<EOF
13721 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13722 EOF
13723
13724 fi
13725 done
13726
13727 echo "$as_me:13727: checking for header declaring getopt variables" >&5
13728 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13729 if test "${cf_cv_getopt_header+set}" = set; then
13730   echo $ECHO_N "(cached) $ECHO_C" >&6
13731 else
13732
13733 cf_cv_getopt_header=none
13734 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13735 do
13736 cat >conftest.$ac_ext <<_ACEOF
13737 #line 13737 "configure"
13738 #include "confdefs.h"
13739
13740 #include <$cf_header>
13741 int
13742 main ()
13743 {
13744 int x = optind; char *y = optarg
13745   ;
13746   return 0;
13747 }
13748 _ACEOF
13749 rm -f conftest.$ac_objext
13750 if { (eval echo "$as_me:13750: \"$ac_compile\"") >&5
13751   (eval $ac_compile) 2>&5
13752   ac_status=$?
13753   echo "$as_me:13753: \$? = $ac_status" >&5
13754   (exit $ac_status); } &&
13755          { ac_try='test -s conftest.$ac_objext'
13756   { (eval echo "$as_me:13756: \"$ac_try\"") >&5
13757   (eval $ac_try) 2>&5
13758   ac_status=$?
13759   echo "$as_me:13759: \$? = $ac_status" >&5
13760   (exit $ac_status); }; }; then
13761   cf_cv_getopt_header=$cf_header
13762  break
13763 else
13764   echo "$as_me: failed program was:" >&5
13765 cat conftest.$ac_ext >&5
13766 fi
13767 rm -f conftest.$ac_objext conftest.$ac_ext
13768 done
13769
13770 fi
13771 echo "$as_me:13771: result: $cf_cv_getopt_header" >&5
13772 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13773 if test $cf_cv_getopt_header != none ; then
13774         cat >>confdefs.h <<\EOF
13775 #define HAVE_GETOPT_HEADER 1
13776 EOF
13777
13778 fi
13779
13780 for ac_func in \
13781 gettimeofday \
13782 strdup \
13783
13784 do
13785 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13786 echo "$as_me:13786: checking for $ac_func" >&5
13787 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13788 if eval "test \"\${$as_ac_var+set}\" = set"; then
13789   echo $ECHO_N "(cached) $ECHO_C" >&6
13790 else
13791   cat >conftest.$ac_ext <<_ACEOF
13792 #line 13792 "configure"
13793 #include "confdefs.h"
13794 /* System header to define __stub macros and hopefully few prototypes,
13795     which can conflict with char $ac_func (); below.  */
13796 #include <assert.h>
13797 /* Override any gcc2 internal prototype to avoid an error.  */
13798 #ifdef __cplusplus
13799 extern "C"
13800 #endif
13801 /* We use char because int might match the return type of a gcc2
13802    builtin and then its argument prototype would still apply.  */
13803 char $ac_func ();
13804 char (*f) ();
13805
13806 int
13807 main ()
13808 {
13809 /* The GNU C library defines this for functions which it implements
13810     to always fail with ENOSYS.  Some functions are actually named
13811     something starting with __ and the normal name is an alias.  */
13812 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13813 choke me
13814 #else
13815 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13816 #endif
13817
13818   ;
13819   return 0;
13820 }
13821 _ACEOF
13822 rm -f conftest.$ac_objext conftest$ac_exeext
13823 if { (eval echo "$as_me:13823: \"$ac_link\"") >&5
13824   (eval $ac_link) 2>&5
13825   ac_status=$?
13826   echo "$as_me:13826: \$? = $ac_status" >&5
13827   (exit $ac_status); } &&
13828          { ac_try='test -s conftest$ac_exeext'
13829   { (eval echo "$as_me:13829: \"$ac_try\"") >&5
13830   (eval $ac_try) 2>&5
13831   ac_status=$?
13832   echo "$as_me:13832: \$? = $ac_status" >&5
13833   (exit $ac_status); }; }; then
13834   eval "$as_ac_var=yes"
13835 else
13836   echo "$as_me: failed program was:" >&5
13837 cat conftest.$ac_ext >&5
13838 eval "$as_ac_var=no"
13839 fi
13840 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13841 fi
13842 echo "$as_me:13842: result: `eval echo '${'$as_ac_var'}'`" >&5
13843 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13844 if test `eval echo '${'$as_ac_var'}'` = yes; then
13845   cat >>confdefs.h <<EOF
13846 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13847 EOF
13848
13849 fi
13850 done
13851
13852 if test "$cf_enable_widec" = yes; then
13853
13854 for ac_func in \
13855 mblen \
13856 mbrlen \
13857 mbrtowc \
13858 mbsrtowcs \
13859 mbstowcs \
13860 mbtowc \
13861 wcsrtombs \
13862 wcstombs \
13863
13864 do
13865 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13866 echo "$as_me:13866: checking for $ac_func" >&5
13867 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13868 if eval "test \"\${$as_ac_var+set}\" = set"; then
13869   echo $ECHO_N "(cached) $ECHO_C" >&6
13870 else
13871   cat >conftest.$ac_ext <<_ACEOF
13872 #line 13872 "configure"
13873 #include "confdefs.h"
13874 /* System header to define __stub macros and hopefully few prototypes,
13875     which can conflict with char $ac_func (); below.  */
13876 #include <assert.h>
13877 /* Override any gcc2 internal prototype to avoid an error.  */
13878 #ifdef __cplusplus
13879 extern "C"
13880 #endif
13881 /* We use char because int might match the return type of a gcc2
13882    builtin and then its argument prototype would still apply.  */
13883 char $ac_func ();
13884 char (*f) ();
13885
13886 int
13887 main ()
13888 {
13889 /* The GNU C library defines this for functions which it implements
13890     to always fail with ENOSYS.  Some functions are actually named
13891     something starting with __ and the normal name is an alias.  */
13892 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13893 choke me
13894 #else
13895 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13896 #endif
13897
13898   ;
13899   return 0;
13900 }
13901 _ACEOF
13902 rm -f conftest.$ac_objext conftest$ac_exeext
13903 if { (eval echo "$as_me:13903: \"$ac_link\"") >&5
13904   (eval $ac_link) 2>&5
13905   ac_status=$?
13906   echo "$as_me:13906: \$? = $ac_status" >&5
13907   (exit $ac_status); } &&
13908          { ac_try='test -s conftest$ac_exeext'
13909   { (eval echo "$as_me:13909: \"$ac_try\"") >&5
13910   (eval $ac_try) 2>&5
13911   ac_status=$?
13912   echo "$as_me:13912: \$? = $ac_status" >&5
13913   (exit $ac_status); }; }; then
13914   eval "$as_ac_var=yes"
13915 else
13916   echo "$as_me: failed program was:" >&5
13917 cat conftest.$ac_ext >&5
13918 eval "$as_ac_var=no"
13919 fi
13920 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13921 fi
13922 echo "$as_me:13922: result: `eval echo '${'$as_ac_var'}'`" >&5
13923 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13924 if test `eval echo '${'$as_ac_var'}'` = yes; then
13925   cat >>confdefs.h <<EOF
13926 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13927 EOF
13928
13929 fi
13930 done
13931
13932 fi
13933
13934 echo "$as_me:13934: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13935 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13936 if test "${cf_cv_need_xopen_extension+set}" = set; then
13937   echo $ECHO_N "(cached) $ECHO_C" >&6
13938 else
13939
13940 cat >conftest.$ac_ext <<_ACEOF
13941 #line 13941 "configure"
13942 #include "confdefs.h"
13943
13944 #include <stdlib.h>
13945 #include <${cf_cv_ncurses_header:-curses.h}>
13946 int
13947 main ()
13948 {
13949
13950 #if defined(NCURSES_VERSION_PATCH)
13951 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
13952         make an error
13953 #endif
13954 #endif
13955         long x = winnstr(stdscr, "", 0);
13956         int x1, y1;
13957         getbegyx(stdscr, y1, x1)
13958   ;
13959   return 0;
13960 }
13961 _ACEOF
13962 rm -f conftest.$ac_objext conftest$ac_exeext
13963 if { (eval echo "$as_me:13963: \"$ac_link\"") >&5
13964   (eval $ac_link) 2>&5
13965   ac_status=$?
13966   echo "$as_me:13966: \$? = $ac_status" >&5
13967   (exit $ac_status); } &&
13968          { ac_try='test -s conftest$ac_exeext'
13969   { (eval echo "$as_me:13969: \"$ac_try\"") >&5
13970   (eval $ac_try) 2>&5
13971   ac_status=$?
13972   echo "$as_me:13972: \$? = $ac_status" >&5
13973   (exit $ac_status); }; }; then
13974   cf_cv_need_xopen_extension=no
13975 else
13976   echo "$as_me: failed program was:" >&5
13977 cat conftest.$ac_ext >&5
13978 cat >conftest.$ac_ext <<_ACEOF
13979 #line 13979 "configure"
13980 #include "confdefs.h"
13981
13982 #define _XOPEN_SOURCE_EXTENDED
13983 #include <stdlib.h>
13984 #include <${cf_cv_ncurses_header:-curses.h}>
13985 int
13986 main ()
13987 {
13988
13989 #ifdef NCURSES_VERSION
13990         cchar_t check;
13991         int check2 = curs_set((int)sizeof(check));
13992 #endif
13993         long x = winnstr(stdscr, "", 0);
13994         int x1, y1;
13995         getbegyx(stdscr, y1, x1)
13996   ;
13997   return 0;
13998 }
13999 _ACEOF
14000 rm -f conftest.$ac_objext conftest$ac_exeext
14001 if { (eval echo "$as_me:14001: \"$ac_link\"") >&5
14002   (eval $ac_link) 2>&5
14003   ac_status=$?
14004   echo "$as_me:14004: \$? = $ac_status" >&5
14005   (exit $ac_status); } &&
14006          { ac_try='test -s conftest$ac_exeext'
14007   { (eval echo "$as_me:14007: \"$ac_try\"") >&5
14008   (eval $ac_try) 2>&5
14009   ac_status=$?
14010   echo "$as_me:14010: \$? = $ac_status" >&5
14011   (exit $ac_status); }; }; then
14012   cf_cv_need_xopen_extension=yes
14013 else
14014   echo "$as_me: failed program was:" >&5
14015 cat conftest.$ac_ext >&5
14016 cf_cv_need_xopen_extension=unknown
14017 fi
14018 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14019 fi
14020 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14021 fi
14022 echo "$as_me:14022: result: $cf_cv_need_xopen_extension" >&5
14023 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14024 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14025
14026 echo "$as_me:14026: checking for term.h" >&5
14027 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14028 if test "${cf_cv_term_header+set}" = set; then
14029   echo $ECHO_N "(cached) $ECHO_C" >&6
14030 else
14031
14032 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14033 # for <term.h> if we do not find the variant.
14034
14035 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14036
14037 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14038 */*)
14039         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14040         cf_header_list="$cf_header_item $cf_header_list"
14041         ;;
14042 esac
14043
14044 for cf_header in $cf_header_list
14045 do
14046         cat >conftest.$ac_ext <<_ACEOF
14047 #line 14047 "configure"
14048 #include "confdefs.h"
14049
14050 #include <${cf_cv_ncurses_header:-curses.h}>
14051 #include <${cf_header}>
14052 int
14053 main ()
14054 {
14055 WINDOW *x
14056   ;
14057   return 0;
14058 }
14059 _ACEOF
14060 rm -f conftest.$ac_objext
14061 if { (eval echo "$as_me:14061: \"$ac_compile\"") >&5
14062   (eval $ac_compile) 2>&5
14063   ac_status=$?
14064   echo "$as_me:14064: \$? = $ac_status" >&5
14065   (exit $ac_status); } &&
14066          { ac_try='test -s conftest.$ac_objext'
14067   { (eval echo "$as_me:14067: \"$ac_try\"") >&5
14068   (eval $ac_try) 2>&5
14069   ac_status=$?
14070   echo "$as_me:14070: \$? = $ac_status" >&5
14071   (exit $ac_status); }; }; then
14072   cf_cv_term_header=$cf_header
14073          break
14074 else
14075   echo "$as_me: failed program was:" >&5
14076 cat conftest.$ac_ext >&5
14077 cf_cv_term_header=no
14078 fi
14079 rm -f conftest.$ac_objext conftest.$ac_ext
14080 done
14081
14082 case $cf_cv_term_header in #(vi
14083 no)
14084         # If curses is ncurses, some packagers still mess it up by trying to make
14085         # us use GNU termcap.  This handles the most common case.
14086         for cf_header in ncurses/term.h ncursesw/term.h
14087         do
14088                 cat >conftest.$ac_ext <<_ACEOF
14089 #line 14089 "configure"
14090 #include "confdefs.h"
14091
14092 #include <${cf_cv_ncurses_header:-curses.h}>
14093 #ifdef NCURSES_VERSION
14094 #include <${cf_header}>
14095 #else
14096 make an error
14097 #endif
14098 int
14099 main ()
14100 {
14101 WINDOW *x
14102   ;
14103   return 0;
14104 }
14105 _ACEOF
14106 rm -f conftest.$ac_objext
14107 if { (eval echo "$as_me:14107: \"$ac_compile\"") >&5
14108   (eval $ac_compile) 2>&5
14109   ac_status=$?
14110   echo "$as_me:14110: \$? = $ac_status" >&5
14111   (exit $ac_status); } &&
14112          { ac_try='test -s conftest.$ac_objext'
14113   { (eval echo "$as_me:14113: \"$ac_try\"") >&5
14114   (eval $ac_try) 2>&5
14115   ac_status=$?
14116   echo "$as_me:14116: \$? = $ac_status" >&5
14117   (exit $ac_status); }; }; then
14118   cf_cv_term_header=$cf_header
14119                          break
14120 else
14121   echo "$as_me: failed program was:" >&5
14122 cat conftest.$ac_ext >&5
14123 cf_cv_term_header=no
14124 fi
14125 rm -f conftest.$ac_objext conftest.$ac_ext
14126         done
14127         ;;
14128 esac
14129
14130 fi
14131 echo "$as_me:14131: result: $cf_cv_term_header" >&5
14132 echo "${ECHO_T}$cf_cv_term_header" >&6
14133
14134 case $cf_cv_term_header in #(vi
14135 term.h) #(vi
14136         cat >>confdefs.h <<\EOF
14137 #define HAVE_TERM_H 1
14138 EOF
14139
14140         ;;
14141 ncurses/term.h) #(vi
14142         cat >>confdefs.h <<\EOF
14143 #define HAVE_NCURSES_TERM_H 1
14144 EOF
14145
14146         ;;
14147 ncursesw/term.h)
14148         cat >>confdefs.h <<\EOF
14149 #define HAVE_NCURSESW_TERM_H 1
14150 EOF
14151
14152         ;;
14153 esac
14154
14155 echo "$as_me:14155: checking for unctrl.h" >&5
14156 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14157 if test "${cf_cv_unctrl_header+set}" = set; then
14158   echo $ECHO_N "(cached) $ECHO_C" >&6
14159 else
14160
14161 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14162 # for <unctrl.h> if we do not find the variant.
14163
14164 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14165
14166 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14167 */*)
14168         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14169         cf_header_list="$cf_header_item $cf_header_list"
14170         ;;
14171 esac
14172
14173 for cf_header in $cf_header_list
14174 do
14175         cat >conftest.$ac_ext <<_ACEOF
14176 #line 14176 "configure"
14177 #include "confdefs.h"
14178
14179 #include <${cf_cv_ncurses_header:-curses.h}>
14180 #include <${cf_header}>
14181 int
14182 main ()
14183 {
14184 WINDOW *x
14185   ;
14186   return 0;
14187 }
14188 _ACEOF
14189 rm -f conftest.$ac_objext
14190 if { (eval echo "$as_me:14190: \"$ac_compile\"") >&5
14191   (eval $ac_compile) 2>&5
14192   ac_status=$?
14193   echo "$as_me:14193: \$? = $ac_status" >&5
14194   (exit $ac_status); } &&
14195          { ac_try='test -s conftest.$ac_objext'
14196   { (eval echo "$as_me:14196: \"$ac_try\"") >&5
14197   (eval $ac_try) 2>&5
14198   ac_status=$?
14199   echo "$as_me:14199: \$? = $ac_status" >&5
14200   (exit $ac_status); }; }; then
14201   cf_cv_unctrl_header=$cf_header
14202          break
14203 else
14204   echo "$as_me: failed program was:" >&5
14205 cat conftest.$ac_ext >&5
14206 cf_cv_unctrl_header=no
14207 fi
14208 rm -f conftest.$ac_objext conftest.$ac_ext
14209 done
14210
14211 case $cf_cv_unctrl_header in #(vi
14212 no)
14213         { echo "$as_me:14213: WARNING: unctrl.h header not found" >&5
14214 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14215         ;;
14216 esac
14217
14218 fi
14219 echo "$as_me:14219: result: $cf_cv_unctrl_header" >&5
14220 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14221
14222 case $cf_cv_unctrl_header in #(vi
14223 unctrl.h) #(vi
14224         cat >>confdefs.h <<\EOF
14225 #define HAVE_UNCTRL_H 1
14226 EOF
14227
14228         ;;
14229 ncurses/unctrl.h) #(vi
14230         cat >>confdefs.h <<\EOF
14231 #define HAVE_NCURSES_UNCTRL_H 1
14232 EOF
14233
14234         ;;
14235 ncursesw/unctrl.h)
14236         cat >>confdefs.h <<\EOF
14237 #define HAVE_NCURSESW_UNCTRL_H 1
14238 EOF
14239
14240         ;;
14241 esac
14242
14243 for cf_func in \
14244 assume_default_colors \
14245 chgat \
14246 color_set \
14247 filter \
14248 getbegx \
14249 getcurx \
14250 getmaxx \
14251 getnstr \
14252 getparx \
14253 getwin \
14254 mvvline \
14255 mvwvline \
14256 napms \
14257 putwin \
14258 resize_term \
14259 resizeterm \
14260 ripoffline \
14261 scr_dump \
14262 setupterm \
14263 slk_color \
14264 slk_init \
14265 termattrs \
14266 tgetent \
14267 tigetnum \
14268 tigetstr \
14269 typeahead \
14270 use_default_colors \
14271 use_screen \
14272 use_window \
14273 vsscanf \
14274 vw_printw \
14275 wchgat \
14276 winsstr \
14277 wresize \
14278 wsyncdown \
14279
14280 do
14281
14282 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14283
14284         echo "$as_me:14284: checking for ${cf_func}" >&5
14285 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14286
14287 echo "${as_me:-configure}:14287: testing ${cf_func} ..." 1>&5
14288
14289         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14290   echo $ECHO_N "(cached) $ECHO_C" >&6
14291 else
14292
14293                 eval cf_result='$ac_cv_func_'$cf_func
14294                 if test ".$cf_result" != ".no"; then
14295                         cat >conftest.$ac_ext <<_ACEOF
14296 #line 14296 "configure"
14297 #include "confdefs.h"
14298
14299 #ifdef HAVE_XCURSES
14300 #include <xcurses.h>
14301 char * XCursesProgramName = "test";
14302 #else
14303 #include <${cf_cv_ncurses_header:-curses.h}>
14304 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14305 #include <ncursesw/term.h>
14306 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14307 #include <ncurses/term.h>
14308 #elif defined(HAVE_TERM_H)
14309 #include <term.h>
14310 #endif
14311 #endif
14312
14313 int
14314 main ()
14315 {
14316
14317 #ifndef ${cf_func}
14318 long foo = (long)(&${cf_func});
14319 if (foo + 1234 > 5678)
14320         ${cf_cv_main_return:-return}(foo);
14321 #endif
14322
14323   ;
14324   return 0;
14325 }
14326 _ACEOF
14327 rm -f conftest.$ac_objext conftest$ac_exeext
14328 if { (eval echo "$as_me:14328: \"$ac_link\"") >&5
14329   (eval $ac_link) 2>&5
14330   ac_status=$?
14331   echo "$as_me:14331: \$? = $ac_status" >&5
14332   (exit $ac_status); } &&
14333          { ac_try='test -s conftest$ac_exeext'
14334   { (eval echo "$as_me:14334: \"$ac_try\"") >&5
14335   (eval $ac_try) 2>&5
14336   ac_status=$?
14337   echo "$as_me:14337: \$? = $ac_status" >&5
14338   (exit $ac_status); }; }; then
14339   cf_result=yes
14340 else
14341   echo "$as_me: failed program was:" >&5
14342 cat conftest.$ac_ext >&5
14343 cf_result=no
14344 fi
14345 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14346                 fi
14347                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14348
14349 fi
14350
14351         # use the computed/retrieved cache-value:
14352         eval 'cf_result=$cf_cv_func_'$cf_func
14353         echo "$as_me:14353: result: $cf_result" >&5
14354 echo "${ECHO_T}$cf_result" >&6
14355         if test $cf_result != no; then
14356                 cat >>confdefs.h <<EOF
14357 #define HAVE_${cf_tr_func} 1
14358 EOF
14359
14360         fi
14361 done
14362
14363 for cf_func in tputs
14364 do
14365
14366 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14367
14368         echo "$as_me:14368: checking for ${cf_func}" >&5
14369 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14370
14371 echo "${as_me:-configure}:14371: testing ${cf_func} ..." 1>&5
14372
14373         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14374   echo $ECHO_N "(cached) $ECHO_C" >&6
14375 else
14376
14377                 eval cf_result='$ac_cv_func_'$cf_func
14378                 if test ".$cf_result" != ".no"; then
14379                         cat >conftest.$ac_ext <<_ACEOF
14380 #line 14380 "configure"
14381 #include "confdefs.h"
14382
14383 #ifdef HAVE_XCURSES
14384 #include <xcurses.h>
14385 char * XCursesProgramName = "test";
14386 #else
14387 #include <${cf_cv_ncurses_header:-curses.h}>
14388 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14389 #include <ncursesw/term.h>
14390 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14391 #include <ncurses/term.h>
14392 #elif defined(HAVE_TERM_H)
14393 #include <term.h>
14394 #endif
14395 #endif
14396
14397 int
14398 main ()
14399 {
14400
14401 #ifndef ${cf_func}
14402 long foo = (long)(&${cf_func});
14403 if (foo + 1234 > 5678)
14404         ${cf_cv_main_return:-return}(foo);
14405 #endif
14406
14407   ;
14408   return 0;
14409 }
14410 _ACEOF
14411 rm -f conftest.$ac_objext conftest$ac_exeext
14412 if { (eval echo "$as_me:14412: \"$ac_link\"") >&5
14413   (eval $ac_link) 2>&5
14414   ac_status=$?
14415   echo "$as_me:14415: \$? = $ac_status" >&5
14416   (exit $ac_status); } &&
14417          { ac_try='test -s conftest$ac_exeext'
14418   { (eval echo "$as_me:14418: \"$ac_try\"") >&5
14419   (eval $ac_try) 2>&5
14420   ac_status=$?
14421   echo "$as_me:14421: \$? = $ac_status" >&5
14422   (exit $ac_status); }; }; then
14423   cf_result=yes
14424 else
14425   echo "$as_me: failed program was:" >&5
14426 cat conftest.$ac_ext >&5
14427 cf_result=no
14428 fi
14429 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14430                 fi
14431                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14432
14433 fi
14434
14435         # use the computed/retrieved cache-value:
14436         eval 'cf_result=$cf_cv_func_'$cf_func
14437         echo "$as_me:14437: result: $cf_result" >&5
14438 echo "${ECHO_T}$cf_result" >&6
14439         if test $cf_result != no; then
14440                 cat >>confdefs.h <<EOF
14441 #define HAVE_${cf_tr_func} 1
14442 EOF
14443
14444         fi
14445 done
14446
14447 if test x$cf_cv_func_tputs = xyes
14448 then
14449         cf_done=no
14450         for cf_arg in int char
14451         do
14452                 for cf_ret in int void
14453                 do
14454                         if test $cf_ret = void
14455                         then
14456                                 cf_return="/* nothing */"
14457                         else
14458                                 cf_return="return value"
14459                         fi
14460                         cat >conftest.$ac_ext <<_ACEOF
14461 #line 14461 "configure"
14462 #include "confdefs.h"
14463
14464 #include <${cf_cv_ncurses_header:-curses.h}>
14465 #include <$cf_cv_term_header>
14466
14467 static $cf_ret outc($cf_arg value) { $cf_return; }
14468
14469 int
14470 main ()
14471 {
14472
14473         tputs("hello", 0, outc);
14474         ${cf_cv_main_return:-return}(0);
14475
14476   ;
14477   return 0;
14478 }
14479 _ACEOF
14480 rm -f conftest.$ac_objext
14481 if { (eval echo "$as_me:14481: \"$ac_compile\"") >&5
14482   (eval $ac_compile) 2>&5
14483   ac_status=$?
14484   echo "$as_me:14484: \$? = $ac_status" >&5
14485   (exit $ac_status); } &&
14486          { ac_try='test -s conftest.$ac_objext'
14487   { (eval echo "$as_me:14487: \"$ac_try\"") >&5
14488   (eval $ac_try) 2>&5
14489   ac_status=$?
14490   echo "$as_me:14490: \$? = $ac_status" >&5
14491   (exit $ac_status); }; }; then
14492
14493                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14494
14495 echo "${as_me:-configure}:14495: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14496
14497                 cat >>confdefs.h <<EOF
14498 #define TPUTS_ARG               $cf_arg
14499 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14500 #define TPUTS_RETURN(value)     $cf_return
14501 EOF
14502                 cf_done=yes
14503                 break
14504
14505 else
14506   echo "$as_me: failed program was:" >&5
14507 cat conftest.$ac_ext >&5
14508 fi
14509 rm -f conftest.$ac_objext conftest.$ac_ext
14510                 done
14511                 test $cf_done = yes && break
14512         done
14513 fi
14514
14515 echo "$as_me:14515: checking for ncurses extended functions" >&5
14516 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14517 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14518   echo $ECHO_N "(cached) $ECHO_C" >&6
14519 else
14520
14521 cat >conftest.$ac_ext <<_ACEOF
14522 #line 14522 "configure"
14523 #include "confdefs.h"
14524
14525 #include <${cf_cv_ncurses_header:-curses.h}>
14526 int
14527 main ()
14528 {
14529
14530 int x = NCURSES_EXT_FUNCS
14531
14532   ;
14533   return 0;
14534 }
14535 _ACEOF
14536 rm -f conftest.$ac_objext
14537 if { (eval echo "$as_me:14537: \"$ac_compile\"") >&5
14538   (eval $ac_compile) 2>&5
14539   ac_status=$?
14540   echo "$as_me:14540: \$? = $ac_status" >&5
14541   (exit $ac_status); } &&
14542          { ac_try='test -s conftest.$ac_objext'
14543   { (eval echo "$as_me:14543: \"$ac_try\"") >&5
14544   (eval $ac_try) 2>&5
14545   ac_status=$?
14546   echo "$as_me:14546: \$? = $ac_status" >&5
14547   (exit $ac_status); }; }; then
14548   cf_cv_ncurses_ext_funcs=defined
14549 else
14550   echo "$as_me: failed program was:" >&5
14551 cat conftest.$ac_ext >&5
14552
14553 cat >conftest.$ac_ext <<_ACEOF
14554 #line 14554 "configure"
14555 #include "confdefs.h"
14556
14557 #include <${cf_cv_ncurses_header:-curses.h}>
14558 int
14559 main ()
14560 {
14561
14562         (void) assume_default_colors (0, 0);
14563         (void) curses_version ();
14564         (void) define_key (0, 0);
14565         (void) is_term_resized (0, 0);
14566         (void) key_defined (0);
14567         (void) keybound (0, 0);
14568         (void) keyok (0, 0);
14569         (void) resize_term (0, 0);
14570         (void) resizeterm (0, 0);
14571         (void) use_default_colors ();
14572         (void) use_extended_names (0);
14573         (void) wresize (0, 0, 0);
14574   ;
14575   return 0;
14576 }
14577 _ACEOF
14578 rm -f conftest.$ac_objext conftest$ac_exeext
14579 if { (eval echo "$as_me:14579: \"$ac_link\"") >&5
14580   (eval $ac_link) 2>&5
14581   ac_status=$?
14582   echo "$as_me:14582: \$? = $ac_status" >&5
14583   (exit $ac_status); } &&
14584          { ac_try='test -s conftest$ac_exeext'
14585   { (eval echo "$as_me:14585: \"$ac_try\"") >&5
14586   (eval $ac_try) 2>&5
14587   ac_status=$?
14588   echo "$as_me:14588: \$? = $ac_status" >&5
14589   (exit $ac_status); }; }; then
14590   cf_cv_ncurses_ext_funcs=yes
14591 else
14592   echo "$as_me: failed program was:" >&5
14593 cat conftest.$ac_ext >&5
14594 cf_cv_ncurses_ext_funcs=no
14595 fi
14596 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14597
14598 fi
14599 rm -f conftest.$ac_objext conftest.$ac_ext
14600
14601 fi
14602 echo "$as_me:14602: result: $cf_cv_ncurses_ext_funcs" >&5
14603 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14604 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14605 #define NCURSES_EXT_FUNCS 1
14606 EOF
14607
14608 if test "$cf_enable_widec" = yes
14609 then
14610         # workaround for systems with ncurses before 20111029, due to change of
14611         # feature test macro from _XPG5 to _XOPEN_SOURCE
14612         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14613         then
14614                 cf_define_xpg5=no
14615                 echo "$as_me:14615: checking if _XPG5 should be defined to enable wide-characters" >&5
14616 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14617
14618                 cat >conftest.$ac_ext <<_ACEOF
14619 #line 14619 "configure"
14620 #include "confdefs.h"
14621
14622 #include <${cf_cv_ncurses_header:-curses.h}>
14623 int
14624 main ()
14625 {
14626 int x = _XPG5
14627   ;
14628   return 0;
14629 }
14630 _ACEOF
14631 rm -f conftest.$ac_objext
14632 if { (eval echo "$as_me:14632: \"$ac_compile\"") >&5
14633   (eval $ac_compile) 2>&5
14634   ac_status=$?
14635   echo "$as_me:14635: \$? = $ac_status" >&5
14636   (exit $ac_status); } &&
14637          { ac_try='test -s conftest.$ac_objext'
14638   { (eval echo "$as_me:14638: \"$ac_try\"") >&5
14639   (eval $ac_try) 2>&5
14640   ac_status=$?
14641   echo "$as_me:14641: \$? = $ac_status" >&5
14642   (exit $ac_status); }; }; then
14643   :
14644 else
14645   echo "$as_me: failed program was:" >&5
14646 cat conftest.$ac_ext >&5
14647 cf_save_cppflags="$CPPFLAGS"
14648                          CPPFLAGS="$CPPFLAGS -D_XPG5"
14649                          cat >conftest.$ac_ext <<_ACEOF
14650 #line 14650 "configure"
14651 #include "confdefs.h"
14652
14653 #include <${cf_cv_ncurses_header:-curses.h}>
14654 int
14655 main ()
14656 {
14657 int x = _XPG5
14658   ;
14659   return 0;
14660 }
14661 _ACEOF
14662 rm -f conftest.$ac_objext
14663 if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5
14664   (eval $ac_compile) 2>&5
14665   ac_status=$?
14666   echo "$as_me:14666: \$? = $ac_status" >&5
14667   (exit $ac_status); } &&
14668          { ac_try='test -s conftest.$ac_objext'
14669   { (eval echo "$as_me:14669: \"$ac_try\"") >&5
14670   (eval $ac_try) 2>&5
14671   ac_status=$?
14672   echo "$as_me:14672: \$? = $ac_status" >&5
14673   (exit $ac_status); }; }; then
14674   cf_define_xpg5=yes
14675 else
14676   echo "$as_me: failed program was:" >&5
14677 cat conftest.$ac_ext >&5
14678 fi
14679 rm -f conftest.$ac_objext conftest.$ac_ext
14680                          CPPFLAGS="$cf_save_cppflags"
14681 fi
14682 rm -f conftest.$ac_objext conftest.$ac_ext
14683                 echo "$as_me:14683: result: $cf_define_xpg5" >&5
14684 echo "${ECHO_T}$cf_define_xpg5" >&6
14685
14686                 if test "$cf_define_xpg5" = yes
14687                 then
14688                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14689                 fi
14690         fi
14691
14692         echo "$as_me:14692: checking for wide-character functions" >&5
14693 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14694 if test "${cf_cv_widechar_funcs+set}" = set; then
14695   echo $ECHO_N "(cached) $ECHO_C" >&6
14696 else
14697
14698         cat >conftest.$ac_ext <<_ACEOF
14699 #line 14699 "configure"
14700 #include "confdefs.h"
14701
14702 #include <${cf_cv_ncurses_header:-curses.h}>
14703 int
14704 main ()
14705 {
14706
14707                 static wchar_t src_wchar[2];
14708                 static cchar_t dst_cchar;
14709                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14710
14711   ;
14712   return 0;
14713 }
14714 _ACEOF
14715 rm -f conftest.$ac_objext conftest$ac_exeext
14716 if { (eval echo "$as_me:14716: \"$ac_link\"") >&5
14717   (eval $ac_link) 2>&5
14718   ac_status=$?
14719   echo "$as_me:14719: \$? = $ac_status" >&5
14720   (exit $ac_status); } &&
14721          { ac_try='test -s conftest$ac_exeext'
14722   { (eval echo "$as_me:14722: \"$ac_try\"") >&5
14723   (eval $ac_try) 2>&5
14724   ac_status=$?
14725   echo "$as_me:14725: \$? = $ac_status" >&5
14726   (exit $ac_status); }; }; then
14727   cf_cv_widechar_funcs=yes
14728 else
14729   echo "$as_me: failed program was:" >&5
14730 cat conftest.$ac_ext >&5
14731 cf_cv_widechar_funcs=no
14732 fi
14733 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14734
14735 fi
14736 echo "$as_me:14736: result: $cf_cv_widechar_funcs" >&5
14737 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14738         if test "$cf_cv_widechar_funcs" != no ; then
14739                 cat >>confdefs.h <<\EOF
14740 #define USE_WIDEC_SUPPORT 1
14741 EOF
14742
14743         else
14744                 cat >>confdefs.h <<\EOF
14745 #define USE_WIDEC_SUPPORT 0
14746 EOF
14747
14748         fi
14749 else
14750         cat >>confdefs.h <<\EOF
14751 #define USE_WIDEC_SUPPORT 0
14752 EOF
14753
14754 fi
14755
14756 echo "$as_me:14756: checking if sys/time.h works with sys/select.h" >&5
14757 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14758 if test "${cf_cv_sys_time_select+set}" = set; then
14759   echo $ECHO_N "(cached) $ECHO_C" >&6
14760 else
14761
14762 cat >conftest.$ac_ext <<_ACEOF
14763 #line 14763 "configure"
14764 #include "confdefs.h"
14765
14766 #include <sys/types.h>
14767 #ifdef HAVE_SYS_TIME_H
14768 #include <sys/time.h>
14769 #endif
14770 #ifdef HAVE_SYS_SELECT_H
14771 #include <sys/select.h>
14772 #endif
14773
14774 int
14775 main ()
14776 {
14777
14778   ;
14779   return 0;
14780 }
14781 _ACEOF
14782 rm -f conftest.$ac_objext
14783 if { (eval echo "$as_me:14783: \"$ac_compile\"") >&5
14784   (eval $ac_compile) 2>&5
14785   ac_status=$?
14786   echo "$as_me:14786: \$? = $ac_status" >&5
14787   (exit $ac_status); } &&
14788          { ac_try='test -s conftest.$ac_objext'
14789   { (eval echo "$as_me:14789: \"$ac_try\"") >&5
14790   (eval $ac_try) 2>&5
14791   ac_status=$?
14792   echo "$as_me:14792: \$? = $ac_status" >&5
14793   (exit $ac_status); }; }; then
14794   cf_cv_sys_time_select=yes
14795 else
14796   echo "$as_me: failed program was:" >&5
14797 cat conftest.$ac_ext >&5
14798 cf_cv_sys_time_select=no
14799 fi
14800 rm -f conftest.$ac_objext conftest.$ac_ext
14801
14802 fi
14803
14804 echo "$as_me:14804: result: $cf_cv_sys_time_select" >&5
14805 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14806 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14807 #define HAVE_SYS_TIME_SELECT 1
14808 EOF
14809
14810 echo "$as_me:14810: checking for function curses_version" >&5
14811 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14812 if test "${cf_cv_func_curses_version+set}" = set; then
14813   echo $ECHO_N "(cached) $ECHO_C" >&6
14814 else
14815
14816 if test "$cross_compiling" = yes; then
14817   cf_cv_func_curses_version=unknown
14818 else
14819   cat >conftest.$ac_ext <<_ACEOF
14820 #line 14820 "configure"
14821 #include "confdefs.h"
14822
14823 #include <${cf_cv_ncurses_header:-curses.h}>
14824 int main()
14825 {
14826         char temp[1024];
14827         sprintf(temp, "%s\n", curses_version());
14828         ${cf_cv_main_return:-return}(0);
14829 }
14830
14831 _ACEOF
14832 rm -f conftest$ac_exeext
14833 if { (eval echo "$as_me:14833: \"$ac_link\"") >&5
14834   (eval $ac_link) 2>&5
14835   ac_status=$?
14836   echo "$as_me:14836: \$? = $ac_status" >&5
14837   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14838   { (eval echo "$as_me:14838: \"$ac_try\"") >&5
14839   (eval $ac_try) 2>&5
14840   ac_status=$?
14841   echo "$as_me:14841: \$? = $ac_status" >&5
14842   (exit $ac_status); }; }; then
14843   cf_cv_func_curses_version=yes
14844
14845 else
14846   echo "$as_me: program exited with status $ac_status" >&5
14847 echo "$as_me: failed program was:" >&5
14848 cat conftest.$ac_ext >&5
14849 cf_cv_func_curses_version=no
14850
14851 fi
14852 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14853 fi
14854 rm -f core
14855 fi
14856 echo "$as_me:14856: result: $cf_cv_func_curses_version" >&5
14857 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14858 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14859 #define HAVE_CURSES_VERSION 1
14860 EOF
14861
14862 echo "$as_me:14862: checking for ncurses wrap-prefix" >&5
14863 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14864
14865 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14866 if test "${with_ncurses_wrap_prefix+set}" = set; then
14867   withval="$with_ncurses_wrap_prefix"
14868   NCURSES_WRAP_PREFIX=$withval
14869 else
14870   NCURSES_WRAP_PREFIX=_nc_
14871 fi;
14872 echo "$as_me:14872: result: $NCURSES_WRAP_PREFIX" >&5
14873 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14874
14875 echo "$as_me:14875: checking for alternate character set array" >&5
14876 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14877 if test "${cf_cv_curses_acs_map+set}" = set; then
14878   echo $ECHO_N "(cached) $ECHO_C" >&6
14879 else
14880
14881 cf_cv_curses_acs_map=unknown
14882 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14883 do
14884 cat >conftest.$ac_ext <<_ACEOF
14885 #line 14885 "configure"
14886 #include "confdefs.h"
14887
14888 #include <${cf_cv_ncurses_header:-curses.h}>
14889
14890 int
14891 main ()
14892 {
14893
14894 $name['k'] = ACS_PLUS
14895
14896   ;
14897   return 0;
14898 }
14899 _ACEOF
14900 rm -f conftest.$ac_objext conftest$ac_exeext
14901 if { (eval echo "$as_me:14901: \"$ac_link\"") >&5
14902   (eval $ac_link) 2>&5
14903   ac_status=$?
14904   echo "$as_me:14904: \$? = $ac_status" >&5
14905   (exit $ac_status); } &&
14906          { ac_try='test -s conftest$ac_exeext'
14907   { (eval echo "$as_me:14907: \"$ac_try\"") >&5
14908   (eval $ac_try) 2>&5
14909   ac_status=$?
14910   echo "$as_me:14910: \$? = $ac_status" >&5
14911   (exit $ac_status); }; }; then
14912   cf_cv_curses_acs_map=$name; break
14913 else
14914   echo "$as_me: failed program was:" >&5
14915 cat conftest.$ac_ext >&5
14916 fi
14917 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14918 done
14919
14920 fi
14921 echo "$as_me:14921: result: $cf_cv_curses_acs_map" >&5
14922 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14923
14924 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14925 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14926 EOF
14927
14928 if test "$cf_enable_widec" = yes; then
14929
14930 echo "$as_me:14930: checking for wide alternate character set array" >&5
14931 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14932 if test "${cf_cv_curses_wacs_map+set}" = set; then
14933   echo $ECHO_N "(cached) $ECHO_C" >&6
14934 else
14935
14936         cf_cv_curses_wacs_map=unknown
14937         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14938         do
14939         cat >conftest.$ac_ext <<_ACEOF
14940 #line 14940 "configure"
14941 #include "confdefs.h"
14942
14943 #ifndef _XOPEN_SOURCE_EXTENDED
14944 #define _XOPEN_SOURCE_EXTENDED
14945 #endif
14946 #include <${cf_cv_ncurses_header:-curses.h}>
14947 int
14948 main ()
14949 {
14950 void *foo = &($name['k'])
14951   ;
14952   return 0;
14953 }
14954 _ACEOF
14955 rm -f conftest.$ac_objext conftest$ac_exeext
14956 if { (eval echo "$as_me:14956: \"$ac_link\"") >&5
14957   (eval $ac_link) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); } &&
14961          { ac_try='test -s conftest$ac_exeext'
14962   { (eval echo "$as_me:14962: \"$ac_try\"") >&5
14963   (eval $ac_try) 2>&5
14964   ac_status=$?
14965   echo "$as_me:14965: \$? = $ac_status" >&5
14966   (exit $ac_status); }; }; then
14967   cf_cv_curses_wacs_map=$name
14968          break
14969 else
14970   echo "$as_me: failed program was:" >&5
14971 cat conftest.$ac_ext >&5
14972 fi
14973 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14974         done
14975 fi
14976 echo "$as_me:14976: result: $cf_cv_curses_wacs_map" >&5
14977 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
14978
14979 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
14980 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
14981 EOF
14982
14983 echo "$as_me:14983: checking for wide alternate character constants" >&5
14984 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
14985 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
14986   echo $ECHO_N "(cached) $ECHO_C" >&6
14987 else
14988
14989 cf_cv_curses_wacs_symbols=no
14990 if test "$cf_cv_curses_wacs_map" != unknown
14991 then
14992         cat >conftest.$ac_ext <<_ACEOF
14993 #line 14993 "configure"
14994 #include "confdefs.h"
14995
14996 #ifndef _XOPEN_SOURCE_EXTENDED
14997 #define _XOPEN_SOURCE_EXTENDED
14998 #endif
14999 #include <${cf_cv_ncurses_header:-curses.h}>
15000 int
15001 main ()
15002 {
15003 cchar_t *foo = WACS_PLUS;
15004          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15005   ;
15006   return 0;
15007 }
15008 _ACEOF
15009 rm -f conftest.$ac_objext conftest$ac_exeext
15010 if { (eval echo "$as_me:15010: \"$ac_link\"") >&5
15011   (eval $ac_link) 2>&5
15012   ac_status=$?
15013   echo "$as_me:15013: \$? = $ac_status" >&5
15014   (exit $ac_status); } &&
15015          { ac_try='test -s conftest$ac_exeext'
15016   { (eval echo "$as_me:15016: \"$ac_try\"") >&5
15017   (eval $ac_try) 2>&5
15018   ac_status=$?
15019   echo "$as_me:15019: \$? = $ac_status" >&5
15020   (exit $ac_status); }; }; then
15021   cf_cv_curses_wacs_symbols=yes
15022 else
15023   echo "$as_me: failed program was:" >&5
15024 cat conftest.$ac_ext >&5
15025 fi
15026 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15027 else
15028         cat >conftest.$ac_ext <<_ACEOF
15029 #line 15029 "configure"
15030 #include "confdefs.h"
15031
15032 #ifndef _XOPEN_SOURCE_EXTENDED
15033 #define _XOPEN_SOURCE_EXTENDED
15034 #endif
15035 #include <${cf_cv_ncurses_header:-curses.h}>
15036 int
15037 main ()
15038 {
15039 cchar_t *foo = WACS_PLUS
15040   ;
15041   return 0;
15042 }
15043 _ACEOF
15044 rm -f conftest.$ac_objext conftest$ac_exeext
15045 if { (eval echo "$as_me:15045: \"$ac_link\"") >&5
15046   (eval $ac_link) 2>&5
15047   ac_status=$?
15048   echo "$as_me:15048: \$? = $ac_status" >&5
15049   (exit $ac_status); } &&
15050          { ac_try='test -s conftest$ac_exeext'
15051   { (eval echo "$as_me:15051: \"$ac_try\"") >&5
15052   (eval $ac_try) 2>&5
15053   ac_status=$?
15054   echo "$as_me:15054: \$? = $ac_status" >&5
15055   (exit $ac_status); }; }; then
15056   cf_cv_curses_wacs_symbols=yes
15057 else
15058   echo "$as_me: failed program was:" >&5
15059 cat conftest.$ac_ext >&5
15060 fi
15061 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15062 fi
15063
15064 fi
15065 echo "$as_me:15065: result: $cf_cv_curses_wacs_symbols" >&5
15066 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15067
15068 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
15069 #define CURSES_WACS_SYMBOLS 1
15070 EOF
15071
15072 fi
15073
15074 echo "$as_me:15074: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15075 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15076 cat >conftest.$ac_ext <<_ACEOF
15077 #line 15077 "configure"
15078 #include "confdefs.h"
15079
15080 #ifndef _XOPEN_SOURCE_EXTENDED
15081 #define _XOPEN_SOURCE_EXTENDED
15082 #endif
15083 #include <${cf_cv_ncurses_header:-curses.h}>
15084 int
15085 main ()
15086 {
15087
15088 attr_t foo
15089
15090   ;
15091   return 0;
15092 }
15093 _ACEOF
15094 rm -f conftest.$ac_objext
15095 if { (eval echo "$as_me:15095: \"$ac_compile\"") >&5
15096   (eval $ac_compile) 2>&5
15097   ac_status=$?
15098   echo "$as_me:15098: \$? = $ac_status" >&5
15099   (exit $ac_status); } &&
15100          { ac_try='test -s conftest.$ac_objext'
15101   { (eval echo "$as_me:15101: \"$ac_try\"") >&5
15102   (eval $ac_try) 2>&5
15103   ac_status=$?
15104   echo "$as_me:15104: \$? = $ac_status" >&5
15105   (exit $ac_status); }; }; then
15106   cf_result=yes
15107 else
15108   echo "$as_me: failed program was:" >&5
15109 cat conftest.$ac_ext >&5
15110 cf_result=no
15111 fi
15112 rm -f conftest.$ac_objext conftest.$ac_ext
15113 echo "$as_me:15113: result: $cf_result" >&5
15114 echo "${ECHO_T}$cf_result" >&6
15115 if test $cf_result = yes ; then
15116
15117 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15118
15119         cat >>confdefs.h <<EOF
15120 #define $cf_result 1
15121 EOF
15122
15123 else
15124         cat >>confdefs.h <<EOF
15125 #define attr_t long
15126 EOF
15127
15128 fi
15129
15130 if test "$cf_enable_widec" = yes; then
15131
15132 # This is needed on Tru64 5.0 to declare mbstate_t
15133 echo "$as_me:15133: checking if we must include wchar.h to declare mbstate_t" >&5
15134 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15135 if test "${cf_cv_mbstate_t+set}" = set; then
15136   echo $ECHO_N "(cached) $ECHO_C" >&6
15137 else
15138
15139 cat >conftest.$ac_ext <<_ACEOF
15140 #line 15140 "configure"
15141 #include "confdefs.h"
15142
15143 #include <stdlib.h>
15144 #include <stdarg.h>
15145 #include <stdio.h>
15146 #ifdef HAVE_LIBUTF8_H
15147 #include <libutf8.h>
15148 #endif
15149 int
15150 main ()
15151 {
15152 mbstate_t state
15153   ;
15154   return 0;
15155 }
15156 _ACEOF
15157 rm -f conftest.$ac_objext
15158 if { (eval echo "$as_me:15158: \"$ac_compile\"") >&5
15159   (eval $ac_compile) 2>&5
15160   ac_status=$?
15161   echo "$as_me:15161: \$? = $ac_status" >&5
15162   (exit $ac_status); } &&
15163          { ac_try='test -s conftest.$ac_objext'
15164   { (eval echo "$as_me:15164: \"$ac_try\"") >&5
15165   (eval $ac_try) 2>&5
15166   ac_status=$?
15167   echo "$as_me:15167: \$? = $ac_status" >&5
15168   (exit $ac_status); }; }; then
15169   cf_cv_mbstate_t=no
15170 else
15171   echo "$as_me: failed program was:" >&5
15172 cat conftest.$ac_ext >&5
15173 cat >conftest.$ac_ext <<_ACEOF
15174 #line 15174 "configure"
15175 #include "confdefs.h"
15176
15177 #include <stdlib.h>
15178 #include <stdarg.h>
15179 #include <stdio.h>
15180 #include <wchar.h>
15181 #ifdef HAVE_LIBUTF8_H
15182 #include <libutf8.h>
15183 #endif
15184 int
15185 main ()
15186 {
15187 mbstate_t value
15188   ;
15189   return 0;
15190 }
15191 _ACEOF
15192 rm -f conftest.$ac_objext
15193 if { (eval echo "$as_me:15193: \"$ac_compile\"") >&5
15194   (eval $ac_compile) 2>&5
15195   ac_status=$?
15196   echo "$as_me:15196: \$? = $ac_status" >&5
15197   (exit $ac_status); } &&
15198          { ac_try='test -s conftest.$ac_objext'
15199   { (eval echo "$as_me:15199: \"$ac_try\"") >&5
15200   (eval $ac_try) 2>&5
15201   ac_status=$?
15202   echo "$as_me:15202: \$? = $ac_status" >&5
15203   (exit $ac_status); }; }; then
15204   cf_cv_mbstate_t=yes
15205 else
15206   echo "$as_me: failed program was:" >&5
15207 cat conftest.$ac_ext >&5
15208 cf_cv_mbstate_t=unknown
15209 fi
15210 rm -f conftest.$ac_objext conftest.$ac_ext
15211 fi
15212 rm -f conftest.$ac_objext conftest.$ac_ext
15213 fi
15214 echo "$as_me:15214: result: $cf_cv_mbstate_t" >&5
15215 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15216
15217 if test "$cf_cv_mbstate_t" = yes ; then
15218         cat >>confdefs.h <<\EOF
15219 #define NEED_WCHAR_H 1
15220 EOF
15221
15222         NEED_WCHAR_H=1
15223 fi
15224
15225 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15226 if test "$cf_cv_mbstate_t" = unknown ; then
15227         NCURSES_MBSTATE_T=1
15228 fi
15229
15230 # if we find mbstate_t in either place, use substitution to provide a fallback.
15231 if test "$cf_cv_mbstate_t" != unknown ; then
15232         NCURSES_OK_MBSTATE_T=1
15233 fi
15234
15235 # This is needed on Tru64 5.0 to declare wchar_t
15236 echo "$as_me:15236: checking if we must include wchar.h to declare wchar_t" >&5
15237 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15238 if test "${cf_cv_wchar_t+set}" = set; then
15239   echo $ECHO_N "(cached) $ECHO_C" >&6
15240 else
15241
15242 cat >conftest.$ac_ext <<_ACEOF
15243 #line 15243 "configure"
15244 #include "confdefs.h"
15245
15246 #include <stdlib.h>
15247 #include <stdarg.h>
15248 #include <stdio.h>
15249 #ifdef HAVE_LIBUTF8_H
15250 #include <libutf8.h>
15251 #endif
15252 int
15253 main ()
15254 {
15255 wchar_t state
15256   ;
15257   return 0;
15258 }
15259 _ACEOF
15260 rm -f conftest.$ac_objext
15261 if { (eval echo "$as_me:15261: \"$ac_compile\"") >&5
15262   (eval $ac_compile) 2>&5
15263   ac_status=$?
15264   echo "$as_me:15264: \$? = $ac_status" >&5
15265   (exit $ac_status); } &&
15266          { ac_try='test -s conftest.$ac_objext'
15267   { (eval echo "$as_me:15267: \"$ac_try\"") >&5
15268   (eval $ac_try) 2>&5
15269   ac_status=$?
15270   echo "$as_me:15270: \$? = $ac_status" >&5
15271   (exit $ac_status); }; }; then
15272   cf_cv_wchar_t=no
15273 else
15274   echo "$as_me: failed program was:" >&5
15275 cat conftest.$ac_ext >&5
15276 cat >conftest.$ac_ext <<_ACEOF
15277 #line 15277 "configure"
15278 #include "confdefs.h"
15279
15280 #include <stdlib.h>
15281 #include <stdarg.h>
15282 #include <stdio.h>
15283 #include <wchar.h>
15284 #ifdef HAVE_LIBUTF8_H
15285 #include <libutf8.h>
15286 #endif
15287 int
15288 main ()
15289 {
15290 wchar_t value
15291   ;
15292   return 0;
15293 }
15294 _ACEOF
15295 rm -f conftest.$ac_objext
15296 if { (eval echo "$as_me:15296: \"$ac_compile\"") >&5
15297   (eval $ac_compile) 2>&5
15298   ac_status=$?
15299   echo "$as_me:15299: \$? = $ac_status" >&5
15300   (exit $ac_status); } &&
15301          { ac_try='test -s conftest.$ac_objext'
15302   { (eval echo "$as_me:15302: \"$ac_try\"") >&5
15303   (eval $ac_try) 2>&5
15304   ac_status=$?
15305   echo "$as_me:15305: \$? = $ac_status" >&5
15306   (exit $ac_status); }; }; then
15307   cf_cv_wchar_t=yes
15308 else
15309   echo "$as_me: failed program was:" >&5
15310 cat conftest.$ac_ext >&5
15311 cf_cv_wchar_t=unknown
15312 fi
15313 rm -f conftest.$ac_objext conftest.$ac_ext
15314 fi
15315 rm -f conftest.$ac_objext conftest.$ac_ext
15316 fi
15317 echo "$as_me:15317: result: $cf_cv_wchar_t" >&5
15318 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15319
15320 if test "$cf_cv_wchar_t" = yes ; then
15321         cat >>confdefs.h <<\EOF
15322 #define NEED_WCHAR_H 1
15323 EOF
15324
15325         NEED_WCHAR_H=1
15326 fi
15327
15328 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15329 if test "$cf_cv_wchar_t" = unknown ; then
15330         NCURSES_WCHAR_T=1
15331 fi
15332
15333 # if we find wchar_t in either place, use substitution to provide a fallback.
15334 if test "$cf_cv_wchar_t" != unknown ; then
15335         NCURSES_OK_WCHAR_T=1
15336 fi
15337
15338 # This is needed on Tru64 5.0 to declare wint_t
15339 echo "$as_me:15339: checking if we must include wchar.h to declare wint_t" >&5
15340 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15341 if test "${cf_cv_wint_t+set}" = set; then
15342   echo $ECHO_N "(cached) $ECHO_C" >&6
15343 else
15344
15345 cat >conftest.$ac_ext <<_ACEOF
15346 #line 15346 "configure"
15347 #include "confdefs.h"
15348
15349 #include <stdlib.h>
15350 #include <stdarg.h>
15351 #include <stdio.h>
15352 #ifdef HAVE_LIBUTF8_H
15353 #include <libutf8.h>
15354 #endif
15355 int
15356 main ()
15357 {
15358 wint_t state
15359   ;
15360   return 0;
15361 }
15362 _ACEOF
15363 rm -f conftest.$ac_objext
15364 if { (eval echo "$as_me:15364: \"$ac_compile\"") >&5
15365   (eval $ac_compile) 2>&5
15366   ac_status=$?
15367   echo "$as_me:15367: \$? = $ac_status" >&5
15368   (exit $ac_status); } &&
15369          { ac_try='test -s conftest.$ac_objext'
15370   { (eval echo "$as_me:15370: \"$ac_try\"") >&5
15371   (eval $ac_try) 2>&5
15372   ac_status=$?
15373   echo "$as_me:15373: \$? = $ac_status" >&5
15374   (exit $ac_status); }; }; then
15375   cf_cv_wint_t=no
15376 else
15377   echo "$as_me: failed program was:" >&5
15378 cat conftest.$ac_ext >&5
15379 cat >conftest.$ac_ext <<_ACEOF
15380 #line 15380 "configure"
15381 #include "confdefs.h"
15382
15383 #include <stdlib.h>
15384 #include <stdarg.h>
15385 #include <stdio.h>
15386 #include <wchar.h>
15387 #ifdef HAVE_LIBUTF8_H
15388 #include <libutf8.h>
15389 #endif
15390 int
15391 main ()
15392 {
15393 wint_t value
15394   ;
15395   return 0;
15396 }
15397 _ACEOF
15398 rm -f conftest.$ac_objext
15399 if { (eval echo "$as_me:15399: \"$ac_compile\"") >&5
15400   (eval $ac_compile) 2>&5
15401   ac_status=$?
15402   echo "$as_me:15402: \$? = $ac_status" >&5
15403   (exit $ac_status); } &&
15404          { ac_try='test -s conftest.$ac_objext'
15405   { (eval echo "$as_me:15405: \"$ac_try\"") >&5
15406   (eval $ac_try) 2>&5
15407   ac_status=$?
15408   echo "$as_me:15408: \$? = $ac_status" >&5
15409   (exit $ac_status); }; }; then
15410   cf_cv_wint_t=yes
15411 else
15412   echo "$as_me: failed program was:" >&5
15413 cat conftest.$ac_ext >&5
15414 cf_cv_wint_t=unknown
15415 fi
15416 rm -f conftest.$ac_objext conftest.$ac_ext
15417 fi
15418 rm -f conftest.$ac_objext conftest.$ac_ext
15419 fi
15420 echo "$as_me:15420: result: $cf_cv_wint_t" >&5
15421 echo "${ECHO_T}$cf_cv_wint_t" >&6
15422
15423 if test "$cf_cv_wint_t" = yes ; then
15424         cat >>confdefs.h <<\EOF
15425 #define NEED_WCHAR_H 1
15426 EOF
15427
15428         NEED_WCHAR_H=1
15429 fi
15430
15431 # if we do not find wint_t in either place, use substitution to provide a fallback.
15432 if test "$cf_cv_wint_t" = unknown ; then
15433         NCURSES_WINT_T=1
15434 fi
15435
15436 # if we find wint_t in either place, use substitution to provide a fallback.
15437 if test "$cf_cv_wint_t" != unknown ; then
15438         NCURSES_OK_WINT_T=1
15439 fi
15440
15441         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15442
15443 echo "$as_me:15443: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15444 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15445 cat >conftest.$ac_ext <<_ACEOF
15446 #line 15446 "configure"
15447 #include "confdefs.h"
15448
15449 #ifndef _XOPEN_SOURCE_EXTENDED
15450 #define _XOPEN_SOURCE_EXTENDED
15451 #endif
15452 #include <${cf_cv_ncurses_header:-curses.h}>
15453 int
15454 main ()
15455 {
15456
15457 mbstate_t foo
15458
15459   ;
15460   return 0;
15461 }
15462 _ACEOF
15463 rm -f conftest.$ac_objext
15464 if { (eval echo "$as_me:15464: \"$ac_compile\"") >&5
15465   (eval $ac_compile) 2>&5
15466   ac_status=$?
15467   echo "$as_me:15467: \$? = $ac_status" >&5
15468   (exit $ac_status); } &&
15469          { ac_try='test -s conftest.$ac_objext'
15470   { (eval echo "$as_me:15470: \"$ac_try\"") >&5
15471   (eval $ac_try) 2>&5
15472   ac_status=$?
15473   echo "$as_me:15473: \$? = $ac_status" >&5
15474   (exit $ac_status); }; }; then
15475   cf_result=yes
15476 else
15477   echo "$as_me: failed program was:" >&5
15478 cat conftest.$ac_ext >&5
15479 cf_result=no
15480 fi
15481 rm -f conftest.$ac_objext conftest.$ac_ext
15482 echo "$as_me:15482: result: $cf_result" >&5
15483 echo "${ECHO_T}$cf_result" >&6
15484 if test $cf_result = yes ; then
15485
15486 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15487
15488         cat >>confdefs.h <<EOF
15489 #define $cf_result 1
15490 EOF
15491
15492 else
15493         cat >>confdefs.h <<EOF
15494 #define mbstate_t long
15495 EOF
15496
15497 fi
15498
15499         fi
15500
15501         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15502
15503 echo "$as_me:15503: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15504 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15505 cat >conftest.$ac_ext <<_ACEOF
15506 #line 15506 "configure"
15507 #include "confdefs.h"
15508
15509 #ifndef _XOPEN_SOURCE_EXTENDED
15510 #define _XOPEN_SOURCE_EXTENDED
15511 #endif
15512 #include <${cf_cv_ncurses_header:-curses.h}>
15513 int
15514 main ()
15515 {
15516
15517 wchar_t foo
15518
15519   ;
15520   return 0;
15521 }
15522 _ACEOF
15523 rm -f conftest.$ac_objext
15524 if { (eval echo "$as_me:15524: \"$ac_compile\"") >&5
15525   (eval $ac_compile) 2>&5
15526   ac_status=$?
15527   echo "$as_me:15527: \$? = $ac_status" >&5
15528   (exit $ac_status); } &&
15529          { ac_try='test -s conftest.$ac_objext'
15530   { (eval echo "$as_me:15530: \"$ac_try\"") >&5
15531   (eval $ac_try) 2>&5
15532   ac_status=$?
15533   echo "$as_me:15533: \$? = $ac_status" >&5
15534   (exit $ac_status); }; }; then
15535   cf_result=yes
15536 else
15537   echo "$as_me: failed program was:" >&5
15538 cat conftest.$ac_ext >&5
15539 cf_result=no
15540 fi
15541 rm -f conftest.$ac_objext conftest.$ac_ext
15542 echo "$as_me:15542: result: $cf_result" >&5
15543 echo "${ECHO_T}$cf_result" >&6
15544 if test $cf_result = yes ; then
15545
15546 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15547
15548         cat >>confdefs.h <<EOF
15549 #define $cf_result 1
15550 EOF
15551
15552 else
15553         cat >>confdefs.h <<EOF
15554 #define wchar_t long
15555 EOF
15556
15557 fi
15558
15559         fi
15560
15561         if test "$NCURSES_OK_WINT_T" = 0 ; then
15562
15563 echo "$as_me:15563: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15564 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15565 cat >conftest.$ac_ext <<_ACEOF
15566 #line 15566 "configure"
15567 #include "confdefs.h"
15568
15569 #ifndef _XOPEN_SOURCE_EXTENDED
15570 #define _XOPEN_SOURCE_EXTENDED
15571 #endif
15572 #include <${cf_cv_ncurses_header:-curses.h}>
15573 int
15574 main ()
15575 {
15576
15577 wint_t foo
15578
15579   ;
15580   return 0;
15581 }
15582 _ACEOF
15583 rm -f conftest.$ac_objext
15584 if { (eval echo "$as_me:15584: \"$ac_compile\"") >&5
15585   (eval $ac_compile) 2>&5
15586   ac_status=$?
15587   echo "$as_me:15587: \$? = $ac_status" >&5
15588   (exit $ac_status); } &&
15589          { ac_try='test -s conftest.$ac_objext'
15590   { (eval echo "$as_me:15590: \"$ac_try\"") >&5
15591   (eval $ac_try) 2>&5
15592   ac_status=$?
15593   echo "$as_me:15593: \$? = $ac_status" >&5
15594   (exit $ac_status); }; }; then
15595   cf_result=yes
15596 else
15597   echo "$as_me: failed program was:" >&5
15598 cat conftest.$ac_ext >&5
15599 cf_result=no
15600 fi
15601 rm -f conftest.$ac_objext conftest.$ac_ext
15602 echo "$as_me:15602: result: $cf_result" >&5
15603 echo "${ECHO_T}$cf_result" >&6
15604 if test $cf_result = yes ; then
15605
15606 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15607
15608         cat >>confdefs.h <<EOF
15609 #define $cf_result 1
15610 EOF
15611
15612 else
15613         cat >>confdefs.h <<EOF
15614 #define wint_t long
15615 EOF
15616
15617 fi
15618
15619         fi
15620 fi
15621
15622 echo "$as_me:15622: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15623 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15624
15625 cat >conftest.$ac_ext <<_ACEOF
15626 #line 15626 "configure"
15627 #include "confdefs.h"
15628
15629 #ifdef HAVE_XCURSES
15630 #include <xcurses.h>
15631 char * XCursesProgramName = "test";
15632 #else
15633 #include <${cf_cv_ncurses_header:-curses.h}>
15634 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15635 #include <ncursesw/term.h>
15636 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15637 #include <ncurses/term.h>
15638 #elif defined(HAVE_TERM_H)
15639 #include <term.h>
15640 #endif
15641 #endif
15642
15643 int
15644 main ()
15645 {
15646
15647 void *foo = &(boolnames)
15648
15649   ;
15650   return 0;
15651 }
15652 _ACEOF
15653 rm -f conftest.$ac_objext
15654 if { (eval echo "$as_me:15654: \"$ac_compile\"") >&5
15655   (eval $ac_compile) 2>&5
15656   ac_status=$?
15657   echo "$as_me:15657: \$? = $ac_status" >&5
15658   (exit $ac_status); } &&
15659          { ac_try='test -s conftest.$ac_objext'
15660   { (eval echo "$as_me:15660: \"$ac_try\"") >&5
15661   (eval $ac_try) 2>&5
15662   ac_status=$?
15663   echo "$as_me:15663: \$? = $ac_status" >&5
15664   (exit $ac_status); }; }; then
15665   cf_result=yes
15666 else
15667   echo "$as_me: failed program was:" >&5
15668 cat conftest.$ac_ext >&5
15669 cf_result=no
15670 fi
15671 rm -f conftest.$ac_objext conftest.$ac_ext
15672 echo "$as_me:15672: result: $cf_result" >&5
15673 echo "${ECHO_T}$cf_result" >&6
15674
15675 if test $cf_result = yes ; then
15676
15677 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15678
15679         cat >>confdefs.h <<EOF
15680 #define $cf_result 1
15681 EOF
15682
15683 else
15684         echo "$as_me:15684: checking for data boolnames in library" >&5
15685 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15686         # BSD linkers insist on making weak linkage, but resolve at runtime.
15687         if test "$cross_compiling" = yes; then
15688
15689         # cross-compiling
15690         cat >conftest.$ac_ext <<_ACEOF
15691 #line 15691 "configure"
15692 #include "confdefs.h"
15693
15694 #ifdef HAVE_XCURSES
15695 #include <xcurses.h>
15696 char * XCursesProgramName = "test";
15697 #else
15698 #include <${cf_cv_ncurses_header:-curses.h}>
15699 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15700 #include <ncursesw/term.h>
15701 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15702 #include <ncurses/term.h>
15703 #elif defined(HAVE_TERM_H)
15704 #include <term.h>
15705 #endif
15706 #endif
15707
15708 extern char boolnames;
15709 int
15710 main ()
15711 {
15712
15713         do {
15714                 void *foo = &(boolnames);
15715                 ${cf_cv_main_return:-return}(foo == 0);
15716         } while (0)
15717
15718   ;
15719   return 0;
15720 }
15721 _ACEOF
15722 rm -f conftest.$ac_objext conftest$ac_exeext
15723 if { (eval echo "$as_me:15723: \"$ac_link\"") >&5
15724   (eval $ac_link) 2>&5
15725   ac_status=$?
15726   echo "$as_me:15726: \$? = $ac_status" >&5
15727   (exit $ac_status); } &&
15728          { ac_try='test -s conftest$ac_exeext'
15729   { (eval echo "$as_me:15729: \"$ac_try\"") >&5
15730   (eval $ac_try) 2>&5
15731   ac_status=$?
15732   echo "$as_me:15732: \$? = $ac_status" >&5
15733   (exit $ac_status); }; }; then
15734   cf_result=yes
15735 else
15736   echo "$as_me: failed program was:" >&5
15737 cat conftest.$ac_ext >&5
15738 cf_result=no
15739 fi
15740 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15741
15742 else
15743   cat >conftest.$ac_ext <<_ACEOF
15744 #line 15744 "configure"
15745 #include "confdefs.h"
15746
15747 #ifdef HAVE_XCURSES
15748 #include <xcurses.h>
15749 char * XCursesProgramName = "test";
15750 #else
15751 #include <${cf_cv_ncurses_header:-curses.h}>
15752 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15753 #include <ncursesw/term.h>
15754 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15755 #include <ncurses/term.h>
15756 #elif defined(HAVE_TERM_H)
15757 #include <term.h>
15758 #endif
15759 #endif
15760
15761 extern char boolnames;
15762 int main(void)
15763 {
15764         void *foo = &(boolnames);
15765         ${cf_cv_main_return:-return}(foo == 0);
15766 }
15767 _ACEOF
15768 rm -f conftest$ac_exeext
15769 if { (eval echo "$as_me:15769: \"$ac_link\"") >&5
15770   (eval $ac_link) 2>&5
15771   ac_status=$?
15772   echo "$as_me:15772: \$? = $ac_status" >&5
15773   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15774   { (eval echo "$as_me:15774: \"$ac_try\"") >&5
15775   (eval $ac_try) 2>&5
15776   ac_status=$?
15777   echo "$as_me:15777: \$? = $ac_status" >&5
15778   (exit $ac_status); }; }; then
15779   cf_result=yes
15780 else
15781   echo "$as_me: program exited with status $ac_status" >&5
15782 echo "$as_me: failed program was:" >&5
15783 cat conftest.$ac_ext >&5
15784 cf_result=no
15785 fi
15786 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15787 fi
15788         echo "$as_me:15788: result: $cf_result" >&5
15789 echo "${ECHO_T}$cf_result" >&6
15790         if test $cf_result = yes ; then
15791
15792 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15793
15794                 cat >>confdefs.h <<EOF
15795 #define $cf_result 1
15796 EOF
15797
15798         fi
15799 fi
15800
15801 echo "$as_me:15801: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15802 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15803
15804 cat >conftest.$ac_ext <<_ACEOF
15805 #line 15805 "configure"
15806 #include "confdefs.h"
15807
15808 #ifdef HAVE_XCURSES
15809 #include <xcurses.h>
15810 char * XCursesProgramName = "test";
15811 #else
15812 #include <${cf_cv_ncurses_header:-curses.h}>
15813 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15814 #include <ncursesw/term.h>
15815 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15816 #include <ncurses/term.h>
15817 #elif defined(HAVE_TERM_H)
15818 #include <term.h>
15819 #endif
15820 #endif
15821
15822 int
15823 main ()
15824 {
15825
15826 void *foo = &(boolfnames)
15827
15828   ;
15829   return 0;
15830 }
15831 _ACEOF
15832 rm -f conftest.$ac_objext
15833 if { (eval echo "$as_me:15833: \"$ac_compile\"") >&5
15834   (eval $ac_compile) 2>&5
15835   ac_status=$?
15836   echo "$as_me:15836: \$? = $ac_status" >&5
15837   (exit $ac_status); } &&
15838          { ac_try='test -s conftest.$ac_objext'
15839   { (eval echo "$as_me:15839: \"$ac_try\"") >&5
15840   (eval $ac_try) 2>&5
15841   ac_status=$?
15842   echo "$as_me:15842: \$? = $ac_status" >&5
15843   (exit $ac_status); }; }; then
15844   cf_result=yes
15845 else
15846   echo "$as_me: failed program was:" >&5
15847 cat conftest.$ac_ext >&5
15848 cf_result=no
15849 fi
15850 rm -f conftest.$ac_objext conftest.$ac_ext
15851 echo "$as_me:15851: result: $cf_result" >&5
15852 echo "${ECHO_T}$cf_result" >&6
15853
15854 if test $cf_result = yes ; then
15855
15856 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15857
15858         cat >>confdefs.h <<EOF
15859 #define $cf_result 1
15860 EOF
15861
15862 else
15863         echo "$as_me:15863: checking for data boolfnames in library" >&5
15864 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15865         # BSD linkers insist on making weak linkage, but resolve at runtime.
15866         if test "$cross_compiling" = yes; then
15867
15868         # cross-compiling
15869         cat >conftest.$ac_ext <<_ACEOF
15870 #line 15870 "configure"
15871 #include "confdefs.h"
15872
15873 #ifdef HAVE_XCURSES
15874 #include <xcurses.h>
15875 char * XCursesProgramName = "test";
15876 #else
15877 #include <${cf_cv_ncurses_header:-curses.h}>
15878 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15879 #include <ncursesw/term.h>
15880 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15881 #include <ncurses/term.h>
15882 #elif defined(HAVE_TERM_H)
15883 #include <term.h>
15884 #endif
15885 #endif
15886
15887 extern char boolfnames;
15888 int
15889 main ()
15890 {
15891
15892         do {
15893                 void *foo = &(boolfnames);
15894                 ${cf_cv_main_return:-return}(foo == 0);
15895         } while (0)
15896
15897   ;
15898   return 0;
15899 }
15900 _ACEOF
15901 rm -f conftest.$ac_objext conftest$ac_exeext
15902 if { (eval echo "$as_me:15902: \"$ac_link\"") >&5
15903   (eval $ac_link) 2>&5
15904   ac_status=$?
15905   echo "$as_me:15905: \$? = $ac_status" >&5
15906   (exit $ac_status); } &&
15907          { ac_try='test -s conftest$ac_exeext'
15908   { (eval echo "$as_me:15908: \"$ac_try\"") >&5
15909   (eval $ac_try) 2>&5
15910   ac_status=$?
15911   echo "$as_me:15911: \$? = $ac_status" >&5
15912   (exit $ac_status); }; }; then
15913   cf_result=yes
15914 else
15915   echo "$as_me: failed program was:" >&5
15916 cat conftest.$ac_ext >&5
15917 cf_result=no
15918 fi
15919 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15920
15921 else
15922   cat >conftest.$ac_ext <<_ACEOF
15923 #line 15923 "configure"
15924 #include "confdefs.h"
15925
15926 #ifdef HAVE_XCURSES
15927 #include <xcurses.h>
15928 char * XCursesProgramName = "test";
15929 #else
15930 #include <${cf_cv_ncurses_header:-curses.h}>
15931 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15932 #include <ncursesw/term.h>
15933 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15934 #include <ncurses/term.h>
15935 #elif defined(HAVE_TERM_H)
15936 #include <term.h>
15937 #endif
15938 #endif
15939
15940 extern char boolfnames;
15941 int main(void)
15942 {
15943         void *foo = &(boolfnames);
15944         ${cf_cv_main_return:-return}(foo == 0);
15945 }
15946 _ACEOF
15947 rm -f conftest$ac_exeext
15948 if { (eval echo "$as_me:15948: \"$ac_link\"") >&5
15949   (eval $ac_link) 2>&5
15950   ac_status=$?
15951   echo "$as_me:15951: \$? = $ac_status" >&5
15952   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15953   { (eval echo "$as_me:15953: \"$ac_try\"") >&5
15954   (eval $ac_try) 2>&5
15955   ac_status=$?
15956   echo "$as_me:15956: \$? = $ac_status" >&5
15957   (exit $ac_status); }; }; then
15958   cf_result=yes
15959 else
15960   echo "$as_me: program exited with status $ac_status" >&5
15961 echo "$as_me: failed program was:" >&5
15962 cat conftest.$ac_ext >&5
15963 cf_result=no
15964 fi
15965 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15966 fi
15967         echo "$as_me:15967: result: $cf_result" >&5
15968 echo "${ECHO_T}$cf_result" >&6
15969         if test $cf_result = yes ; then
15970
15971 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15972
15973                 cat >>confdefs.h <<EOF
15974 #define $cf_result 1
15975 EOF
15976
15977         fi
15978 fi
15979
15980 LD_RPATH_OPT=
15981 echo "$as_me:15981: checking for an rpath option" >&5
15982 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
15983 case $cf_cv_system_name in #(vi
15984 irix*) #(vi
15985         if test "$GCC" = yes; then
15986                 LD_RPATH_OPT="-Wl,-rpath,"
15987         else
15988                 LD_RPATH_OPT="-rpath "
15989         fi
15990         ;;
15991 linux*|gnu*|k*bsd*-gnu) #(vi
15992         LD_RPATH_OPT="-Wl,-rpath,"
15993         ;;
15994 openbsd[2-9].*|mirbsd*) #(vi
15995         LD_RPATH_OPT="-Wl,-rpath,"
15996         ;;
15997 dragonfly*|freebsd*) #(vi
15998         LD_RPATH_OPT="-rpath "
15999         ;;
16000 netbsd*) #(vi
16001         LD_RPATH_OPT="-Wl,-rpath,"
16002         ;;
16003 osf*|mls+*) #(vi
16004         LD_RPATH_OPT="-rpath "
16005         ;;
16006 solaris2*) #(vi
16007         LD_RPATH_OPT="-R"
16008         ;;
16009 *)
16010         ;;
16011 esac
16012 echo "$as_me:16012: result: $LD_RPATH_OPT" >&5
16013 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16014
16015 case "x$LD_RPATH_OPT" in #(vi
16016 x-R*)
16017         echo "$as_me:16017: checking if we need a space after rpath option" >&5
16018 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16019         cf_save_LIBS="$LIBS"
16020         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
16021         cat >conftest.$ac_ext <<_ACEOF
16022 #line 16022 "configure"
16023 #include "confdefs.h"
16024
16025 int
16026 main ()
16027 {
16028
16029   ;
16030   return 0;
16031 }
16032 _ACEOF
16033 rm -f conftest.$ac_objext conftest$ac_exeext
16034 if { (eval echo "$as_me:16034: \"$ac_link\"") >&5
16035   (eval $ac_link) 2>&5
16036   ac_status=$?
16037   echo "$as_me:16037: \$? = $ac_status" >&5
16038   (exit $ac_status); } &&
16039          { ac_try='test -s conftest$ac_exeext'
16040   { (eval echo "$as_me:16040: \"$ac_try\"") >&5
16041   (eval $ac_try) 2>&5
16042   ac_status=$?
16043   echo "$as_me:16043: \$? = $ac_status" >&5
16044   (exit $ac_status); }; }; then
16045   cf_rpath_space=no
16046 else
16047   echo "$as_me: failed program was:" >&5
16048 cat conftest.$ac_ext >&5
16049 cf_rpath_space=yes
16050 fi
16051 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16052         LIBS="$cf_save_LIBS"
16053         echo "$as_me:16053: result: $cf_rpath_space" >&5
16054 echo "${ECHO_T}$cf_rpath_space" >&6
16055         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16056         ;;
16057 esac
16058
16059 echo "$as_me:16059: checking if rpath-hack should be disabled" >&5
16060 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16061
16062 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16063 if test "${enable_rpath_hack+set}" = set; then
16064   enableval="$enable_rpath_hack"
16065   test "$enableval" != no && enableval=yes
16066   if test "$enableval" != "yes" ; then
16067     cf_disable_rpath_hack=yes
16068   else
16069     cf_disable_rpath_hack=no
16070   fi
16071 else
16072   enableval=yes
16073   cf_disable_rpath_hack=no
16074
16075 fi;
16076 echo "$as_me:16076: result: $cf_disable_rpath_hack" >&5
16077 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16078 if test "$cf_disable_rpath_hack" = no ; then
16079
16080 echo "$as_me:16080: checking for updated LDFLAGS" >&5
16081 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16082 if test -n "$LD_RPATH_OPT" ; then
16083         echo "$as_me:16083: result: maybe" >&5
16084 echo "${ECHO_T}maybe" >&6
16085
16086         for ac_prog in ldd
16087 do
16088   # Extract the first word of "$ac_prog", so it can be a program name with args.
16089 set dummy $ac_prog; ac_word=$2
16090 echo "$as_me:16090: checking for $ac_word" >&5
16091 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16092 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16093   echo $ECHO_N "(cached) $ECHO_C" >&6
16094 else
16095   if test -n "$cf_ldd_prog"; then
16096   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16097 else
16098   ac_save_IFS=$IFS; IFS=$ac_path_separator
16099 ac_dummy="$PATH"
16100 for ac_dir in $ac_dummy; do
16101   IFS=$ac_save_IFS
16102   test -z "$ac_dir" && ac_dir=.
16103   $as_executable_p "$ac_dir/$ac_word" || continue
16104 ac_cv_prog_cf_ldd_prog="$ac_prog"
16105 echo "$as_me:16105: found $ac_dir/$ac_word" >&5
16106 break
16107 done
16108
16109 fi
16110 fi
16111 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16112 if test -n "$cf_ldd_prog"; then
16113   echo "$as_me:16113: result: $cf_ldd_prog" >&5
16114 echo "${ECHO_T}$cf_ldd_prog" >&6
16115 else
16116   echo "$as_me:16116: result: no" >&5
16117 echo "${ECHO_T}no" >&6
16118 fi
16119
16120   test -n "$cf_ldd_prog" && break
16121 done
16122 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16123
16124         cf_rpath_list="/usr/lib /lib"
16125         if test "$cf_ldd_prog" != no
16126         then
16127                 cf_rpath_oops=
16128
16129 cat >conftest.$ac_ext <<_ACEOF
16130 #line 16130 "configure"
16131 #include "confdefs.h"
16132 #include <stdio.h>
16133 int
16134 main ()
16135 {
16136 printf("Hello");
16137   ;
16138   return 0;
16139 }
16140 _ACEOF
16141 rm -f conftest.$ac_objext conftest$ac_exeext
16142 if { (eval echo "$as_me:16142: \"$ac_link\"") >&5
16143   (eval $ac_link) 2>&5
16144   ac_status=$?
16145   echo "$as_me:16145: \$? = $ac_status" >&5
16146   (exit $ac_status); } &&
16147          { ac_try='test -s conftest$ac_exeext'
16148   { (eval echo "$as_me:16148: \"$ac_try\"") >&5
16149   (eval $ac_try) 2>&5
16150   ac_status=$?
16151   echo "$as_me:16151: \$? = $ac_status" >&5
16152   (exit $ac_status); }; }; then
16153   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
16154                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
16155 else
16156   echo "$as_me: failed program was:" >&5
16157 cat conftest.$ac_ext >&5
16158 fi
16159 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16160
16161                 # If we passed the link-test, but get a "not found" on a given library,
16162                 # this could be due to inept reconfiguration of gcc to make it only
16163                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16164                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16165                 # /usr/local libraries.
16166                 if test -n "$cf_rpath_oops"
16167                 then
16168                         for cf_rpath_src in $cf_rpath_oops
16169                         do
16170                                 for cf_rpath_dir in \
16171                                         /usr/local \
16172                                         /usr/pkg \
16173                                         /opt/sfw
16174                                 do
16175                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16176                                         then
16177                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16178
16179 echo "${as_me:-configure}:16179: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16180
16181                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16182                                                 break
16183                                         fi
16184                                 done
16185                         done
16186                 fi
16187         fi
16188
16189         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16190
16191 echo "${as_me:-configure}:16191: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16192
16193 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16194
16195 echo "${as_me:-configure}:16195: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16196
16197 cf_rpath_dst=
16198 for cf_rpath_src in $LDFLAGS
16199 do
16200         case $cf_rpath_src in #(vi
16201         -L*) #(vi
16202
16203                 # check if this refers to a directory which we will ignore
16204                 cf_rpath_skip=no
16205                 if test -n "$cf_rpath_list"
16206                 then
16207                         for cf_rpath_item in $cf_rpath_list
16208                         do
16209                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16210                                 then
16211                                         cf_rpath_skip=yes
16212                                         break
16213                                 fi
16214                         done
16215                 fi
16216
16217                 if test "$cf_rpath_skip" = no
16218                 then
16219                         # transform the option
16220                         if test "$LD_RPATH_OPT" = "-R " ; then
16221                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16222                         else
16223                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16224                         fi
16225
16226                         # if we have not already added this, add it now
16227                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16228                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16229                         then
16230                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16231
16232 echo "${as_me:-configure}:16232: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16233
16234                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16235                         fi
16236                 fi
16237                 ;;
16238         esac
16239         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16240 done
16241 LDFLAGS=$cf_rpath_dst
16242
16243 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16244
16245 echo "${as_me:-configure}:16245: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16246
16247 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16248
16249 echo "${as_me:-configure}:16249: testing ...checking LIBS $LIBS ..." 1>&5
16250
16251 cf_rpath_dst=
16252 for cf_rpath_src in $LIBS
16253 do
16254         case $cf_rpath_src in #(vi
16255         -L*) #(vi
16256
16257                 # check if this refers to a directory which we will ignore
16258                 cf_rpath_skip=no
16259                 if test -n "$cf_rpath_list"
16260                 then
16261                         for cf_rpath_item in $cf_rpath_list
16262                         do
16263                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16264                                 then
16265                                         cf_rpath_skip=yes
16266                                         break
16267                                 fi
16268                         done
16269                 fi
16270
16271                 if test "$cf_rpath_skip" = no
16272                 then
16273                         # transform the option
16274                         if test "$LD_RPATH_OPT" = "-R " ; then
16275                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16276                         else
16277                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16278                         fi
16279
16280                         # if we have not already added this, add it now
16281                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16282                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16283                         then
16284                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16285
16286 echo "${as_me:-configure}:16286: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16287
16288                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16289                         fi
16290                 fi
16291                 ;;
16292         esac
16293         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16294 done
16295 LIBS=$cf_rpath_dst
16296
16297 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16298
16299 echo "${as_me:-configure}:16299: testing ...checked LIBS $LIBS ..." 1>&5
16300
16301         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16302
16303 echo "${as_me:-configure}:16303: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16304
16305 fi
16306
16307 fi
16308
16309 TEST_ARGS="$LIBS"
16310 LIBS=
16311
16312 ac_config_files="$ac_config_files Makefile"
16313 ac_config_commands="$ac_config_commands default"
16314 cat >confcache <<\_ACEOF
16315 # This file is a shell script that caches the results of configure
16316 # tests run on this system so they can be shared between configure
16317 # scripts and configure runs, see configure's option --config-cache.
16318 # It is not useful on other systems.  If it contains results you don't
16319 # want to keep, you may remove or edit it.
16320 #
16321 # config.status only pays attention to the cache file if you give it
16322 # the --recheck option to rerun configure.
16323 #
16324 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16325 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16326 # following values.
16327
16328 _ACEOF
16329
16330 # The following way of writing the cache mishandles newlines in values,
16331 # but we know of no workaround that is simple, portable, and efficient.
16332 # So, don't put newlines in cache variables' values.
16333 # Ultrix sh set writes to stderr and can't be redirected directly,
16334 # and sets the high bit in the cache file unless we assign to the vars.
16335 {
16336   (set) 2>&1 |
16337     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16338     *ac_space=\ *)
16339       # `set' does not quote correctly, so add quotes (double-quote
16340       # substitution turns \\\\ into \\, and sed turns \\ into \).
16341       sed -n \
16342         "s/'/'\\\\''/g;
16343           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16344       ;;
16345     *)
16346       # `set' quotes correctly as required by POSIX, so do not add quotes.
16347       sed -n \
16348         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16349       ;;
16350     esac;
16351 } |
16352   sed '
16353      t clear
16354      : clear
16355      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16356      t end
16357      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16358      : end' >>confcache
16359 if cmp -s $cache_file confcache; then :; else
16360   if test -w $cache_file; then
16361     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16362     cat confcache >$cache_file
16363   else
16364     echo "not updating unwritable cache $cache_file"
16365   fi
16366 fi
16367 rm -f confcache
16368
16369 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16370 # Let make expand exec_prefix.
16371 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16372
16373 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16374 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16375 # trailing colons and then remove the whole line if VPATH becomes empty
16376 # (actually we leave an empty line to preserve line numbers).
16377 if test "x$srcdir" = x.; then
16378   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16379 s/:*\$(srcdir):*/:/;
16380 s/:*\${srcdir}:*/:/;
16381 s/:*@srcdir@:*/:/;
16382 s/^\([^=]*=[    ]*\):*/\1/;
16383 s/:*$//;
16384 s/^[^=]*=[      ]*$//;
16385 }'
16386 fi
16387
16388 DEFS=-DHAVE_CONFIG_H
16389
16390 : ${CONFIG_STATUS=./config.status}
16391 ac_clean_files_save=$ac_clean_files
16392 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16393 { echo "$as_me:16393: creating $CONFIG_STATUS" >&5
16394 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16395 cat >$CONFIG_STATUS <<_ACEOF
16396 #! $SHELL
16397 # Generated automatically by configure.
16398 # Run this file to recreate the current configuration.
16399 # Compiler output produced by configure, useful for debugging
16400 # configure, is in config.log if it exists.
16401
16402 debug=false
16403 SHELL=\${CONFIG_SHELL-$SHELL}
16404 ac_cs_invocation="\$0 \$@"
16405
16406 _ACEOF
16407
16408 cat >>$CONFIG_STATUS <<\_ACEOF
16409 # Be Bourne compatible
16410 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16411   emulate sh
16412   NULLCMD=:
16413 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16414   set -o posix
16415 fi
16416
16417 # Name of the executable.
16418 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16419
16420 if expr a : '\(a\)' >/dev/null 2>&1; then
16421   as_expr=expr
16422 else
16423   as_expr=false
16424 fi
16425
16426 rm -f conf$$ conf$$.exe conf$$.file
16427 echo >conf$$.file
16428 if ln -s conf$$.file conf$$ 2>/dev/null; then
16429   # We could just check for DJGPP; but this test a) works b) is more generic
16430   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16431   if test -f conf$$.exe; then
16432     # Don't use ln at all; we don't have any links
16433     as_ln_s='cp -p'
16434   else
16435     as_ln_s='ln -s'
16436   fi
16437 elif ln conf$$.file conf$$ 2>/dev/null; then
16438   as_ln_s=ln
16439 else
16440   as_ln_s='cp -p'
16441 fi
16442 rm -f conf$$ conf$$.exe conf$$.file
16443
16444 as_executable_p="test -f"
16445
16446 # Support unset when possible.
16447 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16448   as_unset=unset
16449 else
16450   as_unset=false
16451 fi
16452
16453 # NLS nuisances.
16454 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16455 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16456 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16457 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16458 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16459 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16460 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16461 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16462
16463 # IFS
16464 # We need space, tab and new line, in precisely that order.
16465 as_nl='
16466 '
16467 IFS="   $as_nl"
16468
16469 # CDPATH.
16470 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16471
16472 exec 6>&1
16473
16474 _ACEOF
16475
16476 # Files that config.status was made for.
16477 if test -n "$ac_config_files"; then
16478   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16479 fi
16480
16481 if test -n "$ac_config_headers"; then
16482   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16483 fi
16484
16485 if test -n "$ac_config_links"; then
16486   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16487 fi
16488
16489 if test -n "$ac_config_commands"; then
16490   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16491 fi
16492
16493 cat >>$CONFIG_STATUS <<\EOF
16494
16495 ac_cs_usage="\
16496 \`$as_me' instantiates files from templates according to the
16497 current configuration.
16498
16499 Usage: $0 [OPTIONS] [FILE]...
16500
16501   -h, --help       print this help, then exit
16502   -V, --version    print version number, then exit
16503   -d, --debug      don't remove temporary files
16504       --recheck    update $as_me by reconfiguring in the same conditions
16505   --file=FILE[:TEMPLATE]
16506                    instantiate the configuration file FILE
16507   --header=FILE[:TEMPLATE]
16508                    instantiate the configuration header FILE
16509
16510 Configuration files:
16511 $config_files
16512
16513 Configuration headers:
16514 $config_headers
16515
16516 Configuration commands:
16517 $config_commands
16518
16519 Report bugs to <dickey@invisible-island.net>."
16520 EOF
16521
16522 cat >>$CONFIG_STATUS <<EOF
16523 ac_cs_version="\\
16524 config.status
16525 configured by $0, generated by GNU Autoconf 2.52.20120310,
16526   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16527
16528 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16529 Free Software Foundation, Inc.
16530 This config.status script is free software; the Free Software Foundation
16531 gives unlimited permission to copy, distribute and modify it."
16532 srcdir=$srcdir
16533 INSTALL="$INSTALL"
16534 EOF
16535
16536 cat >>$CONFIG_STATUS <<\EOF
16537 # If no file are specified by the user, then we need to provide default
16538 # value.  By we need to know if files were specified by the user.
16539 ac_need_defaults=:
16540 while test $# != 0
16541 do
16542   case $1 in
16543   --*=*)
16544     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16545     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16546     shift
16547     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16548     shift
16549     ;;
16550   -*);;
16551   *) # This is not an option, so the user has probably given explicit
16552      # arguments.
16553      ac_need_defaults=false;;
16554   esac
16555
16556   case $1 in
16557   # Handling of the options.
16558 EOF
16559 cat >>$CONFIG_STATUS <<EOF
16560   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16561     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16562     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16563 EOF
16564 cat >>$CONFIG_STATUS <<\EOF
16565   --version | --vers* | -V )
16566     echo "$ac_cs_version"; exit 0 ;;
16567   --he | --h)
16568     # Conflict between --help and --header
16569     { { echo "$as_me:16569: error: ambiguous option: $1
16570 Try \`$0 --help' for more information." >&5
16571 echo "$as_me: error: ambiguous option: $1
16572 Try \`$0 --help' for more information." >&2;}
16573    { (exit 1); exit 1; }; };;
16574   --help | --hel | -h )
16575     echo "$ac_cs_usage"; exit 0 ;;
16576   --debug | --d* | -d )
16577     debug=: ;;
16578   --file | --fil | --fi | --f )
16579     shift
16580     CONFIG_FILES="$CONFIG_FILES $1"
16581     ac_need_defaults=false;;
16582   --header | --heade | --head | --hea )
16583     shift
16584     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16585     ac_need_defaults=false;;
16586
16587   # This is an error.
16588   -*) { { echo "$as_me:16588: error: unrecognized option: $1
16589 Try \`$0 --help' for more information." >&5
16590 echo "$as_me: error: unrecognized option: $1
16591 Try \`$0 --help' for more information." >&2;}
16592    { (exit 1); exit 1; }; } ;;
16593
16594   *) ac_config_targets="$ac_config_targets $1" ;;
16595
16596   esac
16597   shift
16598 done
16599
16600 exec 5>>config.log
16601 cat >&5 << _ACEOF
16602
16603 ## ----------------------- ##
16604 ## Running config.status.  ##
16605 ## ----------------------- ##
16606
16607 This file was extended by $as_me 2.52.20120310, executed with
16608   CONFIG_FILES    = $CONFIG_FILES
16609   CONFIG_HEADERS  = $CONFIG_HEADERS
16610   CONFIG_LINKS    = $CONFIG_LINKS
16611   CONFIG_COMMANDS = $CONFIG_COMMANDS
16612   > $ac_cs_invocation
16613 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16614
16615 _ACEOF
16616 EOF
16617
16618 cat >>$CONFIG_STATUS <<EOF
16619 #
16620 # INIT-COMMANDS section.
16621 #
16622
16623 AWK="$AWK"
16624 ECHO_CC="$ECHO_CC"
16625 ECHO_LD="$ECHO_LD"
16626 SHOW_CC="$SHOW_LD"
16627
16628 EOF
16629
16630 cat >>$CONFIG_STATUS <<\EOF
16631 for ac_config_target in $ac_config_targets
16632 do
16633   case "$ac_config_target" in
16634   # Handling of arguments.
16635   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16636   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16637   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16638   *) { { echo "$as_me:16638: error: invalid argument: $ac_config_target" >&5
16639 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16640    { (exit 1); exit 1; }; };;
16641   esac
16642 done
16643
16644 # If the user did not use the arguments to specify the items to instantiate,
16645 # then the envvar interface is used.  Set only those that are not.
16646 # We use the long form for the default assignment because of an extremely
16647 # bizarre bug on SunOS 4.1.3.
16648 if $ac_need_defaults; then
16649   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16650   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16651   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16652 fi
16653
16654 # Create a temporary directory, and hook for its removal unless debugging.
16655 $debug ||
16656 {
16657   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16658   trap '{ (exit 1); exit 1; }' 1 2 13 15
16659 }
16660
16661 # Create a (secure) tmp directory for tmp files.
16662 : ${TMPDIR=/tmp}
16663 {
16664   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16665   test -n "$tmp" && test -d "$tmp"
16666 }  ||
16667 {
16668   tmp=$TMPDIR/cs$$-$RANDOM
16669   (umask 077 && mkdir $tmp)
16670 } ||
16671 {
16672    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16673    { (exit 1); exit 1; }
16674 }
16675
16676 EOF
16677
16678 cat >>$CONFIG_STATUS <<EOF
16679
16680 #
16681 # CONFIG_FILES section.
16682 #
16683
16684 # No need to generate the scripts if there are no CONFIG_FILES.
16685 # This happens for instance when ./config.status config.h
16686 if test -n "\$CONFIG_FILES"; then
16687   # Protect against being on the right side of a sed subst in config.status.
16688   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16689    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16690 s,@SHELL@,$SHELL,;t t
16691 s,@exec_prefix@,$exec_prefix,;t t
16692 s,@prefix@,$prefix,;t t
16693 s,@program_transform_name@,$program_transform_name,;t t
16694 s,@bindir@,$bindir,;t t
16695 s,@sbindir@,$sbindir,;t t
16696 s,@libexecdir@,$libexecdir,;t t
16697 s,@datadir@,$datadir,;t t
16698 s,@sysconfdir@,$sysconfdir,;t t
16699 s,@sharedstatedir@,$sharedstatedir,;t t
16700 s,@localstatedir@,$localstatedir,;t t
16701 s,@libdir@,$libdir,;t t
16702 s,@includedir@,$includedir,;t t
16703 s,@oldincludedir@,$oldincludedir,;t t
16704 s,@infodir@,$infodir,;t t
16705 s,@mandir@,$mandir,;t t
16706 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16707 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16708 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16709 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16710 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16711 s,@build_alias@,$build_alias,;t t
16712 s,@host_alias@,$host_alias,;t t
16713 s,@target_alias@,$target_alias,;t t
16714 s,@ECHO_C@,$ECHO_C,;t t
16715 s,@ECHO_N@,$ECHO_N,;t t
16716 s,@ECHO_T@,$ECHO_T,;t t
16717 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16718 s,@DEFS@,$DEFS,;t t
16719 s,@LIBS@,$LIBS,;t t
16720 s,@build@,$build,;t t
16721 s,@build_cpu@,$build_cpu,;t t
16722 s,@build_vendor@,$build_vendor,;t t
16723 s,@build_os@,$build_os,;t t
16724 s,@host@,$host,;t t
16725 s,@host_cpu@,$host_cpu,;t t
16726 s,@host_vendor@,$host_vendor,;t t
16727 s,@host_os@,$host_os,;t t
16728 s,@SET_MAKE@,$SET_MAKE,;t t
16729 s,@CC@,$CC,;t t
16730 s,@CFLAGS@,$CFLAGS,;t t
16731 s,@LDFLAGS@,$LDFLAGS,;t t
16732 s,@CPPFLAGS@,$CPPFLAGS,;t t
16733 s,@ac_ct_CC@,$ac_ct_CC,;t t
16734 s,@EXEEXT@,$EXEEXT,;t t
16735 s,@OBJEXT@,$OBJEXT,;t t
16736 s,@CPP@,$CPP,;t t
16737 s,@AWK@,$AWK,;t t
16738 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16739 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16740 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16741 s,@LINT@,$LINT,;t t
16742 s,@LINT_OPTS@,$LINT_OPTS,;t t
16743 s,@CTAGS@,$CTAGS,;t t
16744 s,@ETAGS@,$ETAGS,;t t
16745 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16746 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16747 s,@MATH_LIB@,$MATH_LIB,;t t
16748 s,@top_builddir@,$top_builddir,;t t
16749 s,@CC_G_OPT@,$CC_G_OPT,;t t
16750 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16751 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16752 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16753 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16754 s,@LD@,$LD,;t t
16755 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16756 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16757 s,@LD_MODEL@,$LD_MODEL,;t t
16758 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16759 s,@LIBTOOL@,$LIBTOOL,;t t
16760 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16761 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16762 s,@LIB_LINK@,$LIB_LINK,;t t
16763 s,@LINK_TESTS@,$LINK_TESTS,;t t
16764 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16765 s,@PTHREAD@,$PTHREAD,;t t
16766 s,@TEST_ARGS@,$TEST_ARGS,;t t
16767 s,@TEST_DEPS@,$TEST_DEPS,;t t
16768 s,@TEST_LIBS@,$TEST_LIBS,;t t
16769 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16770 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16771 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16772 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16773 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16774 s,@ECHO_LT@,$ECHO_LT,;t t
16775 s,@ECHO_LD@,$ECHO_LD,;t t
16776 s,@RULE_CC@,$RULE_CC,;t t
16777 s,@SHOW_CC@,$SHOW_CC,;t t
16778 s,@ECHO_CC@,$ECHO_CC,;t t
16779 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16780 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16781 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16782 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16783 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16784 s,@X_CFLAGS@,$X_CFLAGS,;t t
16785 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16786 s,@X_LIBS@,$X_LIBS,;t t
16787 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16788 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16789 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16790 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16791 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16792 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16793 CEOF
16794
16795 EOF
16796
16797   cat >>$CONFIG_STATUS <<\EOF
16798   # Split the substitutions into bite-sized pieces for seds with
16799   # small command number limits, like on Digital OSF/1 and HP-UX.
16800   ac_max_sed_lines=48
16801   ac_sed_frag=1 # Number of current file.
16802   ac_beg=1 # First line for current file.
16803   ac_end=$ac_max_sed_lines # Line after last line for current file.
16804   ac_more_lines=:
16805   ac_sed_cmds=
16806   while $ac_more_lines; do
16807     if test $ac_beg -gt 1; then
16808       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16809     else
16810       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16811     fi
16812     if test ! -s $tmp/subs.frag; then
16813       ac_more_lines=false
16814     else
16815       # The purpose of the label and of the branching condition is to
16816       # speed up the sed processing (if there are no `@' at all, there
16817       # is no need to browse any of the substitutions).
16818       # These are the two extra sed commands mentioned above.
16819       (echo ':t
16820   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16821       if test -z "$ac_sed_cmds"; then
16822         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16823       else
16824         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16825       fi
16826       ac_sed_frag=`expr $ac_sed_frag + 1`
16827       ac_beg=$ac_end
16828       ac_end=`expr $ac_end + $ac_max_sed_lines`
16829     fi
16830   done
16831   if test -z "$ac_sed_cmds"; then
16832     ac_sed_cmds=cat
16833   fi
16834 fi # test -n "$CONFIG_FILES"
16835
16836 EOF
16837 cat >>$CONFIG_STATUS <<\EOF
16838 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16839   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16840   case $ac_file in
16841   - | *:- | *:-:* ) # input from stdin
16842         cat >$tmp/stdin
16843         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16844         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16845   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16846         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16847   * )   ac_file_in=$ac_file.in ;;
16848   esac
16849
16850   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16851   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16852          X"$ac_file" : 'X\(//\)[^/]' \| \
16853          X"$ac_file" : 'X\(//\)$' \| \
16854          X"$ac_file" : 'X\(/\)' \| \
16855          .     : '\(.\)' 2>/dev/null ||
16856 echo X"$ac_file" |
16857     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16858           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16859           /^X\(\/\/\)$/{ s//\1/; q; }
16860           /^X\(\/\).*/{ s//\1/; q; }
16861           s/.*/./; q'`
16862   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16863     { case "$ac_dir" in
16864   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16865   *)                      as_incr_dir=.;;
16866 esac
16867 as_dummy="$ac_dir"
16868 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16869   case $as_mkdir_dir in
16870     # Skip DOS drivespec
16871     ?:) as_incr_dir=$as_mkdir_dir ;;
16872     *)
16873       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16874       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16875     ;;
16876   esac
16877 done; }
16878
16879     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16880     # A "../" for each directory in $ac_dir_suffix.
16881     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16882   else
16883     ac_dir_suffix= ac_dots=
16884   fi
16885
16886   case $srcdir in
16887   .)  ac_srcdir=.
16888       if test -z "$ac_dots"; then
16889          ac_top_srcdir=.
16890       else
16891          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16892       fi ;;
16893   [\\/]* | ?:[\\/]* )
16894       ac_srcdir=$srcdir$ac_dir_suffix;
16895       ac_top_srcdir=$srcdir ;;
16896   *) # Relative path.
16897     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16898     ac_top_srcdir=$ac_dots$srcdir ;;
16899   esac
16900
16901   case $INSTALL in
16902   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16903   *) ac_INSTALL=$ac_dots$INSTALL ;;
16904   esac
16905
16906   if test x"$ac_file" != x-; then
16907     { echo "$as_me:16907: creating $ac_file" >&5
16908 echo "$as_me: creating $ac_file" >&6;}
16909     rm -f "$ac_file"
16910   fi
16911   # Let's still pretend it is `configure' which instantiates (i.e., don't
16912   # use $as_me), people would be surprised to read:
16913   #    /* config.h.  Generated automatically by config.status.  */
16914   configure_input="Generated automatically from `echo $ac_file_in |
16915                                                  sed 's,.*/,,'` by configure."
16916
16917   # First look for the input files in the build tree, otherwise in the
16918   # src tree.
16919   ac_file_inputs=`IFS=:
16920     for f in $ac_file_in; do
16921       case $f in
16922       -) echo $tmp/stdin ;;
16923       [\\/$]*)
16924          # Absolute (can't be DOS-style, as IFS=:)
16925          test -f "$f" || { { echo "$as_me:16925: error: cannot find input file: $f" >&5
16926 echo "$as_me: error: cannot find input file: $f" >&2;}
16927    { (exit 1); exit 1; }; }
16928          echo $f;;
16929       *) # Relative
16930          if test -f "$f"; then
16931            # Build tree
16932            echo $f
16933          elif test -f "$srcdir/$f"; then
16934            # Source tree
16935            echo $srcdir/$f
16936          else
16937            # /dev/null tree
16938            { { echo "$as_me:16938: error: cannot find input file: $f" >&5
16939 echo "$as_me: error: cannot find input file: $f" >&2;}
16940    { (exit 1); exit 1; }; }
16941          fi;;
16942       esac
16943     done` || { (exit 1); exit 1; }
16944 EOF
16945 cat >>$CONFIG_STATUS <<EOF
16946   sed "$ac_vpsub
16947 $extrasub
16948 EOF
16949 cat >>$CONFIG_STATUS <<\EOF
16950 :t
16951 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
16952 s,@configure_input@,$configure_input,;t t
16953 s,@srcdir@,$ac_srcdir,;t t
16954 s,@top_srcdir@,$ac_top_srcdir,;t t
16955 s,@INSTALL@,$ac_INSTALL,;t t
16956 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
16957   rm -f $tmp/stdin
16958   if test x"$ac_file" != x-; then
16959     mv $tmp/out $ac_file
16960   else
16961     cat $tmp/out
16962     rm -f $tmp/out
16963   fi
16964
16965 done
16966 EOF
16967 cat >>$CONFIG_STATUS <<\EOF
16968
16969 #
16970 # CONFIG_HEADER section.
16971 #
16972
16973 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
16974 # NAME is the cpp macro being defined and VALUE is the value it is being given.
16975 #
16976 # ac_d sets the value in "#define NAME VALUE" lines.
16977 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
16978 ac_dB='[        ].*$,\1#\2'
16979 ac_dC=' '
16980 ac_dD=',;t'
16981 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
16982 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16983 ac_iB='\([      ]\),\1#\2define\3'
16984 ac_iC=' '
16985 ac_iD='\4,;t'
16986 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
16987 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
16988 ac_uB='$,\1#\2define\3'
16989 ac_uC=' '
16990 ac_uD=',;t'
16991
16992 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
16993   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16994   case $ac_file in
16995   - | *:- | *:-:* ) # input from stdin
16996         cat >$tmp/stdin
16997         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16998         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16999   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17000         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17001   * )   ac_file_in=$ac_file.in ;;
17002   esac
17003
17004   test x"$ac_file" != x- && { echo "$as_me:17004: creating $ac_file" >&5
17005 echo "$as_me: creating $ac_file" >&6;}
17006
17007   # First look for the input files in the build tree, otherwise in the
17008   # src tree.
17009   ac_file_inputs=`IFS=:
17010     for f in $ac_file_in; do
17011       case $f in
17012       -) echo $tmp/stdin ;;
17013       [\\/$]*)
17014          # Absolute (can't be DOS-style, as IFS=:)
17015          test -f "$f" || { { echo "$as_me:17015: error: cannot find input file: $f" >&5
17016 echo "$as_me: error: cannot find input file: $f" >&2;}
17017    { (exit 1); exit 1; }; }
17018          echo $f;;
17019       *) # Relative
17020          if test -f "$f"; then
17021            # Build tree
17022            echo $f
17023          elif test -f "$srcdir/$f"; then
17024            # Source tree
17025            echo $srcdir/$f
17026          else
17027            # /dev/null tree
17028            { { echo "$as_me:17028: error: cannot find input file: $f" >&5
17029 echo "$as_me: error: cannot find input file: $f" >&2;}
17030    { (exit 1); exit 1; }; }
17031          fi;;
17032       esac
17033     done` || { (exit 1); exit 1; }
17034   # Remove the trailing spaces.
17035   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17036
17037 EOF
17038
17039 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17040 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17041 # be either 'cat' or 'sort'.
17042 cat confdefs.h | uniq >conftest.vals
17043
17044 # Break up conftest.vals because some shells have a limit on
17045 # the size of here documents, and old seds have small limits too.
17046
17047 rm -f conftest.tail
17048 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17049 while grep . conftest.vals >/dev/null
17050 do
17051   # Write chunks of a limited-size here document to conftest.frag.
17052   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17053   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17054   echo 'CEOF' >> $CONFIG_STATUS
17055   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17056   rm -f conftest.vals
17057   mv conftest.tail conftest.vals
17058 done
17059 rm -f conftest.vals
17060
17061 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17062 # marker @DEFS@.
17063 echo '  cat >> conftest.edit <<CEOF
17064 /@DEFS@/r conftest.frag
17065 /@DEFS@/d
17066 CEOF
17067 sed -f conftest.edit $tmp/in > $tmp/out
17068 rm -f $tmp/in
17069 mv $tmp/out $tmp/in
17070 rm -f conftest.edit conftest.frag
17071 ' >> $CONFIG_STATUS
17072
17073 cat >>$CONFIG_STATUS <<\EOF
17074   # Let's still pretend it is `configure' which instantiates (i.e., don't
17075   # use $as_me), people would be surprised to read:
17076   #    /* config.h.  Generated automatically by config.status.  */
17077   if test x"$ac_file" = x-; then
17078     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17079   else
17080     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17081   fi
17082   cat $tmp/in >>$tmp/config.h
17083   rm -f $tmp/in
17084   if test x"$ac_file" != x-; then
17085     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17086       { echo "$as_me:17086: $ac_file is unchanged" >&5
17087 echo "$as_me: $ac_file is unchanged" >&6;}
17088     else
17089       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17090          X"$ac_file" : 'X\(//\)[^/]' \| \
17091          X"$ac_file" : 'X\(//\)$' \| \
17092          X"$ac_file" : 'X\(/\)' \| \
17093          .     : '\(.\)' 2>/dev/null ||
17094 echo X"$ac_file" |
17095     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17096           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17097           /^X\(\/\/\)$/{ s//\1/; q; }
17098           /^X\(\/\).*/{ s//\1/; q; }
17099           s/.*/./; q'`
17100       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17101         { case "$ac_dir" in
17102   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17103   *)                      as_incr_dir=.;;
17104 esac
17105 as_dummy="$ac_dir"
17106 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17107   case $as_mkdir_dir in
17108     # Skip DOS drivespec
17109     ?:) as_incr_dir=$as_mkdir_dir ;;
17110     *)
17111       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17112       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17113     ;;
17114   esac
17115 done; }
17116
17117       fi
17118       rm -f $ac_file
17119       mv $tmp/config.h $ac_file
17120     fi
17121   else
17122     cat $tmp/config.h
17123     rm -f $tmp/config.h
17124   fi
17125 done
17126 EOF
17127 cat >>$CONFIG_STATUS <<\EOF
17128 #
17129 # CONFIG_COMMANDS section.
17130 #
17131 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17132   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17133   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17134
17135   case $ac_dest in
17136     default )
17137
17138 for cf_dir in .
17139 do
17140         if test ! -d $srcdir/$cf_dir; then
17141                 continue
17142         elif test -f $srcdir/$cf_dir/programs; then
17143                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17144         fi
17145 done
17146
17147         cat >>Makefile <<TEST_EOF
17148
17149 # These rules are generated so we do not rely on suffix rules, which do not
17150 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17151 # some, and the '\$x' confuses others).
17152 TEST_EOF
17153
17154 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17155 for N in $LIST
17156 do
17157         cat >>Makefile <<TEST_EOF
17158
17159 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17160         \$(srcdir)/test.priv.h \\
17161         ncurses_cfg.h
17162         $SHOW_CC
17163         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17164 TEST_EOF
17165 done
17166
17167 if test -f ../config.guess && test -f ../config.sub
17168 then
17169         cat >>Makefile <<TEST_EOF
17170
17171 # if we used CF_INHERIT for getting these files, we can remove them
17172 distclean::
17173         rm -f config.guess config.sub
17174 TEST_EOF
17175 fi
17176  ;;
17177   esac
17178 done
17179 EOF
17180
17181 cat >>$CONFIG_STATUS <<\EOF
17182
17183 { (exit 0); exit 0; }
17184 EOF
17185 chmod +x $CONFIG_STATUS
17186 ac_clean_files=$ac_clean_files_save
17187
17188 # configure is writing to config.log, and then calls config.status.
17189 # config.status does its own redirection, appending to config.log.
17190 # Unfortunately, on DOS this fails, as config.log is still kept open
17191 # by configure, so config.status won't be able to write to it; its
17192 # output is simply discarded.  So we exec the FD to /dev/null,
17193 # effectively closing config.log, so it can be properly (re)opened and
17194 # appended to by config.status.  When coming back to configure, we
17195 # need to make the FD available again.
17196 if test "$no_create" != yes; then
17197   ac_cs_success=:
17198   exec 5>/dev/null
17199   $SHELL $CONFIG_STATUS || ac_cs_success=false
17200   exec 5>>config.log
17201   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17202   # would make configure fail if this is the last instruction.
17203   $ac_cs_success || { (exit 1); exit 1; }
17204 fi
17205