]> ncurses.scripts.mit.edu Git - ncurses.git/blob - test/configure
ncurses 5.9 - patch 20120616
[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 CLANG_COMPILER=no
4553
4554 if test "$GCC" = yes ; then
4555         echo "$as_me:4555: checking if this is really Clang C compiler" >&5
4556 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6
4557         cf_save_CFLAGS="$CFLAGS"
4558         CFLAGS="$CFLAGS -Qunused-arguments"
4559         cat >conftest.$ac_ext <<_ACEOF
4560 #line 4560 "configure"
4561 #include "confdefs.h"
4562
4563 int
4564 main ()
4565 {
4566
4567 #ifdef __clang__
4568 #else
4569 make an error
4570 #endif
4571
4572   ;
4573   return 0;
4574 }
4575 _ACEOF
4576 rm -f conftest.$ac_objext
4577 if { (eval echo "$as_me:4577: \"$ac_compile\"") >&5
4578   (eval $ac_compile) 2>&5
4579   ac_status=$?
4580   echo "$as_me:4580: \$? = $ac_status" >&5
4581   (exit $ac_status); } &&
4582          { ac_try='test -s conftest.$ac_objext'
4583   { (eval echo "$as_me:4583: \"$ac_try\"") >&5
4584   (eval $ac_try) 2>&5
4585   ac_status=$?
4586   echo "$as_me:4586: \$? = $ac_status" >&5
4587   (exit $ac_status); }; }; then
4588   CLANG_COMPILER=yes
4589 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
4590
4591 else
4592   echo "$as_me: failed program was:" >&5
4593 cat conftest.$ac_ext >&5
4594 fi
4595 rm -f conftest.$ac_objext conftest.$ac_ext
4596         CFLAGS="$cf_save_CFLAGS"
4597         echo "$as_me:4597: result: $CLANG_COMPILER" >&5
4598 echo "${ECHO_T}$CLANG_COMPILER" >&6
4599 fi
4600
4601 cat > conftest.$ac_ext <<EOF
4602 #line 4602 "${as_me:-configure}"
4603 int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; }
4604 EOF
4605
4606 if test "$INTEL_COMPILER" = yes
4607 then
4608 # The "-wdXXX" options suppress warnings:
4609 # remark #1419: external declaration in primary source file
4610 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
4611 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
4612 # remark #193: zero used for undefined preprocessing identifier
4613 # remark #593: variable "curs_sb_left_arrow" was set but never used
4614 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
4615 # remark #869: parameter "tw" was never referenced
4616 # remark #981: operands are evaluated in unspecified order
4617 # warning #279: controlling expression is constant
4618
4619         { echo "$as_me:4619: checking for $CC warning options..." >&5
4620 echo "$as_me: checking for $CC warning options..." >&6;}
4621         cf_save_CFLAGS="$CFLAGS"
4622         EXTRA_CFLAGS="-Wall"
4623         for cf_opt in \
4624                 wd1419 \
4625                 wd1683 \
4626                 wd1684 \
4627                 wd193 \
4628                 wd593 \
4629                 wd279 \
4630                 wd810 \
4631                 wd869 \
4632                 wd981
4633         do
4634                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4635                 if { (eval echo "$as_me:4635: \"$ac_compile\"") >&5
4636   (eval $ac_compile) 2>&5
4637   ac_status=$?
4638   echo "$as_me:4638: \$? = $ac_status" >&5
4639   (exit $ac_status); }; then
4640                         test -n "$verbose" && echo "$as_me:4640: result: ... -$cf_opt" >&5
4641 echo "${ECHO_T}... -$cf_opt" >&6
4642                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4643                 fi
4644         done
4645         CFLAGS="$cf_save_CFLAGS"
4646
4647 elif test "$GCC" = yes
4648 then
4649         { echo "$as_me:4649: checking for $CC warning options..." >&5
4650 echo "$as_me: checking for $CC warning options..." >&6;}
4651         cf_save_CFLAGS="$CFLAGS"
4652         EXTRA_CFLAGS=
4653         cf_warn_CONST=""
4654         test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
4655         for cf_opt in W Wall \
4656                 Wbad-function-cast \
4657                 Wcast-align \
4658                 Wcast-qual \
4659                 Winline \
4660                 Wmissing-declarations \
4661                 Wmissing-prototypes \
4662                 Wnested-externs \
4663                 Wpointer-arith \
4664                 Wshadow \
4665                 Wstrict-prototypes \
4666                 Wundef $cf_warn_CONST
4667         do
4668                 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
4669                 if { (eval echo "$as_me:4669: \"$ac_compile\"") >&5
4670   (eval $ac_compile) 2>&5
4671   ac_status=$?
4672   echo "$as_me:4672: \$? = $ac_status" >&5
4673   (exit $ac_status); }; then
4674                         test -n "$verbose" && echo "$as_me:4674: result: ... -$cf_opt" >&5
4675 echo "${ECHO_T}... -$cf_opt" >&6
4676                         case $cf_opt in #(vi
4677                         Wcast-qual) #(vi
4678                                 CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES"
4679                                 ;;
4680                         Winline) #(vi
4681                                 case $GCC_VERSION in
4682                                 [34].*)
4683                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4684
4685 echo "${as_me:-configure}:4685: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4686
4687                                         continue;;
4688                                 esac
4689                                 ;;
4690                         Wpointer-arith) #(vi
4691                                 case $GCC_VERSION in
4692                                 [12].*)
4693                                         test -n "$verbose" && echo "    feature is broken in gcc $GCC_VERSION" 1>&6
4694
4695 echo "${as_me:-configure}:4695: testing feature is broken in gcc $GCC_VERSION ..." 1>&5
4696
4697                                         continue;;
4698                                 esac
4699                                 ;;
4700                         esac
4701                         EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
4702                 fi
4703         done
4704         CFLAGS="$cf_save_CFLAGS"
4705 fi
4706 rm -rf conftest*
4707
4708 fi
4709 fi
4710
4711 echo "$as_me:4711: checking if you want to use dmalloc for testing" >&5
4712 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6
4713
4714 # Check whether --with-dmalloc or --without-dmalloc was given.
4715 if test "${with_dmalloc+set}" = set; then
4716   withval="$with_dmalloc"
4717   cat >>confdefs.h <<\EOF
4718 #define USE_DMALLOC 1
4719 EOF
4720
4721         : ${with_cflags:=-g}
4722         : ${with_no_leaks:=yes}
4723          with_dmalloc=yes
4724 else
4725   with_dmalloc=
4726 fi;
4727 echo "$as_me:4727: result: ${with_dmalloc:-no}" >&5
4728 echo "${ECHO_T}${with_dmalloc:-no}" >&6
4729
4730 case .$with_cflags in #(vi
4731 .*-g*)
4732         case .$CFLAGS in #(vi
4733         .*-g*) #(vi
4734                 ;;
4735         *)
4736
4737 cf_fix_cppflags=no
4738 cf_new_cflags=
4739 cf_new_cppflags=
4740 cf_new_extra_cppflags=
4741
4742 for cf_add_cflags in -g
4743 do
4744 case $cf_fix_cppflags in
4745 no)
4746         case $cf_add_cflags in #(vi
4747         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4748                 case $cf_add_cflags in
4749                 -D*)
4750                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4751
4752                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4753                                 && test -z "${cf_tst_cflags}" \
4754                                 && cf_fix_cppflags=yes
4755
4756                         if test $cf_fix_cppflags = yes ; then
4757                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4758                                 continue
4759                         elif test "${cf_tst_cflags}" = "\"'" ; then
4760                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4761                                 continue
4762                         fi
4763                         ;;
4764                 esac
4765                 case "$CPPFLAGS" in
4766                 *$cf_add_cflags) #(vi
4767                         ;;
4768                 *) #(vi
4769                         case $cf_add_cflags in #(vi
4770                         -D*)
4771                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4772
4773 CPPFLAGS=`echo "$CPPFLAGS" | \
4774         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4775                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4776
4777                                 ;;
4778                         esac
4779                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4780                         ;;
4781                 esac
4782                 ;;
4783         *)
4784                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4785                 ;;
4786         esac
4787         ;;
4788 yes)
4789         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4790
4791         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
4792
4793         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4794                 && test -z "${cf_tst_cflags}" \
4795                 && cf_fix_cppflags=no
4796         ;;
4797 esac
4798 done
4799
4800 if test -n "$cf_new_cflags" ; then
4801
4802         CFLAGS="$CFLAGS $cf_new_cflags"
4803 fi
4804
4805 if test -n "$cf_new_cppflags" ; then
4806
4807         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
4808 fi
4809
4810 if test -n "$cf_new_extra_cppflags" ; then
4811
4812         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
4813 fi
4814
4815                 ;;
4816         esac
4817         ;;
4818 esac
4819
4820 if test "$with_dmalloc" = yes ; then
4821         echo "$as_me:4821: checking for dmalloc.h" >&5
4822 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6
4823 if test "${ac_cv_header_dmalloc_h+set}" = set; then
4824   echo $ECHO_N "(cached) $ECHO_C" >&6
4825 else
4826   cat >conftest.$ac_ext <<_ACEOF
4827 #line 4827 "configure"
4828 #include "confdefs.h"
4829 #include <dmalloc.h>
4830 _ACEOF
4831 if { (eval echo "$as_me:4831: \"$ac_cpp conftest.$ac_ext\"") >&5
4832   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
4833   ac_status=$?
4834   egrep -v '^ *\+' conftest.er1 >conftest.err
4835   rm -f conftest.er1
4836   cat conftest.err >&5
4837   echo "$as_me:4837: \$? = $ac_status" >&5
4838   (exit $ac_status); } >/dev/null; then
4839   if test -s conftest.err; then
4840     ac_cpp_err=$ac_c_preproc_warn_flag
4841   else
4842     ac_cpp_err=
4843   fi
4844 else
4845   ac_cpp_err=yes
4846 fi
4847 if test -z "$ac_cpp_err"; then
4848   ac_cv_header_dmalloc_h=yes
4849 else
4850   echo "$as_me: failed program was:" >&5
4851   cat conftest.$ac_ext >&5
4852   ac_cv_header_dmalloc_h=no
4853 fi
4854 rm -f conftest.err conftest.$ac_ext
4855 fi
4856 echo "$as_me:4856: result: $ac_cv_header_dmalloc_h" >&5
4857 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6
4858 if test $ac_cv_header_dmalloc_h = yes; then
4859
4860 echo "$as_me:4860: checking for dmalloc_debug in -ldmalloc" >&5
4861 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6
4862 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then
4863   echo $ECHO_N "(cached) $ECHO_C" >&6
4864 else
4865   ac_check_lib_save_LIBS=$LIBS
4866 LIBS="-ldmalloc  $LIBS"
4867 cat >conftest.$ac_ext <<_ACEOF
4868 #line 4868 "configure"
4869 #include "confdefs.h"
4870
4871 /* Override any gcc2 internal prototype to avoid an error.  */
4872 #ifdef __cplusplus
4873 extern "C"
4874 #endif
4875 /* We use char because int might match the return type of a gcc2
4876    builtin and then its argument prototype would still apply.  */
4877 char dmalloc_debug ();
4878 int
4879 main ()
4880 {
4881 dmalloc_debug ();
4882   ;
4883   return 0;
4884 }
4885 _ACEOF
4886 rm -f conftest.$ac_objext conftest$ac_exeext
4887 if { (eval echo "$as_me:4887: \"$ac_link\"") >&5
4888   (eval $ac_link) 2>&5
4889   ac_status=$?
4890   echo "$as_me:4890: \$? = $ac_status" >&5
4891   (exit $ac_status); } &&
4892          { ac_try='test -s conftest$ac_exeext'
4893   { (eval echo "$as_me:4893: \"$ac_try\"") >&5
4894   (eval $ac_try) 2>&5
4895   ac_status=$?
4896   echo "$as_me:4896: \$? = $ac_status" >&5
4897   (exit $ac_status); }; }; then
4898   ac_cv_lib_dmalloc_dmalloc_debug=yes
4899 else
4900   echo "$as_me: failed program was:" >&5
4901 cat conftest.$ac_ext >&5
4902 ac_cv_lib_dmalloc_dmalloc_debug=no
4903 fi
4904 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
4905 LIBS=$ac_check_lib_save_LIBS
4906 fi
4907 echo "$as_me:4907: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5
4908 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6
4909 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then
4910   cat >>confdefs.h <<EOF
4911 #define HAVE_LIBDMALLOC 1
4912 EOF
4913
4914   LIBS="-ldmalloc $LIBS"
4915
4916 fi
4917
4918 fi
4919
4920 fi
4921
4922 echo "$as_me:4922: checking if you want to use dbmalloc for testing" >&5
4923 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6
4924
4925 # Check whether --with-dbmalloc or --without-dbmalloc was given.
4926 if test "${with_dbmalloc+set}" = set; then
4927   withval="$with_dbmalloc"
4928   cat >>confdefs.h <<\EOF
4929 #define USE_DBMALLOC 1
4930 EOF
4931
4932         : ${with_cflags:=-g}
4933         : ${with_no_leaks:=yes}
4934          with_dbmalloc=yes
4935 else
4936   with_dbmalloc=
4937 fi;
4938 echo "$as_me:4938: result: ${with_dbmalloc:-no}" >&5
4939 echo "${ECHO_T}${with_dbmalloc:-no}" >&6
4940
4941 case .$with_cflags in #(vi
4942 .*-g*)
4943         case .$CFLAGS in #(vi
4944         .*-g*) #(vi
4945                 ;;
4946         *)
4947
4948 cf_fix_cppflags=no
4949 cf_new_cflags=
4950 cf_new_cppflags=
4951 cf_new_extra_cppflags=
4952
4953 for cf_add_cflags in -g
4954 do
4955 case $cf_fix_cppflags in
4956 no)
4957         case $cf_add_cflags in #(vi
4958         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
4959                 case $cf_add_cflags in
4960                 -D*)
4961                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
4962
4963                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
4964                                 && test -z "${cf_tst_cflags}" \
4965                                 && cf_fix_cppflags=yes
4966
4967                         if test $cf_fix_cppflags = yes ; then
4968                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4969                                 continue
4970                         elif test "${cf_tst_cflags}" = "\"'" ; then
4971                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
4972                                 continue
4973                         fi
4974                         ;;
4975                 esac
4976                 case "$CPPFLAGS" in
4977                 *$cf_add_cflags) #(vi
4978                         ;;
4979                 *) #(vi
4980                         case $cf_add_cflags in #(vi
4981                         -D*)
4982                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
4983
4984 CPPFLAGS=`echo "$CPPFLAGS" | \
4985         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
4986                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
4987
4988                                 ;;
4989                         esac
4990                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
4991                         ;;
4992                 esac
4993                 ;;
4994         *)
4995                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
4996                 ;;
4997         esac
4998         ;;
4999 yes)
5000         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5001
5002         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5003
5004         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5005                 && test -z "${cf_tst_cflags}" \
5006                 && cf_fix_cppflags=no
5007         ;;
5008 esac
5009 done
5010
5011 if test -n "$cf_new_cflags" ; then
5012
5013         CFLAGS="$CFLAGS $cf_new_cflags"
5014 fi
5015
5016 if test -n "$cf_new_cppflags" ; then
5017
5018         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5019 fi
5020
5021 if test -n "$cf_new_extra_cppflags" ; then
5022
5023         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5024 fi
5025
5026                 ;;
5027         esac
5028         ;;
5029 esac
5030
5031 if test "$with_dbmalloc" = yes ; then
5032         echo "$as_me:5032: checking for dbmalloc.h" >&5
5033 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6
5034 if test "${ac_cv_header_dbmalloc_h+set}" = set; then
5035   echo $ECHO_N "(cached) $ECHO_C" >&6
5036 else
5037   cat >conftest.$ac_ext <<_ACEOF
5038 #line 5038 "configure"
5039 #include "confdefs.h"
5040 #include <dbmalloc.h>
5041 _ACEOF
5042 if { (eval echo "$as_me:5042: \"$ac_cpp conftest.$ac_ext\"") >&5
5043   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5044   ac_status=$?
5045   egrep -v '^ *\+' conftest.er1 >conftest.err
5046   rm -f conftest.er1
5047   cat conftest.err >&5
5048   echo "$as_me:5048: \$? = $ac_status" >&5
5049   (exit $ac_status); } >/dev/null; then
5050   if test -s conftest.err; then
5051     ac_cpp_err=$ac_c_preproc_warn_flag
5052   else
5053     ac_cpp_err=
5054   fi
5055 else
5056   ac_cpp_err=yes
5057 fi
5058 if test -z "$ac_cpp_err"; then
5059   ac_cv_header_dbmalloc_h=yes
5060 else
5061   echo "$as_me: failed program was:" >&5
5062   cat conftest.$ac_ext >&5
5063   ac_cv_header_dbmalloc_h=no
5064 fi
5065 rm -f conftest.err conftest.$ac_ext
5066 fi
5067 echo "$as_me:5067: result: $ac_cv_header_dbmalloc_h" >&5
5068 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6
5069 if test $ac_cv_header_dbmalloc_h = yes; then
5070
5071 echo "$as_me:5071: checking for debug_malloc in -ldbmalloc" >&5
5072 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6
5073 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then
5074   echo $ECHO_N "(cached) $ECHO_C" >&6
5075 else
5076   ac_check_lib_save_LIBS=$LIBS
5077 LIBS="-ldbmalloc  $LIBS"
5078 cat >conftest.$ac_ext <<_ACEOF
5079 #line 5079 "configure"
5080 #include "confdefs.h"
5081
5082 /* Override any gcc2 internal prototype to avoid an error.  */
5083 #ifdef __cplusplus
5084 extern "C"
5085 #endif
5086 /* We use char because int might match the return type of a gcc2
5087    builtin and then its argument prototype would still apply.  */
5088 char debug_malloc ();
5089 int
5090 main ()
5091 {
5092 debug_malloc ();
5093   ;
5094   return 0;
5095 }
5096 _ACEOF
5097 rm -f conftest.$ac_objext conftest$ac_exeext
5098 if { (eval echo "$as_me:5098: \"$ac_link\"") >&5
5099   (eval $ac_link) 2>&5
5100   ac_status=$?
5101   echo "$as_me:5101: \$? = $ac_status" >&5
5102   (exit $ac_status); } &&
5103          { ac_try='test -s conftest$ac_exeext'
5104   { (eval echo "$as_me:5104: \"$ac_try\"") >&5
5105   (eval $ac_try) 2>&5
5106   ac_status=$?
5107   echo "$as_me:5107: \$? = $ac_status" >&5
5108   (exit $ac_status); }; }; then
5109   ac_cv_lib_dbmalloc_debug_malloc=yes
5110 else
5111   echo "$as_me: failed program was:" >&5
5112 cat conftest.$ac_ext >&5
5113 ac_cv_lib_dbmalloc_debug_malloc=no
5114 fi
5115 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5116 LIBS=$ac_check_lib_save_LIBS
5117 fi
5118 echo "$as_me:5118: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5
5119 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6
5120 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then
5121   cat >>confdefs.h <<EOF
5122 #define HAVE_LIBDBMALLOC 1
5123 EOF
5124
5125   LIBS="-ldbmalloc $LIBS"
5126
5127 fi
5128
5129 fi
5130
5131 fi
5132
5133 echo "$as_me:5133: checking if you want to use valgrind for testing" >&5
5134 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6
5135
5136 # Check whether --with-valgrind or --without-valgrind was given.
5137 if test "${with_valgrind+set}" = set; then
5138   withval="$with_valgrind"
5139   cat >>confdefs.h <<\EOF
5140 #define USE_VALGRIND 1
5141 EOF
5142
5143         : ${with_cflags:=-g}
5144         : ${with_no_leaks:=yes}
5145          with_valgrind=yes
5146 else
5147   with_valgrind=
5148 fi;
5149 echo "$as_me:5149: result: ${with_valgrind:-no}" >&5
5150 echo "${ECHO_T}${with_valgrind:-no}" >&6
5151
5152 case .$with_cflags in #(vi
5153 .*-g*)
5154         case .$CFLAGS in #(vi
5155         .*-g*) #(vi
5156                 ;;
5157         *)
5158
5159 cf_fix_cppflags=no
5160 cf_new_cflags=
5161 cf_new_cppflags=
5162 cf_new_extra_cppflags=
5163
5164 for cf_add_cflags in -g
5165 do
5166 case $cf_fix_cppflags in
5167 no)
5168         case $cf_add_cflags in #(vi
5169         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
5170                 case $cf_add_cflags in
5171                 -D*)
5172                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
5173
5174                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5175                                 && test -z "${cf_tst_cflags}" \
5176                                 && cf_fix_cppflags=yes
5177
5178                         if test $cf_fix_cppflags = yes ; then
5179                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5180                                 continue
5181                         elif test "${cf_tst_cflags}" = "\"'" ; then
5182                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5183                                 continue
5184                         fi
5185                         ;;
5186                 esac
5187                 case "$CPPFLAGS" in
5188                 *$cf_add_cflags) #(vi
5189                         ;;
5190                 *) #(vi
5191                         case $cf_add_cflags in #(vi
5192                         -D*)
5193                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
5194
5195 CPPFLAGS=`echo "$CPPFLAGS" | \
5196         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
5197                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
5198
5199                                 ;;
5200                         esac
5201                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
5202                         ;;
5203                 esac
5204                 ;;
5205         *)
5206                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
5207                 ;;
5208         esac
5209         ;;
5210 yes)
5211         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
5212
5213         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
5214
5215         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
5216                 && test -z "${cf_tst_cflags}" \
5217                 && cf_fix_cppflags=no
5218         ;;
5219 esac
5220 done
5221
5222 if test -n "$cf_new_cflags" ; then
5223
5224         CFLAGS="$CFLAGS $cf_new_cflags"
5225 fi
5226
5227 if test -n "$cf_new_cppflags" ; then
5228
5229         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
5230 fi
5231
5232 if test -n "$cf_new_extra_cppflags" ; then
5233
5234         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
5235 fi
5236
5237                 ;;
5238         esac
5239         ;;
5240 esac
5241
5242 echo "$as_me:5242: checking if you want to perform memory-leak testing" >&5
5243 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6
5244
5245 # Check whether --enable-leaks or --disable-leaks was given.
5246 if test "${enable_leaks+set}" = set; then
5247   enableval="$enable_leaks"
5248   if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
5249 else
5250   : ${with_no_leaks:=no}
5251 fi;
5252 echo "$as_me:5252: result: $with_no_leaks" >&5
5253 echo "${ECHO_T}$with_no_leaks" >&6
5254
5255 if test "$with_no_leaks" = yes ; then
5256         cat >>confdefs.h <<\EOF
5257 #define NO_LEAKS 1
5258 EOF
5259
5260         cat >>confdefs.h <<\EOF
5261 #define YY_NO_LEAKS 1
5262 EOF
5263
5264 fi
5265
5266 echo "$as_me:5266: checking if you want to check for wide-character functions" >&5
5267 echo $ECHO_N "checking if you want to check for wide-character functions... $ECHO_C" >&6
5268
5269 # Check whether --enable-widec or --disable-widec was given.
5270 if test "${enable_widec+set}" = set; then
5271   enableval="$enable_widec"
5272   test "$enableval" != no && enableval=yes
5273   if test "$enableval" != "yes" ; then
5274     cf_enable_widec=no
5275   else
5276     cf_enable_widec=yes
5277   fi
5278 else
5279   enableval=yes
5280   cf_enable_widec=yes
5281
5282 fi;
5283 echo "$as_me:5283: result: $cf_enable_widec" >&5
5284 echo "${ECHO_T}$cf_enable_widec" >&6
5285
5286 echo "$as_me:5286: checking for specific curses-directory" >&5
5287 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6
5288
5289 # Check whether --with-curses-dir or --without-curses-dir was given.
5290 if test "${with_curses_dir+set}" = set; then
5291   withval="$with_curses_dir"
5292   cf_cv_curses_dir=$withval
5293 else
5294   cf_cv_curses_dir=no
5295 fi;
5296 echo "$as_me:5296: result: $cf_cv_curses_dir" >&5
5297 echo "${ECHO_T}$cf_cv_curses_dir" >&6
5298
5299 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
5300 then
5301
5302 if test "x$prefix" != xNONE; then
5303   cf_path_syntax="$prefix"
5304 else
5305   cf_path_syntax="$ac_default_prefix"
5306 fi
5307
5308 case ".$withval" in #(vi
5309 .\$\(*\)*|.\'*\'*) #(vi
5310   ;;
5311 ..|./*|.\\*) #(vi
5312   ;;
5313 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
5314   ;;
5315 .\${*prefix}*) #(vi
5316   eval withval="$withval"
5317   case ".$withval" in #(vi
5318   .NONE/*)
5319     withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5320     ;;
5321   esac
5322   ;; #(vi
5323 .no|.NONE/*)
5324   withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%`
5325   ;;
5326 *)
5327   { { echo "$as_me:5327: error: expected a pathname, not \"$withval\"" >&5
5328 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;}
5329    { (exit 1); exit 1; }; }
5330   ;;
5331 esac
5332
5333         if test -d "$cf_cv_curses_dir"
5334         then
5335
5336 if test -n "$cf_cv_curses_dir/include" ; then
5337   for cf_add_incdir in $cf_cv_curses_dir/include
5338   do
5339         while test $cf_add_incdir != /usr/include
5340         do
5341           if test -d $cf_add_incdir
5342           then
5343                 cf_have_incdir=no
5344                 if test -n "$CFLAGS$CPPFLAGS" ; then
5345                   # a loop is needed to ensure we can add subdirs of existing dirs
5346                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
5347                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
5348                           cf_have_incdir=yes; break
5349                         fi
5350                   done
5351                 fi
5352
5353                 if test "$cf_have_incdir" = no ; then
5354                   if test "$cf_add_incdir" = /usr/local/include ; then
5355                         if test "$GCC" = yes
5356                         then
5357                           cf_save_CPPFLAGS=$CPPFLAGS
5358                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5359                           cat >conftest.$ac_ext <<_ACEOF
5360 #line 5360 "configure"
5361 #include "confdefs.h"
5362 #include <stdio.h>
5363 int
5364 main ()
5365 {
5366 printf("Hello")
5367   ;
5368   return 0;
5369 }
5370 _ACEOF
5371 rm -f conftest.$ac_objext
5372 if { (eval echo "$as_me:5372: \"$ac_compile\"") >&5
5373   (eval $ac_compile) 2>&5
5374   ac_status=$?
5375   echo "$as_me:5375: \$? = $ac_status" >&5
5376   (exit $ac_status); } &&
5377          { ac_try='test -s conftest.$ac_objext'
5378   { (eval echo "$as_me:5378: \"$ac_try\"") >&5
5379   (eval $ac_try) 2>&5
5380   ac_status=$?
5381   echo "$as_me:5381: \$? = $ac_status" >&5
5382   (exit $ac_status); }; }; then
5383   :
5384 else
5385   echo "$as_me: failed program was:" >&5
5386 cat conftest.$ac_ext >&5
5387 cf_have_incdir=yes
5388 fi
5389 rm -f conftest.$ac_objext conftest.$ac_ext
5390                           CPPFLAGS=$cf_save_CPPFLAGS
5391                         fi
5392                   fi
5393                 fi
5394
5395                 if test "$cf_have_incdir" = no ; then
5396                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
5397
5398 echo "${as_me:-configure}:5398: testing adding $cf_add_incdir to include-path ..." 1>&5
5399
5400                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
5401
5402                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
5403                   test "$cf_top_incdir" = "$cf_add_incdir" && break
5404                   cf_add_incdir="$cf_top_incdir"
5405                 else
5406                   break
5407                 fi
5408           fi
5409         done
5410   done
5411 fi
5412
5413 if test -n "$cf_cv_curses_dir/lib" ; then
5414   for cf_add_libdir in $cf_cv_curses_dir/lib
5415   do
5416     if test $cf_add_libdir = /usr/lib ; then
5417       :
5418     elif test -d $cf_add_libdir
5419     then
5420       cf_have_libdir=no
5421       if test -n "$LDFLAGS$LIBS" ; then
5422         # a loop is needed to ensure we can add subdirs of existing dirs
5423         for cf_test_libdir in $LDFLAGS $LIBS ; do
5424           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
5425             cf_have_libdir=yes; break
5426           fi
5427         done
5428       fi
5429       if test "$cf_have_libdir" = no ; then
5430         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
5431
5432 echo "${as_me:-configure}:5432: testing adding $cf_add_libdir to library-path ..." 1>&5
5433
5434         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
5435       fi
5436     fi
5437   done
5438 fi
5439
5440         fi
5441 fi
5442
5443 cf_cv_screen=curses
5444
5445 echo "$as_me:5445: checking for specified curses library type" >&5
5446 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6
5447
5448 # Check whether --with-ncursesw or --without-ncursesw was given.
5449 if test "${with_ncursesw+set}" = set; then
5450   withval="$with_ncursesw"
5451   cf_cv_screen=ncursesw
5452 else
5453
5454 # Check whether --with-ncurses or --without-ncurses was given.
5455 if test "${with_ncurses+set}" = set; then
5456   withval="$with_ncurses"
5457   cf_cv_screen=ncurses
5458 else
5459
5460 # Check whether --with-pdcurses or --without-pdcurses was given.
5461 if test "${with_pdcurses+set}" = set; then
5462   withval="$with_pdcurses"
5463   cf_cv_screen=pdcurses
5464 else
5465
5466 # Check whether --with-curses-colr or --without-curses-colr was given.
5467 if test "${with_curses_colr+set}" = set; then
5468   withval="$with_curses_colr"
5469   cf_cv_screen=curses_colr
5470 else
5471
5472 # Check whether --with-curses-5lib or --without-curses-5lib was given.
5473 if test "${with_curses_5lib+set}" = set; then
5474   withval="$with_curses_5lib"
5475   cf_cv_screen=curses_5lib
5476 fi;
5477 fi;
5478 fi;
5479 fi;
5480 fi;
5481
5482 echo "$as_me:5482: result: $cf_cv_screen" >&5
5483 echo "${ECHO_T}$cf_cv_screen" >&6
5484
5485 case $cf_cv_screen in #(vi
5486 curses|curses_*) #(vi
5487
5488 echo "$as_me:5488: checking for extra include directories" >&5
5489 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6
5490 if test "${cf_cv_curses_incdir+set}" = set; then
5491   echo $ECHO_N "(cached) $ECHO_C" >&6
5492 else
5493
5494 cf_cv_curses_incdir=no
5495 case $host_os in #(vi
5496 hpux10.*) #(vi
5497         if test "x$cf_cv_screen" = "xcurses_colr"
5498         then
5499                 test -d /usr/include/curses_colr && \
5500                 cf_cv_curses_incdir="-I/usr/include/curses_colr"
5501         fi
5502         ;;
5503 sunos3*|sunos4*)
5504         if test "x$cf_cv_screen" = "xcurses_5lib"
5505         then
5506                 test -d /usr/5lib && \
5507                 test -d /usr/5include && \
5508                 cf_cv_curses_incdir="-I/usr/5include"
5509         fi
5510         ;;
5511 esac
5512
5513 fi
5514 echo "$as_me:5514: result: $cf_cv_curses_incdir" >&5
5515 echo "${ECHO_T}$cf_cv_curses_incdir" >&6
5516 test "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir"
5517
5518 echo "$as_me:5518: checking if we have identified curses headers" >&5
5519 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
5520 if test "${cf_cv_ncurses_header+set}" = set; then
5521   echo $ECHO_N "(cached) $ECHO_C" >&6
5522 else
5523
5524 cf_cv_ncurses_header=none
5525 for cf_header in  \
5526         ncurses.h \
5527         curses.h ncurses/ncurses.h ncurses/curses.h
5528 do
5529 cat >conftest.$ac_ext <<_ACEOF
5530 #line 5530 "configure"
5531 #include "confdefs.h"
5532 #include <${cf_header}>
5533 int
5534 main ()
5535 {
5536 initscr(); tgoto("?", 0,0)
5537   ;
5538   return 0;
5539 }
5540 _ACEOF
5541 rm -f conftest.$ac_objext
5542 if { (eval echo "$as_me:5542: \"$ac_compile\"") >&5
5543   (eval $ac_compile) 2>&5
5544   ac_status=$?
5545   echo "$as_me:5545: \$? = $ac_status" >&5
5546   (exit $ac_status); } &&
5547          { ac_try='test -s conftest.$ac_objext'
5548   { (eval echo "$as_me:5548: \"$ac_try\"") >&5
5549   (eval $ac_try) 2>&5
5550   ac_status=$?
5551   echo "$as_me:5551: \$? = $ac_status" >&5
5552   (exit $ac_status); }; }; then
5553   cf_cv_ncurses_header=$cf_header; break
5554 else
5555   echo "$as_me: failed program was:" >&5
5556 cat conftest.$ac_ext >&5
5557 fi
5558 rm -f conftest.$ac_objext conftest.$ac_ext
5559 done
5560
5561 fi
5562 echo "$as_me:5562: result: $cf_cv_ncurses_header" >&5
5563 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
5564
5565 if test "$cf_cv_ncurses_header" = none ; then
5566         { { echo "$as_me:5566: error: No curses header-files found" >&5
5567 echo "$as_me: error: No curses header-files found" >&2;}
5568    { (exit 1); exit 1; }; }
5569 fi
5570
5571 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
5572
5573 for ac_header in $cf_cv_ncurses_header
5574 do
5575 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
5576 echo "$as_me:5576: checking for $ac_header" >&5
5577 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
5578 if eval "test \"\${$as_ac_Header+set}\" = set"; then
5579   echo $ECHO_N "(cached) $ECHO_C" >&6
5580 else
5581   cat >conftest.$ac_ext <<_ACEOF
5582 #line 5582 "configure"
5583 #include "confdefs.h"
5584 #include <$ac_header>
5585 _ACEOF
5586 if { (eval echo "$as_me:5586: \"$ac_cpp conftest.$ac_ext\"") >&5
5587   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
5588   ac_status=$?
5589   egrep -v '^ *\+' conftest.er1 >conftest.err
5590   rm -f conftest.er1
5591   cat conftest.err >&5
5592   echo "$as_me:5592: \$? = $ac_status" >&5
5593   (exit $ac_status); } >/dev/null; then
5594   if test -s conftest.err; then
5595     ac_cpp_err=$ac_c_preproc_warn_flag
5596   else
5597     ac_cpp_err=
5598   fi
5599 else
5600   ac_cpp_err=yes
5601 fi
5602 if test -z "$ac_cpp_err"; then
5603   eval "$as_ac_Header=yes"
5604 else
5605   echo "$as_me: failed program was:" >&5
5606   cat conftest.$ac_ext >&5
5607   eval "$as_ac_Header=no"
5608 fi
5609 rm -f conftest.err conftest.$ac_ext
5610 fi
5611 echo "$as_me:5611: result: `eval echo '${'$as_ac_Header'}'`" >&5
5612 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
5613 if test `eval echo '${'$as_ac_Header'}'` = yes; then
5614   cat >>confdefs.h <<EOF
5615 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
5616 EOF
5617
5618 fi
5619 done
5620
5621 echo "$as_me:5621: checking for terminfo header" >&5
5622 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
5623 if test "${cf_cv_term_header+set}" = set; then
5624   echo $ECHO_N "(cached) $ECHO_C" >&6
5625 else
5626
5627 case ${cf_cv_ncurses_header} in #(vi
5628 */ncurses.h|*/ncursesw.h) #(vi
5629         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
5630         ;;
5631 *)
5632         cf_term_header=term.h
5633         ;;
5634 esac
5635
5636 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
5637 do
5638 cat >conftest.$ac_ext <<_ACEOF
5639 #line 5639 "configure"
5640 #include "confdefs.h"
5641 #include <stdio.h>
5642 #include <${cf_cv_ncurses_header:-curses.h}>
5643 #include <$cf_test>
5644
5645 int
5646 main ()
5647 {
5648 int x = auto_left_margin
5649   ;
5650   return 0;
5651 }
5652 _ACEOF
5653 rm -f conftest.$ac_objext
5654 if { (eval echo "$as_me:5654: \"$ac_compile\"") >&5
5655   (eval $ac_compile) 2>&5
5656   ac_status=$?
5657   echo "$as_me:5657: \$? = $ac_status" >&5
5658   (exit $ac_status); } &&
5659          { ac_try='test -s conftest.$ac_objext'
5660   { (eval echo "$as_me:5660: \"$ac_try\"") >&5
5661   (eval $ac_try) 2>&5
5662   ac_status=$?
5663   echo "$as_me:5663: \$? = $ac_status" >&5
5664   (exit $ac_status); }; }; then
5665
5666         cf_cv_term_header="$cf_test"
5667 else
5668   echo "$as_me: failed program was:" >&5
5669 cat conftest.$ac_ext >&5
5670
5671         cf_cv_term_header=unknown
5672
5673 fi
5674 rm -f conftest.$ac_objext conftest.$ac_ext
5675         test "$cf_cv_term_header" != unknown && break
5676 done
5677
5678 fi
5679 echo "$as_me:5679: result: $cf_cv_term_header" >&5
5680 echo "${ECHO_T}$cf_cv_term_header" >&6
5681
5682 # Set definitions to allow ifdef'ing to accommodate subdirectories
5683
5684 case $cf_cv_term_header in # (vi
5685 *term.h)
5686         cat >>confdefs.h <<\EOF
5687 #define HAVE_TERM_H 1
5688 EOF
5689
5690         ;;
5691 esac
5692
5693 case $cf_cv_term_header in # (vi
5694 ncurses/term.h) #(vi
5695         cat >>confdefs.h <<\EOF
5696 #define HAVE_NCURSES_TERM_H 1
5697 EOF
5698
5699         ;;
5700 ncursesw/term.h)
5701         cat >>confdefs.h <<\EOF
5702 #define HAVE_NCURSESW_TERM_H 1
5703 EOF
5704
5705         ;;
5706 esac
5707
5708 echo "$as_me:5708: checking for ncurses version" >&5
5709 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
5710 if test "${cf_cv_ncurses_version+set}" = set; then
5711   echo $ECHO_N "(cached) $ECHO_C" >&6
5712 else
5713
5714         cf_cv_ncurses_version=no
5715         cf_tempfile=out$$
5716         rm -f $cf_tempfile
5717         if test "$cross_compiling" = yes; then
5718
5719         # This will not work if the preprocessor splits the line after the
5720         # Autoconf token.  The 'unproto' program does that.
5721         cat > conftest.$ac_ext <<EOF
5722 #include <${cf_cv_ncurses_header:-curses.h}>
5723 #undef Autoconf
5724 #ifdef NCURSES_VERSION
5725 Autoconf NCURSES_VERSION
5726 #else
5727 #ifdef __NCURSES_H
5728 Autoconf "old"
5729 #endif
5730 ;
5731 #endif
5732 EOF
5733         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
5734         { (eval echo "$as_me:5734: \"$cf_try\"") >&5
5735   (eval $cf_try) 2>&5
5736   ac_status=$?
5737   echo "$as_me:5737: \$? = $ac_status" >&5
5738   (exit $ac_status); }
5739         if test -f conftest.out ; then
5740                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
5741                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
5742                 rm -f conftest.out
5743         fi
5744
5745 else
5746   cat >conftest.$ac_ext <<_ACEOF
5747 #line 5747 "configure"
5748 #include "confdefs.h"
5749
5750 #include <${cf_cv_ncurses_header:-curses.h}>
5751 #include <stdio.h>
5752 int main()
5753 {
5754         FILE *fp = fopen("$cf_tempfile", "w");
5755 #ifdef NCURSES_VERSION
5756 # ifdef NCURSES_VERSION_PATCH
5757         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
5758 # else
5759         fprintf(fp, "%s\n", NCURSES_VERSION);
5760 # endif
5761 #else
5762 # ifdef __NCURSES_H
5763         fprintf(fp, "old\n");
5764 # else
5765         make an error
5766 # endif
5767 #endif
5768         ${cf_cv_main_return:-return}(0);
5769 }
5770 _ACEOF
5771 rm -f conftest$ac_exeext
5772 if { (eval echo "$as_me:5772: \"$ac_link\"") >&5
5773   (eval $ac_link) 2>&5
5774   ac_status=$?
5775   echo "$as_me:5775: \$? = $ac_status" >&5
5776   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
5777   { (eval echo "$as_me:5777: \"$ac_try\"") >&5
5778   (eval $ac_try) 2>&5
5779   ac_status=$?
5780   echo "$as_me:5780: \$? = $ac_status" >&5
5781   (exit $ac_status); }; }; then
5782
5783         cf_cv_ncurses_version=`cat $cf_tempfile`
5784 else
5785   echo "$as_me: program exited with status $ac_status" >&5
5786 echo "$as_me: failed program was:" >&5
5787 cat conftest.$ac_ext >&5
5788 fi
5789 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
5790 fi
5791         rm -f $cf_tempfile
5792
5793 fi
5794 echo "$as_me:5794: result: $cf_cv_ncurses_version" >&5
5795 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
5796 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
5797 #define NCURSES 1
5798 EOF
5799
5800 echo "$as_me:5800: checking if we have identified curses libraries" >&5
5801 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6
5802 cat >conftest.$ac_ext <<_ACEOF
5803 #line 5803 "configure"
5804 #include "confdefs.h"
5805 #include <${cf_cv_ncurses_header:-curses.h}>
5806 int
5807 main ()
5808 {
5809 initscr(); tgoto("?", 0,0)
5810   ;
5811   return 0;
5812 }
5813 _ACEOF
5814 rm -f conftest.$ac_objext conftest$ac_exeext
5815 if { (eval echo "$as_me:5815: \"$ac_link\"") >&5
5816   (eval $ac_link) 2>&5
5817   ac_status=$?
5818   echo "$as_me:5818: \$? = $ac_status" >&5
5819   (exit $ac_status); } &&
5820          { ac_try='test -s conftest$ac_exeext'
5821   { (eval echo "$as_me:5821: \"$ac_try\"") >&5
5822   (eval $ac_try) 2>&5
5823   ac_status=$?
5824   echo "$as_me:5824: \$? = $ac_status" >&5
5825   (exit $ac_status); }; }; then
5826   cf_result=yes
5827 else
5828   echo "$as_me: failed program was:" >&5
5829 cat conftest.$ac_ext >&5
5830 cf_result=no
5831 fi
5832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5833 echo "$as_me:5833: result: $cf_result" >&5
5834 echo "${ECHO_T}$cf_result" >&6
5835
5836 if test "$cf_result" = no ; then
5837 case $host_os in #(vi
5838 freebsd*) #(vi
5839     echo "$as_me:5839: checking for tgoto in -lmytinfo" >&5
5840 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
5841 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
5842   echo $ECHO_N "(cached) $ECHO_C" >&6
5843 else
5844   ac_check_lib_save_LIBS=$LIBS
5845 LIBS="-lmytinfo  $LIBS"
5846 cat >conftest.$ac_ext <<_ACEOF
5847 #line 5847 "configure"
5848 #include "confdefs.h"
5849
5850 /* Override any gcc2 internal prototype to avoid an error.  */
5851 #ifdef __cplusplus
5852 extern "C"
5853 #endif
5854 /* We use char because int might match the return type of a gcc2
5855    builtin and then its argument prototype would still apply.  */
5856 char tgoto ();
5857 int
5858 main ()
5859 {
5860 tgoto ();
5861   ;
5862   return 0;
5863 }
5864 _ACEOF
5865 rm -f conftest.$ac_objext conftest$ac_exeext
5866 if { (eval echo "$as_me:5866: \"$ac_link\"") >&5
5867   (eval $ac_link) 2>&5
5868   ac_status=$?
5869   echo "$as_me:5869: \$? = $ac_status" >&5
5870   (exit $ac_status); } &&
5871          { ac_try='test -s conftest$ac_exeext'
5872   { (eval echo "$as_me:5872: \"$ac_try\"") >&5
5873   (eval $ac_try) 2>&5
5874   ac_status=$?
5875   echo "$as_me:5875: \$? = $ac_status" >&5
5876   (exit $ac_status); }; }; then
5877   ac_cv_lib_mytinfo_tgoto=yes
5878 else
5879   echo "$as_me: failed program was:" >&5
5880 cat conftest.$ac_ext >&5
5881 ac_cv_lib_mytinfo_tgoto=no
5882 fi
5883 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5884 LIBS=$ac_check_lib_save_LIBS
5885 fi
5886 echo "$as_me:5886: result: $ac_cv_lib_mytinfo_tgoto" >&5
5887 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
5888 if test $ac_cv_lib_mytinfo_tgoto = yes; then
5889   LIBS="-lmytinfo $LIBS"
5890 fi
5891
5892     ;;
5893 hpux10.*) #(vi
5894         # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
5895         # next (1998), and xcurses "newer" (2000).  There is no header file for
5896         # Hcurses; the subdirectory curses_colr has the headers (curses.h and
5897         # term.h) for cur_colr
5898         if test "x$cf_cv_screen" = "xcurses_colr"
5899         then
5900                 echo "$as_me:5900: checking for initscr in -lcur_colr" >&5
5901 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6
5902 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then
5903   echo $ECHO_N "(cached) $ECHO_C" >&6
5904 else
5905   ac_check_lib_save_LIBS=$LIBS
5906 LIBS="-lcur_colr  $LIBS"
5907 cat >conftest.$ac_ext <<_ACEOF
5908 #line 5908 "configure"
5909 #include "confdefs.h"
5910
5911 /* Override any gcc2 internal prototype to avoid an error.  */
5912 #ifdef __cplusplus
5913 extern "C"
5914 #endif
5915 /* We use char because int might match the return type of a gcc2
5916    builtin and then its argument prototype would still apply.  */
5917 char initscr ();
5918 int
5919 main ()
5920 {
5921 initscr ();
5922   ;
5923   return 0;
5924 }
5925 _ACEOF
5926 rm -f conftest.$ac_objext conftest$ac_exeext
5927 if { (eval echo "$as_me:5927: \"$ac_link\"") >&5
5928   (eval $ac_link) 2>&5
5929   ac_status=$?
5930   echo "$as_me:5930: \$? = $ac_status" >&5
5931   (exit $ac_status); } &&
5932          { ac_try='test -s conftest$ac_exeext'
5933   { (eval echo "$as_me:5933: \"$ac_try\"") >&5
5934   (eval $ac_try) 2>&5
5935   ac_status=$?
5936   echo "$as_me:5936: \$? = $ac_status" >&5
5937   (exit $ac_status); }; }; then
5938   ac_cv_lib_cur_colr_initscr=yes
5939 else
5940   echo "$as_me: failed program was:" >&5
5941 cat conftest.$ac_ext >&5
5942 ac_cv_lib_cur_colr_initscr=no
5943 fi
5944 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
5945 LIBS=$ac_check_lib_save_LIBS
5946 fi
5947 echo "$as_me:5947: result: $ac_cv_lib_cur_colr_initscr" >&5
5948 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6
5949 if test $ac_cv_lib_cur_colr_initscr = yes; then
5950
5951                         LIBS="-lcur_colr $LIBS"
5952                         ac_cv_func_initscr=yes
5953
5954 else
5955
5956                 echo "$as_me:5956: checking for initscr in -lHcurses" >&5
5957 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6
5958 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then
5959   echo $ECHO_N "(cached) $ECHO_C" >&6
5960 else
5961   ac_check_lib_save_LIBS=$LIBS
5962 LIBS="-lHcurses  $LIBS"
5963 cat >conftest.$ac_ext <<_ACEOF
5964 #line 5964 "configure"
5965 #include "confdefs.h"
5966
5967 /* Override any gcc2 internal prototype to avoid an error.  */
5968 #ifdef __cplusplus
5969 extern "C"
5970 #endif
5971 /* We use char because int might match the return type of a gcc2
5972    builtin and then its argument prototype would still apply.  */
5973 char initscr ();
5974 int
5975 main ()
5976 {
5977 initscr ();
5978   ;
5979   return 0;
5980 }
5981 _ACEOF
5982 rm -f conftest.$ac_objext conftest$ac_exeext
5983 if { (eval echo "$as_me:5983: \"$ac_link\"") >&5
5984   (eval $ac_link) 2>&5
5985   ac_status=$?
5986   echo "$as_me:5986: \$? = $ac_status" >&5
5987   (exit $ac_status); } &&
5988          { ac_try='test -s conftest$ac_exeext'
5989   { (eval echo "$as_me:5989: \"$ac_try\"") >&5
5990   (eval $ac_try) 2>&5
5991   ac_status=$?
5992   echo "$as_me:5992: \$? = $ac_status" >&5
5993   (exit $ac_status); }; }; then
5994   ac_cv_lib_Hcurses_initscr=yes
5995 else
5996   echo "$as_me: failed program was:" >&5
5997 cat conftest.$ac_ext >&5
5998 ac_cv_lib_Hcurses_initscr=no
5999 fi
6000 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6001 LIBS=$ac_check_lib_save_LIBS
6002 fi
6003 echo "$as_me:6003: result: $ac_cv_lib_Hcurses_initscr" >&5
6004 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6
6005 if test $ac_cv_lib_Hcurses_initscr = yes; then
6006
6007                         # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
6008                         LIBS="-lHcurses $LIBS"
6009                         CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES"
6010                         ac_cv_func_initscr=yes
6011
6012 fi
6013
6014 fi
6015
6016         fi
6017     ;;
6018 linux*)
6019         case `arch 2>/dev/null` in
6020         x86_64)
6021                 if test -d /lib64
6022                 then
6023
6024 if test -n "/lib64" ; then
6025   for cf_add_libdir in /lib64
6026   do
6027     if test $cf_add_libdir = /usr/lib ; then
6028       :
6029     elif test -d $cf_add_libdir
6030     then
6031       cf_have_libdir=no
6032       if test -n "$LDFLAGS$LIBS" ; then
6033         # a loop is needed to ensure we can add subdirs of existing dirs
6034         for cf_test_libdir in $LDFLAGS $LIBS ; do
6035           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6036             cf_have_libdir=yes; break
6037           fi
6038         done
6039       fi
6040       if test "$cf_have_libdir" = no ; then
6041         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6042
6043 echo "${as_me:-configure}:6043: testing adding $cf_add_libdir to library-path ..." 1>&5
6044
6045         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6046       fi
6047     fi
6048   done
6049 fi
6050
6051                 else
6052
6053 if test -n "/lib" ; then
6054   for cf_add_libdir in /lib
6055   do
6056     if test $cf_add_libdir = /usr/lib ; then
6057       :
6058     elif test -d $cf_add_libdir
6059     then
6060       cf_have_libdir=no
6061       if test -n "$LDFLAGS$LIBS" ; then
6062         # a loop is needed to ensure we can add subdirs of existing dirs
6063         for cf_test_libdir in $LDFLAGS $LIBS ; do
6064           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6065             cf_have_libdir=yes; break
6066           fi
6067         done
6068       fi
6069       if test "$cf_have_libdir" = no ; then
6070         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6071
6072 echo "${as_me:-configure}:6072: testing adding $cf_add_libdir to library-path ..." 1>&5
6073
6074         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6075       fi
6076     fi
6077   done
6078 fi
6079
6080                 fi
6081                 ;;
6082         *)
6083
6084 if test -n "/lib" ; then
6085   for cf_add_libdir in /lib
6086   do
6087     if test $cf_add_libdir = /usr/lib ; then
6088       :
6089     elif test -d $cf_add_libdir
6090     then
6091       cf_have_libdir=no
6092       if test -n "$LDFLAGS$LIBS" ; then
6093         # a loop is needed to ensure we can add subdirs of existing dirs
6094         for cf_test_libdir in $LDFLAGS $LIBS ; do
6095           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6096             cf_have_libdir=yes; break
6097           fi
6098         done
6099       fi
6100       if test "$cf_have_libdir" = no ; then
6101         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6102
6103 echo "${as_me:-configure}:6103: testing adding $cf_add_libdir to library-path ..." 1>&5
6104
6105         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6106       fi
6107     fi
6108   done
6109 fi
6110
6111                 ;;
6112         esac
6113     ;;
6114 sunos3*|sunos4*)
6115         if test "x$cf_cv_screen" = "xcurses_5lib"
6116         then
6117                 if test -d /usr/5lib ; then
6118
6119 if test -n "/usr/5lib" ; then
6120   for cf_add_libdir in /usr/5lib
6121   do
6122     if test $cf_add_libdir = /usr/lib ; then
6123       :
6124     elif test -d $cf_add_libdir
6125     then
6126       cf_have_libdir=no
6127       if test -n "$LDFLAGS$LIBS" ; then
6128         # a loop is needed to ensure we can add subdirs of existing dirs
6129         for cf_test_libdir in $LDFLAGS $LIBS ; do
6130           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
6131             cf_have_libdir=yes; break
6132           fi
6133         done
6134       fi
6135       if test "$cf_have_libdir" = no ; then
6136         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
6137
6138 echo "${as_me:-configure}:6138: testing adding $cf_add_libdir to library-path ..." 1>&5
6139
6140         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
6141       fi
6142     fi
6143   done
6144 fi
6145
6146                         LIBS="-lcurses -ltermcap $LIBS"
6147                 fi
6148     fi
6149     ac_cv_func_initscr=yes
6150     ;;
6151 esac
6152
6153 if test ".$ac_cv_func_initscr" != .yes ; then
6154     cf_save_LIBS="$LIBS"
6155     cf_term_lib=""
6156     cf_curs_lib=""
6157
6158     if test ".${cf_cv_ncurses_version:-no}" != .no
6159     then
6160         cf_check_list="ncurses curses cursesX"
6161     else
6162         cf_check_list="cursesX curses ncurses"
6163     fi
6164
6165     # Check for library containing tgoto.  Do this before curses library
6166     # because it may be needed to link the test-case for initscr.
6167     echo "$as_me:6167: checking for tgoto" >&5
6168 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6
6169 if test "${ac_cv_func_tgoto+set}" = set; then
6170   echo $ECHO_N "(cached) $ECHO_C" >&6
6171 else
6172   cat >conftest.$ac_ext <<_ACEOF
6173 #line 6173 "configure"
6174 #include "confdefs.h"
6175 /* System header to define __stub macros and hopefully few prototypes,
6176     which can conflict with char tgoto (); below.  */
6177 #include <assert.h>
6178 /* Override any gcc2 internal prototype to avoid an error.  */
6179 #ifdef __cplusplus
6180 extern "C"
6181 #endif
6182 /* We use char because int might match the return type of a gcc2
6183    builtin and then its argument prototype would still apply.  */
6184 char tgoto ();
6185 char (*f) ();
6186
6187 int
6188 main ()
6189 {
6190 /* The GNU C library defines this for functions which it implements
6191     to always fail with ENOSYS.  Some functions are actually named
6192     something starting with __ and the normal name is an alias.  */
6193 #if defined (__stub_tgoto) || defined (__stub___tgoto)
6194 choke me
6195 #else
6196 f = tgoto; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
6197 #endif
6198
6199   ;
6200   return 0;
6201 }
6202 _ACEOF
6203 rm -f conftest.$ac_objext conftest$ac_exeext
6204 if { (eval echo "$as_me:6204: \"$ac_link\"") >&5
6205   (eval $ac_link) 2>&5
6206   ac_status=$?
6207   echo "$as_me:6207: \$? = $ac_status" >&5
6208   (exit $ac_status); } &&
6209          { ac_try='test -s conftest$ac_exeext'
6210   { (eval echo "$as_me:6210: \"$ac_try\"") >&5
6211   (eval $ac_try) 2>&5
6212   ac_status=$?
6213   echo "$as_me:6213: \$? = $ac_status" >&5
6214   (exit $ac_status); }; }; then
6215   ac_cv_func_tgoto=yes
6216 else
6217   echo "$as_me: failed program was:" >&5
6218 cat conftest.$ac_ext >&5
6219 ac_cv_func_tgoto=no
6220 fi
6221 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6222 fi
6223 echo "$as_me:6223: result: $ac_cv_func_tgoto" >&5
6224 echo "${ECHO_T}$ac_cv_func_tgoto" >&6
6225 if test $ac_cv_func_tgoto = yes; then
6226   cf_term_lib=predefined
6227 else
6228
6229         for cf_term_lib in $cf_check_list otermcap termcap termlib unknown
6230         do
6231             as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh`
6232 echo "$as_me:6232: checking for tgoto in -l$cf_term_lib" >&5
6233 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6
6234 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6235   echo $ECHO_N "(cached) $ECHO_C" >&6
6236 else
6237   ac_check_lib_save_LIBS=$LIBS
6238 LIBS="-l$cf_term_lib  $LIBS"
6239 cat >conftest.$ac_ext <<_ACEOF
6240 #line 6240 "configure"
6241 #include "confdefs.h"
6242
6243 /* Override any gcc2 internal prototype to avoid an error.  */
6244 #ifdef __cplusplus
6245 extern "C"
6246 #endif
6247 /* We use char because int might match the return type of a gcc2
6248    builtin and then its argument prototype would still apply.  */
6249 char tgoto ();
6250 int
6251 main ()
6252 {
6253 tgoto ();
6254   ;
6255   return 0;
6256 }
6257 _ACEOF
6258 rm -f conftest.$ac_objext conftest$ac_exeext
6259 if { (eval echo "$as_me:6259: \"$ac_link\"") >&5
6260   (eval $ac_link) 2>&5
6261   ac_status=$?
6262   echo "$as_me:6262: \$? = $ac_status" >&5
6263   (exit $ac_status); } &&
6264          { ac_try='test -s conftest$ac_exeext'
6265   { (eval echo "$as_me:6265: \"$ac_try\"") >&5
6266   (eval $ac_try) 2>&5
6267   ac_status=$?
6268   echo "$as_me:6268: \$? = $ac_status" >&5
6269   (exit $ac_status); }; }; then
6270   eval "$as_ac_Lib=yes"
6271 else
6272   echo "$as_me: failed program was:" >&5
6273 cat conftest.$ac_ext >&5
6274 eval "$as_ac_Lib=no"
6275 fi
6276 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6277 LIBS=$ac_check_lib_save_LIBS
6278 fi
6279 echo "$as_me:6279: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6280 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6281 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6282   break
6283 fi
6284
6285         done
6286
6287 fi
6288
6289     # Check for library containing initscr
6290     test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
6291         for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
6292     do
6293         as_ac_Lib=`echo "ac_cv_lib_$cf_curs_lib''_initscr" | $as_tr_sh`
6294 echo "$as_me:6294: checking for initscr in -l$cf_curs_lib" >&5
6295 echo $ECHO_N "checking for initscr in -l$cf_curs_lib... $ECHO_C" >&6
6296 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
6297   echo $ECHO_N "(cached) $ECHO_C" >&6
6298 else
6299   ac_check_lib_save_LIBS=$LIBS
6300 LIBS="-l$cf_curs_lib  $LIBS"
6301 cat >conftest.$ac_ext <<_ACEOF
6302 #line 6302 "configure"
6303 #include "confdefs.h"
6304
6305 /* Override any gcc2 internal prototype to avoid an error.  */
6306 #ifdef __cplusplus
6307 extern "C"
6308 #endif
6309 /* We use char because int might match the return type of a gcc2
6310    builtin and then its argument prototype would still apply.  */
6311 char initscr ();
6312 int
6313 main ()
6314 {
6315 initscr ();
6316   ;
6317   return 0;
6318 }
6319 _ACEOF
6320 rm -f conftest.$ac_objext conftest$ac_exeext
6321 if { (eval echo "$as_me:6321: \"$ac_link\"") >&5
6322   (eval $ac_link) 2>&5
6323   ac_status=$?
6324   echo "$as_me:6324: \$? = $ac_status" >&5
6325   (exit $ac_status); } &&
6326          { ac_try='test -s conftest$ac_exeext'
6327   { (eval echo "$as_me:6327: \"$ac_try\"") >&5
6328   (eval $ac_try) 2>&5
6329   ac_status=$?
6330   echo "$as_me:6330: \$? = $ac_status" >&5
6331   (exit $ac_status); }; }; then
6332   eval "$as_ac_Lib=yes"
6333 else
6334   echo "$as_me: failed program was:" >&5
6335 cat conftest.$ac_ext >&5
6336 eval "$as_ac_Lib=no"
6337 fi
6338 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6339 LIBS=$ac_check_lib_save_LIBS
6340 fi
6341 echo "$as_me:6341: result: `eval echo '${'$as_ac_Lib'}'`" >&5
6342 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
6343 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
6344   break
6345 fi
6346
6347     done
6348     test $cf_curs_lib = unknown && { { echo "$as_me:6348: error: no curses library found" >&5
6349 echo "$as_me: error: no curses library found" >&2;}
6350    { (exit 1); exit 1; }; }
6351
6352     LIBS="-l$cf_curs_lib $cf_save_LIBS"
6353     if test "$cf_term_lib" = unknown ; then
6354         echo "$as_me:6354: checking if we can link with $cf_curs_lib library" >&5
6355 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6
6356         cat >conftest.$ac_ext <<_ACEOF
6357 #line 6357 "configure"
6358 #include "confdefs.h"
6359 #include <${cf_cv_ncurses_header:-curses.h}>
6360 int
6361 main ()
6362 {
6363 initscr()
6364   ;
6365   return 0;
6366 }
6367 _ACEOF
6368 rm -f conftest.$ac_objext conftest$ac_exeext
6369 if { (eval echo "$as_me:6369: \"$ac_link\"") >&5
6370   (eval $ac_link) 2>&5
6371   ac_status=$?
6372   echo "$as_me:6372: \$? = $ac_status" >&5
6373   (exit $ac_status); } &&
6374          { ac_try='test -s conftest$ac_exeext'
6375   { (eval echo "$as_me:6375: \"$ac_try\"") >&5
6376   (eval $ac_try) 2>&5
6377   ac_status=$?
6378   echo "$as_me:6378: \$? = $ac_status" >&5
6379   (exit $ac_status); }; }; then
6380   cf_result=yes
6381 else
6382   echo "$as_me: failed program was:" >&5
6383 cat conftest.$ac_ext >&5
6384 cf_result=no
6385 fi
6386 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6387         echo "$as_me:6387: result: $cf_result" >&5
6388 echo "${ECHO_T}$cf_result" >&6
6389         test $cf_result = no && { { echo "$as_me:6389: error: Cannot link curses library" >&5
6390 echo "$as_me: error: Cannot link curses library" >&2;}
6391    { (exit 1); exit 1; }; }
6392     elif test "$cf_curs_lib" = "$cf_term_lib" ; then
6393         :
6394     elif test "$cf_term_lib" != predefined ; then
6395         echo "$as_me:6395: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5
6396 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6
6397         cat >conftest.$ac_ext <<_ACEOF
6398 #line 6398 "configure"
6399 #include "confdefs.h"
6400 #include <${cf_cv_ncurses_header:-curses.h}>
6401 int
6402 main ()
6403 {
6404 initscr(); tgoto((char *)0, 0, 0);
6405   ;
6406   return 0;
6407 }
6408 _ACEOF
6409 rm -f conftest.$ac_objext conftest$ac_exeext
6410 if { (eval echo "$as_me:6410: \"$ac_link\"") >&5
6411   (eval $ac_link) 2>&5
6412   ac_status=$?
6413   echo "$as_me:6413: \$? = $ac_status" >&5
6414   (exit $ac_status); } &&
6415          { ac_try='test -s conftest$ac_exeext'
6416   { (eval echo "$as_me:6416: \"$ac_try\"") >&5
6417   (eval $ac_try) 2>&5
6418   ac_status=$?
6419   echo "$as_me:6419: \$? = $ac_status" >&5
6420   (exit $ac_status); }; }; then
6421   cf_result=no
6422 else
6423   echo "$as_me: failed program was:" >&5
6424 cat conftest.$ac_ext >&5
6425
6426             LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
6427             cat >conftest.$ac_ext <<_ACEOF
6428 #line 6428 "configure"
6429 #include "confdefs.h"
6430 #include <${cf_cv_ncurses_header:-curses.h}>
6431 int
6432 main ()
6433 {
6434 initscr()
6435   ;
6436   return 0;
6437 }
6438 _ACEOF
6439 rm -f conftest.$ac_objext conftest$ac_exeext
6440 if { (eval echo "$as_me:6440: \"$ac_link\"") >&5
6441   (eval $ac_link) 2>&5
6442   ac_status=$?
6443   echo "$as_me:6443: \$? = $ac_status" >&5
6444   (exit $ac_status); } &&
6445          { ac_try='test -s conftest$ac_exeext'
6446   { (eval echo "$as_me:6446: \"$ac_try\"") >&5
6447   (eval $ac_try) 2>&5
6448   ac_status=$?
6449   echo "$as_me:6449: \$? = $ac_status" >&5
6450   (exit $ac_status); }; }; then
6451   cf_result=yes
6452 else
6453   echo "$as_me: failed program was:" >&5
6454 cat conftest.$ac_ext >&5
6455 cf_result=error
6456 fi
6457 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6458
6459 fi
6460 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
6461         echo "$as_me:6461: result: $cf_result" >&5
6462 echo "${ECHO_T}$cf_result" >&6
6463     fi
6464 fi
6465 fi
6466
6467         ;;
6468 ncurses) #(vi
6469
6470 cf_ncuconfig_root=ncurses
6471
6472 echo "Looking for ${cf_ncuconfig_root}-config"
6473
6474 if test -n "$ac_tool_prefix"; then
6475   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6476   do
6477     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
6478 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
6479 echo "$as_me:6479: checking for $ac_word" >&5
6480 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6481 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
6482   echo $ECHO_N "(cached) $ECHO_C" >&6
6483 else
6484   if test -n "$NCURSES_CONFIG"; then
6485   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
6486 else
6487   ac_save_IFS=$IFS; IFS=$ac_path_separator
6488 ac_dummy="$PATH"
6489 for ac_dir in $ac_dummy; do
6490   IFS=$ac_save_IFS
6491   test -z "$ac_dir" && ac_dir=.
6492   $as_executable_p "$ac_dir/$ac_word" || continue
6493 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
6494 echo "$as_me:6494: found $ac_dir/$ac_word" >&5
6495 break
6496 done
6497
6498 fi
6499 fi
6500 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
6501 if test -n "$NCURSES_CONFIG"; then
6502   echo "$as_me:6502: result: $NCURSES_CONFIG" >&5
6503 echo "${ECHO_T}$NCURSES_CONFIG" >&6
6504 else
6505   echo "$as_me:6505: result: no" >&5
6506 echo "${ECHO_T}no" >&6
6507 fi
6508
6509     test -n "$NCURSES_CONFIG" && break
6510   done
6511 fi
6512 if test -z "$NCURSES_CONFIG"; then
6513   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
6514   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
6515 do
6516   # Extract the first word of "$ac_prog", so it can be a program name with args.
6517 set dummy $ac_prog; ac_word=$2
6518 echo "$as_me:6518: checking for $ac_word" >&5
6519 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
6520 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
6521   echo $ECHO_N "(cached) $ECHO_C" >&6
6522 else
6523   if test -n "$ac_ct_NCURSES_CONFIG"; then
6524   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
6525 else
6526   ac_save_IFS=$IFS; IFS=$ac_path_separator
6527 ac_dummy="$PATH"
6528 for ac_dir in $ac_dummy; do
6529   IFS=$ac_save_IFS
6530   test -z "$ac_dir" && ac_dir=.
6531   $as_executable_p "$ac_dir/$ac_word" || continue
6532 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
6533 echo "$as_me:6533: found $ac_dir/$ac_word" >&5
6534 break
6535 done
6536
6537 fi
6538 fi
6539 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
6540 if test -n "$ac_ct_NCURSES_CONFIG"; then
6541   echo "$as_me:6541: result: $ac_ct_NCURSES_CONFIG" >&5
6542 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
6543 else
6544   echo "$as_me:6544: result: no" >&5
6545 echo "${ECHO_T}no" >&6
6546 fi
6547
6548   test -n "$ac_ct_NCURSES_CONFIG" && break
6549 done
6550 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
6551
6552   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
6553 fi
6554
6555 if test "$NCURSES_CONFIG" != none ; then
6556
6557 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
6558 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
6559
6560 # even with config script, some packages use no-override for curses.h
6561
6562 echo "$as_me:6562: checking if we have identified curses headers" >&5
6563 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
6564 if test "${cf_cv_ncurses_header+set}" = set; then
6565   echo $ECHO_N "(cached) $ECHO_C" >&6
6566 else
6567
6568 cf_cv_ncurses_header=none
6569 for cf_header in  \
6570     ncurses/ncurses.h \
6571         ncurses/curses.h \
6572         ncurses.h \
6573         curses.h
6574 do
6575 cat >conftest.$ac_ext <<_ACEOF
6576 #line 6576 "configure"
6577 #include "confdefs.h"
6578 #include <${cf_header}>
6579 int
6580 main ()
6581 {
6582 initscr(); tgoto("?", 0,0)
6583   ;
6584   return 0;
6585 }
6586 _ACEOF
6587 rm -f conftest.$ac_objext
6588 if { (eval echo "$as_me:6588: \"$ac_compile\"") >&5
6589   (eval $ac_compile) 2>&5
6590   ac_status=$?
6591   echo "$as_me:6591: \$? = $ac_status" >&5
6592   (exit $ac_status); } &&
6593          { ac_try='test -s conftest.$ac_objext'
6594   { (eval echo "$as_me:6594: \"$ac_try\"") >&5
6595   (eval $ac_try) 2>&5
6596   ac_status=$?
6597   echo "$as_me:6597: \$? = $ac_status" >&5
6598   (exit $ac_status); }; }; then
6599   cf_cv_ncurses_header=$cf_header; break
6600 else
6601   echo "$as_me: failed program was:" >&5
6602 cat conftest.$ac_ext >&5
6603 fi
6604 rm -f conftest.$ac_objext conftest.$ac_ext
6605 done
6606
6607 fi
6608 echo "$as_me:6608: result: $cf_cv_ncurses_header" >&5
6609 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
6610
6611 if test "$cf_cv_ncurses_header" = none ; then
6612         { { echo "$as_me:6612: error: No curses header-files found" >&5
6613 echo "$as_me: error: No curses header-files found" >&2;}
6614    { (exit 1); exit 1; }; }
6615 fi
6616
6617 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
6618
6619 for ac_header in $cf_cv_ncurses_header
6620 do
6621 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
6622 echo "$as_me:6622: checking for $ac_header" >&5
6623 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
6624 if eval "test \"\${$as_ac_Header+set}\" = set"; then
6625   echo $ECHO_N "(cached) $ECHO_C" >&6
6626 else
6627   cat >conftest.$ac_ext <<_ACEOF
6628 #line 6628 "configure"
6629 #include "confdefs.h"
6630 #include <$ac_header>
6631 _ACEOF
6632 if { (eval echo "$as_me:6632: \"$ac_cpp conftest.$ac_ext\"") >&5
6633   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
6634   ac_status=$?
6635   egrep -v '^ *\+' conftest.er1 >conftest.err
6636   rm -f conftest.er1
6637   cat conftest.err >&5
6638   echo "$as_me:6638: \$? = $ac_status" >&5
6639   (exit $ac_status); } >/dev/null; then
6640   if test -s conftest.err; then
6641     ac_cpp_err=$ac_c_preproc_warn_flag
6642   else
6643     ac_cpp_err=
6644   fi
6645 else
6646   ac_cpp_err=yes
6647 fi
6648 if test -z "$ac_cpp_err"; then
6649   eval "$as_ac_Header=yes"
6650 else
6651   echo "$as_me: failed program was:" >&5
6652   cat conftest.$ac_ext >&5
6653   eval "$as_ac_Header=no"
6654 fi
6655 rm -f conftest.err conftest.$ac_ext
6656 fi
6657 echo "$as_me:6657: result: `eval echo '${'$as_ac_Header'}'`" >&5
6658 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
6659 if test `eval echo '${'$as_ac_Header'}'` = yes; then
6660   cat >>confdefs.h <<EOF
6661 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
6662 EOF
6663
6664 fi
6665 done
6666
6667 cat >>confdefs.h <<\EOF
6668 #define NCURSES 1
6669 EOF
6670
6671 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
6672
6673 cat >>confdefs.h <<EOF
6674 #define $cf_nculib_ROOT 1
6675 EOF
6676
6677 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
6678
6679 else
6680
6681 cf_ncuhdr_root=ncurses
6682
6683 test -n "$cf_cv_curses_dir" && \
6684 test "$cf_cv_curses_dir" != "no" && { \
6685
6686 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
6687   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
6688   do
6689         while test $cf_add_incdir != /usr/include
6690         do
6691           if test -d $cf_add_incdir
6692           then
6693                 cf_have_incdir=no
6694                 if test -n "$CFLAGS$CPPFLAGS" ; then
6695                   # a loop is needed to ensure we can add subdirs of existing dirs
6696                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6697                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6698                           cf_have_incdir=yes; break
6699                         fi
6700                   done
6701                 fi
6702
6703                 if test "$cf_have_incdir" = no ; then
6704                   if test "$cf_add_incdir" = /usr/local/include ; then
6705                         if test "$GCC" = yes
6706                         then
6707                           cf_save_CPPFLAGS=$CPPFLAGS
6708                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6709                           cat >conftest.$ac_ext <<_ACEOF
6710 #line 6710 "configure"
6711 #include "confdefs.h"
6712 #include <stdio.h>
6713 int
6714 main ()
6715 {
6716 printf("Hello")
6717   ;
6718   return 0;
6719 }
6720 _ACEOF
6721 rm -f conftest.$ac_objext
6722 if { (eval echo "$as_me:6722: \"$ac_compile\"") >&5
6723   (eval $ac_compile) 2>&5
6724   ac_status=$?
6725   echo "$as_me:6725: \$? = $ac_status" >&5
6726   (exit $ac_status); } &&
6727          { ac_try='test -s conftest.$ac_objext'
6728   { (eval echo "$as_me:6728: \"$ac_try\"") >&5
6729   (eval $ac_try) 2>&5
6730   ac_status=$?
6731   echo "$as_me:6731: \$? = $ac_status" >&5
6732   (exit $ac_status); }; }; then
6733   :
6734 else
6735   echo "$as_me: failed program was:" >&5
6736 cat conftest.$ac_ext >&5
6737 cf_have_incdir=yes
6738 fi
6739 rm -f conftest.$ac_objext conftest.$ac_ext
6740                           CPPFLAGS=$cf_save_CPPFLAGS
6741                         fi
6742                   fi
6743                 fi
6744
6745                 if test "$cf_have_incdir" = no ; then
6746                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
6747
6748 echo "${as_me:-configure}:6748: testing adding $cf_add_incdir to include-path ..." 1>&5
6749
6750                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6751
6752                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
6753                   test "$cf_top_incdir" = "$cf_add_incdir" && break
6754                   cf_add_incdir="$cf_top_incdir"
6755                 else
6756                   break
6757                 fi
6758           fi
6759         done
6760   done
6761 fi
6762
6763 }
6764
6765 echo "$as_me:6765: checking for $cf_ncuhdr_root header in include-path" >&5
6766 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
6767 if test "${cf_cv_ncurses_h+set}" = set; then
6768   echo $ECHO_N "(cached) $ECHO_C" >&6
6769 else
6770
6771         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
6772         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
6773         for cf_header in $cf_header_list
6774         do
6775
6776         cat >conftest.$ac_ext <<_ACEOF
6777 #line 6777 "configure"
6778 #include "confdefs.h"
6779
6780 #include <$cf_header>
6781 int
6782 main ()
6783 {
6784
6785 #ifdef NCURSES_VERSION
6786
6787 printf("%s\n", NCURSES_VERSION);
6788 #else
6789 #ifdef __NCURSES_H
6790 printf("old\n");
6791 #else
6792         make an error
6793 #endif
6794 #endif
6795
6796   ;
6797   return 0;
6798 }
6799 _ACEOF
6800 rm -f conftest.$ac_objext
6801 if { (eval echo "$as_me:6801: \"$ac_compile\"") >&5
6802   (eval $ac_compile) 2>&5
6803   ac_status=$?
6804   echo "$as_me:6804: \$? = $ac_status" >&5
6805   (exit $ac_status); } &&
6806          { ac_try='test -s conftest.$ac_objext'
6807   { (eval echo "$as_me:6807: \"$ac_try\"") >&5
6808   (eval $ac_try) 2>&5
6809   ac_status=$?
6810   echo "$as_me:6810: \$? = $ac_status" >&5
6811   (exit $ac_status); }; }; then
6812   cf_cv_ncurses_h=$cf_header
6813
6814 else
6815   echo "$as_me: failed program was:" >&5
6816 cat conftest.$ac_ext >&5
6817 cf_cv_ncurses_h=no
6818 fi
6819 rm -f conftest.$ac_objext conftest.$ac_ext
6820
6821                 test "$cf_cv_ncurses_h" != no && break
6822         done
6823
6824 fi
6825 echo "$as_me:6825: result: $cf_cv_ncurses_h" >&5
6826 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
6827
6828 if test "$cf_cv_ncurses_h" != no ; then
6829         cf_cv_ncurses_header=$cf_cv_ncurses_h
6830 else
6831
6832 echo "$as_me:6832: checking for $cf_ncuhdr_root include-path" >&5
6833 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
6834 if test "${cf_cv_ncurses_h2+set}" = set; then
6835   echo $ECHO_N "(cached) $ECHO_C" >&6
6836 else
6837
6838         test -n "$verbose" && echo
6839
6840 cf_search=
6841
6842 # collect the current set of include-directories from compiler flags
6843 cf_header_path_list=""
6844 if test -n "${CFLAGS}${CPPFLAGS}" ; then
6845         for cf_header_path in $CPPFLAGS $CFLAGS
6846         do
6847                 case $cf_header_path in #(vi
6848                 -I*)
6849                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
6850
6851 test "$cf_header_path" != "NONE" && \
6852 test -d "$cf_header_path" && \
6853  {
6854         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
6855         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
6856         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
6857         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
6858         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
6859         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"
6860 }
6861
6862                         cf_header_path_list="$cf_header_path_list $cf_search"
6863                         ;;
6864                 esac
6865         done
6866 fi
6867
6868 # add the variations for the package we are looking for
6869
6870 cf_search=
6871
6872 test "/usr" != "$prefix" && \
6873 test -d "/usr" && \
6874 (test $prefix = NONE || test "/usr" != "$prefix") && {
6875         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
6876         test -d /usr/include &&          cf_search="$cf_search /usr/include"
6877         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
6878         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
6879         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
6880         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6881 }
6882
6883 test "$prefix" != "NONE" && \
6884 test -d "$prefix" && \
6885  {
6886         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
6887         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
6888         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
6889         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
6890         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
6891         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6892 }
6893
6894 test "/usr/local" != "$prefix" && \
6895 test -d "/usr/local" && \
6896 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
6897         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
6898         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
6899         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
6900         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
6901         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
6902         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6903 }
6904
6905 test "/opt" != "$prefix" && \
6906 test -d "/opt" && \
6907 (test $prefix = NONE || test "/opt" != "$prefix") && {
6908         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
6909         test -d /opt/include &&          cf_search="$cf_search /opt/include"
6910         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
6911         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
6912         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
6913         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6914 }
6915
6916 test "$HOME" != "$prefix" && \
6917 test -d "$HOME" && \
6918 (test $prefix = NONE || test "$HOME" != "$prefix") && {
6919         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
6920         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
6921         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
6922         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
6923         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
6924         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
6925 }
6926
6927 test "$includedir" != NONE && \
6928 test "$includedir" != "/usr/include" && \
6929 test -d "$includedir" && {
6930         test -d $includedir &&    cf_search="$cf_search $includedir"
6931         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
6932 }
6933
6934 test "$oldincludedir" != NONE && \
6935 test "$oldincludedir" != "/usr/include" && \
6936 test -d "$oldincludedir" && {
6937         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
6938         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
6939 }
6940
6941 cf_search="$cf_search $cf_header_path_list"
6942
6943         test -n "$verbose" && echo search path $cf_search
6944         cf_save2_CPPFLAGS="$CPPFLAGS"
6945         for cf_incdir in $cf_search
6946         do
6947
6948 if test -n "$cf_incdir" ; then
6949   for cf_add_incdir in $cf_incdir
6950   do
6951         while test $cf_add_incdir != /usr/include
6952         do
6953           if test -d $cf_add_incdir
6954           then
6955                 cf_have_incdir=no
6956                 if test -n "$CFLAGS$CPPFLAGS" ; then
6957                   # a loop is needed to ensure we can add subdirs of existing dirs
6958                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
6959                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
6960                           cf_have_incdir=yes; break
6961                         fi
6962                   done
6963                 fi
6964
6965                 if test "$cf_have_incdir" = no ; then
6966                   if test "$cf_add_incdir" = /usr/local/include ; then
6967                         if test "$GCC" = yes
6968                         then
6969                           cf_save_CPPFLAGS=$CPPFLAGS
6970                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
6971                           cat >conftest.$ac_ext <<_ACEOF
6972 #line 6972 "configure"
6973 #include "confdefs.h"
6974 #include <stdio.h>
6975 int
6976 main ()
6977 {
6978 printf("Hello")
6979   ;
6980   return 0;
6981 }
6982 _ACEOF
6983 rm -f conftest.$ac_objext
6984 if { (eval echo "$as_me:6984: \"$ac_compile\"") >&5
6985   (eval $ac_compile) 2>&5
6986   ac_status=$?
6987   echo "$as_me:6987: \$? = $ac_status" >&5
6988   (exit $ac_status); } &&
6989          { ac_try='test -s conftest.$ac_objext'
6990   { (eval echo "$as_me:6990: \"$ac_try\"") >&5
6991   (eval $ac_try) 2>&5
6992   ac_status=$?
6993   echo "$as_me:6993: \$? = $ac_status" >&5
6994   (exit $ac_status); }; }; then
6995   :
6996 else
6997   echo "$as_me: failed program was:" >&5
6998 cat conftest.$ac_ext >&5
6999 cf_have_incdir=yes
7000 fi
7001 rm -f conftest.$ac_objext conftest.$ac_ext
7002                           CPPFLAGS=$cf_save_CPPFLAGS
7003                         fi
7004                   fi
7005                 fi
7006
7007                 if test "$cf_have_incdir" = no ; then
7008                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7009
7010 echo "${as_me:-configure}:7010: testing adding $cf_add_incdir to include-path ..." 1>&5
7011
7012                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7013
7014                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7015                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7016                   cf_add_incdir="$cf_top_incdir"
7017                 else
7018                   break
7019                 fi
7020           fi
7021         done
7022   done
7023 fi
7024
7025                 for cf_header in \
7026                         ncurses.h \
7027                         curses.h
7028                 do
7029
7030         cat >conftest.$ac_ext <<_ACEOF
7031 #line 7031 "configure"
7032 #include "confdefs.h"
7033
7034 #include <$cf_header>
7035 int
7036 main ()
7037 {
7038
7039 #ifdef NCURSES_VERSION
7040
7041 printf("%s\n", NCURSES_VERSION);
7042 #else
7043 #ifdef __NCURSES_H
7044 printf("old\n");
7045 #else
7046         make an error
7047 #endif
7048 #endif
7049
7050   ;
7051   return 0;
7052 }
7053 _ACEOF
7054 rm -f conftest.$ac_objext
7055 if { (eval echo "$as_me:7055: \"$ac_compile\"") >&5
7056   (eval $ac_compile) 2>&5
7057   ac_status=$?
7058   echo "$as_me:7058: \$? = $ac_status" >&5
7059   (exit $ac_status); } &&
7060          { ac_try='test -s conftest.$ac_objext'
7061   { (eval echo "$as_me:7061: \"$ac_try\"") >&5
7062   (eval $ac_try) 2>&5
7063   ac_status=$?
7064   echo "$as_me:7064: \$? = $ac_status" >&5
7065   (exit $ac_status); }; }; then
7066   cf_cv_ncurses_h2=$cf_header
7067
7068 else
7069   echo "$as_me: failed program was:" >&5
7070 cat conftest.$ac_ext >&5
7071 cf_cv_ncurses_h2=no
7072 fi
7073 rm -f conftest.$ac_objext conftest.$ac_ext
7074
7075                         if test "$cf_cv_ncurses_h2" != no ; then
7076                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
7077                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
7078                                 break
7079                         fi
7080                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
7081                 done
7082                 CPPFLAGS="$cf_save2_CPPFLAGS"
7083                 test "$cf_cv_ncurses_h2" != no && break
7084         done
7085         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:7085: error: not found" >&5
7086 echo "$as_me: error: not found" >&2;}
7087    { (exit 1); exit 1; }; }
7088
7089 fi
7090 echo "$as_me:7090: result: $cf_cv_ncurses_h2" >&5
7091 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
7092
7093         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
7094         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
7095         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
7096                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
7097         fi
7098
7099 if test -n "$cf_1st_incdir" ; then
7100   for cf_add_incdir in $cf_1st_incdir
7101   do
7102         while test $cf_add_incdir != /usr/include
7103         do
7104           if test -d $cf_add_incdir
7105           then
7106                 cf_have_incdir=no
7107                 if test -n "$CFLAGS$CPPFLAGS" ; then
7108                   # a loop is needed to ensure we can add subdirs of existing dirs
7109                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
7110                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
7111                           cf_have_incdir=yes; break
7112                         fi
7113                   done
7114                 fi
7115
7116                 if test "$cf_have_incdir" = no ; then
7117                   if test "$cf_add_incdir" = /usr/local/include ; then
7118                         if test "$GCC" = yes
7119                         then
7120                           cf_save_CPPFLAGS=$CPPFLAGS
7121                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7122                           cat >conftest.$ac_ext <<_ACEOF
7123 #line 7123 "configure"
7124 #include "confdefs.h"
7125 #include <stdio.h>
7126 int
7127 main ()
7128 {
7129 printf("Hello")
7130   ;
7131   return 0;
7132 }
7133 _ACEOF
7134 rm -f conftest.$ac_objext
7135 if { (eval echo "$as_me:7135: \"$ac_compile\"") >&5
7136   (eval $ac_compile) 2>&5
7137   ac_status=$?
7138   echo "$as_me:7138: \$? = $ac_status" >&5
7139   (exit $ac_status); } &&
7140          { ac_try='test -s conftest.$ac_objext'
7141   { (eval echo "$as_me:7141: \"$ac_try\"") >&5
7142   (eval $ac_try) 2>&5
7143   ac_status=$?
7144   echo "$as_me:7144: \$? = $ac_status" >&5
7145   (exit $ac_status); }; }; then
7146   :
7147 else
7148   echo "$as_me: failed program was:" >&5
7149 cat conftest.$ac_ext >&5
7150 cf_have_incdir=yes
7151 fi
7152 rm -f conftest.$ac_objext conftest.$ac_ext
7153                           CPPFLAGS=$cf_save_CPPFLAGS
7154                         fi
7155                   fi
7156                 fi
7157
7158                 if test "$cf_have_incdir" = no ; then
7159                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
7160
7161 echo "${as_me:-configure}:7161: testing adding $cf_add_incdir to include-path ..." 1>&5
7162
7163                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
7164
7165                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
7166                   test "$cf_top_incdir" = "$cf_add_incdir" && break
7167                   cf_add_incdir="$cf_top_incdir"
7168                 else
7169                   break
7170                 fi
7171           fi
7172         done
7173   done
7174 fi
7175
7176 fi
7177
7178 # Set definitions to allow ifdef'ing for ncurses.h
7179
7180 case $cf_cv_ncurses_header in # (vi
7181 *ncurses.h)
7182         cat >>confdefs.h <<\EOF
7183 #define HAVE_NCURSES_H 1
7184 EOF
7185
7186         ;;
7187 esac
7188
7189 case $cf_cv_ncurses_header in # (vi
7190 ncurses/curses.h|ncurses/ncurses.h)
7191         cat >>confdefs.h <<\EOF
7192 #define HAVE_NCURSES_NCURSES_H 1
7193 EOF
7194
7195         ;;
7196 ncursesw/curses.h|ncursesw/ncurses.h)
7197         cat >>confdefs.h <<\EOF
7198 #define HAVE_NCURSESW_NCURSES_H 1
7199 EOF
7200
7201         ;;
7202 esac
7203
7204 echo "$as_me:7204: checking for terminfo header" >&5
7205 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
7206 if test "${cf_cv_term_header+set}" = set; then
7207   echo $ECHO_N "(cached) $ECHO_C" >&6
7208 else
7209
7210 case ${cf_cv_ncurses_header} in #(vi
7211 */ncurses.h|*/ncursesw.h) #(vi
7212         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
7213         ;;
7214 *)
7215         cf_term_header=term.h
7216         ;;
7217 esac
7218
7219 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
7220 do
7221 cat >conftest.$ac_ext <<_ACEOF
7222 #line 7222 "configure"
7223 #include "confdefs.h"
7224 #include <stdio.h>
7225 #include <${cf_cv_ncurses_header:-curses.h}>
7226 #include <$cf_test>
7227
7228 int
7229 main ()
7230 {
7231 int x = auto_left_margin
7232   ;
7233   return 0;
7234 }
7235 _ACEOF
7236 rm -f conftest.$ac_objext
7237 if { (eval echo "$as_me:7237: \"$ac_compile\"") >&5
7238   (eval $ac_compile) 2>&5
7239   ac_status=$?
7240   echo "$as_me:7240: \$? = $ac_status" >&5
7241   (exit $ac_status); } &&
7242          { ac_try='test -s conftest.$ac_objext'
7243   { (eval echo "$as_me:7243: \"$ac_try\"") >&5
7244   (eval $ac_try) 2>&5
7245   ac_status=$?
7246   echo "$as_me:7246: \$? = $ac_status" >&5
7247   (exit $ac_status); }; }; then
7248
7249         cf_cv_term_header="$cf_test"
7250 else
7251   echo "$as_me: failed program was:" >&5
7252 cat conftest.$ac_ext >&5
7253
7254         cf_cv_term_header=unknown
7255
7256 fi
7257 rm -f conftest.$ac_objext conftest.$ac_ext
7258         test "$cf_cv_term_header" != unknown && break
7259 done
7260
7261 fi
7262 echo "$as_me:7262: result: $cf_cv_term_header" >&5
7263 echo "${ECHO_T}$cf_cv_term_header" >&6
7264
7265 # Set definitions to allow ifdef'ing to accommodate subdirectories
7266
7267 case $cf_cv_term_header in # (vi
7268 *term.h)
7269         cat >>confdefs.h <<\EOF
7270 #define HAVE_TERM_H 1
7271 EOF
7272
7273         ;;
7274 esac
7275
7276 case $cf_cv_term_header in # (vi
7277 ncurses/term.h) #(vi
7278         cat >>confdefs.h <<\EOF
7279 #define HAVE_NCURSES_TERM_H 1
7280 EOF
7281
7282         ;;
7283 ncursesw/term.h)
7284         cat >>confdefs.h <<\EOF
7285 #define HAVE_NCURSESW_TERM_H 1
7286 EOF
7287
7288         ;;
7289 esac
7290
7291 # some applications need this, but should check for NCURSES_VERSION
7292 cat >>confdefs.h <<\EOF
7293 #define NCURSES 1
7294 EOF
7295
7296 echo "$as_me:7296: checking for ncurses version" >&5
7297 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
7298 if test "${cf_cv_ncurses_version+set}" = set; then
7299   echo $ECHO_N "(cached) $ECHO_C" >&6
7300 else
7301
7302         cf_cv_ncurses_version=no
7303         cf_tempfile=out$$
7304         rm -f $cf_tempfile
7305         if test "$cross_compiling" = yes; then
7306
7307         # This will not work if the preprocessor splits the line after the
7308         # Autoconf token.  The 'unproto' program does that.
7309         cat > conftest.$ac_ext <<EOF
7310 #include <${cf_cv_ncurses_header:-curses.h}>
7311 #undef Autoconf
7312 #ifdef NCURSES_VERSION
7313 Autoconf NCURSES_VERSION
7314 #else
7315 #ifdef __NCURSES_H
7316 Autoconf "old"
7317 #endif
7318 ;
7319 #endif
7320 EOF
7321         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
7322         { (eval echo "$as_me:7322: \"$cf_try\"") >&5
7323   (eval $cf_try) 2>&5
7324   ac_status=$?
7325   echo "$as_me:7325: \$? = $ac_status" >&5
7326   (exit $ac_status); }
7327         if test -f conftest.out ; then
7328                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
7329                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
7330                 rm -f conftest.out
7331         fi
7332
7333 else
7334   cat >conftest.$ac_ext <<_ACEOF
7335 #line 7335 "configure"
7336 #include "confdefs.h"
7337
7338 #include <${cf_cv_ncurses_header:-curses.h}>
7339 #include <stdio.h>
7340 int main()
7341 {
7342         FILE *fp = fopen("$cf_tempfile", "w");
7343 #ifdef NCURSES_VERSION
7344 # ifdef NCURSES_VERSION_PATCH
7345         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
7346 # else
7347         fprintf(fp, "%s\n", NCURSES_VERSION);
7348 # endif
7349 #else
7350 # ifdef __NCURSES_H
7351         fprintf(fp, "old\n");
7352 # else
7353         make an error
7354 # endif
7355 #endif
7356         ${cf_cv_main_return:-return}(0);
7357 }
7358 _ACEOF
7359 rm -f conftest$ac_exeext
7360 if { (eval echo "$as_me:7360: \"$ac_link\"") >&5
7361   (eval $ac_link) 2>&5
7362   ac_status=$?
7363   echo "$as_me:7363: \$? = $ac_status" >&5
7364   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
7365   { (eval echo "$as_me:7365: \"$ac_try\"") >&5
7366   (eval $ac_try) 2>&5
7367   ac_status=$?
7368   echo "$as_me:7368: \$? = $ac_status" >&5
7369   (exit $ac_status); }; }; then
7370
7371         cf_cv_ncurses_version=`cat $cf_tempfile`
7372 else
7373   echo "$as_me: program exited with status $ac_status" >&5
7374 echo "$as_me: failed program was:" >&5
7375 cat conftest.$ac_ext >&5
7376 fi
7377 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
7378 fi
7379         rm -f $cf_tempfile
7380
7381 fi
7382 echo "$as_me:7382: result: $cf_cv_ncurses_version" >&5
7383 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
7384 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
7385 #define NCURSES 1
7386 EOF
7387
7388 cf_nculib_root=ncurses
7389         # This works, except for the special case where we find gpm, but
7390         # ncurses is in a nonstandard location via $LIBS, and we really want
7391         # to link gpm.
7392 cf_ncurses_LIBS=""
7393 cf_ncurses_SAVE="$LIBS"
7394 echo "$as_me:7394: checking for Gpm_Open in -lgpm" >&5
7395 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
7396 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
7397   echo $ECHO_N "(cached) $ECHO_C" >&6
7398 else
7399   ac_check_lib_save_LIBS=$LIBS
7400 LIBS="-lgpm  $LIBS"
7401 cat >conftest.$ac_ext <<_ACEOF
7402 #line 7402 "configure"
7403 #include "confdefs.h"
7404
7405 /* Override any gcc2 internal prototype to avoid an error.  */
7406 #ifdef __cplusplus
7407 extern "C"
7408 #endif
7409 /* We use char because int might match the return type of a gcc2
7410    builtin and then its argument prototype would still apply.  */
7411 char Gpm_Open ();
7412 int
7413 main ()
7414 {
7415 Gpm_Open ();
7416   ;
7417   return 0;
7418 }
7419 _ACEOF
7420 rm -f conftest.$ac_objext conftest$ac_exeext
7421 if { (eval echo "$as_me:7421: \"$ac_link\"") >&5
7422   (eval $ac_link) 2>&5
7423   ac_status=$?
7424   echo "$as_me:7424: \$? = $ac_status" >&5
7425   (exit $ac_status); } &&
7426          { ac_try='test -s conftest$ac_exeext'
7427   { (eval echo "$as_me:7427: \"$ac_try\"") >&5
7428   (eval $ac_try) 2>&5
7429   ac_status=$?
7430   echo "$as_me:7430: \$? = $ac_status" >&5
7431   (exit $ac_status); }; }; then
7432   ac_cv_lib_gpm_Gpm_Open=yes
7433 else
7434   echo "$as_me: failed program was:" >&5
7435 cat conftest.$ac_ext >&5
7436 ac_cv_lib_gpm_Gpm_Open=no
7437 fi
7438 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7439 LIBS=$ac_check_lib_save_LIBS
7440 fi
7441 echo "$as_me:7441: result: $ac_cv_lib_gpm_Gpm_Open" >&5
7442 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
7443 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
7444   echo "$as_me:7444: checking for initscr in -lgpm" >&5
7445 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
7446 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
7447   echo $ECHO_N "(cached) $ECHO_C" >&6
7448 else
7449   ac_check_lib_save_LIBS=$LIBS
7450 LIBS="-lgpm  $LIBS"
7451 cat >conftest.$ac_ext <<_ACEOF
7452 #line 7452 "configure"
7453 #include "confdefs.h"
7454
7455 /* Override any gcc2 internal prototype to avoid an error.  */
7456 #ifdef __cplusplus
7457 extern "C"
7458 #endif
7459 /* We use char because int might match the return type of a gcc2
7460    builtin and then its argument prototype would still apply.  */
7461 char initscr ();
7462 int
7463 main ()
7464 {
7465 initscr ();
7466   ;
7467   return 0;
7468 }
7469 _ACEOF
7470 rm -f conftest.$ac_objext conftest$ac_exeext
7471 if { (eval echo "$as_me:7471: \"$ac_link\"") >&5
7472   (eval $ac_link) 2>&5
7473   ac_status=$?
7474   echo "$as_me:7474: \$? = $ac_status" >&5
7475   (exit $ac_status); } &&
7476          { ac_try='test -s conftest$ac_exeext'
7477   { (eval echo "$as_me:7477: \"$ac_try\"") >&5
7478   (eval $ac_try) 2>&5
7479   ac_status=$?
7480   echo "$as_me:7480: \$? = $ac_status" >&5
7481   (exit $ac_status); }; }; then
7482   ac_cv_lib_gpm_initscr=yes
7483 else
7484   echo "$as_me: failed program was:" >&5
7485 cat conftest.$ac_ext >&5
7486 ac_cv_lib_gpm_initscr=no
7487 fi
7488 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7489 LIBS=$ac_check_lib_save_LIBS
7490 fi
7491 echo "$as_me:7491: result: $ac_cv_lib_gpm_initscr" >&5
7492 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
7493 if test $ac_cv_lib_gpm_initscr = yes; then
7494   LIBS="$cf_ncurses_SAVE"
7495 else
7496   cf_ncurses_LIBS="-lgpm"
7497 fi
7498
7499 fi
7500
7501 case $host_os in #(vi
7502 freebsd*)
7503         # This is only necessary if you are linking against an obsolete
7504         # version of ncurses (but it should do no harm, since it's static).
7505         if test "$cf_nculib_root" = ncurses ; then
7506                 echo "$as_me:7506: checking for tgoto in -lmytinfo" >&5
7507 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
7508 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
7509   echo $ECHO_N "(cached) $ECHO_C" >&6
7510 else
7511   ac_check_lib_save_LIBS=$LIBS
7512 LIBS="-lmytinfo  $LIBS"
7513 cat >conftest.$ac_ext <<_ACEOF
7514 #line 7514 "configure"
7515 #include "confdefs.h"
7516
7517 /* Override any gcc2 internal prototype to avoid an error.  */
7518 #ifdef __cplusplus
7519 extern "C"
7520 #endif
7521 /* We use char because int might match the return type of a gcc2
7522    builtin and then its argument prototype would still apply.  */
7523 char tgoto ();
7524 int
7525 main ()
7526 {
7527 tgoto ();
7528   ;
7529   return 0;
7530 }
7531 _ACEOF
7532 rm -f conftest.$ac_objext conftest$ac_exeext
7533 if { (eval echo "$as_me:7533: \"$ac_link\"") >&5
7534   (eval $ac_link) 2>&5
7535   ac_status=$?
7536   echo "$as_me:7536: \$? = $ac_status" >&5
7537   (exit $ac_status); } &&
7538          { ac_try='test -s conftest$ac_exeext'
7539   { (eval echo "$as_me:7539: \"$ac_try\"") >&5
7540   (eval $ac_try) 2>&5
7541   ac_status=$?
7542   echo "$as_me:7542: \$? = $ac_status" >&5
7543   (exit $ac_status); }; }; then
7544   ac_cv_lib_mytinfo_tgoto=yes
7545 else
7546   echo "$as_me: failed program was:" >&5
7547 cat conftest.$ac_ext >&5
7548 ac_cv_lib_mytinfo_tgoto=no
7549 fi
7550 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7551 LIBS=$ac_check_lib_save_LIBS
7552 fi
7553 echo "$as_me:7553: result: $ac_cv_lib_mytinfo_tgoto" >&5
7554 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
7555 if test $ac_cv_lib_mytinfo_tgoto = yes; then
7556   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
7557 fi
7558
7559         fi
7560         ;;
7561 esac
7562
7563 LIBS="$cf_ncurses_LIBS $LIBS"
7564
7565 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
7566 then
7567         LIBS="-l$cf_nculib_root $LIBS"
7568 else
7569
7570         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
7571         cf_libdir=""
7572         echo "$as_me:7572: checking for initscr" >&5
7573 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
7574 if test "${ac_cv_func_initscr+set}" = set; then
7575   echo $ECHO_N "(cached) $ECHO_C" >&6
7576 else
7577   cat >conftest.$ac_ext <<_ACEOF
7578 #line 7578 "configure"
7579 #include "confdefs.h"
7580 /* System header to define __stub macros and hopefully few prototypes,
7581     which can conflict with char initscr (); below.  */
7582 #include <assert.h>
7583 /* Override any gcc2 internal prototype to avoid an error.  */
7584 #ifdef __cplusplus
7585 extern "C"
7586 #endif
7587 /* We use char because int might match the return type of a gcc2
7588    builtin and then its argument prototype would still apply.  */
7589 char initscr ();
7590 char (*f) ();
7591
7592 int
7593 main ()
7594 {
7595 /* The GNU C library defines this for functions which it implements
7596     to always fail with ENOSYS.  Some functions are actually named
7597     something starting with __ and the normal name is an alias.  */
7598 #if defined (__stub_initscr) || defined (__stub___initscr)
7599 choke me
7600 #else
7601 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
7602 #endif
7603
7604   ;
7605   return 0;
7606 }
7607 _ACEOF
7608 rm -f conftest.$ac_objext conftest$ac_exeext
7609 if { (eval echo "$as_me:7609: \"$ac_link\"") >&5
7610   (eval $ac_link) 2>&5
7611   ac_status=$?
7612   echo "$as_me:7612: \$? = $ac_status" >&5
7613   (exit $ac_status); } &&
7614          { ac_try='test -s conftest$ac_exeext'
7615   { (eval echo "$as_me:7615: \"$ac_try\"") >&5
7616   (eval $ac_try) 2>&5
7617   ac_status=$?
7618   echo "$as_me:7618: \$? = $ac_status" >&5
7619   (exit $ac_status); }; }; then
7620   ac_cv_func_initscr=yes
7621 else
7622   echo "$as_me: failed program was:" >&5
7623 cat conftest.$ac_ext >&5
7624 ac_cv_func_initscr=no
7625 fi
7626 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7627 fi
7628 echo "$as_me:7628: result: $ac_cv_func_initscr" >&5
7629 echo "${ECHO_T}$ac_cv_func_initscr" >&6
7630 if test $ac_cv_func_initscr = yes; then
7631   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7632 else
7633
7634                 cf_save_LIBS="$LIBS"
7635                 echo "$as_me:7635: checking for initscr in -l$cf_nculib_root" >&5
7636 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
7637                 LIBS="-l$cf_nculib_root $LIBS"
7638                 cat >conftest.$ac_ext <<_ACEOF
7639 #line 7639 "configure"
7640 #include "confdefs.h"
7641 #include <${cf_cv_ncurses_header:-curses.h}>
7642 int
7643 main ()
7644 {
7645 initscr()
7646   ;
7647   return 0;
7648 }
7649 _ACEOF
7650 rm -f conftest.$ac_objext conftest$ac_exeext
7651 if { (eval echo "$as_me:7651: \"$ac_link\"") >&5
7652   (eval $ac_link) 2>&5
7653   ac_status=$?
7654   echo "$as_me:7654: \$? = $ac_status" >&5
7655   (exit $ac_status); } &&
7656          { ac_try='test -s conftest$ac_exeext'
7657   { (eval echo "$as_me:7657: \"$ac_try\"") >&5
7658   (eval $ac_try) 2>&5
7659   ac_status=$?
7660   echo "$as_me:7660: \$? = $ac_status" >&5
7661   (exit $ac_status); }; }; then
7662   echo "$as_me:7662: result: yes" >&5
7663 echo "${ECHO_T}yes" >&6
7664                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7665
7666 else
7667   echo "$as_me: failed program was:" >&5
7668 cat conftest.$ac_ext >&5
7669 echo "$as_me:7669: result: no" >&5
7670 echo "${ECHO_T}no" >&6
7671
7672 cf_search=
7673 cf_library_path_list=""
7674 if test -n "${LDFLAGS}${LIBS}" ; then
7675         for cf_library_path in $LDFLAGS $LIBS
7676         do
7677                 case $cf_library_path in #(vi
7678                 -L*)
7679                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
7680
7681 test "$cf_library_path" != "NONE" && \
7682 test -d "$cf_library_path" && \
7683  {
7684         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
7685         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
7686         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
7687         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
7688         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
7689         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"
7690 }
7691
7692                         cf_library_path_list="$cf_library_path_list $cf_search"
7693                         ;;
7694                 esac
7695         done
7696 fi
7697
7698 cf_search=
7699
7700 test "/usr" != "$prefix" && \
7701 test -d "/usr" && \
7702 (test $prefix = NONE || test "/usr" != "$prefix") && {
7703         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
7704         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
7705         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
7706         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
7707         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
7708         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
7709 }
7710
7711 test "$prefix" != "NONE" && \
7712 test -d "$prefix" && \
7713  {
7714         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
7715         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
7716         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
7717         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
7718         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
7719         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
7720 }
7721
7722 test "/usr/local" != "$prefix" && \
7723 test -d "/usr/local" && \
7724 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
7725         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
7726         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
7727         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
7728         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
7729         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
7730         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
7731 }
7732
7733 test "/opt" != "$prefix" && \
7734 test -d "/opt" && \
7735 (test $prefix = NONE || test "/opt" != "$prefix") && {
7736         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
7737         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
7738         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
7739         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
7740         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
7741         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
7742 }
7743
7744 test "$HOME" != "$prefix" && \
7745 test -d "$HOME" && \
7746 (test $prefix = NONE || test "$HOME" != "$prefix") && {
7747         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
7748         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
7749         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
7750         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
7751         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
7752         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
7753 }
7754
7755 cf_search="$cf_library_path_list $cf_search"
7756
7757                         for cf_libdir in $cf_search
7758                         do
7759                                 echo "$as_me:7759: checking for -l$cf_nculib_root in $cf_libdir" >&5
7760 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
7761                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
7762                                 cat >conftest.$ac_ext <<_ACEOF
7763 #line 7763 "configure"
7764 #include "confdefs.h"
7765 #include <${cf_cv_ncurses_header:-curses.h}>
7766 int
7767 main ()
7768 {
7769 initscr()
7770   ;
7771   return 0;
7772 }
7773 _ACEOF
7774 rm -f conftest.$ac_objext conftest$ac_exeext
7775 if { (eval echo "$as_me:7775: \"$ac_link\"") >&5
7776   (eval $ac_link) 2>&5
7777   ac_status=$?
7778   echo "$as_me:7778: \$? = $ac_status" >&5
7779   (exit $ac_status); } &&
7780          { ac_try='test -s conftest$ac_exeext'
7781   { (eval echo "$as_me:7781: \"$ac_try\"") >&5
7782   (eval $ac_try) 2>&5
7783   ac_status=$?
7784   echo "$as_me:7784: \$? = $ac_status" >&5
7785   (exit $ac_status); }; }; then
7786   echo "$as_me:7786: result: yes" >&5
7787 echo "${ECHO_T}yes" >&6
7788                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
7789                                          break
7790 else
7791   echo "$as_me: failed program was:" >&5
7792 cat conftest.$ac_ext >&5
7793 echo "$as_me:7793: result: no" >&5
7794 echo "${ECHO_T}no" >&6
7795                                          LIBS="$cf_save_LIBS"
7796 fi
7797 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7798                         done
7799
7800 fi
7801 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7802
7803 fi
7804
7805 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
7806
7807 if test $cf_found_library = no ; then
7808         { { echo "$as_me:7808: error: Cannot link $cf_nculib_root library" >&5
7809 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
7810    { (exit 1); exit 1; }; }
7811 fi
7812
7813 fi
7814
7815 if test -n "$cf_ncurses_LIBS" ; then
7816         echo "$as_me:7816: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
7817 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
7818         cf_ncurses_SAVE="$LIBS"
7819         for p in $cf_ncurses_LIBS ; do
7820                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
7821                 if test "$q" != "$LIBS" ; then
7822                         LIBS="$q"
7823                 fi
7824         done
7825         cat >conftest.$ac_ext <<_ACEOF
7826 #line 7826 "configure"
7827 #include "confdefs.h"
7828 #include <${cf_cv_ncurses_header:-curses.h}>
7829 int
7830 main ()
7831 {
7832 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
7833   ;
7834   return 0;
7835 }
7836 _ACEOF
7837 rm -f conftest.$ac_objext conftest$ac_exeext
7838 if { (eval echo "$as_me:7838: \"$ac_link\"") >&5
7839   (eval $ac_link) 2>&5
7840   ac_status=$?
7841   echo "$as_me:7841: \$? = $ac_status" >&5
7842   (exit $ac_status); } &&
7843          { ac_try='test -s conftest$ac_exeext'
7844   { (eval echo "$as_me:7844: \"$ac_try\"") >&5
7845   (eval $ac_try) 2>&5
7846   ac_status=$?
7847   echo "$as_me:7847: \$? = $ac_status" >&5
7848   (exit $ac_status); }; }; then
7849   echo "$as_me:7849: result: yes" >&5
7850 echo "${ECHO_T}yes" >&6
7851 else
7852   echo "$as_me: failed program was:" >&5
7853 cat conftest.$ac_ext >&5
7854 echo "$as_me:7854: result: no" >&5
7855 echo "${ECHO_T}no" >&6
7856                  LIBS="$cf_ncurses_SAVE"
7857 fi
7858 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
7859 fi
7860
7861 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
7862
7863 cat >>confdefs.h <<EOF
7864 #define $cf_nculib_ROOT 1
7865 EOF
7866
7867 fi
7868
7869         ;;
7870 ncursesw) #(vi
7871
7872 echo "$as_me:7872: checking for multibyte character support" >&5
7873 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6
7874 if test "${cf_cv_utf8_lib+set}" = set; then
7875   echo $ECHO_N "(cached) $ECHO_C" >&6
7876 else
7877
7878         cf_save_LIBS="$LIBS"
7879         cat >conftest.$ac_ext <<_ACEOF
7880 #line 7880 "configure"
7881 #include "confdefs.h"
7882
7883 #include <stdlib.h>
7884 int
7885 main ()
7886 {
7887 putwc(0,0);
7888   ;
7889   return 0;
7890 }
7891 _ACEOF
7892 rm -f conftest.$ac_objext conftest$ac_exeext
7893 if { (eval echo "$as_me:7893: \"$ac_link\"") >&5
7894   (eval $ac_link) 2>&5
7895   ac_status=$?
7896   echo "$as_me:7896: \$? = $ac_status" >&5
7897   (exit $ac_status); } &&
7898          { ac_try='test -s conftest$ac_exeext'
7899   { (eval echo "$as_me:7899: \"$ac_try\"") >&5
7900   (eval $ac_try) 2>&5
7901   ac_status=$?
7902   echo "$as_me:7902: \$? = $ac_status" >&5
7903   (exit $ac_status); }; }; then
7904   cf_cv_utf8_lib=yes
7905 else
7906   echo "$as_me: failed program was:" >&5
7907 cat conftest.$ac_ext >&5
7908
7909 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
7910 # will be set on completion of the AC_TRY_LINK below.
7911 cf_cv_header_path_utf8=
7912 cf_cv_library_path_utf8=
7913
7914 echo "${as_me:-configure}:7914: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5
7915
7916 cf_save_LIBS="$LIBS"
7917
7918 cat >conftest.$ac_ext <<_ACEOF
7919 #line 7919 "configure"
7920 #include "confdefs.h"
7921
7922 #include <libutf8.h>
7923 int
7924 main ()
7925 {
7926 putwc(0,0);
7927   ;
7928   return 0;
7929 }
7930 _ACEOF
7931 rm -f conftest.$ac_objext conftest$ac_exeext
7932 if { (eval echo "$as_me:7932: \"$ac_link\"") >&5
7933   (eval $ac_link) 2>&5
7934   ac_status=$?
7935   echo "$as_me:7935: \$? = $ac_status" >&5
7936   (exit $ac_status); } &&
7937          { ac_try='test -s conftest$ac_exeext'
7938   { (eval echo "$as_me:7938: \"$ac_try\"") >&5
7939   (eval $ac_try) 2>&5
7940   ac_status=$?
7941   echo "$as_me:7941: \$? = $ac_status" >&5
7942   (exit $ac_status); }; }; then
7943
7944         cf_cv_find_linkage_utf8=yes
7945         cf_cv_header_path_utf8=/usr/include
7946         cf_cv_library_path_utf8=/usr/lib
7947
7948 else
7949   echo "$as_me: failed program was:" >&5
7950 cat conftest.$ac_ext >&5
7951
7952 LIBS="-lutf8  $cf_save_LIBS"
7953
7954 cat >conftest.$ac_ext <<_ACEOF
7955 #line 7955 "configure"
7956 #include "confdefs.h"
7957
7958 #include <libutf8.h>
7959 int
7960 main ()
7961 {
7962 putwc(0,0);
7963   ;
7964   return 0;
7965 }
7966 _ACEOF
7967 rm -f conftest.$ac_objext conftest$ac_exeext
7968 if { (eval echo "$as_me:7968: \"$ac_link\"") >&5
7969   (eval $ac_link) 2>&5
7970   ac_status=$?
7971   echo "$as_me:7971: \$? = $ac_status" >&5
7972   (exit $ac_status); } &&
7973          { ac_try='test -s conftest$ac_exeext'
7974   { (eval echo "$as_me:7974: \"$ac_try\"") >&5
7975   (eval $ac_try) 2>&5
7976   ac_status=$?
7977   echo "$as_me:7977: \$? = $ac_status" >&5
7978   (exit $ac_status); }; }; then
7979
7980         cf_cv_find_linkage_utf8=yes
7981         cf_cv_header_path_utf8=/usr/include
7982         cf_cv_library_path_utf8=/usr/lib
7983         cf_cv_library_file_utf8="-lutf8"
7984
7985 else
7986   echo "$as_me: failed program was:" >&5
7987 cat conftest.$ac_ext >&5
7988
7989         cf_cv_find_linkage_utf8=no
7990         LIBS="$cf_save_LIBS"
7991
7992     test -n "$verbose" && echo "        find linkage for utf8 library" 1>&6
7993
7994 echo "${as_me:-configure}:7994: testing find linkage for utf8 library ..." 1>&5
7995
7996 echo "${as_me:-configure}:7996: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5
7997
7998     cf_save_CPPFLAGS="$CPPFLAGS"
7999     cf_test_CPPFLAGS="$CPPFLAGS"
8000
8001 cf_search=
8002
8003 # collect the current set of include-directories from compiler flags
8004 cf_header_path_list=""
8005 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8006         for cf_header_path in $CPPFLAGS $CFLAGS
8007         do
8008                 case $cf_header_path in #(vi
8009                 -I*)
8010                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8011
8012 test "$cf_header_path" != "NONE" && \
8013 test -d "$cf_header_path" && \
8014  {
8015         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8016         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8017         test -d $cf_header_path/include/utf8 &&       cf_search="$cf_search $cf_header_path/include/utf8"
8018         test -d $cf_header_path/include/utf8/include &&    cf_search="$cf_search $cf_header_path/include/utf8/include"
8019         test -d $cf_header_path/utf8/include &&       cf_search="$cf_search $cf_header_path/utf8/include"
8020         test -d $cf_header_path/utf8/include/utf8 &&    cf_search="$cf_search $cf_header_path/utf8/include/utf8"
8021 }
8022
8023                         cf_header_path_list="$cf_header_path_list $cf_search"
8024                         ;;
8025                 esac
8026         done
8027 fi
8028
8029 # add the variations for the package we are looking for
8030
8031 cf_search=
8032
8033 test "/usr" != "$prefix" && \
8034 test -d "/usr" && \
8035 (test $prefix = NONE || test "/usr" != "$prefix") && {
8036         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8037         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8038         test -d /usr/include/utf8 &&       cf_search="$cf_search /usr/include/utf8"
8039         test -d /usr/include/utf8/include &&    cf_search="$cf_search /usr/include/utf8/include"
8040         test -d /usr/utf8/include &&       cf_search="$cf_search /usr/utf8/include"
8041         test -d /usr/utf8/include/utf8 &&    cf_search="$cf_search /usr/utf8/include/utf8"
8042 }
8043
8044 test "$prefix" != "NONE" && \
8045 test -d "$prefix" && \
8046  {
8047         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8048         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8049         test -d $prefix/include/utf8 &&       cf_search="$cf_search $prefix/include/utf8"
8050         test -d $prefix/include/utf8/include &&    cf_search="$cf_search $prefix/include/utf8/include"
8051         test -d $prefix/utf8/include &&       cf_search="$cf_search $prefix/utf8/include"
8052         test -d $prefix/utf8/include/utf8 &&    cf_search="$cf_search $prefix/utf8/include/utf8"
8053 }
8054
8055 test "/usr/local" != "$prefix" && \
8056 test -d "/usr/local" && \
8057 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8058         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8059         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8060         test -d /usr/local/include/utf8 &&       cf_search="$cf_search /usr/local/include/utf8"
8061         test -d /usr/local/include/utf8/include &&    cf_search="$cf_search /usr/local/include/utf8/include"
8062         test -d /usr/local/utf8/include &&       cf_search="$cf_search /usr/local/utf8/include"
8063         test -d /usr/local/utf8/include/utf8 &&    cf_search="$cf_search /usr/local/utf8/include/utf8"
8064 }
8065
8066 test "/opt" != "$prefix" && \
8067 test -d "/opt" && \
8068 (test $prefix = NONE || test "/opt" != "$prefix") && {
8069         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8070         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8071         test -d /opt/include/utf8 &&       cf_search="$cf_search /opt/include/utf8"
8072         test -d /opt/include/utf8/include &&    cf_search="$cf_search /opt/include/utf8/include"
8073         test -d /opt/utf8/include &&       cf_search="$cf_search /opt/utf8/include"
8074         test -d /opt/utf8/include/utf8 &&    cf_search="$cf_search /opt/utf8/include/utf8"
8075 }
8076
8077 test "$HOME" != "$prefix" && \
8078 test -d "$HOME" && \
8079 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8080         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8081         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8082         test -d $HOME/include/utf8 &&       cf_search="$cf_search $HOME/include/utf8"
8083         test -d $HOME/include/utf8/include &&    cf_search="$cf_search $HOME/include/utf8/include"
8084         test -d $HOME/utf8/include &&       cf_search="$cf_search $HOME/utf8/include"
8085         test -d $HOME/utf8/include/utf8 &&    cf_search="$cf_search $HOME/utf8/include/utf8"
8086 }
8087
8088 test "$includedir" != NONE && \
8089 test "$includedir" != "/usr/include" && \
8090 test -d "$includedir" && {
8091         test -d $includedir &&    cf_search="$cf_search $includedir"
8092         test -d $includedir/utf8 && cf_search="$cf_search $includedir/utf8"
8093 }
8094
8095 test "$oldincludedir" != NONE && \
8096 test "$oldincludedir" != "/usr/include" && \
8097 test -d "$oldincludedir" && {
8098         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8099         test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8"
8100 }
8101
8102 cf_search="$cf_search $cf_header_path_list"
8103
8104     for cf_cv_header_path_utf8 in $cf_search
8105     do
8106       if test -d $cf_cv_header_path_utf8 ; then
8107         test -n "$verbose" && echo "    ... testing $cf_cv_header_path_utf8" 1>&6
8108
8109 echo "${as_me:-configure}:8109: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5
8110
8111         CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8"
8112         cat >conftest.$ac_ext <<_ACEOF
8113 #line 8113 "configure"
8114 #include "confdefs.h"
8115
8116 #include <libutf8.h>
8117 int
8118 main ()
8119 {
8120 putwc(0,0);
8121   ;
8122   return 0;
8123 }
8124 _ACEOF
8125 rm -f conftest.$ac_objext
8126 if { (eval echo "$as_me:8126: \"$ac_compile\"") >&5
8127   (eval $ac_compile) 2>&5
8128   ac_status=$?
8129   echo "$as_me:8129: \$? = $ac_status" >&5
8130   (exit $ac_status); } &&
8131          { ac_try='test -s conftest.$ac_objext'
8132   { (eval echo "$as_me:8132: \"$ac_try\"") >&5
8133   (eval $ac_try) 2>&5
8134   ac_status=$?
8135   echo "$as_me:8135: \$? = $ac_status" >&5
8136   (exit $ac_status); }; }; then
8137
8138             test -n "$verbose" && echo "        ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6
8139
8140 echo "${as_me:-configure}:8140: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5
8141
8142             cf_cv_find_linkage_utf8=maybe
8143             cf_test_CPPFLAGS="$CPPFLAGS"
8144             break
8145 else
8146   echo "$as_me: failed program was:" >&5
8147 cat conftest.$ac_ext >&5
8148
8149             CPPFLAGS="$cf_save_CPPFLAGS"
8150
8151 fi
8152 rm -f conftest.$ac_objext conftest.$ac_ext
8153       fi
8154     done
8155
8156     if test "$cf_cv_find_linkage_utf8" = maybe ; then
8157
8158 echo "${as_me:-configure}:8158: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5
8159
8160       cf_save_LIBS="$LIBS"
8161       cf_save_LDFLAGS="$LDFLAGS"
8162
8163       if test "$cf_cv_find_linkage_utf8" != yes ; then
8164
8165 cf_search=
8166 cf_library_path_list=""
8167 if test -n "${LDFLAGS}${LIBS}" ; then
8168         for cf_library_path in $LDFLAGS $LIBS
8169         do
8170                 case $cf_library_path in #(vi
8171                 -L*)
8172                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
8173
8174 test "$cf_library_path" != "NONE" && \
8175 test -d "$cf_library_path" && \
8176  {
8177         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
8178         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
8179         test -d $cf_library_path/lib/utf8 &&       cf_search="$cf_search $cf_library_path/lib/utf8"
8180         test -d $cf_library_path/lib/utf8/lib &&    cf_search="$cf_search $cf_library_path/lib/utf8/lib"
8181         test -d $cf_library_path/utf8/lib &&       cf_search="$cf_search $cf_library_path/utf8/lib"
8182         test -d $cf_library_path/utf8/lib/utf8 &&    cf_search="$cf_search $cf_library_path/utf8/lib/utf8"
8183 }
8184
8185                         cf_library_path_list="$cf_library_path_list $cf_search"
8186                         ;;
8187                 esac
8188         done
8189 fi
8190
8191 cf_search=
8192
8193 test "/usr" != "$prefix" && \
8194 test -d "/usr" && \
8195 (test $prefix = NONE || test "/usr" != "$prefix") && {
8196         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
8197         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
8198         test -d /usr/lib/utf8 &&       cf_search="$cf_search /usr/lib/utf8"
8199         test -d /usr/lib/utf8/lib &&    cf_search="$cf_search /usr/lib/utf8/lib"
8200         test -d /usr/utf8/lib &&       cf_search="$cf_search /usr/utf8/lib"
8201         test -d /usr/utf8/lib/utf8 &&    cf_search="$cf_search /usr/utf8/lib/utf8"
8202 }
8203
8204 test "$prefix" != "NONE" && \
8205 test -d "$prefix" && \
8206  {
8207         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
8208         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
8209         test -d $prefix/lib/utf8 &&       cf_search="$cf_search $prefix/lib/utf8"
8210         test -d $prefix/lib/utf8/lib &&    cf_search="$cf_search $prefix/lib/utf8/lib"
8211         test -d $prefix/utf8/lib &&       cf_search="$cf_search $prefix/utf8/lib"
8212         test -d $prefix/utf8/lib/utf8 &&    cf_search="$cf_search $prefix/utf8/lib/utf8"
8213 }
8214
8215 test "/usr/local" != "$prefix" && \
8216 test -d "/usr/local" && \
8217 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8218         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
8219         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
8220         test -d /usr/local/lib/utf8 &&       cf_search="$cf_search /usr/local/lib/utf8"
8221         test -d /usr/local/lib/utf8/lib &&    cf_search="$cf_search /usr/local/lib/utf8/lib"
8222         test -d /usr/local/utf8/lib &&       cf_search="$cf_search /usr/local/utf8/lib"
8223         test -d /usr/local/utf8/lib/utf8 &&    cf_search="$cf_search /usr/local/utf8/lib/utf8"
8224 }
8225
8226 test "/opt" != "$prefix" && \
8227 test -d "/opt" && \
8228 (test $prefix = NONE || test "/opt" != "$prefix") && {
8229         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
8230         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
8231         test -d /opt/lib/utf8 &&       cf_search="$cf_search /opt/lib/utf8"
8232         test -d /opt/lib/utf8/lib &&    cf_search="$cf_search /opt/lib/utf8/lib"
8233         test -d /opt/utf8/lib &&       cf_search="$cf_search /opt/utf8/lib"
8234         test -d /opt/utf8/lib/utf8 &&    cf_search="$cf_search /opt/utf8/lib/utf8"
8235 }
8236
8237 test "$HOME" != "$prefix" && \
8238 test -d "$HOME" && \
8239 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8240         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
8241         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
8242         test -d $HOME/lib/utf8 &&       cf_search="$cf_search $HOME/lib/utf8"
8243         test -d $HOME/lib/utf8/lib &&    cf_search="$cf_search $HOME/lib/utf8/lib"
8244         test -d $HOME/utf8/lib &&       cf_search="$cf_search $HOME/utf8/lib"
8245         test -d $HOME/utf8/lib/utf8 &&    cf_search="$cf_search $HOME/utf8/lib/utf8"
8246 }
8247
8248 cf_search="$cf_library_path_list $cf_search"
8249
8250         for cf_cv_library_path_utf8 in $cf_search
8251         do
8252           if test -d $cf_cv_library_path_utf8 ; then
8253             test -n "$verbose" && echo "        ... testing $cf_cv_library_path_utf8" 1>&6
8254
8255 echo "${as_me:-configure}:8255: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5
8256
8257             CPPFLAGS="$cf_test_CPPFLAGS"
8258             LIBS="-lutf8  $cf_save_LIBS"
8259             LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8"
8260             cat >conftest.$ac_ext <<_ACEOF
8261 #line 8261 "configure"
8262 #include "confdefs.h"
8263
8264 #include <libutf8.h>
8265 int
8266 main ()
8267 {
8268 putwc(0,0);
8269   ;
8270   return 0;
8271 }
8272 _ACEOF
8273 rm -f conftest.$ac_objext conftest$ac_exeext
8274 if { (eval echo "$as_me:8274: \"$ac_link\"") >&5
8275   (eval $ac_link) 2>&5
8276   ac_status=$?
8277   echo "$as_me:8277: \$? = $ac_status" >&5
8278   (exit $ac_status); } &&
8279          { ac_try='test -s conftest$ac_exeext'
8280   { (eval echo "$as_me:8280: \"$ac_try\"") >&5
8281   (eval $ac_try) 2>&5
8282   ac_status=$?
8283   echo "$as_me:8283: \$? = $ac_status" >&5
8284   (exit $ac_status); }; }; then
8285
8286                 test -n "$verbose" && echo "    ... found utf8 library in $cf_cv_library_path_utf8" 1>&6
8287
8288 echo "${as_me:-configure}:8288: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5
8289
8290                 cf_cv_find_linkage_utf8=yes
8291                 cf_cv_library_file_utf8="-lutf8"
8292                 break
8293 else
8294   echo "$as_me: failed program was:" >&5
8295 cat conftest.$ac_ext >&5
8296
8297                 CPPFLAGS="$cf_save_CPPFLAGS"
8298                 LIBS="$cf_save_LIBS"
8299                 LDFLAGS="$cf_save_LDFLAGS"
8300
8301 fi
8302 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8303           fi
8304         done
8305         CPPFLAGS="$cf_save_CPPFLAGS"
8306         LDFLAGS="$cf_save_LDFLAGS"
8307       fi
8308
8309     else
8310       cf_cv_find_linkage_utf8=no
8311     fi
8312
8313 fi
8314 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8315
8316 fi
8317 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8318
8319 LIBS="$cf_save_LIBS"
8320
8321 if test "$cf_cv_find_linkage_utf8" = yes ; then
8322 cf_cv_utf8_lib=add-on
8323 else
8324 cf_cv_utf8_lib=no
8325 fi
8326
8327 fi
8328 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
8329 fi
8330 echo "$as_me:8330: result: $cf_cv_utf8_lib" >&5
8331 echo "${ECHO_T}$cf_cv_utf8_lib" >&6
8332
8333 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
8334 # ncurses/ncursesw:
8335 if test "$cf_cv_utf8_lib" = "add-on" ; then
8336         cat >>confdefs.h <<\EOF
8337 #define HAVE_LIBUTF8_H 1
8338 EOF
8339
8340 if test -n "$cf_cv_header_path_utf8" ; then
8341   for cf_add_incdir in $cf_cv_header_path_utf8
8342   do
8343         while test $cf_add_incdir != /usr/include
8344         do
8345           if test -d $cf_add_incdir
8346           then
8347                 cf_have_incdir=no
8348                 if test -n "$CFLAGS$CPPFLAGS" ; then
8349                   # a loop is needed to ensure we can add subdirs of existing dirs
8350                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8351                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8352                           cf_have_incdir=yes; break
8353                         fi
8354                   done
8355                 fi
8356
8357                 if test "$cf_have_incdir" = no ; then
8358                   if test "$cf_add_incdir" = /usr/local/include ; then
8359                         if test "$GCC" = yes
8360                         then
8361                           cf_save_CPPFLAGS=$CPPFLAGS
8362                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8363                           cat >conftest.$ac_ext <<_ACEOF
8364 #line 8364 "configure"
8365 #include "confdefs.h"
8366 #include <stdio.h>
8367 int
8368 main ()
8369 {
8370 printf("Hello")
8371   ;
8372   return 0;
8373 }
8374 _ACEOF
8375 rm -f conftest.$ac_objext
8376 if { (eval echo "$as_me:8376: \"$ac_compile\"") >&5
8377   (eval $ac_compile) 2>&5
8378   ac_status=$?
8379   echo "$as_me:8379: \$? = $ac_status" >&5
8380   (exit $ac_status); } &&
8381          { ac_try='test -s conftest.$ac_objext'
8382   { (eval echo "$as_me:8382: \"$ac_try\"") >&5
8383   (eval $ac_try) 2>&5
8384   ac_status=$?
8385   echo "$as_me:8385: \$? = $ac_status" >&5
8386   (exit $ac_status); }; }; then
8387   :
8388 else
8389   echo "$as_me: failed program was:" >&5
8390 cat conftest.$ac_ext >&5
8391 cf_have_incdir=yes
8392 fi
8393 rm -f conftest.$ac_objext conftest.$ac_ext
8394                           CPPFLAGS=$cf_save_CPPFLAGS
8395                         fi
8396                   fi
8397                 fi
8398
8399                 if test "$cf_have_incdir" = no ; then
8400                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8401
8402 echo "${as_me:-configure}:8402: testing adding $cf_add_incdir to include-path ..." 1>&5
8403
8404                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8405
8406                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8407                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8408                   cf_add_incdir="$cf_top_incdir"
8409                 else
8410                   break
8411                 fi
8412           fi
8413         done
8414   done
8415 fi
8416
8417 if test -n "$cf_cv_library_path_utf8" ; then
8418   for cf_add_libdir in $cf_cv_library_path_utf8
8419   do
8420     if test $cf_add_libdir = /usr/lib ; then
8421       :
8422     elif test -d $cf_add_libdir
8423     then
8424       cf_have_libdir=no
8425       if test -n "$LDFLAGS$LIBS" ; then
8426         # a loop is needed to ensure we can add subdirs of existing dirs
8427         for cf_test_libdir in $LDFLAGS $LIBS ; do
8428           if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
8429             cf_have_libdir=yes; break
8430           fi
8431         done
8432       fi
8433       if test "$cf_have_libdir" = no ; then
8434         test -n "$verbose" && echo "    adding $cf_add_libdir to library-path" 1>&6
8435
8436 echo "${as_me:-configure}:8436: testing adding $cf_add_libdir to library-path ..." 1>&5
8437
8438         LDFLAGS="-L$cf_add_libdir $LDFLAGS"
8439       fi
8440     fi
8441   done
8442 fi
8443
8444         LIBS="$cf_cv_library_file_utf8 $LIBS"
8445 fi
8446
8447 cf_ncuconfig_root=ncursesw
8448
8449 echo "Looking for ${cf_ncuconfig_root}-config"
8450
8451 if test -n "$ac_tool_prefix"; then
8452   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8453   do
8454     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8455 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8456 echo "$as_me:8456: checking for $ac_word" >&5
8457 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8458 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then
8459   echo $ECHO_N "(cached) $ECHO_C" >&6
8460 else
8461   if test -n "$NCURSES_CONFIG"; then
8462   ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # Let the user override the test.
8463 else
8464   ac_save_IFS=$IFS; IFS=$ac_path_separator
8465 ac_dummy="$PATH"
8466 for ac_dir in $ac_dummy; do
8467   IFS=$ac_save_IFS
8468   test -z "$ac_dir" && ac_dir=.
8469   $as_executable_p "$ac_dir/$ac_word" || continue
8470 ac_cv_prog_NCURSES_CONFIG="$ac_tool_prefix$ac_prog"
8471 echo "$as_me:8471: found $ac_dir/$ac_word" >&5
8472 break
8473 done
8474
8475 fi
8476 fi
8477 NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG
8478 if test -n "$NCURSES_CONFIG"; then
8479   echo "$as_me:8479: result: $NCURSES_CONFIG" >&5
8480 echo "${ECHO_T}$NCURSES_CONFIG" >&6
8481 else
8482   echo "$as_me:8482: result: no" >&5
8483 echo "${ECHO_T}no" >&6
8484 fi
8485
8486     test -n "$NCURSES_CONFIG" && break
8487   done
8488 fi
8489 if test -z "$NCURSES_CONFIG"; then
8490   ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG
8491   for ac_prog in ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config
8492 do
8493   # Extract the first word of "$ac_prog", so it can be a program name with args.
8494 set dummy $ac_prog; ac_word=$2
8495 echo "$as_me:8495: checking for $ac_word" >&5
8496 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8497 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then
8498   echo $ECHO_N "(cached) $ECHO_C" >&6
8499 else
8500   if test -n "$ac_ct_NCURSES_CONFIG"; then
8501   ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # Let the user override the test.
8502 else
8503   ac_save_IFS=$IFS; IFS=$ac_path_separator
8504 ac_dummy="$PATH"
8505 for ac_dir in $ac_dummy; do
8506   IFS=$ac_save_IFS
8507   test -z "$ac_dir" && ac_dir=.
8508   $as_executable_p "$ac_dir/$ac_word" || continue
8509 ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_prog"
8510 echo "$as_me:8510: found $ac_dir/$ac_word" >&5
8511 break
8512 done
8513
8514 fi
8515 fi
8516 ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG
8517 if test -n "$ac_ct_NCURSES_CONFIG"; then
8518   echo "$as_me:8518: result: $ac_ct_NCURSES_CONFIG" >&5
8519 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6
8520 else
8521   echo "$as_me:8521: result: no" >&5
8522 echo "${ECHO_T}no" >&6
8523 fi
8524
8525   test -n "$ac_ct_NCURSES_CONFIG" && break
8526 done
8527 test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none"
8528
8529   NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG
8530 fi
8531
8532 if test "$NCURSES_CONFIG" != none ; then
8533
8534 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
8535 LIBS="`$NCURSES_CONFIG --libs` $LIBS"
8536
8537 # even with config script, some packages use no-override for curses.h
8538
8539 echo "$as_me:8539: checking if we have identified curses headers" >&5
8540 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6
8541 if test "${cf_cv_ncurses_header+set}" = set; then
8542   echo $ECHO_N "(cached) $ECHO_C" >&6
8543 else
8544
8545 cf_cv_ncurses_header=none
8546 for cf_header in  \
8547     ncursesw/ncurses.h \
8548         ncursesw/curses.h \
8549         ncurses.h \
8550         curses.h
8551 do
8552 cat >conftest.$ac_ext <<_ACEOF
8553 #line 8553 "configure"
8554 #include "confdefs.h"
8555 #include <${cf_header}>
8556 int
8557 main ()
8558 {
8559 initscr(); tgoto("?", 0,0)
8560   ;
8561   return 0;
8562 }
8563 _ACEOF
8564 rm -f conftest.$ac_objext
8565 if { (eval echo "$as_me:8565: \"$ac_compile\"") >&5
8566   (eval $ac_compile) 2>&5
8567   ac_status=$?
8568   echo "$as_me:8568: \$? = $ac_status" >&5
8569   (exit $ac_status); } &&
8570          { ac_try='test -s conftest.$ac_objext'
8571   { (eval echo "$as_me:8571: \"$ac_try\"") >&5
8572   (eval $ac_try) 2>&5
8573   ac_status=$?
8574   echo "$as_me:8574: \$? = $ac_status" >&5
8575   (exit $ac_status); }; }; then
8576   cf_cv_ncurses_header=$cf_header; break
8577 else
8578   echo "$as_me: failed program was:" >&5
8579 cat conftest.$ac_ext >&5
8580 fi
8581 rm -f conftest.$ac_objext conftest.$ac_ext
8582 done
8583
8584 fi
8585 echo "$as_me:8585: result: $cf_cv_ncurses_header" >&5
8586 echo "${ECHO_T}$cf_cv_ncurses_header" >&6
8587
8588 if test "$cf_cv_ncurses_header" = none ; then
8589         { { echo "$as_me:8589: error: No curses header-files found" >&5
8590 echo "$as_me: error: No curses header-files found" >&2;}
8591    { (exit 1); exit 1; }; }
8592 fi
8593
8594 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
8595
8596 for ac_header in $cf_cv_ncurses_header
8597 do
8598 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
8599 echo "$as_me:8599: checking for $ac_header" >&5
8600 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
8601 if eval "test \"\${$as_ac_Header+set}\" = set"; then
8602   echo $ECHO_N "(cached) $ECHO_C" >&6
8603 else
8604   cat >conftest.$ac_ext <<_ACEOF
8605 #line 8605 "configure"
8606 #include "confdefs.h"
8607 #include <$ac_header>
8608 _ACEOF
8609 if { (eval echo "$as_me:8609: \"$ac_cpp conftest.$ac_ext\"") >&5
8610   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
8611   ac_status=$?
8612   egrep -v '^ *\+' conftest.er1 >conftest.err
8613   rm -f conftest.er1
8614   cat conftest.err >&5
8615   echo "$as_me:8615: \$? = $ac_status" >&5
8616   (exit $ac_status); } >/dev/null; then
8617   if test -s conftest.err; then
8618     ac_cpp_err=$ac_c_preproc_warn_flag
8619   else
8620     ac_cpp_err=
8621   fi
8622 else
8623   ac_cpp_err=yes
8624 fi
8625 if test -z "$ac_cpp_err"; then
8626   eval "$as_ac_Header=yes"
8627 else
8628   echo "$as_me: failed program was:" >&5
8629   cat conftest.$ac_ext >&5
8630   eval "$as_ac_Header=no"
8631 fi
8632 rm -f conftest.err conftest.$ac_ext
8633 fi
8634 echo "$as_me:8634: result: `eval echo '${'$as_ac_Header'}'`" >&5
8635 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
8636 if test `eval echo '${'$as_ac_Header'}'` = yes; then
8637   cat >>confdefs.h <<EOF
8638 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
8639 EOF
8640
8641 fi
8642 done
8643
8644 cat >>confdefs.h <<\EOF
8645 #define NCURSES 1
8646 EOF
8647
8648 cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
8649
8650 cat >>confdefs.h <<EOF
8651 #define $cf_nculib_ROOT 1
8652 EOF
8653
8654 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
8655
8656 else
8657
8658 cf_ncuhdr_root=ncursesw
8659
8660 test -n "$cf_cv_curses_dir" && \
8661 test "$cf_cv_curses_dir" != "no" && { \
8662
8663 if test -n "$cf_cv_curses_dir/include/$cf_ncuhdr_root" ; then
8664   for cf_add_incdir in $cf_cv_curses_dir/include/$cf_ncuhdr_root
8665   do
8666         while test $cf_add_incdir != /usr/include
8667         do
8668           if test -d $cf_add_incdir
8669           then
8670                 cf_have_incdir=no
8671                 if test -n "$CFLAGS$CPPFLAGS" ; then
8672                   # a loop is needed to ensure we can add subdirs of existing dirs
8673                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8674                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8675                           cf_have_incdir=yes; break
8676                         fi
8677                   done
8678                 fi
8679
8680                 if test "$cf_have_incdir" = no ; then
8681                   if test "$cf_add_incdir" = /usr/local/include ; then
8682                         if test "$GCC" = yes
8683                         then
8684                           cf_save_CPPFLAGS=$CPPFLAGS
8685                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8686                           cat >conftest.$ac_ext <<_ACEOF
8687 #line 8687 "configure"
8688 #include "confdefs.h"
8689 #include <stdio.h>
8690 int
8691 main ()
8692 {
8693 printf("Hello")
8694   ;
8695   return 0;
8696 }
8697 _ACEOF
8698 rm -f conftest.$ac_objext
8699 if { (eval echo "$as_me:8699: \"$ac_compile\"") >&5
8700   (eval $ac_compile) 2>&5
8701   ac_status=$?
8702   echo "$as_me:8702: \$? = $ac_status" >&5
8703   (exit $ac_status); } &&
8704          { ac_try='test -s conftest.$ac_objext'
8705   { (eval echo "$as_me:8705: \"$ac_try\"") >&5
8706   (eval $ac_try) 2>&5
8707   ac_status=$?
8708   echo "$as_me:8708: \$? = $ac_status" >&5
8709   (exit $ac_status); }; }; then
8710   :
8711 else
8712   echo "$as_me: failed program was:" >&5
8713 cat conftest.$ac_ext >&5
8714 cf_have_incdir=yes
8715 fi
8716 rm -f conftest.$ac_objext conftest.$ac_ext
8717                           CPPFLAGS=$cf_save_CPPFLAGS
8718                         fi
8719                   fi
8720                 fi
8721
8722                 if test "$cf_have_incdir" = no ; then
8723                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8724
8725 echo "${as_me:-configure}:8725: testing adding $cf_add_incdir to include-path ..." 1>&5
8726
8727                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8728
8729                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
8730                   test "$cf_top_incdir" = "$cf_add_incdir" && break
8731                   cf_add_incdir="$cf_top_incdir"
8732                 else
8733                   break
8734                 fi
8735           fi
8736         done
8737   done
8738 fi
8739
8740 }
8741
8742 echo "$as_me:8742: checking for $cf_ncuhdr_root header in include-path" >&5
8743 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6
8744 if test "${cf_cv_ncurses_h+set}" = set; then
8745   echo $ECHO_N "(cached) $ECHO_C" >&6
8746 else
8747
8748         cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
8749         ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
8750         for cf_header in $cf_header_list
8751         do
8752
8753         cat >conftest.$ac_ext <<_ACEOF
8754 #line 8754 "configure"
8755 #include "confdefs.h"
8756
8757 #define _XOPEN_SOURCE_EXTENDED
8758 #undef  HAVE_LIBUTF8_H  /* in case we used CF_UTF8_LIB */
8759 #define HAVE_LIBUTF8_H  /* to force ncurses' header file to use cchar_t */
8760
8761 #include <$cf_header>
8762 int
8763 main ()
8764 {
8765
8766 #ifdef NCURSES_VERSION
8767
8768 #ifndef WACS_BSSB
8769         make an error
8770 #endif
8771
8772 printf("%s\n", NCURSES_VERSION);
8773 #else
8774 #ifdef __NCURSES_H
8775 printf("old\n");
8776 #else
8777         make an error
8778 #endif
8779 #endif
8780
8781   ;
8782   return 0;
8783 }
8784 _ACEOF
8785 rm -f conftest.$ac_objext
8786 if { (eval echo "$as_me:8786: \"$ac_compile\"") >&5
8787   (eval $ac_compile) 2>&5
8788   ac_status=$?
8789   echo "$as_me:8789: \$? = $ac_status" >&5
8790   (exit $ac_status); } &&
8791          { ac_try='test -s conftest.$ac_objext'
8792   { (eval echo "$as_me:8792: \"$ac_try\"") >&5
8793   (eval $ac_try) 2>&5
8794   ac_status=$?
8795   echo "$as_me:8795: \$? = $ac_status" >&5
8796   (exit $ac_status); }; }; then
8797   cf_cv_ncurses_h=$cf_header
8798
8799 else
8800   echo "$as_me: failed program was:" >&5
8801 cat conftest.$ac_ext >&5
8802 cf_cv_ncurses_h=no
8803 fi
8804 rm -f conftest.$ac_objext conftest.$ac_ext
8805
8806                 test "$cf_cv_ncurses_h" != no && break
8807         done
8808
8809 fi
8810 echo "$as_me:8810: result: $cf_cv_ncurses_h" >&5
8811 echo "${ECHO_T}$cf_cv_ncurses_h" >&6
8812
8813 if test "$cf_cv_ncurses_h" != no ; then
8814         cf_cv_ncurses_header=$cf_cv_ncurses_h
8815 else
8816
8817 echo "$as_me:8817: checking for $cf_ncuhdr_root include-path" >&5
8818 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6
8819 if test "${cf_cv_ncurses_h2+set}" = set; then
8820   echo $ECHO_N "(cached) $ECHO_C" >&6
8821 else
8822
8823         test -n "$verbose" && echo
8824
8825 cf_search=
8826
8827 # collect the current set of include-directories from compiler flags
8828 cf_header_path_list=""
8829 if test -n "${CFLAGS}${CPPFLAGS}" ; then
8830         for cf_header_path in $CPPFLAGS $CFLAGS
8831         do
8832                 case $cf_header_path in #(vi
8833                 -I*)
8834                         cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
8835
8836 test "$cf_header_path" != "NONE" && \
8837 test -d "$cf_header_path" && \
8838  {
8839         test -n "$verbose" && echo "    ... testing for include-directories under $cf_header_path"
8840         test -d $cf_header_path/include &&          cf_search="$cf_search $cf_header_path/include"
8841         test -d $cf_header_path/include/$cf_ncuhdr_root &&       cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root"
8842         test -d $cf_header_path/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include"
8843         test -d $cf_header_path/$cf_ncuhdr_root/include &&       cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include"
8844         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"
8845 }
8846
8847                         cf_header_path_list="$cf_header_path_list $cf_search"
8848                         ;;
8849                 esac
8850         done
8851 fi
8852
8853 # add the variations for the package we are looking for
8854
8855 cf_search=
8856
8857 test "/usr" != "$prefix" && \
8858 test -d "/usr" && \
8859 (test $prefix = NONE || test "/usr" != "$prefix") && {
8860         test -n "$verbose" && echo "    ... testing for include-directories under /usr"
8861         test -d /usr/include &&          cf_search="$cf_search /usr/include"
8862         test -d /usr/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/include/$cf_ncuhdr_root"
8863         test -d /usr/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/include/$cf_ncuhdr_root/include"
8864         test -d /usr/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/$cf_ncuhdr_root/include"
8865         test -d /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8866 }
8867
8868 test "$prefix" != "NONE" && \
8869 test -d "$prefix" && \
8870  {
8871         test -n "$verbose" && echo "    ... testing for include-directories under $prefix"
8872         test -d $prefix/include &&          cf_search="$cf_search $prefix/include"
8873         test -d $prefix/include/$cf_ncuhdr_root &&       cf_search="$cf_search $prefix/include/$cf_ncuhdr_root"
8874         test -d $prefix/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include"
8875         test -d $prefix/$cf_ncuhdr_root/include &&       cf_search="$cf_search $prefix/$cf_ncuhdr_root/include"
8876         test -d $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8877 }
8878
8879 test "/usr/local" != "$prefix" && \
8880 test -d "/usr/local" && \
8881 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
8882         test -n "$verbose" && echo "    ... testing for include-directories under /usr/local"
8883         test -d /usr/local/include &&          cf_search="$cf_search /usr/local/include"
8884         test -d /usr/local/include/$cf_ncuhdr_root &&       cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root"
8885         test -d /usr/local/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /usr/local/include/$cf_ncuhdr_root/include"
8886         test -d /usr/local/$cf_ncuhdr_root/include &&       cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include"
8887         test -d /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /usr/local/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8888 }
8889
8890 test "/opt" != "$prefix" && \
8891 test -d "/opt" && \
8892 (test $prefix = NONE || test "/opt" != "$prefix") && {
8893         test -n "$verbose" && echo "    ... testing for include-directories under /opt"
8894         test -d /opt/include &&          cf_search="$cf_search /opt/include"
8895         test -d /opt/include/$cf_ncuhdr_root &&       cf_search="$cf_search /opt/include/$cf_ncuhdr_root"
8896         test -d /opt/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search /opt/include/$cf_ncuhdr_root/include"
8897         test -d /opt/$cf_ncuhdr_root/include &&       cf_search="$cf_search /opt/$cf_ncuhdr_root/include"
8898         test -d /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search /opt/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8899 }
8900
8901 test "$HOME" != "$prefix" && \
8902 test -d "$HOME" && \
8903 (test $prefix = NONE || test "$HOME" != "$prefix") && {
8904         test -n "$verbose" && echo "    ... testing for include-directories under $HOME"
8905         test -d $HOME/include &&          cf_search="$cf_search $HOME/include"
8906         test -d $HOME/include/$cf_ncuhdr_root &&       cf_search="$cf_search $HOME/include/$cf_ncuhdr_root"
8907         test -d $HOME/include/$cf_ncuhdr_root/include &&    cf_search="$cf_search $HOME/include/$cf_ncuhdr_root/include"
8908         test -d $HOME/$cf_ncuhdr_root/include &&       cf_search="$cf_search $HOME/$cf_ncuhdr_root/include"
8909         test -d $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root &&    cf_search="$cf_search $HOME/$cf_ncuhdr_root/include/$cf_ncuhdr_root"
8910 }
8911
8912 test "$includedir" != NONE && \
8913 test "$includedir" != "/usr/include" && \
8914 test -d "$includedir" && {
8915         test -d $includedir &&    cf_search="$cf_search $includedir"
8916         test -d $includedir/$cf_ncuhdr_root && cf_search="$cf_search $includedir/$cf_ncuhdr_root"
8917 }
8918
8919 test "$oldincludedir" != NONE && \
8920 test "$oldincludedir" != "/usr/include" && \
8921 test -d "$oldincludedir" && {
8922         test -d $oldincludedir    && cf_search="$cf_search $oldincludedir"
8923         test -d $oldincludedir/$cf_ncuhdr_root && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root"
8924 }
8925
8926 cf_search="$cf_search $cf_header_path_list"
8927
8928         test -n "$verbose" && echo search path $cf_search
8929         cf_save2_CPPFLAGS="$CPPFLAGS"
8930         for cf_incdir in $cf_search
8931         do
8932
8933 if test -n "$cf_incdir" ; then
8934   for cf_add_incdir in $cf_incdir
8935   do
8936         while test $cf_add_incdir != /usr/include
8937         do
8938           if test -d $cf_add_incdir
8939           then
8940                 cf_have_incdir=no
8941                 if test -n "$CFLAGS$CPPFLAGS" ; then
8942                   # a loop is needed to ensure we can add subdirs of existing dirs
8943                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
8944                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
8945                           cf_have_incdir=yes; break
8946                         fi
8947                   done
8948                 fi
8949
8950                 if test "$cf_have_incdir" = no ; then
8951                   if test "$cf_add_incdir" = /usr/local/include ; then
8952                         if test "$GCC" = yes
8953                         then
8954                           cf_save_CPPFLAGS=$CPPFLAGS
8955                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8956                           cat >conftest.$ac_ext <<_ACEOF
8957 #line 8957 "configure"
8958 #include "confdefs.h"
8959 #include <stdio.h>
8960 int
8961 main ()
8962 {
8963 printf("Hello")
8964   ;
8965   return 0;
8966 }
8967 _ACEOF
8968 rm -f conftest.$ac_objext
8969 if { (eval echo "$as_me:8969: \"$ac_compile\"") >&5
8970   (eval $ac_compile) 2>&5
8971   ac_status=$?
8972   echo "$as_me:8972: \$? = $ac_status" >&5
8973   (exit $ac_status); } &&
8974          { ac_try='test -s conftest.$ac_objext'
8975   { (eval echo "$as_me:8975: \"$ac_try\"") >&5
8976   (eval $ac_try) 2>&5
8977   ac_status=$?
8978   echo "$as_me:8978: \$? = $ac_status" >&5
8979   (exit $ac_status); }; }; then
8980   :
8981 else
8982   echo "$as_me: failed program was:" >&5
8983 cat conftest.$ac_ext >&5
8984 cf_have_incdir=yes
8985 fi
8986 rm -f conftest.$ac_objext conftest.$ac_ext
8987                           CPPFLAGS=$cf_save_CPPFLAGS
8988                         fi
8989                   fi
8990                 fi
8991
8992                 if test "$cf_have_incdir" = no ; then
8993                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
8994
8995 echo "${as_me:-configure}:8995: testing adding $cf_add_incdir to include-path ..." 1>&5
8996
8997                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
8998
8999                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9000                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9001                   cf_add_incdir="$cf_top_incdir"
9002                 else
9003                   break
9004                 fi
9005           fi
9006         done
9007   done
9008 fi
9009
9010                 for cf_header in \
9011                         ncurses.h \
9012                         curses.h
9013                 do
9014
9015         cat >conftest.$ac_ext <<_ACEOF
9016 #line 9016 "configure"
9017 #include "confdefs.h"
9018
9019 #include <$cf_header>
9020 int
9021 main ()
9022 {
9023
9024 #ifdef NCURSES_VERSION
9025
9026 printf("%s\n", NCURSES_VERSION);
9027 #else
9028 #ifdef __NCURSES_H
9029 printf("old\n");
9030 #else
9031         make an error
9032 #endif
9033 #endif
9034
9035   ;
9036   return 0;
9037 }
9038 _ACEOF
9039 rm -f conftest.$ac_objext
9040 if { (eval echo "$as_me:9040: \"$ac_compile\"") >&5
9041   (eval $ac_compile) 2>&5
9042   ac_status=$?
9043   echo "$as_me:9043: \$? = $ac_status" >&5
9044   (exit $ac_status); } &&
9045          { ac_try='test -s conftest.$ac_objext'
9046   { (eval echo "$as_me:9046: \"$ac_try\"") >&5
9047   (eval $ac_try) 2>&5
9048   ac_status=$?
9049   echo "$as_me:9049: \$? = $ac_status" >&5
9050   (exit $ac_status); }; }; then
9051   cf_cv_ncurses_h2=$cf_header
9052
9053 else
9054   echo "$as_me: failed program was:" >&5
9055 cat conftest.$ac_ext >&5
9056 cf_cv_ncurses_h2=no
9057 fi
9058 rm -f conftest.$ac_objext conftest.$ac_ext
9059
9060                         if test "$cf_cv_ncurses_h2" != no ; then
9061                                 cf_cv_ncurses_h2=$cf_incdir/$cf_header
9062                                 test -n "$verbose" && echo $ac_n "      ... found $ac_c" 1>&6
9063                                 break
9064                         fi
9065                         test -n "$verbose" && echo "    ... tested $cf_incdir/$cf_header" 1>&6
9066                 done
9067                 CPPFLAGS="$cf_save2_CPPFLAGS"
9068                 test "$cf_cv_ncurses_h2" != no && break
9069         done
9070         test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:9070: error: not found" >&5
9071 echo "$as_me: error: not found" >&2;}
9072    { (exit 1); exit 1; }; }
9073
9074 fi
9075 echo "$as_me:9075: result: $cf_cv_ncurses_h2" >&5
9076 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6
9077
9078         cf_1st_incdir=`echo $cf_cv_ncurses_h2 | sed -e 's%/[^/]*$%%'`
9079         cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
9080         if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
9081                 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
9082         fi
9083
9084 if test -n "$cf_1st_incdir" ; then
9085   for cf_add_incdir in $cf_1st_incdir
9086   do
9087         while test $cf_add_incdir != /usr/include
9088         do
9089           if test -d $cf_add_incdir
9090           then
9091                 cf_have_incdir=no
9092                 if test -n "$CFLAGS$CPPFLAGS" ; then
9093                   # a loop is needed to ensure we can add subdirs of existing dirs
9094                   for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
9095                         if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
9096                           cf_have_incdir=yes; break
9097                         fi
9098                   done
9099                 fi
9100
9101                 if test "$cf_have_incdir" = no ; then
9102                   if test "$cf_add_incdir" = /usr/local/include ; then
9103                         if test "$GCC" = yes
9104                         then
9105                           cf_save_CPPFLAGS=$CPPFLAGS
9106                           CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9107                           cat >conftest.$ac_ext <<_ACEOF
9108 #line 9108 "configure"
9109 #include "confdefs.h"
9110 #include <stdio.h>
9111 int
9112 main ()
9113 {
9114 printf("Hello")
9115   ;
9116   return 0;
9117 }
9118 _ACEOF
9119 rm -f conftest.$ac_objext
9120 if { (eval echo "$as_me:9120: \"$ac_compile\"") >&5
9121   (eval $ac_compile) 2>&5
9122   ac_status=$?
9123   echo "$as_me:9123: \$? = $ac_status" >&5
9124   (exit $ac_status); } &&
9125          { ac_try='test -s conftest.$ac_objext'
9126   { (eval echo "$as_me:9126: \"$ac_try\"") >&5
9127   (eval $ac_try) 2>&5
9128   ac_status=$?
9129   echo "$as_me:9129: \$? = $ac_status" >&5
9130   (exit $ac_status); }; }; then
9131   :
9132 else
9133   echo "$as_me: failed program was:" >&5
9134 cat conftest.$ac_ext >&5
9135 cf_have_incdir=yes
9136 fi
9137 rm -f conftest.$ac_objext conftest.$ac_ext
9138                           CPPFLAGS=$cf_save_CPPFLAGS
9139                         fi
9140                   fi
9141                 fi
9142
9143                 if test "$cf_have_incdir" = no ; then
9144                   test -n "$verbose" && echo "  adding $cf_add_incdir to include-path" 1>&6
9145
9146 echo "${as_me:-configure}:9146: testing adding $cf_add_incdir to include-path ..." 1>&5
9147
9148                   CPPFLAGS="$CPPFLAGS -I$cf_add_incdir"
9149
9150                   cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
9151                   test "$cf_top_incdir" = "$cf_add_incdir" && break
9152                   cf_add_incdir="$cf_top_incdir"
9153                 else
9154                   break
9155                 fi
9156           fi
9157         done
9158   done
9159 fi
9160
9161 fi
9162
9163 # Set definitions to allow ifdef'ing for ncurses.h
9164
9165 case $cf_cv_ncurses_header in # (vi
9166 *ncurses.h)
9167         cat >>confdefs.h <<\EOF
9168 #define HAVE_NCURSES_H 1
9169 EOF
9170
9171         ;;
9172 esac
9173
9174 case $cf_cv_ncurses_header in # (vi
9175 ncurses/curses.h|ncurses/ncurses.h)
9176         cat >>confdefs.h <<\EOF
9177 #define HAVE_NCURSES_NCURSES_H 1
9178 EOF
9179
9180         ;;
9181 ncursesw/curses.h|ncursesw/ncurses.h)
9182         cat >>confdefs.h <<\EOF
9183 #define HAVE_NCURSESW_NCURSES_H 1
9184 EOF
9185
9186         ;;
9187 esac
9188
9189 echo "$as_me:9189: checking for terminfo header" >&5
9190 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6
9191 if test "${cf_cv_term_header+set}" = set; then
9192   echo $ECHO_N "(cached) $ECHO_C" >&6
9193 else
9194
9195 case ${cf_cv_ncurses_header} in #(vi
9196 */ncurses.h|*/ncursesw.h) #(vi
9197         cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'`
9198         ;;
9199 *)
9200         cf_term_header=term.h
9201         ;;
9202 esac
9203
9204 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
9205 do
9206 cat >conftest.$ac_ext <<_ACEOF
9207 #line 9207 "configure"
9208 #include "confdefs.h"
9209 #include <stdio.h>
9210 #include <${cf_cv_ncurses_header:-curses.h}>
9211 #include <$cf_test>
9212
9213 int
9214 main ()
9215 {
9216 int x = auto_left_margin
9217   ;
9218   return 0;
9219 }
9220 _ACEOF
9221 rm -f conftest.$ac_objext
9222 if { (eval echo "$as_me:9222: \"$ac_compile\"") >&5
9223   (eval $ac_compile) 2>&5
9224   ac_status=$?
9225   echo "$as_me:9225: \$? = $ac_status" >&5
9226   (exit $ac_status); } &&
9227          { ac_try='test -s conftest.$ac_objext'
9228   { (eval echo "$as_me:9228: \"$ac_try\"") >&5
9229   (eval $ac_try) 2>&5
9230   ac_status=$?
9231   echo "$as_me:9231: \$? = $ac_status" >&5
9232   (exit $ac_status); }; }; then
9233
9234         cf_cv_term_header="$cf_test"
9235 else
9236   echo "$as_me: failed program was:" >&5
9237 cat conftest.$ac_ext >&5
9238
9239         cf_cv_term_header=unknown
9240
9241 fi
9242 rm -f conftest.$ac_objext conftest.$ac_ext
9243         test "$cf_cv_term_header" != unknown && break
9244 done
9245
9246 fi
9247 echo "$as_me:9247: result: $cf_cv_term_header" >&5
9248 echo "${ECHO_T}$cf_cv_term_header" >&6
9249
9250 # Set definitions to allow ifdef'ing to accommodate subdirectories
9251
9252 case $cf_cv_term_header in # (vi
9253 *term.h)
9254         cat >>confdefs.h <<\EOF
9255 #define HAVE_TERM_H 1
9256 EOF
9257
9258         ;;
9259 esac
9260
9261 case $cf_cv_term_header in # (vi
9262 ncurses/term.h) #(vi
9263         cat >>confdefs.h <<\EOF
9264 #define HAVE_NCURSES_TERM_H 1
9265 EOF
9266
9267         ;;
9268 ncursesw/term.h)
9269         cat >>confdefs.h <<\EOF
9270 #define HAVE_NCURSESW_TERM_H 1
9271 EOF
9272
9273         ;;
9274 esac
9275
9276 # some applications need this, but should check for NCURSES_VERSION
9277 cat >>confdefs.h <<\EOF
9278 #define NCURSES 1
9279 EOF
9280
9281 echo "$as_me:9281: checking for ncurses version" >&5
9282 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6
9283 if test "${cf_cv_ncurses_version+set}" = set; then
9284   echo $ECHO_N "(cached) $ECHO_C" >&6
9285 else
9286
9287         cf_cv_ncurses_version=no
9288         cf_tempfile=out$$
9289         rm -f $cf_tempfile
9290         if test "$cross_compiling" = yes; then
9291
9292         # This will not work if the preprocessor splits the line after the
9293         # Autoconf token.  The 'unproto' program does that.
9294         cat > conftest.$ac_ext <<EOF
9295 #include <${cf_cv_ncurses_header:-curses.h}>
9296 #undef Autoconf
9297 #ifdef NCURSES_VERSION
9298 Autoconf NCURSES_VERSION
9299 #else
9300 #ifdef __NCURSES_H
9301 Autoconf "old"
9302 #endif
9303 ;
9304 #endif
9305 EOF
9306         cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out"
9307         { (eval echo "$as_me:9307: \"$cf_try\"") >&5
9308   (eval $cf_try) 2>&5
9309   ac_status=$?
9310   echo "$as_me:9310: \$? = $ac_status" >&5
9311   (exit $ac_status); }
9312         if test -f conftest.out ; then
9313                 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%'`
9314                 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
9315                 rm -f conftest.out
9316         fi
9317
9318 else
9319   cat >conftest.$ac_ext <<_ACEOF
9320 #line 9320 "configure"
9321 #include "confdefs.h"
9322
9323 #include <${cf_cv_ncurses_header:-curses.h}>
9324 #include <stdio.h>
9325 int main()
9326 {
9327         FILE *fp = fopen("$cf_tempfile", "w");
9328 #ifdef NCURSES_VERSION
9329 # ifdef NCURSES_VERSION_PATCH
9330         fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
9331 # else
9332         fprintf(fp, "%s\n", NCURSES_VERSION);
9333 # endif
9334 #else
9335 # ifdef __NCURSES_H
9336         fprintf(fp, "old\n");
9337 # else
9338         make an error
9339 # endif
9340 #endif
9341         ${cf_cv_main_return:-return}(0);
9342 }
9343 _ACEOF
9344 rm -f conftest$ac_exeext
9345 if { (eval echo "$as_me:9345: \"$ac_link\"") >&5
9346   (eval $ac_link) 2>&5
9347   ac_status=$?
9348   echo "$as_me:9348: \$? = $ac_status" >&5
9349   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
9350   { (eval echo "$as_me:9350: \"$ac_try\"") >&5
9351   (eval $ac_try) 2>&5
9352   ac_status=$?
9353   echo "$as_me:9353: \$? = $ac_status" >&5
9354   (exit $ac_status); }; }; then
9355
9356         cf_cv_ncurses_version=`cat $cf_tempfile`
9357 else
9358   echo "$as_me: program exited with status $ac_status" >&5
9359 echo "$as_me: failed program was:" >&5
9360 cat conftest.$ac_ext >&5
9361 fi
9362 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
9363 fi
9364         rm -f $cf_tempfile
9365
9366 fi
9367 echo "$as_me:9367: result: $cf_cv_ncurses_version" >&5
9368 echo "${ECHO_T}$cf_cv_ncurses_version" >&6
9369 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF
9370 #define NCURSES 1
9371 EOF
9372
9373 cf_nculib_root=ncursesw
9374         # This works, except for the special case where we find gpm, but
9375         # ncurses is in a nonstandard location via $LIBS, and we really want
9376         # to link gpm.
9377 cf_ncurses_LIBS=""
9378 cf_ncurses_SAVE="$LIBS"
9379 echo "$as_me:9379: checking for Gpm_Open in -lgpm" >&5
9380 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6
9381 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then
9382   echo $ECHO_N "(cached) $ECHO_C" >&6
9383 else
9384   ac_check_lib_save_LIBS=$LIBS
9385 LIBS="-lgpm  $LIBS"
9386 cat >conftest.$ac_ext <<_ACEOF
9387 #line 9387 "configure"
9388 #include "confdefs.h"
9389
9390 /* Override any gcc2 internal prototype to avoid an error.  */
9391 #ifdef __cplusplus
9392 extern "C"
9393 #endif
9394 /* We use char because int might match the return type of a gcc2
9395    builtin and then its argument prototype would still apply.  */
9396 char Gpm_Open ();
9397 int
9398 main ()
9399 {
9400 Gpm_Open ();
9401   ;
9402   return 0;
9403 }
9404 _ACEOF
9405 rm -f conftest.$ac_objext conftest$ac_exeext
9406 if { (eval echo "$as_me:9406: \"$ac_link\"") >&5
9407   (eval $ac_link) 2>&5
9408   ac_status=$?
9409   echo "$as_me:9409: \$? = $ac_status" >&5
9410   (exit $ac_status); } &&
9411          { ac_try='test -s conftest$ac_exeext'
9412   { (eval echo "$as_me:9412: \"$ac_try\"") >&5
9413   (eval $ac_try) 2>&5
9414   ac_status=$?
9415   echo "$as_me:9415: \$? = $ac_status" >&5
9416   (exit $ac_status); }; }; then
9417   ac_cv_lib_gpm_Gpm_Open=yes
9418 else
9419   echo "$as_me: failed program was:" >&5
9420 cat conftest.$ac_ext >&5
9421 ac_cv_lib_gpm_Gpm_Open=no
9422 fi
9423 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9424 LIBS=$ac_check_lib_save_LIBS
9425 fi
9426 echo "$as_me:9426: result: $ac_cv_lib_gpm_Gpm_Open" >&5
9427 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6
9428 if test $ac_cv_lib_gpm_Gpm_Open = yes; then
9429   echo "$as_me:9429: checking for initscr in -lgpm" >&5
9430 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6
9431 if test "${ac_cv_lib_gpm_initscr+set}" = set; then
9432   echo $ECHO_N "(cached) $ECHO_C" >&6
9433 else
9434   ac_check_lib_save_LIBS=$LIBS
9435 LIBS="-lgpm  $LIBS"
9436 cat >conftest.$ac_ext <<_ACEOF
9437 #line 9437 "configure"
9438 #include "confdefs.h"
9439
9440 /* Override any gcc2 internal prototype to avoid an error.  */
9441 #ifdef __cplusplus
9442 extern "C"
9443 #endif
9444 /* We use char because int might match the return type of a gcc2
9445    builtin and then its argument prototype would still apply.  */
9446 char initscr ();
9447 int
9448 main ()
9449 {
9450 initscr ();
9451   ;
9452   return 0;
9453 }
9454 _ACEOF
9455 rm -f conftest.$ac_objext conftest$ac_exeext
9456 if { (eval echo "$as_me:9456: \"$ac_link\"") >&5
9457   (eval $ac_link) 2>&5
9458   ac_status=$?
9459   echo "$as_me:9459: \$? = $ac_status" >&5
9460   (exit $ac_status); } &&
9461          { ac_try='test -s conftest$ac_exeext'
9462   { (eval echo "$as_me:9462: \"$ac_try\"") >&5
9463   (eval $ac_try) 2>&5
9464   ac_status=$?
9465   echo "$as_me:9465: \$? = $ac_status" >&5
9466   (exit $ac_status); }; }; then
9467   ac_cv_lib_gpm_initscr=yes
9468 else
9469   echo "$as_me: failed program was:" >&5
9470 cat conftest.$ac_ext >&5
9471 ac_cv_lib_gpm_initscr=no
9472 fi
9473 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9474 LIBS=$ac_check_lib_save_LIBS
9475 fi
9476 echo "$as_me:9476: result: $ac_cv_lib_gpm_initscr" >&5
9477 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6
9478 if test $ac_cv_lib_gpm_initscr = yes; then
9479   LIBS="$cf_ncurses_SAVE"
9480 else
9481   cf_ncurses_LIBS="-lgpm"
9482 fi
9483
9484 fi
9485
9486 case $host_os in #(vi
9487 freebsd*)
9488         # This is only necessary if you are linking against an obsolete
9489         # version of ncurses (but it should do no harm, since it's static).
9490         if test "$cf_nculib_root" = ncurses ; then
9491                 echo "$as_me:9491: checking for tgoto in -lmytinfo" >&5
9492 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6
9493 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then
9494   echo $ECHO_N "(cached) $ECHO_C" >&6
9495 else
9496   ac_check_lib_save_LIBS=$LIBS
9497 LIBS="-lmytinfo  $LIBS"
9498 cat >conftest.$ac_ext <<_ACEOF
9499 #line 9499 "configure"
9500 #include "confdefs.h"
9501
9502 /* Override any gcc2 internal prototype to avoid an error.  */
9503 #ifdef __cplusplus
9504 extern "C"
9505 #endif
9506 /* We use char because int might match the return type of a gcc2
9507    builtin and then its argument prototype would still apply.  */
9508 char tgoto ();
9509 int
9510 main ()
9511 {
9512 tgoto ();
9513   ;
9514   return 0;
9515 }
9516 _ACEOF
9517 rm -f conftest.$ac_objext conftest$ac_exeext
9518 if { (eval echo "$as_me:9518: \"$ac_link\"") >&5
9519   (eval $ac_link) 2>&5
9520   ac_status=$?
9521   echo "$as_me:9521: \$? = $ac_status" >&5
9522   (exit $ac_status); } &&
9523          { ac_try='test -s conftest$ac_exeext'
9524   { (eval echo "$as_me:9524: \"$ac_try\"") >&5
9525   (eval $ac_try) 2>&5
9526   ac_status=$?
9527   echo "$as_me:9527: \$? = $ac_status" >&5
9528   (exit $ac_status); }; }; then
9529   ac_cv_lib_mytinfo_tgoto=yes
9530 else
9531   echo "$as_me: failed program was:" >&5
9532 cat conftest.$ac_ext >&5
9533 ac_cv_lib_mytinfo_tgoto=no
9534 fi
9535 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9536 LIBS=$ac_check_lib_save_LIBS
9537 fi
9538 echo "$as_me:9538: result: $ac_cv_lib_mytinfo_tgoto" >&5
9539 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6
9540 if test $ac_cv_lib_mytinfo_tgoto = yes; then
9541   cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"
9542 fi
9543
9544         fi
9545         ;;
9546 esac
9547
9548 LIBS="$cf_ncurses_LIBS $LIBS"
9549
9550 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
9551 then
9552         LIBS="-l$cf_nculib_root $LIBS"
9553 else
9554
9555         eval 'cf_cv_have_lib_'$cf_nculib_root'=no'
9556         cf_libdir=""
9557         echo "$as_me:9557: checking for initscr" >&5
9558 echo $ECHO_N "checking for initscr... $ECHO_C" >&6
9559 if test "${ac_cv_func_initscr+set}" = set; then
9560   echo $ECHO_N "(cached) $ECHO_C" >&6
9561 else
9562   cat >conftest.$ac_ext <<_ACEOF
9563 #line 9563 "configure"
9564 #include "confdefs.h"
9565 /* System header to define __stub macros and hopefully few prototypes,
9566     which can conflict with char initscr (); below.  */
9567 #include <assert.h>
9568 /* Override any gcc2 internal prototype to avoid an error.  */
9569 #ifdef __cplusplus
9570 extern "C"
9571 #endif
9572 /* We use char because int might match the return type of a gcc2
9573    builtin and then its argument prototype would still apply.  */
9574 char initscr ();
9575 char (*f) ();
9576
9577 int
9578 main ()
9579 {
9580 /* The GNU C library defines this for functions which it implements
9581     to always fail with ENOSYS.  Some functions are actually named
9582     something starting with __ and the normal name is an alias.  */
9583 #if defined (__stub_initscr) || defined (__stub___initscr)
9584 choke me
9585 #else
9586 f = initscr; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
9587 #endif
9588
9589   ;
9590   return 0;
9591 }
9592 _ACEOF
9593 rm -f conftest.$ac_objext conftest$ac_exeext
9594 if { (eval echo "$as_me:9594: \"$ac_link\"") >&5
9595   (eval $ac_link) 2>&5
9596   ac_status=$?
9597   echo "$as_me:9597: \$? = $ac_status" >&5
9598   (exit $ac_status); } &&
9599          { ac_try='test -s conftest$ac_exeext'
9600   { (eval echo "$as_me:9600: \"$ac_try\"") >&5
9601   (eval $ac_try) 2>&5
9602   ac_status=$?
9603   echo "$as_me:9603: \$? = $ac_status" >&5
9604   (exit $ac_status); }; }; then
9605   ac_cv_func_initscr=yes
9606 else
9607   echo "$as_me: failed program was:" >&5
9608 cat conftest.$ac_ext >&5
9609 ac_cv_func_initscr=no
9610 fi
9611 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9612 fi
9613 echo "$as_me:9613: result: $ac_cv_func_initscr" >&5
9614 echo "${ECHO_T}$ac_cv_func_initscr" >&6
9615 if test $ac_cv_func_initscr = yes; then
9616   eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9617 else
9618
9619                 cf_save_LIBS="$LIBS"
9620                 echo "$as_me:9620: checking for initscr in -l$cf_nculib_root" >&5
9621 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6
9622                 LIBS="-l$cf_nculib_root $LIBS"
9623                 cat >conftest.$ac_ext <<_ACEOF
9624 #line 9624 "configure"
9625 #include "confdefs.h"
9626 #include <${cf_cv_ncurses_header:-curses.h}>
9627 int
9628 main ()
9629 {
9630 initscr()
9631   ;
9632   return 0;
9633 }
9634 _ACEOF
9635 rm -f conftest.$ac_objext conftest$ac_exeext
9636 if { (eval echo "$as_me:9636: \"$ac_link\"") >&5
9637   (eval $ac_link) 2>&5
9638   ac_status=$?
9639   echo "$as_me:9639: \$? = $ac_status" >&5
9640   (exit $ac_status); } &&
9641          { ac_try='test -s conftest$ac_exeext'
9642   { (eval echo "$as_me:9642: \"$ac_try\"") >&5
9643   (eval $ac_try) 2>&5
9644   ac_status=$?
9645   echo "$as_me:9645: \$? = $ac_status" >&5
9646   (exit $ac_status); }; }; then
9647   echo "$as_me:9647: result: yes" >&5
9648 echo "${ECHO_T}yes" >&6
9649                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9650
9651 else
9652   echo "$as_me: failed program was:" >&5
9653 cat conftest.$ac_ext >&5
9654 echo "$as_me:9654: result: no" >&5
9655 echo "${ECHO_T}no" >&6
9656
9657 cf_search=
9658 cf_library_path_list=""
9659 if test -n "${LDFLAGS}${LIBS}" ; then
9660         for cf_library_path in $LDFLAGS $LIBS
9661         do
9662                 case $cf_library_path in #(vi
9663                 -L*)
9664                         cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
9665
9666 test "$cf_library_path" != "NONE" && \
9667 test -d "$cf_library_path" && \
9668  {
9669         test -n "$verbose" && echo "    ... testing for lib-directories under $cf_library_path"
9670         test -d $cf_library_path/lib &&          cf_search="$cf_search $cf_library_path/lib"
9671         test -d $cf_library_path/lib/$cf_nculib_root &&       cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root"
9672         test -d $cf_library_path/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib"
9673         test -d $cf_library_path/$cf_nculib_root/lib &&       cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib"
9674         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"
9675 }
9676
9677                         cf_library_path_list="$cf_library_path_list $cf_search"
9678                         ;;
9679                 esac
9680         done
9681 fi
9682
9683 cf_search=
9684
9685 test "/usr" != "$prefix" && \
9686 test -d "/usr" && \
9687 (test $prefix = NONE || test "/usr" != "$prefix") && {
9688         test -n "$verbose" && echo "    ... testing for lib-directories under /usr"
9689         test -d /usr/lib &&          cf_search="$cf_search /usr/lib"
9690         test -d /usr/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/lib/$cf_nculib_root"
9691         test -d /usr/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/lib/$cf_nculib_root/lib"
9692         test -d /usr/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/$cf_nculib_root/lib"
9693         test -d /usr/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/$cf_nculib_root/lib/$cf_nculib_root"
9694 }
9695
9696 test "$prefix" != "NONE" && \
9697 test -d "$prefix" && \
9698  {
9699         test -n "$verbose" && echo "    ... testing for lib-directories under $prefix"
9700         test -d $prefix/lib &&          cf_search="$cf_search $prefix/lib"
9701         test -d $prefix/lib/$cf_nculib_root &&       cf_search="$cf_search $prefix/lib/$cf_nculib_root"
9702         test -d $prefix/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib"
9703         test -d $prefix/$cf_nculib_root/lib &&       cf_search="$cf_search $prefix/$cf_nculib_root/lib"
9704         test -d $prefix/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root"
9705 }
9706
9707 test "/usr/local" != "$prefix" && \
9708 test -d "/usr/local" && \
9709 (test $prefix = NONE || test "/usr/local" != "$prefix") && {
9710         test -n "$verbose" && echo "    ... testing for lib-directories under /usr/local"
9711         test -d /usr/local/lib &&          cf_search="$cf_search /usr/local/lib"
9712         test -d /usr/local/lib/$cf_nculib_root &&       cf_search="$cf_search /usr/local/lib/$cf_nculib_root"
9713         test -d /usr/local/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /usr/local/lib/$cf_nculib_root/lib"
9714         test -d /usr/local/$cf_nculib_root/lib &&       cf_search="$cf_search /usr/local/$cf_nculib_root/lib"
9715         test -d /usr/local/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /usr/local/$cf_nculib_root/lib/$cf_nculib_root"
9716 }
9717
9718 test "/opt" != "$prefix" && \
9719 test -d "/opt" && \
9720 (test $prefix = NONE || test "/opt" != "$prefix") && {
9721         test -n "$verbose" && echo "    ... testing for lib-directories under /opt"
9722         test -d /opt/lib &&          cf_search="$cf_search /opt/lib"
9723         test -d /opt/lib/$cf_nculib_root &&       cf_search="$cf_search /opt/lib/$cf_nculib_root"
9724         test -d /opt/lib/$cf_nculib_root/lib &&    cf_search="$cf_search /opt/lib/$cf_nculib_root/lib"
9725         test -d /opt/$cf_nculib_root/lib &&       cf_search="$cf_search /opt/$cf_nculib_root/lib"
9726         test -d /opt/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search /opt/$cf_nculib_root/lib/$cf_nculib_root"
9727 }
9728
9729 test "$HOME" != "$prefix" && \
9730 test -d "$HOME" && \
9731 (test $prefix = NONE || test "$HOME" != "$prefix") && {
9732         test -n "$verbose" && echo "    ... testing for lib-directories under $HOME"
9733         test -d $HOME/lib &&          cf_search="$cf_search $HOME/lib"
9734         test -d $HOME/lib/$cf_nculib_root &&       cf_search="$cf_search $HOME/lib/$cf_nculib_root"
9735         test -d $HOME/lib/$cf_nculib_root/lib &&    cf_search="$cf_search $HOME/lib/$cf_nculib_root/lib"
9736         test -d $HOME/$cf_nculib_root/lib &&       cf_search="$cf_search $HOME/$cf_nculib_root/lib"
9737         test -d $HOME/$cf_nculib_root/lib/$cf_nculib_root &&    cf_search="$cf_search $HOME/$cf_nculib_root/lib/$cf_nculib_root"
9738 }
9739
9740 cf_search="$cf_library_path_list $cf_search"
9741
9742                         for cf_libdir in $cf_search
9743                         do
9744                                 echo "$as_me:9744: checking for -l$cf_nculib_root in $cf_libdir" >&5
9745 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6
9746                                 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS"
9747                                 cat >conftest.$ac_ext <<_ACEOF
9748 #line 9748 "configure"
9749 #include "confdefs.h"
9750 #include <${cf_cv_ncurses_header:-curses.h}>
9751 int
9752 main ()
9753 {
9754 initscr()
9755   ;
9756   return 0;
9757 }
9758 _ACEOF
9759 rm -f conftest.$ac_objext conftest$ac_exeext
9760 if { (eval echo "$as_me:9760: \"$ac_link\"") >&5
9761   (eval $ac_link) 2>&5
9762   ac_status=$?
9763   echo "$as_me:9763: \$? = $ac_status" >&5
9764   (exit $ac_status); } &&
9765          { ac_try='test -s conftest$ac_exeext'
9766   { (eval echo "$as_me:9766: \"$ac_try\"") >&5
9767   (eval $ac_try) 2>&5
9768   ac_status=$?
9769   echo "$as_me:9769: \$? = $ac_status" >&5
9770   (exit $ac_status); }; }; then
9771   echo "$as_me:9771: result: yes" >&5
9772 echo "${ECHO_T}yes" >&6
9773                                          eval 'cf_cv_have_lib_'$cf_nculib_root'=yes'
9774                                          break
9775 else
9776   echo "$as_me: failed program was:" >&5
9777 cat conftest.$ac_ext >&5
9778 echo "$as_me:9778: result: no" >&5
9779 echo "${ECHO_T}no" >&6
9780                                          LIBS="$cf_save_LIBS"
9781 fi
9782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9783                         done
9784
9785 fi
9786 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9787
9788 fi
9789
9790 eval 'cf_found_library=$cf_cv_have_lib_'$cf_nculib_root
9791
9792 if test $cf_found_library = no ; then
9793         { { echo "$as_me:9793: error: Cannot link $cf_nculib_root library" >&5
9794 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;}
9795    { (exit 1); exit 1; }; }
9796 fi
9797
9798 fi
9799
9800 if test -n "$cf_ncurses_LIBS" ; then
9801         echo "$as_me:9801: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5
9802 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6
9803         cf_ncurses_SAVE="$LIBS"
9804         for p in $cf_ncurses_LIBS ; do
9805                 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
9806                 if test "$q" != "$LIBS" ; then
9807                         LIBS="$q"
9808                 fi
9809         done
9810         cat >conftest.$ac_ext <<_ACEOF
9811 #line 9811 "configure"
9812 #include "confdefs.h"
9813 #include <${cf_cv_ncurses_header:-curses.h}>
9814 int
9815 main ()
9816 {
9817 initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
9818   ;
9819   return 0;
9820 }
9821 _ACEOF
9822 rm -f conftest.$ac_objext conftest$ac_exeext
9823 if { (eval echo "$as_me:9823: \"$ac_link\"") >&5
9824   (eval $ac_link) 2>&5
9825   ac_status=$?
9826   echo "$as_me:9826: \$? = $ac_status" >&5
9827   (exit $ac_status); } &&
9828          { ac_try='test -s conftest$ac_exeext'
9829   { (eval echo "$as_me:9829: \"$ac_try\"") >&5
9830   (eval $ac_try) 2>&5
9831   ac_status=$?
9832   echo "$as_me:9832: \$? = $ac_status" >&5
9833   (exit $ac_status); }; }; then
9834   echo "$as_me:9834: result: yes" >&5
9835 echo "${ECHO_T}yes" >&6
9836 else
9837   echo "$as_me: failed program was:" >&5
9838 cat conftest.$ac_ext >&5
9839 echo "$as_me:9839: result: no" >&5
9840 echo "${ECHO_T}no" >&6
9841                  LIBS="$cf_ncurses_SAVE"
9842 fi
9843 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
9844 fi
9845
9846 cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
9847
9848 cat >>confdefs.h <<EOF
9849 #define $cf_nculib_ROOT 1
9850 EOF
9851
9852 fi
9853
9854         ;;
9855 pdcurses)
9856
9857 echo "$as_me:9857: checking if you want to use pkg-config" >&5
9858 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6
9859
9860 # Check whether --with-pkg-config or --without-pkg-config was given.
9861 if test "${with_pkg_config+set}" = set; then
9862   withval="$with_pkg_config"
9863   cf_pkg_config=$withval
9864 else
9865   cf_pkg_config=yes
9866 fi;
9867 echo "$as_me:9867: result: $cf_pkg_config" >&5
9868 echo "${ECHO_T}$cf_pkg_config" >&6
9869
9870 case $cf_pkg_config in #(vi
9871 no) #(vi
9872         PKG_CONFIG=none
9873         ;;
9874 yes) #(vi
9875
9876 if test -n "$ac_tool_prefix"; then
9877   # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
9878 set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
9879 echo "$as_me:9879: checking for $ac_word" >&5
9880 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9881 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
9882   echo $ECHO_N "(cached) $ECHO_C" >&6
9883 else
9884   case $PKG_CONFIG in
9885   [\\/]* | ?:[\\/]*)
9886   ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
9887   ;;
9888   *)
9889   ac_save_IFS=$IFS; IFS=$ac_path_separator
9890 ac_dummy="$PATH"
9891 for ac_dir in $ac_dummy; do
9892   IFS=$ac_save_IFS
9893   test -z "$ac_dir" && ac_dir=.
9894   if $as_executable_p "$ac_dir/$ac_word"; then
9895    ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word"
9896    echo "$as_me:9896: found $ac_dir/$ac_word" >&5
9897    break
9898 fi
9899 done
9900
9901   ;;
9902 esac
9903 fi
9904 PKG_CONFIG=$ac_cv_path_PKG_CONFIG
9905
9906 if test -n "$PKG_CONFIG"; then
9907   echo "$as_me:9907: result: $PKG_CONFIG" >&5
9908 echo "${ECHO_T}$PKG_CONFIG" >&6
9909 else
9910   echo "$as_me:9910: result: no" >&5
9911 echo "${ECHO_T}no" >&6
9912 fi
9913
9914 fi
9915 if test -z "$ac_cv_path_PKG_CONFIG"; then
9916   ac_pt_PKG_CONFIG=$PKG_CONFIG
9917   # Extract the first word of "pkg-config", so it can be a program name with args.
9918 set dummy pkg-config; ac_word=$2
9919 echo "$as_me:9919: checking for $ac_word" >&5
9920 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9921 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
9922   echo $ECHO_N "(cached) $ECHO_C" >&6
9923 else
9924   case $ac_pt_PKG_CONFIG in
9925   [\\/]* | ?:[\\/]*)
9926   ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
9927   ;;
9928   *)
9929   ac_save_IFS=$IFS; IFS=$ac_path_separator
9930 ac_dummy="$PATH"
9931 for ac_dir in $ac_dummy; do
9932   IFS=$ac_save_IFS
9933   test -z "$ac_dir" && ac_dir=.
9934   if $as_executable_p "$ac_dir/$ac_word"; then
9935    ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word"
9936    echo "$as_me:9936: found $ac_dir/$ac_word" >&5
9937    break
9938 fi
9939 done
9940
9941   test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none"
9942   ;;
9943 esac
9944 fi
9945 ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
9946
9947 if test -n "$ac_pt_PKG_CONFIG"; then
9948   echo "$as_me:9948: result: $ac_pt_PKG_CONFIG" >&5
9949 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
9950 else
9951   echo "$as_me:9951: result: no" >&5
9952 echo "${ECHO_T}no" >&6
9953 fi
9954
9955   PKG_CONFIG=$ac_pt_PKG_CONFIG
9956 else
9957   PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
9958 fi
9959
9960         ;;
9961 *)
9962         PKG_CONFIG=$withval
9963         ;;
9964 esac
9965
9966 test -z "$PKG_CONFIG" && PKG_CONFIG=none
9967 if test "$PKG_CONFIG" != none ; then
9968
9969 if test "x$prefix" != xNONE; then
9970   cf_path_syntax="$prefix"
9971 else
9972   cf_path_syntax="$ac_default_prefix"
9973 fi
9974
9975 case ".$PKG_CONFIG" in #(vi
9976 .\$\(*\)*|.\'*\'*) #(vi
9977   ;;
9978 ..|./*|.\\*) #(vi
9979   ;;
9980 .[a-zA-Z]:[\\/]*) #(vi OS/2 EMX
9981   ;;
9982 .\${*prefix}*) #(vi
9983   eval PKG_CONFIG="$PKG_CONFIG"
9984   case ".$PKG_CONFIG" in #(vi
9985   .NONE/*)
9986     PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9987     ;;
9988   esac
9989   ;; #(vi
9990 .no|.NONE/*)
9991   PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%`
9992   ;;
9993 *)
9994   { { echo "$as_me:9994: error: expected a pathname, not \"$PKG_CONFIG\"" >&5
9995 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;}
9996    { (exit 1); exit 1; }; }
9997   ;;
9998 esac
9999
10000 fi
10001
10002 echo "$as_me:10002: checking for X" >&5
10003 echo $ECHO_N "checking for X... $ECHO_C" >&6
10004
10005 # Check whether --with-x or --without-x was given.
10006 if test "${with_x+set}" = set; then
10007   withval="$with_x"
10008
10009 fi;
10010 # $have_x is `yes', `no', `disabled', or empty when we do not yet know.
10011 if test "x$with_x" = xno; then
10012   # The user explicitly disabled X.
10013   have_x=disabled
10014 else
10015   if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then
10016     # Both variables are already set.
10017     have_x=yes
10018   else
10019     if test "${ac_cv_have_x+set}" = set; then
10020   echo $ECHO_N "(cached) $ECHO_C" >&6
10021 else
10022   # One or both of the vars are not set, and there is no cached value.
10023 ac_x_includes=no ac_x_libraries=no
10024 rm -fr conftest.dir
10025 if mkdir conftest.dir; then
10026   cd conftest.dir
10027   # Make sure to not put "make" in the Imakefile rules, since we grep it out.
10028   cat >Imakefile <<'EOF'
10029 acfindx:
10030         @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
10031 EOF
10032   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
10033     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
10034     eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
10035     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
10036     for ac_extension in a so sl dylib dll; do
10037       if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
10038          test -f $ac_im_libdir/libX11.$ac_extension; then
10039         ac_im_usrlibdir=$ac_im_libdir; break
10040       fi
10041     done
10042     # Screen out bogus values from the imake configuration.  They are
10043     # bogus both because they are the default anyway, and because
10044     # using them would break gcc on systems where it needs fixed includes.
10045     case $ac_im_incroot in
10046         /usr/include) ;;
10047         *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
10048     esac
10049     case $ac_im_usrlibdir in
10050         /usr/lib | /lib) ;;
10051         *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
10052     esac
10053   fi
10054   cd ..
10055   rm -fr conftest.dir
10056 fi
10057
10058 # Standard set of common directories for X headers.
10059 # Check X11 before X11Rn because it is often a symlink to the current release.
10060 ac_x_header_dirs='
10061 /usr/X11/include
10062 /usr/X11R6/include
10063 /usr/X11R5/include
10064 /usr/X11R4/include
10065
10066 /usr/include/X11
10067 /usr/include/X11R6
10068 /usr/include/X11R5
10069 /usr/include/X11R4
10070
10071 /usr/local/X11/include
10072 /usr/local/X11R6/include
10073 /usr/local/X11R5/include
10074 /usr/local/X11R4/include
10075
10076 /usr/local/include/X11
10077 /usr/local/include/X11R6
10078 /usr/local/include/X11R5
10079 /usr/local/include/X11R4
10080
10081 /usr/X386/include
10082 /usr/x386/include
10083 /usr/XFree86/include/X11
10084
10085 /usr/include
10086 /usr/local/include
10087 /usr/unsupported/include
10088 /usr/athena/include
10089 /usr/local/x11r5/include
10090 /usr/lpp/Xamples/include
10091
10092 /usr/openwin/include
10093 /usr/openwin/share/include'
10094
10095 if test "$ac_x_includes" = no; then
10096   # Guess where to find include files, by looking for Intrinsic.h.
10097   # First, try using that file with no special directory specified.
10098   cat >conftest.$ac_ext <<_ACEOF
10099 #line 10099 "configure"
10100 #include "confdefs.h"
10101 #include <X11/Intrinsic.h>
10102 _ACEOF
10103 if { (eval echo "$as_me:10103: \"$ac_cpp conftest.$ac_ext\"") >&5
10104   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10105   ac_status=$?
10106   egrep -v '^ *\+' conftest.er1 >conftest.err
10107   rm -f conftest.er1
10108   cat conftest.err >&5
10109   echo "$as_me:10109: \$? = $ac_status" >&5
10110   (exit $ac_status); } >/dev/null; then
10111   if test -s conftest.err; then
10112     ac_cpp_err=$ac_c_preproc_warn_flag
10113   else
10114     ac_cpp_err=
10115   fi
10116 else
10117   ac_cpp_err=yes
10118 fi
10119 if test -z "$ac_cpp_err"; then
10120   # We can compile using X headers with no special include directory.
10121 ac_x_includes=
10122 else
10123   echo "$as_me: failed program was:" >&5
10124   cat conftest.$ac_ext >&5
10125   for ac_dir in $ac_x_header_dirs; do
10126   if test -r "$ac_dir/X11/Intrinsic.h"; then
10127     ac_x_includes=$ac_dir
10128     break
10129   fi
10130 done
10131 fi
10132 rm -f conftest.err conftest.$ac_ext
10133 fi # $ac_x_includes = no
10134
10135 if test "$ac_x_libraries" = no; then
10136   # Check for the libraries.
10137   # See if we find them without any special options.
10138   # Don't add to $LIBS permanently.
10139   ac_save_LIBS=$LIBS
10140   LIBS="-lXt $LIBS"
10141   cat >conftest.$ac_ext <<_ACEOF
10142 #line 10142 "configure"
10143 #include "confdefs.h"
10144 #include <X11/Intrinsic.h>
10145 int
10146 main ()
10147 {
10148 XtMalloc (0)
10149   ;
10150   return 0;
10151 }
10152 _ACEOF
10153 rm -f conftest.$ac_objext conftest$ac_exeext
10154 if { (eval echo "$as_me:10154: \"$ac_link\"") >&5
10155   (eval $ac_link) 2>&5
10156   ac_status=$?
10157   echo "$as_me:10157: \$? = $ac_status" >&5
10158   (exit $ac_status); } &&
10159          { ac_try='test -s conftest$ac_exeext'
10160   { (eval echo "$as_me:10160: \"$ac_try\"") >&5
10161   (eval $ac_try) 2>&5
10162   ac_status=$?
10163   echo "$as_me:10163: \$? = $ac_status" >&5
10164   (exit $ac_status); }; }; then
10165   LIBS=$ac_save_LIBS
10166 # We can link X programs with no special library path.
10167 ac_x_libraries=
10168 else
10169   echo "$as_me: failed program was:" >&5
10170 cat conftest.$ac_ext >&5
10171 LIBS=$ac_save_LIBS
10172 for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
10173 do
10174   # Don't even attempt the hair of trying to link an X program!
10175   for ac_extension in a so sl dylib dll; do
10176     if test -r $ac_dir/libXt.$ac_extension; then
10177       ac_x_libraries=$ac_dir
10178       break 2
10179     fi
10180   done
10181 done
10182 fi
10183 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10184 fi # $ac_x_libraries = no
10185
10186 if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then
10187   # Didn't find X anywhere.  Cache the known absence of X.
10188   ac_cv_have_x="have_x=no"
10189 else
10190   # Record where we found X for the cache.
10191   ac_cv_have_x="have_x=yes \
10192                 ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries"
10193 fi
10194 fi
10195
10196   fi
10197   eval "$ac_cv_have_x"
10198 fi # $with_x != no
10199
10200 if test "$have_x" != yes; then
10201   echo "$as_me:10201: result: $have_x" >&5
10202 echo "${ECHO_T}$have_x" >&6
10203   no_x=yes
10204 else
10205   # If each of the values was on the command line, it overrides each guess.
10206   test "x$x_includes" = xNONE && x_includes=$ac_x_includes
10207   test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
10208   # Update the cache value to reflect the command line values.
10209   ac_cv_have_x="have_x=yes \
10210                 ac_x_includes=$x_includes ac_x_libraries=$x_libraries"
10211   echo "$as_me:10211: result: libraries $x_libraries, headers $x_includes" >&5
10212 echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6
10213 fi
10214
10215 if test "$no_x" = yes; then
10216   # Not all programs may use this symbol, but it does not hurt to define it.
10217
10218 cat >>confdefs.h <<\EOF
10219 #define X_DISPLAY_MISSING 1
10220 EOF
10221
10222   X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS=
10223 else
10224   if test -n "$x_includes"; then
10225     X_CFLAGS="$X_CFLAGS -I$x_includes"
10226   fi
10227
10228   # It would also be nice to do this for all -L options, not just this one.
10229   if test -n "$x_libraries"; then
10230     X_LIBS="$X_LIBS -L$x_libraries"
10231     # For Solaris; some versions of Sun CC require a space after -R and
10232     # others require no space.  Words are not sufficient . . . .
10233     case `(uname -sr) 2>/dev/null` in
10234     "SunOS 5"*)
10235       echo "$as_me:10235: checking whether -R must be followed by a space" >&5
10236 echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6
10237       ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries"
10238       cat >conftest.$ac_ext <<_ACEOF
10239 #line 10239 "configure"
10240 #include "confdefs.h"
10241
10242 int
10243 main ()
10244 {
10245
10246   ;
10247   return 0;
10248 }
10249 _ACEOF
10250 rm -f conftest.$ac_objext conftest$ac_exeext
10251 if { (eval echo "$as_me:10251: \"$ac_link\"") >&5
10252   (eval $ac_link) 2>&5
10253   ac_status=$?
10254   echo "$as_me:10254: \$? = $ac_status" >&5
10255   (exit $ac_status); } &&
10256          { ac_try='test -s conftest$ac_exeext'
10257   { (eval echo "$as_me:10257: \"$ac_try\"") >&5
10258   (eval $ac_try) 2>&5
10259   ac_status=$?
10260   echo "$as_me:10260: \$? = $ac_status" >&5
10261   (exit $ac_status); }; }; then
10262   ac_R_nospace=yes
10263 else
10264   echo "$as_me: failed program was:" >&5
10265 cat conftest.$ac_ext >&5
10266 ac_R_nospace=no
10267 fi
10268 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10269       if test $ac_R_nospace = yes; then
10270         echo "$as_me:10270: result: no" >&5
10271 echo "${ECHO_T}no" >&6
10272         X_LIBS="$X_LIBS -R$x_libraries"
10273       else
10274         LIBS="$ac_xsave_LIBS -R $x_libraries"
10275         cat >conftest.$ac_ext <<_ACEOF
10276 #line 10276 "configure"
10277 #include "confdefs.h"
10278
10279 int
10280 main ()
10281 {
10282
10283   ;
10284   return 0;
10285 }
10286 _ACEOF
10287 rm -f conftest.$ac_objext conftest$ac_exeext
10288 if { (eval echo "$as_me:10288: \"$ac_link\"") >&5
10289   (eval $ac_link) 2>&5
10290   ac_status=$?
10291   echo "$as_me:10291: \$? = $ac_status" >&5
10292   (exit $ac_status); } &&
10293          { ac_try='test -s conftest$ac_exeext'
10294   { (eval echo "$as_me:10294: \"$ac_try\"") >&5
10295   (eval $ac_try) 2>&5
10296   ac_status=$?
10297   echo "$as_me:10297: \$? = $ac_status" >&5
10298   (exit $ac_status); }; }; then
10299   ac_R_space=yes
10300 else
10301   echo "$as_me: failed program was:" >&5
10302 cat conftest.$ac_ext >&5
10303 ac_R_space=no
10304 fi
10305 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10306         if test $ac_R_space = yes; then
10307           echo "$as_me:10307: result: yes" >&5
10308 echo "${ECHO_T}yes" >&6
10309           X_LIBS="$X_LIBS -R $x_libraries"
10310         else
10311           echo "$as_me:10311: result: neither works" >&5
10312 echo "${ECHO_T}neither works" >&6
10313         fi
10314       fi
10315       LIBS=$ac_xsave_LIBS
10316     esac
10317   fi
10318
10319   # Check for system-dependent libraries X programs must link with.
10320   # Do this before checking for the system-independent R6 libraries
10321   # (-lICE), since we may need -lsocket or whatever for X linking.
10322
10323   if test "$ISC" = yes; then
10324     X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
10325   else
10326     # Martyn Johnson says this is needed for Ultrix, if the X
10327     # libraries were built with DECnet support.  And Karl Berry says
10328     # the Alpha needs dnet_stub (dnet does not exist).
10329     ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11"
10330     cat >conftest.$ac_ext <<_ACEOF
10331 #line 10331 "configure"
10332 #include "confdefs.h"
10333
10334 /* Override any gcc2 internal prototype to avoid an error.  */
10335 #ifdef __cplusplus
10336 extern "C"
10337 #endif
10338 /* We use char because int might match the return type of a gcc2
10339    builtin and then its argument prototype would still apply.  */
10340 char XOpenDisplay ();
10341 int
10342 main ()
10343 {
10344 XOpenDisplay ();
10345   ;
10346   return 0;
10347 }
10348 _ACEOF
10349 rm -f conftest.$ac_objext conftest$ac_exeext
10350 if { (eval echo "$as_me:10350: \"$ac_link\"") >&5
10351   (eval $ac_link) 2>&5
10352   ac_status=$?
10353   echo "$as_me:10353: \$? = $ac_status" >&5
10354   (exit $ac_status); } &&
10355          { ac_try='test -s conftest$ac_exeext'
10356   { (eval echo "$as_me:10356: \"$ac_try\"") >&5
10357   (eval $ac_try) 2>&5
10358   ac_status=$?
10359   echo "$as_me:10359: \$? = $ac_status" >&5
10360   (exit $ac_status); }; }; then
10361   :
10362 else
10363   echo "$as_me: failed program was:" >&5
10364 cat conftest.$ac_ext >&5
10365 echo "$as_me:10365: checking for dnet_ntoa in -ldnet" >&5
10366 echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6
10367 if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then
10368   echo $ECHO_N "(cached) $ECHO_C" >&6
10369 else
10370   ac_check_lib_save_LIBS=$LIBS
10371 LIBS="-ldnet  $LIBS"
10372 cat >conftest.$ac_ext <<_ACEOF
10373 #line 10373 "configure"
10374 #include "confdefs.h"
10375
10376 /* Override any gcc2 internal prototype to avoid an error.  */
10377 #ifdef __cplusplus
10378 extern "C"
10379 #endif
10380 /* We use char because int might match the return type of a gcc2
10381    builtin and then its argument prototype would still apply.  */
10382 char dnet_ntoa ();
10383 int
10384 main ()
10385 {
10386 dnet_ntoa ();
10387   ;
10388   return 0;
10389 }
10390 _ACEOF
10391 rm -f conftest.$ac_objext conftest$ac_exeext
10392 if { (eval echo "$as_me:10392: \"$ac_link\"") >&5
10393   (eval $ac_link) 2>&5
10394   ac_status=$?
10395   echo "$as_me:10395: \$? = $ac_status" >&5
10396   (exit $ac_status); } &&
10397          { ac_try='test -s conftest$ac_exeext'
10398   { (eval echo "$as_me:10398: \"$ac_try\"") >&5
10399   (eval $ac_try) 2>&5
10400   ac_status=$?
10401   echo "$as_me:10401: \$? = $ac_status" >&5
10402   (exit $ac_status); }; }; then
10403   ac_cv_lib_dnet_dnet_ntoa=yes
10404 else
10405   echo "$as_me: failed program was:" >&5
10406 cat conftest.$ac_ext >&5
10407 ac_cv_lib_dnet_dnet_ntoa=no
10408 fi
10409 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10410 LIBS=$ac_check_lib_save_LIBS
10411 fi
10412 echo "$as_me:10412: result: $ac_cv_lib_dnet_dnet_ntoa" >&5
10413 echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6
10414 if test $ac_cv_lib_dnet_dnet_ntoa = yes; then
10415   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
10416 fi
10417
10418     if test $ac_cv_lib_dnet_dnet_ntoa = no; then
10419       echo "$as_me:10419: checking for dnet_ntoa in -ldnet_stub" >&5
10420 echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6
10421 if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then
10422   echo $ECHO_N "(cached) $ECHO_C" >&6
10423 else
10424   ac_check_lib_save_LIBS=$LIBS
10425 LIBS="-ldnet_stub  $LIBS"
10426 cat >conftest.$ac_ext <<_ACEOF
10427 #line 10427 "configure"
10428 #include "confdefs.h"
10429
10430 /* Override any gcc2 internal prototype to avoid an error.  */
10431 #ifdef __cplusplus
10432 extern "C"
10433 #endif
10434 /* We use char because int might match the return type of a gcc2
10435    builtin and then its argument prototype would still apply.  */
10436 char dnet_ntoa ();
10437 int
10438 main ()
10439 {
10440 dnet_ntoa ();
10441   ;
10442   return 0;
10443 }
10444 _ACEOF
10445 rm -f conftest.$ac_objext conftest$ac_exeext
10446 if { (eval echo "$as_me:10446: \"$ac_link\"") >&5
10447   (eval $ac_link) 2>&5
10448   ac_status=$?
10449   echo "$as_me:10449: \$? = $ac_status" >&5
10450   (exit $ac_status); } &&
10451          { ac_try='test -s conftest$ac_exeext'
10452   { (eval echo "$as_me:10452: \"$ac_try\"") >&5
10453   (eval $ac_try) 2>&5
10454   ac_status=$?
10455   echo "$as_me:10455: \$? = $ac_status" >&5
10456   (exit $ac_status); }; }; then
10457   ac_cv_lib_dnet_stub_dnet_ntoa=yes
10458 else
10459   echo "$as_me: failed program was:" >&5
10460 cat conftest.$ac_ext >&5
10461 ac_cv_lib_dnet_stub_dnet_ntoa=no
10462 fi
10463 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10464 LIBS=$ac_check_lib_save_LIBS
10465 fi
10466 echo "$as_me:10466: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5
10467 echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6
10468 if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then
10469   X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
10470 fi
10471
10472     fi
10473 fi
10474 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10475     LIBS="$ac_xsave_LIBS"
10476
10477     # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
10478     # to get the SysV transport functions.
10479     # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4)
10480     # needs -lnsl.
10481     # The nsl library prevents programs from opening the X display
10482     # on Irix 5.2, according to T.E. Dickey.
10483     # The functions gethostbyname, getservbyname, and inet_addr are
10484     # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking.
10485     echo "$as_me:10485: checking for gethostbyname" >&5
10486 echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6
10487 if test "${ac_cv_func_gethostbyname+set}" = set; then
10488   echo $ECHO_N "(cached) $ECHO_C" >&6
10489 else
10490   cat >conftest.$ac_ext <<_ACEOF
10491 #line 10491 "configure"
10492 #include "confdefs.h"
10493 /* System header to define __stub macros and hopefully few prototypes,
10494     which can conflict with char gethostbyname (); below.  */
10495 #include <assert.h>
10496 /* Override any gcc2 internal prototype to avoid an error.  */
10497 #ifdef __cplusplus
10498 extern "C"
10499 #endif
10500 /* We use char because int might match the return type of a gcc2
10501    builtin and then its argument prototype would still apply.  */
10502 char gethostbyname ();
10503 char (*f) ();
10504
10505 int
10506 main ()
10507 {
10508 /* The GNU C library defines this for functions which it implements
10509     to always fail with ENOSYS.  Some functions are actually named
10510     something starting with __ and the normal name is an alias.  */
10511 #if defined (__stub_gethostbyname) || defined (__stub___gethostbyname)
10512 choke me
10513 #else
10514 f = gethostbyname; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10515 #endif
10516
10517   ;
10518   return 0;
10519 }
10520 _ACEOF
10521 rm -f conftest.$ac_objext conftest$ac_exeext
10522 if { (eval echo "$as_me:10522: \"$ac_link\"") >&5
10523   (eval $ac_link) 2>&5
10524   ac_status=$?
10525   echo "$as_me:10525: \$? = $ac_status" >&5
10526   (exit $ac_status); } &&
10527          { ac_try='test -s conftest$ac_exeext'
10528   { (eval echo "$as_me:10528: \"$ac_try\"") >&5
10529   (eval $ac_try) 2>&5
10530   ac_status=$?
10531   echo "$as_me:10531: \$? = $ac_status" >&5
10532   (exit $ac_status); }; }; then
10533   ac_cv_func_gethostbyname=yes
10534 else
10535   echo "$as_me: failed program was:" >&5
10536 cat conftest.$ac_ext >&5
10537 ac_cv_func_gethostbyname=no
10538 fi
10539 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10540 fi
10541 echo "$as_me:10541: result: $ac_cv_func_gethostbyname" >&5
10542 echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6
10543
10544     if test $ac_cv_func_gethostbyname = no; then
10545       echo "$as_me:10545: checking for gethostbyname in -lnsl" >&5
10546 echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6
10547 if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then
10548   echo $ECHO_N "(cached) $ECHO_C" >&6
10549 else
10550   ac_check_lib_save_LIBS=$LIBS
10551 LIBS="-lnsl  $LIBS"
10552 cat >conftest.$ac_ext <<_ACEOF
10553 #line 10553 "configure"
10554 #include "confdefs.h"
10555
10556 /* Override any gcc2 internal prototype to avoid an error.  */
10557 #ifdef __cplusplus
10558 extern "C"
10559 #endif
10560 /* We use char because int might match the return type of a gcc2
10561    builtin and then its argument prototype would still apply.  */
10562 char gethostbyname ();
10563 int
10564 main ()
10565 {
10566 gethostbyname ();
10567   ;
10568   return 0;
10569 }
10570 _ACEOF
10571 rm -f conftest.$ac_objext conftest$ac_exeext
10572 if { (eval echo "$as_me:10572: \"$ac_link\"") >&5
10573   (eval $ac_link) 2>&5
10574   ac_status=$?
10575   echo "$as_me:10575: \$? = $ac_status" >&5
10576   (exit $ac_status); } &&
10577          { ac_try='test -s conftest$ac_exeext'
10578   { (eval echo "$as_me:10578: \"$ac_try\"") >&5
10579   (eval $ac_try) 2>&5
10580   ac_status=$?
10581   echo "$as_me:10581: \$? = $ac_status" >&5
10582   (exit $ac_status); }; }; then
10583   ac_cv_lib_nsl_gethostbyname=yes
10584 else
10585   echo "$as_me: failed program was:" >&5
10586 cat conftest.$ac_ext >&5
10587 ac_cv_lib_nsl_gethostbyname=no
10588 fi
10589 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10590 LIBS=$ac_check_lib_save_LIBS
10591 fi
10592 echo "$as_me:10592: result: $ac_cv_lib_nsl_gethostbyname" >&5
10593 echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6
10594 if test $ac_cv_lib_nsl_gethostbyname = yes; then
10595   X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
10596 fi
10597
10598       if test $ac_cv_lib_nsl_gethostbyname = no; then
10599         echo "$as_me:10599: checking for gethostbyname in -lbsd" >&5
10600 echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6
10601 if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then
10602   echo $ECHO_N "(cached) $ECHO_C" >&6
10603 else
10604   ac_check_lib_save_LIBS=$LIBS
10605 LIBS="-lbsd  $LIBS"
10606 cat >conftest.$ac_ext <<_ACEOF
10607 #line 10607 "configure"
10608 #include "confdefs.h"
10609
10610 /* Override any gcc2 internal prototype to avoid an error.  */
10611 #ifdef __cplusplus
10612 extern "C"
10613 #endif
10614 /* We use char because int might match the return type of a gcc2
10615    builtin and then its argument prototype would still apply.  */
10616 char gethostbyname ();
10617 int
10618 main ()
10619 {
10620 gethostbyname ();
10621   ;
10622   return 0;
10623 }
10624 _ACEOF
10625 rm -f conftest.$ac_objext conftest$ac_exeext
10626 if { (eval echo "$as_me:10626: \"$ac_link\"") >&5
10627   (eval $ac_link) 2>&5
10628   ac_status=$?
10629   echo "$as_me:10629: \$? = $ac_status" >&5
10630   (exit $ac_status); } &&
10631          { ac_try='test -s conftest$ac_exeext'
10632   { (eval echo "$as_me:10632: \"$ac_try\"") >&5
10633   (eval $ac_try) 2>&5
10634   ac_status=$?
10635   echo "$as_me:10635: \$? = $ac_status" >&5
10636   (exit $ac_status); }; }; then
10637   ac_cv_lib_bsd_gethostbyname=yes
10638 else
10639   echo "$as_me: failed program was:" >&5
10640 cat conftest.$ac_ext >&5
10641 ac_cv_lib_bsd_gethostbyname=no
10642 fi
10643 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10644 LIBS=$ac_check_lib_save_LIBS
10645 fi
10646 echo "$as_me:10646: result: $ac_cv_lib_bsd_gethostbyname" >&5
10647 echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6
10648 if test $ac_cv_lib_bsd_gethostbyname = yes; then
10649   X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"
10650 fi
10651
10652       fi
10653     fi
10654
10655     # lieder@skyler.mavd.honeywell.com says without -lsocket,
10656     # socket/setsockopt and other routines are undefined under SCO ODT
10657     # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
10658     # on later versions), says Simon Leinen: it contains gethostby*
10659     # variants that don't use the nameserver (or something).  -lsocket
10660     # must be given before -lnsl if both are needed.  We assume that
10661     # if connect needs -lnsl, so does gethostbyname.
10662     echo "$as_me:10662: checking for connect" >&5
10663 echo $ECHO_N "checking for connect... $ECHO_C" >&6
10664 if test "${ac_cv_func_connect+set}" = set; then
10665   echo $ECHO_N "(cached) $ECHO_C" >&6
10666 else
10667   cat >conftest.$ac_ext <<_ACEOF
10668 #line 10668 "configure"
10669 #include "confdefs.h"
10670 /* System header to define __stub macros and hopefully few prototypes,
10671     which can conflict with char connect (); below.  */
10672 #include <assert.h>
10673 /* Override any gcc2 internal prototype to avoid an error.  */
10674 #ifdef __cplusplus
10675 extern "C"
10676 #endif
10677 /* We use char because int might match the return type of a gcc2
10678    builtin and then its argument prototype would still apply.  */
10679 char connect ();
10680 char (*f) ();
10681
10682 int
10683 main ()
10684 {
10685 /* The GNU C library defines this for functions which it implements
10686     to always fail with ENOSYS.  Some functions are actually named
10687     something starting with __ and the normal name is an alias.  */
10688 #if defined (__stub_connect) || defined (__stub___connect)
10689 choke me
10690 #else
10691 f = connect; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10692 #endif
10693
10694   ;
10695   return 0;
10696 }
10697 _ACEOF
10698 rm -f conftest.$ac_objext conftest$ac_exeext
10699 if { (eval echo "$as_me:10699: \"$ac_link\"") >&5
10700   (eval $ac_link) 2>&5
10701   ac_status=$?
10702   echo "$as_me:10702: \$? = $ac_status" >&5
10703   (exit $ac_status); } &&
10704          { ac_try='test -s conftest$ac_exeext'
10705   { (eval echo "$as_me:10705: \"$ac_try\"") >&5
10706   (eval $ac_try) 2>&5
10707   ac_status=$?
10708   echo "$as_me:10708: \$? = $ac_status" >&5
10709   (exit $ac_status); }; }; then
10710   ac_cv_func_connect=yes
10711 else
10712   echo "$as_me: failed program was:" >&5
10713 cat conftest.$ac_ext >&5
10714 ac_cv_func_connect=no
10715 fi
10716 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10717 fi
10718 echo "$as_me:10718: result: $ac_cv_func_connect" >&5
10719 echo "${ECHO_T}$ac_cv_func_connect" >&6
10720
10721     if test $ac_cv_func_connect = no; then
10722       echo "$as_me:10722: checking for connect in -lsocket" >&5
10723 echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6
10724 if test "${ac_cv_lib_socket_connect+set}" = set; then
10725   echo $ECHO_N "(cached) $ECHO_C" >&6
10726 else
10727   ac_check_lib_save_LIBS=$LIBS
10728 LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
10729 cat >conftest.$ac_ext <<_ACEOF
10730 #line 10730 "configure"
10731 #include "confdefs.h"
10732
10733 /* Override any gcc2 internal prototype to avoid an error.  */
10734 #ifdef __cplusplus
10735 extern "C"
10736 #endif
10737 /* We use char because int might match the return type of a gcc2
10738    builtin and then its argument prototype would still apply.  */
10739 char connect ();
10740 int
10741 main ()
10742 {
10743 connect ();
10744   ;
10745   return 0;
10746 }
10747 _ACEOF
10748 rm -f conftest.$ac_objext conftest$ac_exeext
10749 if { (eval echo "$as_me:10749: \"$ac_link\"") >&5
10750   (eval $ac_link) 2>&5
10751   ac_status=$?
10752   echo "$as_me:10752: \$? = $ac_status" >&5
10753   (exit $ac_status); } &&
10754          { ac_try='test -s conftest$ac_exeext'
10755   { (eval echo "$as_me:10755: \"$ac_try\"") >&5
10756   (eval $ac_try) 2>&5
10757   ac_status=$?
10758   echo "$as_me:10758: \$? = $ac_status" >&5
10759   (exit $ac_status); }; }; then
10760   ac_cv_lib_socket_connect=yes
10761 else
10762   echo "$as_me: failed program was:" >&5
10763 cat conftest.$ac_ext >&5
10764 ac_cv_lib_socket_connect=no
10765 fi
10766 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10767 LIBS=$ac_check_lib_save_LIBS
10768 fi
10769 echo "$as_me:10769: result: $ac_cv_lib_socket_connect" >&5
10770 echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6
10771 if test $ac_cv_lib_socket_connect = yes; then
10772   X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
10773 fi
10774
10775     fi
10776
10777     # Guillermo Gomez says -lposix is necessary on A/UX.
10778     echo "$as_me:10778: checking for remove" >&5
10779 echo $ECHO_N "checking for remove... $ECHO_C" >&6
10780 if test "${ac_cv_func_remove+set}" = set; then
10781   echo $ECHO_N "(cached) $ECHO_C" >&6
10782 else
10783   cat >conftest.$ac_ext <<_ACEOF
10784 #line 10784 "configure"
10785 #include "confdefs.h"
10786 /* System header to define __stub macros and hopefully few prototypes,
10787     which can conflict with char remove (); below.  */
10788 #include <assert.h>
10789 /* Override any gcc2 internal prototype to avoid an error.  */
10790 #ifdef __cplusplus
10791 extern "C"
10792 #endif
10793 /* We use char because int might match the return type of a gcc2
10794    builtin and then its argument prototype would still apply.  */
10795 char remove ();
10796 char (*f) ();
10797
10798 int
10799 main ()
10800 {
10801 /* The GNU C library defines this for functions which it implements
10802     to always fail with ENOSYS.  Some functions are actually named
10803     something starting with __ and the normal name is an alias.  */
10804 #if defined (__stub_remove) || defined (__stub___remove)
10805 choke me
10806 #else
10807 f = remove; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10808 #endif
10809
10810   ;
10811   return 0;
10812 }
10813 _ACEOF
10814 rm -f conftest.$ac_objext conftest$ac_exeext
10815 if { (eval echo "$as_me:10815: \"$ac_link\"") >&5
10816   (eval $ac_link) 2>&5
10817   ac_status=$?
10818   echo "$as_me:10818: \$? = $ac_status" >&5
10819   (exit $ac_status); } &&
10820          { ac_try='test -s conftest$ac_exeext'
10821   { (eval echo "$as_me:10821: \"$ac_try\"") >&5
10822   (eval $ac_try) 2>&5
10823   ac_status=$?
10824   echo "$as_me:10824: \$? = $ac_status" >&5
10825   (exit $ac_status); }; }; then
10826   ac_cv_func_remove=yes
10827 else
10828   echo "$as_me: failed program was:" >&5
10829 cat conftest.$ac_ext >&5
10830 ac_cv_func_remove=no
10831 fi
10832 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10833 fi
10834 echo "$as_me:10834: result: $ac_cv_func_remove" >&5
10835 echo "${ECHO_T}$ac_cv_func_remove" >&6
10836
10837     if test $ac_cv_func_remove = no; then
10838       echo "$as_me:10838: checking for remove in -lposix" >&5
10839 echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6
10840 if test "${ac_cv_lib_posix_remove+set}" = set; then
10841   echo $ECHO_N "(cached) $ECHO_C" >&6
10842 else
10843   ac_check_lib_save_LIBS=$LIBS
10844 LIBS="-lposix  $LIBS"
10845 cat >conftest.$ac_ext <<_ACEOF
10846 #line 10846 "configure"
10847 #include "confdefs.h"
10848
10849 /* Override any gcc2 internal prototype to avoid an error.  */
10850 #ifdef __cplusplus
10851 extern "C"
10852 #endif
10853 /* We use char because int might match the return type of a gcc2
10854    builtin and then its argument prototype would still apply.  */
10855 char remove ();
10856 int
10857 main ()
10858 {
10859 remove ();
10860   ;
10861   return 0;
10862 }
10863 _ACEOF
10864 rm -f conftest.$ac_objext conftest$ac_exeext
10865 if { (eval echo "$as_me:10865: \"$ac_link\"") >&5
10866   (eval $ac_link) 2>&5
10867   ac_status=$?
10868   echo "$as_me:10868: \$? = $ac_status" >&5
10869   (exit $ac_status); } &&
10870          { ac_try='test -s conftest$ac_exeext'
10871   { (eval echo "$as_me:10871: \"$ac_try\"") >&5
10872   (eval $ac_try) 2>&5
10873   ac_status=$?
10874   echo "$as_me:10874: \$? = $ac_status" >&5
10875   (exit $ac_status); }; }; then
10876   ac_cv_lib_posix_remove=yes
10877 else
10878   echo "$as_me: failed program was:" >&5
10879 cat conftest.$ac_ext >&5
10880 ac_cv_lib_posix_remove=no
10881 fi
10882 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10883 LIBS=$ac_check_lib_save_LIBS
10884 fi
10885 echo "$as_me:10885: result: $ac_cv_lib_posix_remove" >&5
10886 echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6
10887 if test $ac_cv_lib_posix_remove = yes; then
10888   X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
10889 fi
10890
10891     fi
10892
10893     # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
10894     echo "$as_me:10894: checking for shmat" >&5
10895 echo $ECHO_N "checking for shmat... $ECHO_C" >&6
10896 if test "${ac_cv_func_shmat+set}" = set; then
10897   echo $ECHO_N "(cached) $ECHO_C" >&6
10898 else
10899   cat >conftest.$ac_ext <<_ACEOF
10900 #line 10900 "configure"
10901 #include "confdefs.h"
10902 /* System header to define __stub macros and hopefully few prototypes,
10903     which can conflict with char shmat (); below.  */
10904 #include <assert.h>
10905 /* Override any gcc2 internal prototype to avoid an error.  */
10906 #ifdef __cplusplus
10907 extern "C"
10908 #endif
10909 /* We use char because int might match the return type of a gcc2
10910    builtin and then its argument prototype would still apply.  */
10911 char shmat ();
10912 char (*f) ();
10913
10914 int
10915 main ()
10916 {
10917 /* The GNU C library defines this for functions which it implements
10918     to always fail with ENOSYS.  Some functions are actually named
10919     something starting with __ and the normal name is an alias.  */
10920 #if defined (__stub_shmat) || defined (__stub___shmat)
10921 choke me
10922 #else
10923 f = shmat; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
10924 #endif
10925
10926   ;
10927   return 0;
10928 }
10929 _ACEOF
10930 rm -f conftest.$ac_objext conftest$ac_exeext
10931 if { (eval echo "$as_me:10931: \"$ac_link\"") >&5
10932   (eval $ac_link) 2>&5
10933   ac_status=$?
10934   echo "$as_me:10934: \$? = $ac_status" >&5
10935   (exit $ac_status); } &&
10936          { ac_try='test -s conftest$ac_exeext'
10937   { (eval echo "$as_me:10937: \"$ac_try\"") >&5
10938   (eval $ac_try) 2>&5
10939   ac_status=$?
10940   echo "$as_me:10940: \$? = $ac_status" >&5
10941   (exit $ac_status); }; }; then
10942   ac_cv_func_shmat=yes
10943 else
10944   echo "$as_me: failed program was:" >&5
10945 cat conftest.$ac_ext >&5
10946 ac_cv_func_shmat=no
10947 fi
10948 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10949 fi
10950 echo "$as_me:10950: result: $ac_cv_func_shmat" >&5
10951 echo "${ECHO_T}$ac_cv_func_shmat" >&6
10952
10953     if test $ac_cv_func_shmat = no; then
10954       echo "$as_me:10954: checking for shmat in -lipc" >&5
10955 echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6
10956 if test "${ac_cv_lib_ipc_shmat+set}" = set; then
10957   echo $ECHO_N "(cached) $ECHO_C" >&6
10958 else
10959   ac_check_lib_save_LIBS=$LIBS
10960 LIBS="-lipc  $LIBS"
10961 cat >conftest.$ac_ext <<_ACEOF
10962 #line 10962 "configure"
10963 #include "confdefs.h"
10964
10965 /* Override any gcc2 internal prototype to avoid an error.  */
10966 #ifdef __cplusplus
10967 extern "C"
10968 #endif
10969 /* We use char because int might match the return type of a gcc2
10970    builtin and then its argument prototype would still apply.  */
10971 char shmat ();
10972 int
10973 main ()
10974 {
10975 shmat ();
10976   ;
10977   return 0;
10978 }
10979 _ACEOF
10980 rm -f conftest.$ac_objext conftest$ac_exeext
10981 if { (eval echo "$as_me:10981: \"$ac_link\"") >&5
10982   (eval $ac_link) 2>&5
10983   ac_status=$?
10984   echo "$as_me:10984: \$? = $ac_status" >&5
10985   (exit $ac_status); } &&
10986          { ac_try='test -s conftest$ac_exeext'
10987   { (eval echo "$as_me:10987: \"$ac_try\"") >&5
10988   (eval $ac_try) 2>&5
10989   ac_status=$?
10990   echo "$as_me:10990: \$? = $ac_status" >&5
10991   (exit $ac_status); }; }; then
10992   ac_cv_lib_ipc_shmat=yes
10993 else
10994   echo "$as_me: failed program was:" >&5
10995 cat conftest.$ac_ext >&5
10996 ac_cv_lib_ipc_shmat=no
10997 fi
10998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
10999 LIBS=$ac_check_lib_save_LIBS
11000 fi
11001 echo "$as_me:11001: result: $ac_cv_lib_ipc_shmat" >&5
11002 echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6
11003 if test $ac_cv_lib_ipc_shmat = yes; then
11004   X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
11005 fi
11006
11007     fi
11008   fi
11009
11010   # Check for libraries that X11R6 Xt/Xaw programs need.
11011   ac_save_LDFLAGS=$LDFLAGS
11012   test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries"
11013   # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
11014   # check for ICE first), but we must link in the order -lSM -lICE or
11015   # we get undefined symbols.  So assume we have SM if we have ICE.
11016   # These have to be linked with before -lX11, unlike the other
11017   # libraries we check for below, so use a different variable.
11018   # John Interrante, Karl Berry
11019   echo "$as_me:11019: checking for IceConnectionNumber in -lICE" >&5
11020 echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6
11021 if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then
11022   echo $ECHO_N "(cached) $ECHO_C" >&6
11023 else
11024   ac_check_lib_save_LIBS=$LIBS
11025 LIBS="-lICE $X_EXTRA_LIBS $LIBS"
11026 cat >conftest.$ac_ext <<_ACEOF
11027 #line 11027 "configure"
11028 #include "confdefs.h"
11029
11030 /* Override any gcc2 internal prototype to avoid an error.  */
11031 #ifdef __cplusplus
11032 extern "C"
11033 #endif
11034 /* We use char because int might match the return type of a gcc2
11035    builtin and then its argument prototype would still apply.  */
11036 char IceConnectionNumber ();
11037 int
11038 main ()
11039 {
11040 IceConnectionNumber ();
11041   ;
11042   return 0;
11043 }
11044 _ACEOF
11045 rm -f conftest.$ac_objext conftest$ac_exeext
11046 if { (eval echo "$as_me:11046: \"$ac_link\"") >&5
11047   (eval $ac_link) 2>&5
11048   ac_status=$?
11049   echo "$as_me:11049: \$? = $ac_status" >&5
11050   (exit $ac_status); } &&
11051          { ac_try='test -s conftest$ac_exeext'
11052   { (eval echo "$as_me:11052: \"$ac_try\"") >&5
11053   (eval $ac_try) 2>&5
11054   ac_status=$?
11055   echo "$as_me:11055: \$? = $ac_status" >&5
11056   (exit $ac_status); }; }; then
11057   ac_cv_lib_ICE_IceConnectionNumber=yes
11058 else
11059   echo "$as_me: failed program was:" >&5
11060 cat conftest.$ac_ext >&5
11061 ac_cv_lib_ICE_IceConnectionNumber=no
11062 fi
11063 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11064 LIBS=$ac_check_lib_save_LIBS
11065 fi
11066 echo "$as_me:11066: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5
11067 echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6
11068 if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then
11069   X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"
11070 fi
11071
11072   LDFLAGS=$ac_save_LDFLAGS
11073
11074 fi
11075
11076 cf_x_athena=${cf_x_athena:-Xaw}
11077
11078 echo "$as_me:11078: checking if you want to link with Xaw 3d library" >&5
11079 echo $ECHO_N "checking if you want to link with Xaw 3d library... $ECHO_C" >&6
11080 withval=
11081
11082 # Check whether --with-Xaw3d or --without-Xaw3d was given.
11083 if test "${with_Xaw3d+set}" = set; then
11084   withval="$with_Xaw3d"
11085
11086 fi;
11087 if test "$withval" = yes ; then
11088         cf_x_athena=Xaw3d
11089         echo "$as_me:11089: result: yes" >&5
11090 echo "${ECHO_T}yes" >&6
11091 else
11092         echo "$as_me:11092: result: no" >&5
11093 echo "${ECHO_T}no" >&6
11094 fi
11095
11096 echo "$as_me:11096: checking if you want to link with neXT Athena library" >&5
11097 echo $ECHO_N "checking if you want to link with neXT Athena library... $ECHO_C" >&6
11098 withval=
11099
11100 # Check whether --with-neXtaw or --without-neXtaw was given.
11101 if test "${with_neXtaw+set}" = set; then
11102   withval="$with_neXtaw"
11103
11104 fi;
11105 if test "$withval" = yes ; then
11106         cf_x_athena=neXtaw
11107         echo "$as_me:11107: result: yes" >&5
11108 echo "${ECHO_T}yes" >&6
11109 else
11110         echo "$as_me:11110: result: no" >&5
11111 echo "${ECHO_T}no" >&6
11112 fi
11113
11114 echo "$as_me:11114: checking if you want to link with Athena-Plus library" >&5
11115 echo $ECHO_N "checking if you want to link with Athena-Plus library... $ECHO_C" >&6
11116 withval=
11117
11118 # Check whether --with-XawPlus or --without-XawPlus was given.
11119 if test "${with_XawPlus+set}" = set; then
11120   withval="$with_XawPlus"
11121
11122 fi;
11123 if test "$withval" = yes ; then
11124         cf_x_athena=XawPlus
11125         echo "$as_me:11125: result: yes" >&5
11126 echo "${ECHO_T}yes" >&6
11127 else
11128         echo "$as_me:11128: result: no" >&5
11129 echo "${ECHO_T}no" >&6
11130 fi
11131
11132 cf_x_athena_lib=""
11133
11134 if test "$PKG_CONFIG" != none ; then
11135         cf_athena_list=
11136         test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
11137         for cf_athena_pkg in \
11138                 $cf_athena_list \
11139                 ${cf_x_athena} \
11140                 ${cf_x_athena}-devel \
11141                 lib${cf_x_athena} \
11142                 lib${cf_x_athena}-devel
11143         do
11144
11145 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $cf_athena_pkg; then
11146         test -n "$verbose" && echo "    found package $cf_athena_pkg" 1>&6
11147
11148 echo "${as_me:-configure}:11148: testing found package $cf_athena_pkg ..." 1>&5
11149
11150         cf_pkgconfig_incs="`$PKG_CONFIG --cflags $cf_athena_pkg 2>/dev/null`"
11151         cf_pkgconfig_libs="`$PKG_CONFIG --libs   $cf_athena_pkg 2>/dev/null`"
11152         test -n "$verbose" && echo "    package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs" 1>&6
11153
11154 echo "${as_me:-configure}:11154: testing package $cf_athena_pkg CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11155
11156         test -n "$verbose" && echo "    package $cf_athena_pkg LIBS: $cf_pkgconfig_libs" 1>&6
11157
11158 echo "${as_me:-configure}:11158: testing package $cf_athena_pkg LIBS: $cf_pkgconfig_libs ..." 1>&5
11159
11160 cf_fix_cppflags=no
11161 cf_new_cflags=
11162 cf_new_cppflags=
11163 cf_new_extra_cppflags=
11164
11165 for cf_add_cflags in $cf_pkgconfig_incs
11166 do
11167 case $cf_fix_cppflags in
11168 no)
11169         case $cf_add_cflags in #(vi
11170         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11171                 case $cf_add_cflags in
11172                 -D*)
11173                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11174
11175                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11176                                 && test -z "${cf_tst_cflags}" \
11177                                 && cf_fix_cppflags=yes
11178
11179                         if test $cf_fix_cppflags = yes ; then
11180                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11181                                 continue
11182                         elif test "${cf_tst_cflags}" = "\"'" ; then
11183                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11184                                 continue
11185                         fi
11186                         ;;
11187                 esac
11188                 case "$CPPFLAGS" in
11189                 *$cf_add_cflags) #(vi
11190                         ;;
11191                 *) #(vi
11192                         case $cf_add_cflags in #(vi
11193                         -D*)
11194                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11195
11196 CPPFLAGS=`echo "$CPPFLAGS" | \
11197         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11198                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11199
11200                                 ;;
11201                         esac
11202                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11203                         ;;
11204                 esac
11205                 ;;
11206         *)
11207                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11208                 ;;
11209         esac
11210         ;;
11211 yes)
11212         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11213
11214         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11215
11216         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11217                 && test -z "${cf_tst_cflags}" \
11218                 && cf_fix_cppflags=no
11219         ;;
11220 esac
11221 done
11222
11223 if test -n "$cf_new_cflags" ; then
11224
11225         CFLAGS="$CFLAGS $cf_new_cflags"
11226 fi
11227
11228 if test -n "$cf_new_cppflags" ; then
11229
11230         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11231 fi
11232
11233 if test -n "$cf_new_extra_cppflags" ; then
11234
11235         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11236 fi
11237
11238         LIBS="$cf_pkgconfig_libs $LIBS"
11239
11240                         cf_x_athena_lib="$cf_pkgconfig_libs"
11241
11242 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
11243
11244                         cat >>confdefs.h <<EOF
11245 #define $cf_x_athena_LIBS 1
11246 EOF
11247
11248 echo "$as_me:11248: checking for usable $cf_x_athena/Xmu package" >&5
11249 echo $ECHO_N "checking for usable $cf_x_athena/Xmu package... $ECHO_C" >&6
11250 if test "${cf_cv_xaw_compat+set}" = set; then
11251   echo $ECHO_N "(cached) $ECHO_C" >&6
11252 else
11253
11254 cat >conftest.$ac_ext <<_ACEOF
11255 #line 11255 "configure"
11256 #include "confdefs.h"
11257
11258 #include <X11/Xmu/CharSet.h>
11259
11260 int
11261 main ()
11262 {
11263
11264 int check = XmuCompareISOLatin1("big", "small")
11265
11266   ;
11267   return 0;
11268 }
11269 _ACEOF
11270 rm -f conftest.$ac_objext conftest$ac_exeext
11271 if { (eval echo "$as_me:11271: \"$ac_link\"") >&5
11272   (eval $ac_link) 2>&5
11273   ac_status=$?
11274   echo "$as_me:11274: \$? = $ac_status" >&5
11275   (exit $ac_status); } &&
11276          { ac_try='test -s conftest$ac_exeext'
11277   { (eval echo "$as_me:11277: \"$ac_try\"") >&5
11278   (eval $ac_try) 2>&5
11279   ac_status=$?
11280   echo "$as_me:11280: \$? = $ac_status" >&5
11281   (exit $ac_status); }; }; then
11282   cf_cv_xaw_compat=yes
11283 else
11284   echo "$as_me: failed program was:" >&5
11285 cat conftest.$ac_ext >&5
11286 cf_cv_xaw_compat=no
11287 fi
11288 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11289 fi
11290 echo "$as_me:11290: result: $cf_cv_xaw_compat" >&5
11291 echo "${ECHO_T}$cf_cv_xaw_compat" >&6
11292
11293                         if test "$cf_cv_xaw_compat" = no
11294                         then
11295                                 # workaround for broken ".pc" files...
11296                                 case "$cf_x_athena_lib" in #(vi
11297                                 *-lXmu*) #(vi
11298                                         ;;
11299                                 *)
11300                                         test -n "$verbose" && echo "    work around broken package" 1>&6
11301
11302 echo "${as_me:-configure}:11302: testing work around broken package ..." 1>&5
11303
11304 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xmu; then
11305         test -n "$verbose" && echo "    found package xmu" 1>&6
11306
11307 echo "${as_me:-configure}:11307: testing found package xmu ..." 1>&5
11308
11309         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xmu 2>/dev/null`"
11310         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xmu 2>/dev/null`"
11311         test -n "$verbose" && echo "    package xmu CFLAGS: $cf_pkgconfig_incs" 1>&6
11312
11313 echo "${as_me:-configure}:11313: testing package xmu CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11314
11315         test -n "$verbose" && echo "    package xmu LIBS: $cf_pkgconfig_libs" 1>&6
11316
11317 echo "${as_me:-configure}:11317: testing package xmu LIBS: $cf_pkgconfig_libs ..." 1>&5
11318
11319 cf_fix_cppflags=no
11320 cf_new_cflags=
11321 cf_new_cppflags=
11322 cf_new_extra_cppflags=
11323
11324 for cf_add_cflags in $cf_pkgconfig_incs
11325 do
11326 case $cf_fix_cppflags in
11327 no)
11328         case $cf_add_cflags in #(vi
11329         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11330                 case $cf_add_cflags in
11331                 -D*)
11332                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11333
11334                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11335                                 && test -z "${cf_tst_cflags}" \
11336                                 && cf_fix_cppflags=yes
11337
11338                         if test $cf_fix_cppflags = yes ; then
11339                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11340                                 continue
11341                         elif test "${cf_tst_cflags}" = "\"'" ; then
11342                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11343                                 continue
11344                         fi
11345                         ;;
11346                 esac
11347                 case "$CPPFLAGS" in
11348                 *$cf_add_cflags) #(vi
11349                         ;;
11350                 *) #(vi
11351                         case $cf_add_cflags in #(vi
11352                         -D*)
11353                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11354
11355 CPPFLAGS=`echo "$CPPFLAGS" | \
11356         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11357                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11358
11359                                 ;;
11360                         esac
11361                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11362                         ;;
11363                 esac
11364                 ;;
11365         *)
11366                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11367                 ;;
11368         esac
11369         ;;
11370 yes)
11371         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11372
11373         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11374
11375         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11376                 && test -z "${cf_tst_cflags}" \
11377                 && cf_fix_cppflags=no
11378         ;;
11379 esac
11380 done
11381
11382 if test -n "$cf_new_cflags" ; then
11383
11384         CFLAGS="$CFLAGS $cf_new_cflags"
11385 fi
11386
11387 if test -n "$cf_new_cppflags" ; then
11388
11389         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11390 fi
11391
11392 if test -n "$cf_new_extra_cppflags" ; then
11393
11394         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11395 fi
11396
11397         LIBS="$cf_pkgconfig_libs $LIBS"
11398         :
11399 else
11400
11401 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11402
11403 echo "${as_me:-configure}:11403: testing ...before $LIBS ..." 1>&5
11404
11405 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lXmu ," -e 's/  / /g'`
11406 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11407
11408 echo "${as_me:-configure}:11408: testing ...after  $LIBS ..." 1>&5
11409
11410 fi
11411
11412                                         ;;
11413                                 esac
11414                         fi
11415
11416                         break
11417 else
11418         :
11419 fi
11420
11421         done
11422 fi
11423
11424 if test -z "$cf_x_athena_lib" ; then
11425
11426 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists Xext; then
11427         test -n "$verbose" && echo "    found package Xext" 1>&6
11428
11429 echo "${as_me:-configure}:11429: testing found package Xext ..." 1>&5
11430
11431         cf_pkgconfig_incs="`$PKG_CONFIG --cflags Xext 2>/dev/null`"
11432         cf_pkgconfig_libs="`$PKG_CONFIG --libs   Xext 2>/dev/null`"
11433         test -n "$verbose" && echo "    package Xext CFLAGS: $cf_pkgconfig_incs" 1>&6
11434
11435 echo "${as_me:-configure}:11435: testing package Xext CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11436
11437         test -n "$verbose" && echo "    package Xext LIBS: $cf_pkgconfig_libs" 1>&6
11438
11439 echo "${as_me:-configure}:11439: testing package Xext LIBS: $cf_pkgconfig_libs ..." 1>&5
11440
11441 cf_fix_cppflags=no
11442 cf_new_cflags=
11443 cf_new_cppflags=
11444 cf_new_extra_cppflags=
11445
11446 for cf_add_cflags in $cf_pkgconfig_incs
11447 do
11448 case $cf_fix_cppflags in
11449 no)
11450         case $cf_add_cflags in #(vi
11451         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11452                 case $cf_add_cflags in
11453                 -D*)
11454                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11455
11456                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11457                                 && test -z "${cf_tst_cflags}" \
11458                                 && cf_fix_cppflags=yes
11459
11460                         if test $cf_fix_cppflags = yes ; then
11461                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11462                                 continue
11463                         elif test "${cf_tst_cflags}" = "\"'" ; then
11464                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11465                                 continue
11466                         fi
11467                         ;;
11468                 esac
11469                 case "$CPPFLAGS" in
11470                 *$cf_add_cflags) #(vi
11471                         ;;
11472                 *) #(vi
11473                         case $cf_add_cflags in #(vi
11474                         -D*)
11475                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11476
11477 CPPFLAGS=`echo "$CPPFLAGS" | \
11478         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11479                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11480
11481                                 ;;
11482                         esac
11483                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11484                         ;;
11485                 esac
11486                 ;;
11487         *)
11488                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11489                 ;;
11490         esac
11491         ;;
11492 yes)
11493         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11494
11495         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11496
11497         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11498                 && test -z "${cf_tst_cflags}" \
11499                 && cf_fix_cppflags=no
11500         ;;
11501 esac
11502 done
11503
11504 if test -n "$cf_new_cflags" ; then
11505
11506         CFLAGS="$CFLAGS $cf_new_cflags"
11507 fi
11508
11509 if test -n "$cf_new_cppflags" ; then
11510
11511         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11512 fi
11513
11514 if test -n "$cf_new_extra_cppflags" ; then
11515
11516         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11517 fi
11518
11519         LIBS="$cf_pkgconfig_libs $LIBS"
11520         :
11521 else
11522
11523         echo "$as_me:11523: checking for XextCreateExtension in -lXext" >&5
11524 echo $ECHO_N "checking for XextCreateExtension in -lXext... $ECHO_C" >&6
11525 if test "${ac_cv_lib_Xext_XextCreateExtension+set}" = set; then
11526   echo $ECHO_N "(cached) $ECHO_C" >&6
11527 else
11528   ac_check_lib_save_LIBS=$LIBS
11529 LIBS="-lXext  $LIBS"
11530 cat >conftest.$ac_ext <<_ACEOF
11531 #line 11531 "configure"
11532 #include "confdefs.h"
11533
11534 /* Override any gcc2 internal prototype to avoid an error.  */
11535 #ifdef __cplusplus
11536 extern "C"
11537 #endif
11538 /* We use char because int might match the return type of a gcc2
11539    builtin and then its argument prototype would still apply.  */
11540 char XextCreateExtension ();
11541 int
11542 main ()
11543 {
11544 XextCreateExtension ();
11545   ;
11546   return 0;
11547 }
11548 _ACEOF
11549 rm -f conftest.$ac_objext conftest$ac_exeext
11550 if { (eval echo "$as_me:11550: \"$ac_link\"") >&5
11551   (eval $ac_link) 2>&5
11552   ac_status=$?
11553   echo "$as_me:11553: \$? = $ac_status" >&5
11554   (exit $ac_status); } &&
11555          { ac_try='test -s conftest$ac_exeext'
11556   { (eval echo "$as_me:11556: \"$ac_try\"") >&5
11557   (eval $ac_try) 2>&5
11558   ac_status=$?
11559   echo "$as_me:11559: \$? = $ac_status" >&5
11560   (exit $ac_status); }; }; then
11561   ac_cv_lib_Xext_XextCreateExtension=yes
11562 else
11563   echo "$as_me: failed program was:" >&5
11564 cat conftest.$ac_ext >&5
11565 ac_cv_lib_Xext_XextCreateExtension=no
11566 fi
11567 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11568 LIBS=$ac_check_lib_save_LIBS
11569 fi
11570 echo "$as_me:11570: result: $ac_cv_lib_Xext_XextCreateExtension" >&5
11571 echo "${ECHO_T}$ac_cv_lib_Xext_XextCreateExtension" >&6
11572 if test $ac_cv_lib_Xext_XextCreateExtension = yes; then
11573   LIBS="-lXext $LIBS"
11574 fi
11575
11576 fi
11577
11578 cf_have_X_LIBS=no
11579
11580 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists xt; then
11581         test -n "$verbose" && echo "    found package xt" 1>&6
11582
11583 echo "${as_me:-configure}:11583: testing found package xt ..." 1>&5
11584
11585         cf_pkgconfig_incs="`$PKG_CONFIG --cflags xt 2>/dev/null`"
11586         cf_pkgconfig_libs="`$PKG_CONFIG --libs   xt 2>/dev/null`"
11587         test -n "$verbose" && echo "    package xt CFLAGS: $cf_pkgconfig_incs" 1>&6
11588
11589 echo "${as_me:-configure}:11589: testing package xt CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11590
11591         test -n "$verbose" && echo "    package xt LIBS: $cf_pkgconfig_libs" 1>&6
11592
11593 echo "${as_me:-configure}:11593: testing package xt LIBS: $cf_pkgconfig_libs ..." 1>&5
11594
11595 cf_fix_cppflags=no
11596 cf_new_cflags=
11597 cf_new_cppflags=
11598 cf_new_extra_cppflags=
11599
11600 for cf_add_cflags in $cf_pkgconfig_incs
11601 do
11602 case $cf_fix_cppflags in
11603 no)
11604         case $cf_add_cflags in #(vi
11605         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11606                 case $cf_add_cflags in
11607                 -D*)
11608                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11609
11610                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11611                                 && test -z "${cf_tst_cflags}" \
11612                                 && cf_fix_cppflags=yes
11613
11614                         if test $cf_fix_cppflags = yes ; then
11615                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11616                                 continue
11617                         elif test "${cf_tst_cflags}" = "\"'" ; then
11618                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11619                                 continue
11620                         fi
11621                         ;;
11622                 esac
11623                 case "$CPPFLAGS" in
11624                 *$cf_add_cflags) #(vi
11625                         ;;
11626                 *) #(vi
11627                         case $cf_add_cflags in #(vi
11628                         -D*)
11629                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11630
11631 CPPFLAGS=`echo "$CPPFLAGS" | \
11632         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11633                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11634
11635                                 ;;
11636                         esac
11637                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11638                         ;;
11639                 esac
11640                 ;;
11641         *)
11642                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11643                 ;;
11644         esac
11645         ;;
11646 yes)
11647         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11648
11649         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11650
11651         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11652                 && test -z "${cf_tst_cflags}" \
11653                 && cf_fix_cppflags=no
11654         ;;
11655 esac
11656 done
11657
11658 if test -n "$cf_new_cflags" ; then
11659
11660         CFLAGS="$CFLAGS $cf_new_cflags"
11661 fi
11662
11663 if test -n "$cf_new_cppflags" ; then
11664
11665         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11666 fi
11667
11668 if test -n "$cf_new_extra_cppflags" ; then
11669
11670         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11671 fi
11672
11673         LIBS="$cf_pkgconfig_libs $LIBS"
11674
11675         case "x$LIBS" in #(vi
11676         *-lX11*) #(vi
11677                 ;;
11678         *)
11679 # we have an "xt" package, but it may omit Xt's dependency on X11
11680 echo "$as_me:11680: checking for usable X dependency" >&5
11681 echo $ECHO_N "checking for usable X dependency... $ECHO_C" >&6
11682 if test "${cf_cv_xt_x11_compat+set}" = set; then
11683   echo $ECHO_N "(cached) $ECHO_C" >&6
11684 else
11685
11686 cat >conftest.$ac_ext <<_ACEOF
11687 #line 11687 "configure"
11688 #include "confdefs.h"
11689
11690 #include <X11/Xlib.h>
11691
11692 int
11693 main ()
11694 {
11695
11696         int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
11697         int rc2 = XClearWindow((Display*) 0, (Window) 0);
11698         int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
11699         int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
11700
11701   ;
11702   return 0;
11703 }
11704 _ACEOF
11705 rm -f conftest.$ac_objext conftest$ac_exeext
11706 if { (eval echo "$as_me:11706: \"$ac_link\"") >&5
11707   (eval $ac_link) 2>&5
11708   ac_status=$?
11709   echo "$as_me:11709: \$? = $ac_status" >&5
11710   (exit $ac_status); } &&
11711          { ac_try='test -s conftest$ac_exeext'
11712   { (eval echo "$as_me:11712: \"$ac_try\"") >&5
11713   (eval $ac_try) 2>&5
11714   ac_status=$?
11715   echo "$as_me:11715: \$? = $ac_status" >&5
11716   (exit $ac_status); }; }; then
11717   cf_cv_xt_x11_compat=yes
11718 else
11719   echo "$as_me: failed program was:" >&5
11720 cat conftest.$ac_ext >&5
11721 cf_cv_xt_x11_compat=no
11722 fi
11723 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11724 fi
11725 echo "$as_me:11725: result: $cf_cv_xt_x11_compat" >&5
11726 echo "${ECHO_T}$cf_cv_xt_x11_compat" >&6
11727                 if test "$cf_cv_xt_x11_compat" = no
11728                 then
11729                         test -n "$verbose" && echo "    work around broken X11 dependency" 1>&6
11730
11731 echo "${as_me:-configure}:11731: testing work around broken X11 dependency ..." 1>&5
11732
11733                         # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
11734
11735 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists x11; then
11736         test -n "$verbose" && echo "    found package x11" 1>&6
11737
11738 echo "${as_me:-configure}:11738: testing found package x11 ..." 1>&5
11739
11740         cf_pkgconfig_incs="`$PKG_CONFIG --cflags x11 2>/dev/null`"
11741         cf_pkgconfig_libs="`$PKG_CONFIG --libs   x11 2>/dev/null`"
11742         test -n "$verbose" && echo "    package x11 CFLAGS: $cf_pkgconfig_incs" 1>&6
11743
11744 echo "${as_me:-configure}:11744: testing package x11 CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11745
11746         test -n "$verbose" && echo "    package x11 LIBS: $cf_pkgconfig_libs" 1>&6
11747
11748 echo "${as_me:-configure}:11748: testing package x11 LIBS: $cf_pkgconfig_libs ..." 1>&5
11749
11750 cf_fix_cppflags=no
11751 cf_new_cflags=
11752 cf_new_cppflags=
11753 cf_new_extra_cppflags=
11754
11755 for cf_add_cflags in $cf_pkgconfig_incs
11756 do
11757 case $cf_fix_cppflags in
11758 no)
11759         case $cf_add_cflags in #(vi
11760         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11761                 case $cf_add_cflags in
11762                 -D*)
11763                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11764
11765                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11766                                 && test -z "${cf_tst_cflags}" \
11767                                 && cf_fix_cppflags=yes
11768
11769                         if test $cf_fix_cppflags = yes ; then
11770                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11771                                 continue
11772                         elif test "${cf_tst_cflags}" = "\"'" ; then
11773                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11774                                 continue
11775                         fi
11776                         ;;
11777                 esac
11778                 case "$CPPFLAGS" in
11779                 *$cf_add_cflags) #(vi
11780                         ;;
11781                 *) #(vi
11782                         case $cf_add_cflags in #(vi
11783                         -D*)
11784                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11785
11786 CPPFLAGS=`echo "$CPPFLAGS" | \
11787         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11788                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11789
11790                                 ;;
11791                         esac
11792                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11793                         ;;
11794                 esac
11795                 ;;
11796         *)
11797                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11798                 ;;
11799         esac
11800         ;;
11801 yes)
11802         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11803
11804         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11805
11806         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11807                 && test -z "${cf_tst_cflags}" \
11808                 && cf_fix_cppflags=no
11809         ;;
11810 esac
11811 done
11812
11813 if test -n "$cf_new_cflags" ; then
11814
11815         CFLAGS="$CFLAGS $cf_new_cflags"
11816 fi
11817
11818 if test -n "$cf_new_cppflags" ; then
11819
11820         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11821 fi
11822
11823 if test -n "$cf_new_extra_cppflags" ; then
11824
11825         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11826 fi
11827
11828         LIBS="$cf_pkgconfig_libs $LIBS"
11829         :
11830 else
11831
11832 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
11833
11834 echo "${as_me:-configure}:11834: testing ...before $LIBS ..." 1>&5
11835
11836 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt -lX11 ," -e 's/  / /g'`
11837 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
11838
11839 echo "${as_me:-configure}:11839: testing ...after  $LIBS ..." 1>&5
11840
11841 fi
11842
11843                 fi
11844                 ;;
11845         esac
11846
11847 echo "$as_me:11847: checking for usable X Toolkit package" >&5
11848 echo $ECHO_N "checking for usable X Toolkit package... $ECHO_C" >&6
11849 if test "${cf_cv_xt_ice_compat+set}" = set; then
11850   echo $ECHO_N "(cached) $ECHO_C" >&6
11851 else
11852
11853 cat >conftest.$ac_ext <<_ACEOF
11854 #line 11854 "configure"
11855 #include "confdefs.h"
11856
11857 #include <X11/Shell.h>
11858
11859 int
11860 main ()
11861 {
11862 int num = IceConnectionNumber(0)
11863
11864   ;
11865   return 0;
11866 }
11867 _ACEOF
11868 rm -f conftest.$ac_objext conftest$ac_exeext
11869 if { (eval echo "$as_me:11869: \"$ac_link\"") >&5
11870   (eval $ac_link) 2>&5
11871   ac_status=$?
11872   echo "$as_me:11872: \$? = $ac_status" >&5
11873   (exit $ac_status); } &&
11874          { ac_try='test -s conftest$ac_exeext'
11875   { (eval echo "$as_me:11875: \"$ac_try\"") >&5
11876   (eval $ac_try) 2>&5
11877   ac_status=$?
11878   echo "$as_me:11878: \$? = $ac_status" >&5
11879   (exit $ac_status); }; }; then
11880   cf_cv_xt_ice_compat=yes
11881 else
11882   echo "$as_me: failed program was:" >&5
11883 cat conftest.$ac_ext >&5
11884 cf_cv_xt_ice_compat=no
11885 fi
11886 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
11887 fi
11888 echo "$as_me:11888: result: $cf_cv_xt_ice_compat" >&5
11889 echo "${ECHO_T}$cf_cv_xt_ice_compat" >&6
11890
11891         if test "$cf_cv_xt_ice_compat" = no
11892         then
11893                 # workaround for broken ".pc" files used for X Toolkit.
11894                 case "x$X_PRE_LIBS" in #(vi
11895                 *-lICE*)
11896                         case "x$LIBS" in #(vi
11897                         *-lICE*) #(vi
11898                                 ;;
11899                         *)
11900                                 test -n "$verbose" && echo "    work around broken ICE dependency" 1>&6
11901
11902 echo "${as_me:-configure}:11902: testing work around broken ICE dependency ..." 1>&5
11903
11904 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists ice; then
11905         test -n "$verbose" && echo "    found package ice" 1>&6
11906
11907 echo "${as_me:-configure}:11907: testing found package ice ..." 1>&5
11908
11909         cf_pkgconfig_incs="`$PKG_CONFIG --cflags ice 2>/dev/null`"
11910         cf_pkgconfig_libs="`$PKG_CONFIG --libs   ice 2>/dev/null`"
11911         test -n "$verbose" && echo "    package ice CFLAGS: $cf_pkgconfig_incs" 1>&6
11912
11913 echo "${as_me:-configure}:11913: testing package ice CFLAGS: $cf_pkgconfig_incs ..." 1>&5
11914
11915         test -n "$verbose" && echo "    package ice LIBS: $cf_pkgconfig_libs" 1>&6
11916
11917 echo "${as_me:-configure}:11917: testing package ice LIBS: $cf_pkgconfig_libs ..." 1>&5
11918
11919 cf_fix_cppflags=no
11920 cf_new_cflags=
11921 cf_new_cppflags=
11922 cf_new_extra_cppflags=
11923
11924 for cf_add_cflags in $cf_pkgconfig_incs
11925 do
11926 case $cf_fix_cppflags in
11927 no)
11928         case $cf_add_cflags in #(vi
11929         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
11930                 case $cf_add_cflags in
11931                 -D*)
11932                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
11933
11934                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11935                                 && test -z "${cf_tst_cflags}" \
11936                                 && cf_fix_cppflags=yes
11937
11938                         if test $cf_fix_cppflags = yes ; then
11939                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11940                                 continue
11941                         elif test "${cf_tst_cflags}" = "\"'" ; then
11942                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11943                                 continue
11944                         fi
11945                         ;;
11946                 esac
11947                 case "$CPPFLAGS" in
11948                 *$cf_add_cflags) #(vi
11949                         ;;
11950                 *) #(vi
11951                         case $cf_add_cflags in #(vi
11952                         -D*)
11953                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
11954
11955 CPPFLAGS=`echo "$CPPFLAGS" | \
11956         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
11957                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
11958
11959                                 ;;
11960                         esac
11961                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
11962                         ;;
11963                 esac
11964                 ;;
11965         *)
11966                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
11967                 ;;
11968         esac
11969         ;;
11970 yes)
11971         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
11972
11973         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
11974
11975         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
11976                 && test -z "${cf_tst_cflags}" \
11977                 && cf_fix_cppflags=no
11978         ;;
11979 esac
11980 done
11981
11982 if test -n "$cf_new_cflags" ; then
11983
11984         CFLAGS="$CFLAGS $cf_new_cflags"
11985 fi
11986
11987 if test -n "$cf_new_cppflags" ; then
11988
11989         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
11990 fi
11991
11992 if test -n "$cf_new_extra_cppflags" ; then
11993
11994         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
11995 fi
11996
11997         LIBS="$cf_pkgconfig_libs $LIBS"
11998
11999 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists sm; then
12000         test -n "$verbose" && echo "    found package sm" 1>&6
12001
12002 echo "${as_me:-configure}:12002: testing found package sm ..." 1>&5
12003
12004         cf_pkgconfig_incs="`$PKG_CONFIG --cflags sm 2>/dev/null`"
12005         cf_pkgconfig_libs="`$PKG_CONFIG --libs   sm 2>/dev/null`"
12006         test -n "$verbose" && echo "    package sm CFLAGS: $cf_pkgconfig_incs" 1>&6
12007
12008 echo "${as_me:-configure}:12008: testing package sm CFLAGS: $cf_pkgconfig_incs ..." 1>&5
12009
12010         test -n "$verbose" && echo "    package sm LIBS: $cf_pkgconfig_libs" 1>&6
12011
12012 echo "${as_me:-configure}:12012: testing package sm LIBS: $cf_pkgconfig_libs ..." 1>&5
12013
12014 cf_fix_cppflags=no
12015 cf_new_cflags=
12016 cf_new_cppflags=
12017 cf_new_extra_cppflags=
12018
12019 for cf_add_cflags in $cf_pkgconfig_incs
12020 do
12021 case $cf_fix_cppflags in
12022 no)
12023         case $cf_add_cflags in #(vi
12024         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12025                 case $cf_add_cflags in
12026                 -D*)
12027                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12028
12029                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12030                                 && test -z "${cf_tst_cflags}" \
12031                                 && cf_fix_cppflags=yes
12032
12033                         if test $cf_fix_cppflags = yes ; then
12034                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12035                                 continue
12036                         elif test "${cf_tst_cflags}" = "\"'" ; then
12037                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12038                                 continue
12039                         fi
12040                         ;;
12041                 esac
12042                 case "$CPPFLAGS" in
12043                 *$cf_add_cflags) #(vi
12044                         ;;
12045                 *) #(vi
12046                         case $cf_add_cflags in #(vi
12047                         -D*)
12048                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12049
12050 CPPFLAGS=`echo "$CPPFLAGS" | \
12051         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12052                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12053
12054                                 ;;
12055                         esac
12056                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12057                         ;;
12058                 esac
12059                 ;;
12060         *)
12061                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12062                 ;;
12063         esac
12064         ;;
12065 yes)
12066         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12067
12068         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12069
12070         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12071                 && test -z "${cf_tst_cflags}" \
12072                 && cf_fix_cppflags=no
12073         ;;
12074 esac
12075 done
12076
12077 if test -n "$cf_new_cflags" ; then
12078
12079         CFLAGS="$CFLAGS $cf_new_cflags"
12080 fi
12081
12082 if test -n "$cf_new_cppflags" ; then
12083
12084         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12085 fi
12086
12087 if test -n "$cf_new_extra_cppflags" ; then
12088
12089         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12090 fi
12091
12092         LIBS="$cf_pkgconfig_libs $LIBS"
12093         :
12094 else
12095         :
12096 fi
12097
12098 else
12099
12100 test -n "$verbose" && echo "    ...before $LIBS" 1>&6
12101
12102 echo "${as_me:-configure}:12102: testing ...before $LIBS ..." 1>&5
12103
12104 LIBS=`echo "$LIBS" | sed -e "s/[        ][      ]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
12105 test -n "$verbose" && echo "    ...after  $LIBS" 1>&6
12106
12107 echo "${as_me:-configure}:12107: testing ...after  $LIBS ..." 1>&5
12108
12109 fi
12110
12111                                 ;;
12112                         esac
12113                         ;;
12114                 esac
12115         fi
12116
12117         cf_have_X_LIBS=yes
12118
12119 else
12120
12121         LDFLAGS="$X_LIBS $LDFLAGS"
12122
12123 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12124
12125 echo "${as_me:-configure}:12125: testing checking additions to CFLAGS ..." 1>&5
12126
12127 cf_check_cflags="$CFLAGS"
12128 cf_check_cppflags="$CPPFLAGS"
12129
12130 cf_fix_cppflags=no
12131 cf_new_cflags=
12132 cf_new_cppflags=
12133 cf_new_extra_cppflags=
12134
12135 for cf_add_cflags in $X_CFLAGS
12136 do
12137 case $cf_fix_cppflags in
12138 no)
12139         case $cf_add_cflags in #(vi
12140         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12141                 case $cf_add_cflags in
12142                 -D*)
12143                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12144
12145                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12146                                 && test -z "${cf_tst_cflags}" \
12147                                 && cf_fix_cppflags=yes
12148
12149                         if test $cf_fix_cppflags = yes ; then
12150                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12151                                 continue
12152                         elif test "${cf_tst_cflags}" = "\"'" ; then
12153                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12154                                 continue
12155                         fi
12156                         ;;
12157                 esac
12158                 case "$CPPFLAGS" in
12159                 *$cf_add_cflags) #(vi
12160                         ;;
12161                 *) #(vi
12162                         case $cf_add_cflags in #(vi
12163                         -D*)
12164                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12165
12166 CPPFLAGS=`echo "$CPPFLAGS" | \
12167         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12168                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12169
12170                                 ;;
12171                         esac
12172                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12173                         ;;
12174                 esac
12175                 ;;
12176         *)
12177                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12178                 ;;
12179         esac
12180         ;;
12181 yes)
12182         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12183
12184         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12185
12186         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12187                 && test -z "${cf_tst_cflags}" \
12188                 && cf_fix_cppflags=no
12189         ;;
12190 esac
12191 done
12192
12193 if test -n "$cf_new_cflags" ; then
12194         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12195
12196 echo "${as_me:-configure}:12196: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12197
12198         CFLAGS="$CFLAGS $cf_new_cflags"
12199 fi
12200
12201 if test -n "$cf_new_cppflags" ; then
12202         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12203
12204 echo "${as_me:-configure}:12204: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12205
12206         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12207 fi
12208
12209 if test -n "$cf_new_extra_cppflags" ; then
12210         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12211
12212 echo "${as_me:-configure}:12212: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12213
12214         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12215 fi
12216
12217 if test "$cf_check_cflags" != "$CFLAGS" ; then
12218 cat >conftest.$ac_ext <<_ACEOF
12219 #line 12219 "configure"
12220 #include "confdefs.h"
12221 #include <stdio.h>
12222 int
12223 main ()
12224 {
12225 printf("Hello world");
12226   ;
12227   return 0;
12228 }
12229 _ACEOF
12230 rm -f conftest.$ac_objext conftest$ac_exeext
12231 if { (eval echo "$as_me:12231: \"$ac_link\"") >&5
12232   (eval $ac_link) 2>&5
12233   ac_status=$?
12234   echo "$as_me:12234: \$? = $ac_status" >&5
12235   (exit $ac_status); } &&
12236          { ac_try='test -s conftest$ac_exeext'
12237   { (eval echo "$as_me:12237: \"$ac_try\"") >&5
12238   (eval $ac_try) 2>&5
12239   ac_status=$?
12240   echo "$as_me:12240: \$? = $ac_status" >&5
12241   (exit $ac_status); }; }; then
12242   :
12243 else
12244   echo "$as_me: failed program was:" >&5
12245 cat conftest.$ac_ext >&5
12246 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12247
12248 echo "${as_me:-configure}:12248: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12249
12250          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12251                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12252
12253 echo "${as_me:-configure}:12253: testing but keeping change to \$CPPFLAGS ..." 1>&5
12254
12255          fi
12256          CFLAGS="$cf_check_flags"
12257 fi
12258 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12259 fi
12260
12261         echo "$as_me:12261: checking for XOpenDisplay" >&5
12262 echo $ECHO_N "checking for XOpenDisplay... $ECHO_C" >&6
12263 if test "${ac_cv_func_XOpenDisplay+set}" = set; then
12264   echo $ECHO_N "(cached) $ECHO_C" >&6
12265 else
12266   cat >conftest.$ac_ext <<_ACEOF
12267 #line 12267 "configure"
12268 #include "confdefs.h"
12269 /* System header to define __stub macros and hopefully few prototypes,
12270     which can conflict with char XOpenDisplay (); below.  */
12271 #include <assert.h>
12272 /* Override any gcc2 internal prototype to avoid an error.  */
12273 #ifdef __cplusplus
12274 extern "C"
12275 #endif
12276 /* We use char because int might match the return type of a gcc2
12277    builtin and then its argument prototype would still apply.  */
12278 char XOpenDisplay ();
12279 char (*f) ();
12280
12281 int
12282 main ()
12283 {
12284 /* The GNU C library defines this for functions which it implements
12285     to always fail with ENOSYS.  Some functions are actually named
12286     something starting with __ and the normal name is an alias.  */
12287 #if defined (__stub_XOpenDisplay) || defined (__stub___XOpenDisplay)
12288 choke me
12289 #else
12290 f = XOpenDisplay; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12291 #endif
12292
12293   ;
12294   return 0;
12295 }
12296 _ACEOF
12297 rm -f conftest.$ac_objext conftest$ac_exeext
12298 if { (eval echo "$as_me:12298: \"$ac_link\"") >&5
12299   (eval $ac_link) 2>&5
12300   ac_status=$?
12301   echo "$as_me:12301: \$? = $ac_status" >&5
12302   (exit $ac_status); } &&
12303          { ac_try='test -s conftest$ac_exeext'
12304   { (eval echo "$as_me:12304: \"$ac_try\"") >&5
12305   (eval $ac_try) 2>&5
12306   ac_status=$?
12307   echo "$as_me:12307: \$? = $ac_status" >&5
12308   (exit $ac_status); }; }; then
12309   ac_cv_func_XOpenDisplay=yes
12310 else
12311   echo "$as_me: failed program was:" >&5
12312 cat conftest.$ac_ext >&5
12313 ac_cv_func_XOpenDisplay=no
12314 fi
12315 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12316 fi
12317 echo "$as_me:12317: result: $ac_cv_func_XOpenDisplay" >&5
12318 echo "${ECHO_T}$ac_cv_func_XOpenDisplay" >&6
12319 if test $ac_cv_func_XOpenDisplay = yes; then
12320   :
12321 else
12322
12323         echo "$as_me:12323: checking for XOpenDisplay in -lX11" >&5
12324 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12325 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12326   echo $ECHO_N "(cached) $ECHO_C" >&6
12327 else
12328   ac_check_lib_save_LIBS=$LIBS
12329 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12330 cat >conftest.$ac_ext <<_ACEOF
12331 #line 12331 "configure"
12332 #include "confdefs.h"
12333
12334 /* Override any gcc2 internal prototype to avoid an error.  */
12335 #ifdef __cplusplus
12336 extern "C"
12337 #endif
12338 /* We use char because int might match the return type of a gcc2
12339    builtin and then its argument prototype would still apply.  */
12340 char XOpenDisplay ();
12341 int
12342 main ()
12343 {
12344 XOpenDisplay ();
12345   ;
12346   return 0;
12347 }
12348 _ACEOF
12349 rm -f conftest.$ac_objext conftest$ac_exeext
12350 if { (eval echo "$as_me:12350: \"$ac_link\"") >&5
12351   (eval $ac_link) 2>&5
12352   ac_status=$?
12353   echo "$as_me:12353: \$? = $ac_status" >&5
12354   (exit $ac_status); } &&
12355          { ac_try='test -s conftest$ac_exeext'
12356   { (eval echo "$as_me:12356: \"$ac_try\"") >&5
12357   (eval $ac_try) 2>&5
12358   ac_status=$?
12359   echo "$as_me:12359: \$? = $ac_status" >&5
12360   (exit $ac_status); }; }; then
12361   ac_cv_lib_X11_XOpenDisplay=yes
12362 else
12363   echo "$as_me: failed program was:" >&5
12364 cat conftest.$ac_ext >&5
12365 ac_cv_lib_X11_XOpenDisplay=no
12366 fi
12367 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12368 LIBS=$ac_check_lib_save_LIBS
12369 fi
12370 echo "$as_me:12370: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12371 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12372 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12373   LIBS="-lX11 $LIBS"
12374 fi
12375
12376 fi
12377
12378         echo "$as_me:12378: checking for XtAppInitialize" >&5
12379 echo $ECHO_N "checking for XtAppInitialize... $ECHO_C" >&6
12380 if test "${ac_cv_func_XtAppInitialize+set}" = set; then
12381   echo $ECHO_N "(cached) $ECHO_C" >&6
12382 else
12383   cat >conftest.$ac_ext <<_ACEOF
12384 #line 12384 "configure"
12385 #include "confdefs.h"
12386 /* System header to define __stub macros and hopefully few prototypes,
12387     which can conflict with char XtAppInitialize (); below.  */
12388 #include <assert.h>
12389 /* Override any gcc2 internal prototype to avoid an error.  */
12390 #ifdef __cplusplus
12391 extern "C"
12392 #endif
12393 /* We use char because int might match the return type of a gcc2
12394    builtin and then its argument prototype would still apply.  */
12395 char XtAppInitialize ();
12396 char (*f) ();
12397
12398 int
12399 main ()
12400 {
12401 /* The GNU C library defines this for functions which it implements
12402     to always fail with ENOSYS.  Some functions are actually named
12403     something starting with __ and the normal name is an alias.  */
12404 #if defined (__stub_XtAppInitialize) || defined (__stub___XtAppInitialize)
12405 choke me
12406 #else
12407 f = XtAppInitialize; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
12408 #endif
12409
12410   ;
12411   return 0;
12412 }
12413 _ACEOF
12414 rm -f conftest.$ac_objext conftest$ac_exeext
12415 if { (eval echo "$as_me:12415: \"$ac_link\"") >&5
12416   (eval $ac_link) 2>&5
12417   ac_status=$?
12418   echo "$as_me:12418: \$? = $ac_status" >&5
12419   (exit $ac_status); } &&
12420          { ac_try='test -s conftest$ac_exeext'
12421   { (eval echo "$as_me:12421: \"$ac_try\"") >&5
12422   (eval $ac_try) 2>&5
12423   ac_status=$?
12424   echo "$as_me:12424: \$? = $ac_status" >&5
12425   (exit $ac_status); }; }; then
12426   ac_cv_func_XtAppInitialize=yes
12427 else
12428   echo "$as_me: failed program was:" >&5
12429 cat conftest.$ac_ext >&5
12430 ac_cv_func_XtAppInitialize=no
12431 fi
12432 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12433 fi
12434 echo "$as_me:12434: result: $ac_cv_func_XtAppInitialize" >&5
12435 echo "${ECHO_T}$ac_cv_func_XtAppInitialize" >&6
12436 if test $ac_cv_func_XtAppInitialize = yes; then
12437   :
12438 else
12439
12440         echo "$as_me:12440: checking for XtAppInitialize in -lXt" >&5
12441 echo $ECHO_N "checking for XtAppInitialize in -lXt... $ECHO_C" >&6
12442 if test "${ac_cv_lib_Xt_XtAppInitialize+set}" = set; then
12443   echo $ECHO_N "(cached) $ECHO_C" >&6
12444 else
12445   ac_check_lib_save_LIBS=$LIBS
12446 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12447 cat >conftest.$ac_ext <<_ACEOF
12448 #line 12448 "configure"
12449 #include "confdefs.h"
12450
12451 /* Override any gcc2 internal prototype to avoid an error.  */
12452 #ifdef __cplusplus
12453 extern "C"
12454 #endif
12455 /* We use char because int might match the return type of a gcc2
12456    builtin and then its argument prototype would still apply.  */
12457 char XtAppInitialize ();
12458 int
12459 main ()
12460 {
12461 XtAppInitialize ();
12462   ;
12463   return 0;
12464 }
12465 _ACEOF
12466 rm -f conftest.$ac_objext conftest$ac_exeext
12467 if { (eval echo "$as_me:12467: \"$ac_link\"") >&5
12468   (eval $ac_link) 2>&5
12469   ac_status=$?
12470   echo "$as_me:12470: \$? = $ac_status" >&5
12471   (exit $ac_status); } &&
12472          { ac_try='test -s conftest$ac_exeext'
12473   { (eval echo "$as_me:12473: \"$ac_try\"") >&5
12474   (eval $ac_try) 2>&5
12475   ac_status=$?
12476   echo "$as_me:12476: \$? = $ac_status" >&5
12477   (exit $ac_status); }; }; then
12478   ac_cv_lib_Xt_XtAppInitialize=yes
12479 else
12480   echo "$as_me: failed program was:" >&5
12481 cat conftest.$ac_ext >&5
12482 ac_cv_lib_Xt_XtAppInitialize=no
12483 fi
12484 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12485 LIBS=$ac_check_lib_save_LIBS
12486 fi
12487 echo "$as_me:12487: result: $ac_cv_lib_Xt_XtAppInitialize" >&5
12488 echo "${ECHO_T}$ac_cv_lib_Xt_XtAppInitialize" >&6
12489 if test $ac_cv_lib_Xt_XtAppInitialize = yes; then
12490   cat >>confdefs.h <<\EOF
12491 #define HAVE_LIBXT 1
12492 EOF
12493
12494                  cf_have_X_LIBS=Xt
12495                  LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"
12496 fi
12497
12498 fi
12499
12500 fi
12501
12502 if test $cf_have_X_LIBS = no ; then
12503         { echo "$as_me:12503: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12504 test program.  You will have to check and add the proper libraries by hand
12505 to makefile." >&5
12506 echo "$as_me: WARNING: Unable to successfully link X Toolkit library (-lXt) with
12507 test program.  You will have to check and add the proper libraries by hand
12508 to makefile." >&2;}
12509 fi
12510
12511 cf_x_athena_root=$cf_x_athena
12512 cf_x_athena_inc=""
12513
12514 for cf_path in default \
12515         /usr/contrib/X11R6 \
12516         /usr/contrib/X11R5 \
12517         /usr/lib/X11R5 \
12518         /usr/local
12519 do
12520         if test -z "$cf_x_athena_inc" ; then
12521                 cf_save="$CPPFLAGS"
12522                 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
12523                 if test $cf_path != default ; then
12524                         CPPFLAGS="$cf_save -I$cf_path/include"
12525                         echo "$as_me:12525: checking for $cf_test in $cf_path" >&5
12526 echo $ECHO_N "checking for $cf_test in $cf_path... $ECHO_C" >&6
12527                 else
12528                         echo "$as_me:12528: checking for $cf_test" >&5
12529 echo $ECHO_N "checking for $cf_test... $ECHO_C" >&6
12530                 fi
12531                 cat >conftest.$ac_ext <<_ACEOF
12532 #line 12532 "configure"
12533 #include "confdefs.h"
12534
12535 #include <X11/Intrinsic.h>
12536 #include <$cf_test>
12537 int
12538 main ()
12539 {
12540
12541   ;
12542   return 0;
12543 }
12544 _ACEOF
12545 rm -f conftest.$ac_objext
12546 if { (eval echo "$as_me:12546: \"$ac_compile\"") >&5
12547   (eval $ac_compile) 2>&5
12548   ac_status=$?
12549   echo "$as_me:12549: \$? = $ac_status" >&5
12550   (exit $ac_status); } &&
12551          { ac_try='test -s conftest.$ac_objext'
12552   { (eval echo "$as_me:12552: \"$ac_try\"") >&5
12553   (eval $ac_try) 2>&5
12554   ac_status=$?
12555   echo "$as_me:12555: \$? = $ac_status" >&5
12556   (exit $ac_status); }; }; then
12557   cf_result=yes
12558 else
12559   echo "$as_me: failed program was:" >&5
12560 cat conftest.$ac_ext >&5
12561 cf_result=no
12562 fi
12563 rm -f conftest.$ac_objext conftest.$ac_ext
12564                 echo "$as_me:12564: result: $cf_result" >&5
12565 echo "${ECHO_T}$cf_result" >&6
12566                 if test "$cf_result" = yes ; then
12567                         cf_x_athena_inc=$cf_path
12568                         break
12569                 else
12570                         CPPFLAGS="$cf_save"
12571                 fi
12572         fi
12573 done
12574
12575 if test -z "$cf_x_athena_inc" ; then
12576         { echo "$as_me:12576: WARNING: Unable to successfully find Athena header files with test program" >&5
12577 echo "$as_me: WARNING: Unable to successfully find Athena header files with test program" >&2;}
12578 elif test "$cf_x_athena_inc" != default ; then
12579         CPPFLAGS="$CPPFLAGS -I$cf_x_athena_inc"
12580 fi
12581
12582 cf_x_athena_root=$cf_x_athena
12583 cf_x_athena_lib=""
12584
12585 for cf_path in default \
12586         /usr/contrib/X11R6 \
12587         /usr/contrib/X11R5 \
12588         /usr/lib/X11R5 \
12589         /usr/local
12590 do
12591         for cf_lib in \
12592                 ${cf_x_athena_root} \
12593                 ${cf_x_athena_root}7 \
12594                 ${cf_x_athena_root}6
12595         do
12596         for cf_libs in \
12597                 "-l$cf_lib -lXmu" \
12598                 "-l$cf_lib -lXpm -lXmu" \
12599                 "-l${cf_lib}_s -lXmu_s"
12600         do
12601                 if test -z "$cf_x_athena_lib" ; then
12602                         cf_save="$LIBS"
12603                         cf_test=XawSimpleMenuAddGlobalActions
12604                         if test $cf_path != default ; then
12605                                 LIBS="-L$cf_path/lib $cf_libs $LIBS"
12606                                 echo "$as_me:12606: checking for $cf_libs in $cf_path" >&5
12607 echo $ECHO_N "checking for $cf_libs in $cf_path... $ECHO_C" >&6
12608                         else
12609                                 LIBS="$cf_libs $LIBS"
12610                                 echo "$as_me:12610: checking for $cf_test in $cf_libs" >&5
12611 echo $ECHO_N "checking for $cf_test in $cf_libs... $ECHO_C" >&6
12612                         fi
12613                         cat >conftest.$ac_ext <<_ACEOF
12614 #line 12614 "configure"
12615 #include "confdefs.h"
12616
12617 #include <X11/Intrinsic.h>
12618 #include <X11/$cf_x_athena_root/SimpleMenu.h>
12619
12620 int
12621 main ()
12622 {
12623
12624 $cf_test((XtAppContext) 0)
12625   ;
12626   return 0;
12627 }
12628 _ACEOF
12629 rm -f conftest.$ac_objext conftest$ac_exeext
12630 if { (eval echo "$as_me:12630: \"$ac_link\"") >&5
12631   (eval $ac_link) 2>&5
12632   ac_status=$?
12633   echo "$as_me:12633: \$? = $ac_status" >&5
12634   (exit $ac_status); } &&
12635          { ac_try='test -s conftest$ac_exeext'
12636   { (eval echo "$as_me:12636: \"$ac_try\"") >&5
12637   (eval $ac_try) 2>&5
12638   ac_status=$?
12639   echo "$as_me:12639: \$? = $ac_status" >&5
12640   (exit $ac_status); }; }; then
12641   cf_result=yes
12642 else
12643   echo "$as_me: failed program was:" >&5
12644 cat conftest.$ac_ext >&5
12645 cf_result=no
12646 fi
12647 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12648                         echo "$as_me:12648: result: $cf_result" >&5
12649 echo "${ECHO_T}$cf_result" >&6
12650                         if test "$cf_result" = yes ; then
12651                                 cf_x_athena_lib="$cf_libs"
12652                                 break
12653                         fi
12654                         LIBS="$cf_save"
12655                 fi
12656         done # cf_libs
12657                 test -n "$cf_x_athena_lib" && break
12658         done # cf_lib
12659 done
12660
12661 if test -z "$cf_x_athena_lib" ; then
12662         { { echo "$as_me:12662: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&5
12663 echo "$as_me: error: Unable to successfully link Athena library (-l$cf_x_athena_root) with test program" >&2;}
12664    { (exit 1); exit 1; }; }
12665 fi
12666
12667 cf_x_athena_LIBS=`echo "HAVE_LIB_$cf_x_athena" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
12668
12669 cat >>confdefs.h <<EOF
12670 #define $cf_x_athena_LIBS 1
12671 EOF
12672
12673 fi
12674
12675 if test -n "$ac_tool_prefix"; then
12676   for ac_prog in xcurses-config
12677   do
12678     # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
12679 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
12680 echo "$as_me:12680: checking for $ac_word" >&5
12681 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12682 if test "${ac_cv_prog_XCURSES_CONFIG+set}" = set; then
12683   echo $ECHO_N "(cached) $ECHO_C" >&6
12684 else
12685   if test -n "$XCURSES_CONFIG"; then
12686   ac_cv_prog_XCURSES_CONFIG="$XCURSES_CONFIG" # Let the user override the test.
12687 else
12688   ac_save_IFS=$IFS; IFS=$ac_path_separator
12689 ac_dummy="$PATH"
12690 for ac_dir in $ac_dummy; do
12691   IFS=$ac_save_IFS
12692   test -z "$ac_dir" && ac_dir=.
12693   $as_executable_p "$ac_dir/$ac_word" || continue
12694 ac_cv_prog_XCURSES_CONFIG="$ac_tool_prefix$ac_prog"
12695 echo "$as_me:12695: found $ac_dir/$ac_word" >&5
12696 break
12697 done
12698
12699 fi
12700 fi
12701 XCURSES_CONFIG=$ac_cv_prog_XCURSES_CONFIG
12702 if test -n "$XCURSES_CONFIG"; then
12703   echo "$as_me:12703: result: $XCURSES_CONFIG" >&5
12704 echo "${ECHO_T}$XCURSES_CONFIG" >&6
12705 else
12706   echo "$as_me:12706: result: no" >&5
12707 echo "${ECHO_T}no" >&6
12708 fi
12709
12710     test -n "$XCURSES_CONFIG" && break
12711   done
12712 fi
12713 if test -z "$XCURSES_CONFIG"; then
12714   ac_ct_XCURSES_CONFIG=$XCURSES_CONFIG
12715   for ac_prog in xcurses-config
12716 do
12717   # Extract the first word of "$ac_prog", so it can be a program name with args.
12718 set dummy $ac_prog; ac_word=$2
12719 echo "$as_me:12719: checking for $ac_word" >&5
12720 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
12721 if test "${ac_cv_prog_ac_ct_XCURSES_CONFIG+set}" = set; then
12722   echo $ECHO_N "(cached) $ECHO_C" >&6
12723 else
12724   if test -n "$ac_ct_XCURSES_CONFIG"; then
12725   ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_ct_XCURSES_CONFIG" # Let the user override the test.
12726 else
12727   ac_save_IFS=$IFS; IFS=$ac_path_separator
12728 ac_dummy="$PATH"
12729 for ac_dir in $ac_dummy; do
12730   IFS=$ac_save_IFS
12731   test -z "$ac_dir" && ac_dir=.
12732   $as_executable_p "$ac_dir/$ac_word" || continue
12733 ac_cv_prog_ac_ct_XCURSES_CONFIG="$ac_prog"
12734 echo "$as_me:12734: found $ac_dir/$ac_word" >&5
12735 break
12736 done
12737
12738 fi
12739 fi
12740 ac_ct_XCURSES_CONFIG=$ac_cv_prog_ac_ct_XCURSES_CONFIG
12741 if test -n "$ac_ct_XCURSES_CONFIG"; then
12742   echo "$as_me:12742: result: $ac_ct_XCURSES_CONFIG" >&5
12743 echo "${ECHO_T}$ac_ct_XCURSES_CONFIG" >&6
12744 else
12745   echo "$as_me:12745: result: no" >&5
12746 echo "${ECHO_T}no" >&6
12747 fi
12748
12749   test -n "$ac_ct_XCURSES_CONFIG" && break
12750 done
12751 test -n "$ac_ct_XCURSES_CONFIG" || ac_ct_XCURSES_CONFIG="none"
12752
12753   XCURSES_CONFIG=$ac_ct_XCURSES_CONFIG
12754 fi
12755
12756 if test "$XCURSES_CONFIG" != none ; then
12757
12758 CPPFLAGS="$CPPFLAGS `$XCURSES_CONFIG --cflags`"
12759 LIBS="`$XCURSES_CONFIG --libs` $LIBS"
12760
12761 cf_cv_lib_XCurses=yes
12762
12763 else
12764
12765 LDFLAGS="$LDFLAGS $X_LIBS"
12766
12767 test -n "$verbose" && echo "    checking additions to CFLAGS" 1>&6
12768
12769 echo "${as_me:-configure}:12769: testing checking additions to CFLAGS ..." 1>&5
12770
12771 cf_check_cflags="$CFLAGS"
12772 cf_check_cppflags="$CPPFLAGS"
12773
12774 cf_fix_cppflags=no
12775 cf_new_cflags=
12776 cf_new_cppflags=
12777 cf_new_extra_cppflags=
12778
12779 for cf_add_cflags in $X_CFLAGS
12780 do
12781 case $cf_fix_cppflags in
12782 no)
12783         case $cf_add_cflags in #(vi
12784         -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
12785                 case $cf_add_cflags in
12786                 -D*)
12787                         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
12788
12789                         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12790                                 && test -z "${cf_tst_cflags}" \
12791                                 && cf_fix_cppflags=yes
12792
12793                         if test $cf_fix_cppflags = yes ; then
12794                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12795                                 continue
12796                         elif test "${cf_tst_cflags}" = "\"'" ; then
12797                                 cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12798                                 continue
12799                         fi
12800                         ;;
12801                 esac
12802                 case "$CPPFLAGS" in
12803                 *$cf_add_cflags) #(vi
12804                         ;;
12805                 *) #(vi
12806                         case $cf_add_cflags in #(vi
12807                         -D*)
12808                                 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
12809
12810 CPPFLAGS=`echo "$CPPFLAGS" | \
12811         sed     -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?[         ]/ /g' \
12812                 -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^    ]*\)\?$//g'`
12813
12814                                 ;;
12815                         esac
12816                         cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
12817                         ;;
12818                 esac
12819                 ;;
12820         *)
12821                 cf_new_cflags="$cf_new_cflags $cf_add_cflags"
12822                 ;;
12823         esac
12824         ;;
12825 yes)
12826         cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
12827
12828         cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
12829
12830         test "${cf_add_cflags}" != "${cf_tst_cflags}" \
12831                 && test -z "${cf_tst_cflags}" \
12832                 && cf_fix_cppflags=no
12833         ;;
12834 esac
12835 done
12836
12837 if test -n "$cf_new_cflags" ; then
12838         test -n "$verbose" && echo "    add to \$CFLAGS $cf_new_cflags" 1>&6
12839
12840 echo "${as_me:-configure}:12840: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5
12841
12842         CFLAGS="$CFLAGS $cf_new_cflags"
12843 fi
12844
12845 if test -n "$cf_new_cppflags" ; then
12846         test -n "$verbose" && echo "    add to \$CPPFLAGS $cf_new_cppflags" 1>&6
12847
12848 echo "${as_me:-configure}:12848: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5
12849
12850         CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
12851 fi
12852
12853 if test -n "$cf_new_extra_cppflags" ; then
12854         test -n "$verbose" && echo "    add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6
12855
12856 echo "${as_me:-configure}:12856: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5
12857
12858         EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
12859 fi
12860
12861 if test "$cf_check_cflags" != "$CFLAGS" ; then
12862 cat >conftest.$ac_ext <<_ACEOF
12863 #line 12863 "configure"
12864 #include "confdefs.h"
12865 #include <stdio.h>
12866 int
12867 main ()
12868 {
12869 printf("Hello world");
12870   ;
12871   return 0;
12872 }
12873 _ACEOF
12874 rm -f conftest.$ac_objext conftest$ac_exeext
12875 if { (eval echo "$as_me:12875: \"$ac_link\"") >&5
12876   (eval $ac_link) 2>&5
12877   ac_status=$?
12878   echo "$as_me:12878: \$? = $ac_status" >&5
12879   (exit $ac_status); } &&
12880          { ac_try='test -s conftest$ac_exeext'
12881   { (eval echo "$as_me:12881: \"$ac_try\"") >&5
12882   (eval $ac_try) 2>&5
12883   ac_status=$?
12884   echo "$as_me:12884: \$? = $ac_status" >&5
12885   (exit $ac_status); }; }; then
12886   :
12887 else
12888   echo "$as_me: failed program was:" >&5
12889 cat conftest.$ac_ext >&5
12890 test -n "$verbose" && echo "    test-compile failed.  Undoing change to \$CFLAGS" 1>&6
12891
12892 echo "${as_me:-configure}:12892: testing test-compile failed.  Undoing change to \$CFLAGS ..." 1>&5
12893
12894          if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
12895                  test -n "$verbose" && echo "   but keeping change to \$CPPFLAGS" 1>&6
12896
12897 echo "${as_me:-configure}:12897: testing but keeping change to \$CPPFLAGS ..." 1>&5
12898
12899          fi
12900          CFLAGS="$cf_check_flags"
12901 fi
12902 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12903 fi
12904
12905 echo "$as_me:12905: checking for XOpenDisplay in -lX11" >&5
12906 echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6
12907 if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then
12908   echo $ECHO_N "(cached) $ECHO_C" >&6
12909 else
12910   ac_check_lib_save_LIBS=$LIBS
12911 LIBS="-lX11 $X_PRE_LIBS $LIBS $X_EXTRA_LIBS $LIBS"
12912 cat >conftest.$ac_ext <<_ACEOF
12913 #line 12913 "configure"
12914 #include "confdefs.h"
12915
12916 /* Override any gcc2 internal prototype to avoid an error.  */
12917 #ifdef __cplusplus
12918 extern "C"
12919 #endif
12920 /* We use char because int might match the return type of a gcc2
12921    builtin and then its argument prototype would still apply.  */
12922 char XOpenDisplay ();
12923 int
12924 main ()
12925 {
12926 XOpenDisplay ();
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   ac_cv_lib_X11_XOpenDisplay=yes
12944 else
12945   echo "$as_me: failed program was:" >&5
12946 cat conftest.$ac_ext >&5
12947 ac_cv_lib_X11_XOpenDisplay=no
12948 fi
12949 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12950 LIBS=$ac_check_lib_save_LIBS
12951 fi
12952 echo "$as_me:12952: result: $ac_cv_lib_X11_XOpenDisplay" >&5
12953 echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6
12954 if test $ac_cv_lib_X11_XOpenDisplay = yes; then
12955   LIBS="-lX11 $LIBS"
12956 fi
12957
12958 echo "$as_me:12958: checking for XCurses library" >&5
12959 echo $ECHO_N "checking for XCurses library... $ECHO_C" >&6
12960 if test "${cf_cv_lib_XCurses+set}" = set; then
12961   echo $ECHO_N "(cached) $ECHO_C" >&6
12962 else
12963
12964 LIBS="-lXCurses $LIBS"
12965 cat >conftest.$ac_ext <<_ACEOF
12966 #line 12966 "configure"
12967 #include "confdefs.h"
12968
12969 #include <xcurses.h>
12970 char *XCursesProgramName = "test";
12971
12972 int
12973 main ()
12974 {
12975 XCursesExit();
12976   ;
12977   return 0;
12978 }
12979 _ACEOF
12980 rm -f conftest.$ac_objext conftest$ac_exeext
12981 if { (eval echo "$as_me:12981: \"$ac_link\"") >&5
12982   (eval $ac_link) 2>&5
12983   ac_status=$?
12984   echo "$as_me:12984: \$? = $ac_status" >&5
12985   (exit $ac_status); } &&
12986          { ac_try='test -s conftest$ac_exeext'
12987   { (eval echo "$as_me:12987: \"$ac_try\"") >&5
12988   (eval $ac_try) 2>&5
12989   ac_status=$?
12990   echo "$as_me:12990: \$? = $ac_status" >&5
12991   (exit $ac_status); }; }; then
12992   cf_cv_lib_XCurses=yes
12993 else
12994   echo "$as_me: failed program was:" >&5
12995 cat conftest.$ac_ext >&5
12996 cf_cv_lib_XCurses=no
12997 fi
12998 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
12999
13000 fi
13001 echo "$as_me:13001: result: $cf_cv_lib_XCurses" >&5
13002 echo "${ECHO_T}$cf_cv_lib_XCurses" >&6
13003
13004 fi
13005
13006 if test $cf_cv_lib_XCurses = yes ; then
13007         cat >>confdefs.h <<\EOF
13008 #define UNIX 1
13009 EOF
13010
13011         cat >>confdefs.h <<\EOF
13012 #define XCURSES 1
13013 EOF
13014
13015         echo "$as_me:13015: checking for xcurses.h" >&5
13016 echo $ECHO_N "checking for xcurses.h... $ECHO_C" >&6
13017 if test "${ac_cv_header_xcurses_h+set}" = set; then
13018   echo $ECHO_N "(cached) $ECHO_C" >&6
13019 else
13020   cat >conftest.$ac_ext <<_ACEOF
13021 #line 13021 "configure"
13022 #include "confdefs.h"
13023 #include <xcurses.h>
13024 _ACEOF
13025 if { (eval echo "$as_me:13025: \"$ac_cpp conftest.$ac_ext\"") >&5
13026   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13027   ac_status=$?
13028   egrep -v '^ *\+' conftest.er1 >conftest.err
13029   rm -f conftest.er1
13030   cat conftest.err >&5
13031   echo "$as_me:13031: \$? = $ac_status" >&5
13032   (exit $ac_status); } >/dev/null; then
13033   if test -s conftest.err; then
13034     ac_cpp_err=$ac_c_preproc_warn_flag
13035   else
13036     ac_cpp_err=
13037   fi
13038 else
13039   ac_cpp_err=yes
13040 fi
13041 if test -z "$ac_cpp_err"; then
13042   ac_cv_header_xcurses_h=yes
13043 else
13044   echo "$as_me: failed program was:" >&5
13045   cat conftest.$ac_ext >&5
13046   ac_cv_header_xcurses_h=no
13047 fi
13048 rm -f conftest.err conftest.$ac_ext
13049 fi
13050 echo "$as_me:13050: result: $ac_cv_header_xcurses_h" >&5
13051 echo "${ECHO_T}$ac_cv_header_xcurses_h" >&6
13052 if test $ac_cv_header_xcurses_h = yes; then
13053   cat >>confdefs.h <<\EOF
13054 #define HAVE_XCURSES 1
13055 EOF
13056
13057 fi
13058
13059 else
13060         { { echo "$as_me:13060: error: Cannot link with XCurses" >&5
13061 echo "$as_me: error: Cannot link with XCurses" >&2;}
13062    { (exit 1); exit 1; }; }
13063 fi
13064
13065         ;;
13066 esac
13067
13068 case $cf_cv_screen in
13069 curses|curses_*)
13070
13071 echo "$as_me:13071: checking for NetBSD form.h" >&5
13072 echo $ECHO_N "checking for NetBSD form.h... $ECHO_C" >&6
13073 if test "${cf_cv_netbsd_form_h+set}" = set; then
13074   echo $ECHO_N "(cached) $ECHO_C" >&6
13075 else
13076
13077 cat >conftest.$ac_ext <<_ACEOF
13078 #line 13078 "configure"
13079 #include "confdefs.h"
13080
13081 #include <${cf_cv_ncurses_header:-curses.h}>
13082 #include <form.h>
13083
13084 int
13085 main ()
13086 {
13087
13088         FORM *form;
13089         int y = current_field(form)->cursor_ypos;
13090         int x = current_field(form)->cursor_xpos;
13091
13092   ;
13093   return 0;
13094 }
13095 _ACEOF
13096 rm -f conftest.$ac_objext
13097 if { (eval echo "$as_me:13097: \"$ac_compile\"") >&5
13098   (eval $ac_compile) 2>&5
13099   ac_status=$?
13100   echo "$as_me:13100: \$? = $ac_status" >&5
13101   (exit $ac_status); } &&
13102          { ac_try='test -s conftest.$ac_objext'
13103   { (eval echo "$as_me:13103: \"$ac_try\"") >&5
13104   (eval $ac_try) 2>&5
13105   ac_status=$?
13106   echo "$as_me:13106: \$? = $ac_status" >&5
13107   (exit $ac_status); }; }; then
13108   cf_cv_netbsd_form_h=yes
13109
13110 else
13111   echo "$as_me: failed program was:" >&5
13112 cat conftest.$ac_ext >&5
13113 cf_cv_netbsd_form_h=no
13114 fi
13115 rm -f conftest.$ac_objext conftest.$ac_ext
13116
13117 fi
13118 echo "$as_me:13118: result: $cf_cv_netbsd_form_h" >&5
13119 echo "${ECHO_T}$cf_cv_netbsd_form_h" >&6
13120
13121 test "$cf_cv_netbsd_form_h" = yes && cat >>confdefs.h <<\EOF
13122 #define HAVE_NETBSD_FORM_H 1
13123 EOF
13124
13125 echo "$as_me:13125: checking for NetBSD menu.h" >&5
13126 echo $ECHO_N "checking for NetBSD menu.h... $ECHO_C" >&6
13127 if test "${cf_cv_netbsd_menu_h+set}" = set; then
13128   echo $ECHO_N "(cached) $ECHO_C" >&6
13129 else
13130
13131 cat >conftest.$ac_ext <<_ACEOF
13132 #line 13132 "configure"
13133 #include "confdefs.h"
13134
13135 #include <${cf_cv_ncurses_header:-curses.h}>
13136 #include <menu.h>
13137
13138 int
13139 main ()
13140 {
13141
13142         MENU *menu;
13143         int y = menu->max_item_width;
13144
13145   ;
13146   return 0;
13147 }
13148 _ACEOF
13149 rm -f conftest.$ac_objext
13150 if { (eval echo "$as_me:13150: \"$ac_compile\"") >&5
13151   (eval $ac_compile) 2>&5
13152   ac_status=$?
13153   echo "$as_me:13153: \$? = $ac_status" >&5
13154   (exit $ac_status); } &&
13155          { ac_try='test -s conftest.$ac_objext'
13156   { (eval echo "$as_me:13156: \"$ac_try\"") >&5
13157   (eval $ac_try) 2>&5
13158   ac_status=$?
13159   echo "$as_me:13159: \$? = $ac_status" >&5
13160   (exit $ac_status); }; }; then
13161   cf_cv_netbsd_menu_h=yes
13162
13163 else
13164   echo "$as_me: failed program was:" >&5
13165 cat conftest.$ac_ext >&5
13166 cf_cv_netbsd_menu_h=no
13167 fi
13168 rm -f conftest.$ac_objext conftest.$ac_ext
13169
13170 fi
13171 echo "$as_me:13171: result: $cf_cv_netbsd_menu_h" >&5
13172 echo "${ECHO_T}$cf_cv_netbsd_menu_h" >&6
13173
13174 test "$cf_cv_netbsd_menu_h" = yes && cat >>confdefs.h <<\EOF
13175 #define HAVE_NETBSD_MENU_H 1
13176 EOF
13177
13178         ;;
13179 ncursesw)
13180         cf_cv_libtype=w
13181         ;;
13182 esac
13183
13184 case $cf_cv_screen in #(vi
13185 pdcurses) #(vi
13186         ;;
13187 *)
13188         # look for curses-related libraries
13189
13190 as_ac_Lib=`echo "ac_cv_lib_panel$cf_cv_libtype''_new_panel" | $as_tr_sh`
13191 echo "$as_me:13191: checking for new_panel in -lpanel$cf_cv_libtype" >&5
13192 echo $ECHO_N "checking for new_panel in -lpanel$cf_cv_libtype... $ECHO_C" >&6
13193 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13194   echo $ECHO_N "(cached) $ECHO_C" >&6
13195 else
13196   ac_check_lib_save_LIBS=$LIBS
13197 LIBS="-lpanel$cf_cv_libtype  $LIBS"
13198 cat >conftest.$ac_ext <<_ACEOF
13199 #line 13199 "configure"
13200 #include "confdefs.h"
13201
13202 /* Override any gcc2 internal prototype to avoid an error.  */
13203 #ifdef __cplusplus
13204 extern "C"
13205 #endif
13206 /* We use char because int might match the return type of a gcc2
13207    builtin and then its argument prototype would still apply.  */
13208 char new_panel ();
13209 int
13210 main ()
13211 {
13212 new_panel ();
13213   ;
13214   return 0;
13215 }
13216 _ACEOF
13217 rm -f conftest.$ac_objext conftest$ac_exeext
13218 if { (eval echo "$as_me:13218: \"$ac_link\"") >&5
13219   (eval $ac_link) 2>&5
13220   ac_status=$?
13221   echo "$as_me:13221: \$? = $ac_status" >&5
13222   (exit $ac_status); } &&
13223          { ac_try='test -s conftest$ac_exeext'
13224   { (eval echo "$as_me:13224: \"$ac_try\"") >&5
13225   (eval $ac_try) 2>&5
13226   ac_status=$?
13227   echo "$as_me:13227: \$? = $ac_status" >&5
13228   (exit $ac_status); }; }; then
13229   eval "$as_ac_Lib=yes"
13230 else
13231   echo "$as_me: failed program was:" >&5
13232 cat conftest.$ac_ext >&5
13233 eval "$as_ac_Lib=no"
13234 fi
13235 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13236 LIBS=$ac_check_lib_save_LIBS
13237 fi
13238 echo "$as_me:13238: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13239 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13240 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13241   cat >>confdefs.h <<EOF
13242 #define `echo "HAVE_LIBpanel$cf_cv_libtype" | $as_tr_cpp` 1
13243 EOF
13244
13245   LIBS="-lpanel$cf_cv_libtype $LIBS"
13246
13247 fi
13248
13249 as_ac_Lib=`echo "ac_cv_lib_menu$cf_cv_libtype''_menu_driver" | $as_tr_sh`
13250 echo "$as_me:13250: checking for menu_driver in -lmenu$cf_cv_libtype" >&5
13251 echo $ECHO_N "checking for menu_driver in -lmenu$cf_cv_libtype... $ECHO_C" >&6
13252 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13253   echo $ECHO_N "(cached) $ECHO_C" >&6
13254 else
13255   ac_check_lib_save_LIBS=$LIBS
13256 LIBS="-lmenu$cf_cv_libtype  $LIBS"
13257 cat >conftest.$ac_ext <<_ACEOF
13258 #line 13258 "configure"
13259 #include "confdefs.h"
13260
13261 /* Override any gcc2 internal prototype to avoid an error.  */
13262 #ifdef __cplusplus
13263 extern "C"
13264 #endif
13265 /* We use char because int might match the return type of a gcc2
13266    builtin and then its argument prototype would still apply.  */
13267 char menu_driver ();
13268 int
13269 main ()
13270 {
13271 menu_driver ();
13272   ;
13273   return 0;
13274 }
13275 _ACEOF
13276 rm -f conftest.$ac_objext conftest$ac_exeext
13277 if { (eval echo "$as_me:13277: \"$ac_link\"") >&5
13278   (eval $ac_link) 2>&5
13279   ac_status=$?
13280   echo "$as_me:13280: \$? = $ac_status" >&5
13281   (exit $ac_status); } &&
13282          { ac_try='test -s conftest$ac_exeext'
13283   { (eval echo "$as_me:13283: \"$ac_try\"") >&5
13284   (eval $ac_try) 2>&5
13285   ac_status=$?
13286   echo "$as_me:13286: \$? = $ac_status" >&5
13287   (exit $ac_status); }; }; then
13288   eval "$as_ac_Lib=yes"
13289 else
13290   echo "$as_me: failed program was:" >&5
13291 cat conftest.$ac_ext >&5
13292 eval "$as_ac_Lib=no"
13293 fi
13294 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13295 LIBS=$ac_check_lib_save_LIBS
13296 fi
13297 echo "$as_me:13297: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13298 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13299 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13300   cat >>confdefs.h <<EOF
13301 #define `echo "HAVE_LIBmenu$cf_cv_libtype" | $as_tr_cpp` 1
13302 EOF
13303
13304   LIBS="-lmenu$cf_cv_libtype $LIBS"
13305
13306 fi
13307
13308 as_ac_Lib=`echo "ac_cv_lib_form$cf_cv_libtype''_form_driver" | $as_tr_sh`
13309 echo "$as_me:13309: checking for form_driver in -lform$cf_cv_libtype" >&5
13310 echo $ECHO_N "checking for form_driver in -lform$cf_cv_libtype... $ECHO_C" >&6
13311 if eval "test \"\${$as_ac_Lib+set}\" = set"; then
13312   echo $ECHO_N "(cached) $ECHO_C" >&6
13313 else
13314   ac_check_lib_save_LIBS=$LIBS
13315 LIBS="-lform$cf_cv_libtype  $LIBS"
13316 cat >conftest.$ac_ext <<_ACEOF
13317 #line 13317 "configure"
13318 #include "confdefs.h"
13319
13320 /* Override any gcc2 internal prototype to avoid an error.  */
13321 #ifdef __cplusplus
13322 extern "C"
13323 #endif
13324 /* We use char because int might match the return type of a gcc2
13325    builtin and then its argument prototype would still apply.  */
13326 char form_driver ();
13327 int
13328 main ()
13329 {
13330 form_driver ();
13331   ;
13332   return 0;
13333 }
13334 _ACEOF
13335 rm -f conftest.$ac_objext conftest$ac_exeext
13336 if { (eval echo "$as_me:13336: \"$ac_link\"") >&5
13337   (eval $ac_link) 2>&5
13338   ac_status=$?
13339   echo "$as_me:13339: \$? = $ac_status" >&5
13340   (exit $ac_status); } &&
13341          { ac_try='test -s conftest$ac_exeext'
13342   { (eval echo "$as_me:13342: \"$ac_try\"") >&5
13343   (eval $ac_try) 2>&5
13344   ac_status=$?
13345   echo "$as_me:13345: \$? = $ac_status" >&5
13346   (exit $ac_status); }; }; then
13347   eval "$as_ac_Lib=yes"
13348 else
13349   echo "$as_me: failed program was:" >&5
13350 cat conftest.$ac_ext >&5
13351 eval "$as_ac_Lib=no"
13352 fi
13353 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13354 LIBS=$ac_check_lib_save_LIBS
13355 fi
13356 echo "$as_me:13356: result: `eval echo '${'$as_ac_Lib'}'`" >&5
13357 echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6
13358 if test `eval echo '${'$as_ac_Lib'}'` = yes; then
13359   cat >>confdefs.h <<EOF
13360 #define `echo "HAVE_LIBform$cf_cv_libtype" | $as_tr_cpp` 1
13361 EOF
13362
13363   LIBS="-lform$cf_cv_libtype $LIBS"
13364
13365 fi
13366
13367         # look for curses-related headers
13368
13369 for ac_header in \
13370                 nc_alloc.h \
13371                 nomacros.h \
13372                 form.h \
13373                 menu.h \
13374                 panel.h \
13375                 term_entry.h \
13376
13377 do
13378 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13379 echo "$as_me:13379: checking for $ac_header" >&5
13380 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13381 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13382   echo $ECHO_N "(cached) $ECHO_C" >&6
13383 else
13384   cat >conftest.$ac_ext <<_ACEOF
13385 #line 13385 "configure"
13386 #include "confdefs.h"
13387 #include <$ac_header>
13388 _ACEOF
13389 if { (eval echo "$as_me:13389: \"$ac_cpp conftest.$ac_ext\"") >&5
13390   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13391   ac_status=$?
13392   egrep -v '^ *\+' conftest.er1 >conftest.err
13393   rm -f conftest.er1
13394   cat conftest.err >&5
13395   echo "$as_me:13395: \$? = $ac_status" >&5
13396   (exit $ac_status); } >/dev/null; then
13397   if test -s conftest.err; then
13398     ac_cpp_err=$ac_c_preproc_warn_flag
13399   else
13400     ac_cpp_err=
13401   fi
13402 else
13403   ac_cpp_err=yes
13404 fi
13405 if test -z "$ac_cpp_err"; then
13406   eval "$as_ac_Header=yes"
13407 else
13408   echo "$as_me: failed program was:" >&5
13409   cat conftest.$ac_ext >&5
13410   eval "$as_ac_Header=no"
13411 fi
13412 rm -f conftest.err conftest.$ac_ext
13413 fi
13414 echo "$as_me:13414: result: `eval echo '${'$as_ac_Header'}'`" >&5
13415 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13416 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13417   cat >>confdefs.h <<EOF
13418 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13419 EOF
13420
13421 fi
13422 done
13423
13424         ;;
13425 esac
13426
13427 echo "$as_me:13427: checking return type of signal handlers" >&5
13428 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
13429 if test "${ac_cv_type_signal+set}" = set; then
13430   echo $ECHO_N "(cached) $ECHO_C" >&6
13431 else
13432   cat >conftest.$ac_ext <<_ACEOF
13433 #line 13433 "configure"
13434 #include "confdefs.h"
13435 #include <sys/types.h>
13436 #include <signal.h>
13437 #ifdef signal
13438 # undef signal
13439 #endif
13440 #ifdef __cplusplus
13441 extern "C" void (*signal (int, void (*)(int)))(int);
13442 #else
13443 void (*signal ()) ();
13444 #endif
13445
13446 int
13447 main ()
13448 {
13449 int i;
13450   ;
13451   return 0;
13452 }
13453 _ACEOF
13454 rm -f conftest.$ac_objext
13455 if { (eval echo "$as_me:13455: \"$ac_compile\"") >&5
13456   (eval $ac_compile) 2>&5
13457   ac_status=$?
13458   echo "$as_me:13458: \$? = $ac_status" >&5
13459   (exit $ac_status); } &&
13460          { ac_try='test -s conftest.$ac_objext'
13461   { (eval echo "$as_me:13461: \"$ac_try\"") >&5
13462   (eval $ac_try) 2>&5
13463   ac_status=$?
13464   echo "$as_me:13464: \$? = $ac_status" >&5
13465   (exit $ac_status); }; }; then
13466   ac_cv_type_signal=void
13467 else
13468   echo "$as_me: failed program was:" >&5
13469 cat conftest.$ac_ext >&5
13470 ac_cv_type_signal=int
13471 fi
13472 rm -f conftest.$ac_objext conftest.$ac_ext
13473 fi
13474 echo "$as_me:13474: result: $ac_cv_type_signal" >&5
13475 echo "${ECHO_T}$ac_cv_type_signal" >&6
13476
13477 cat >>confdefs.h <<EOF
13478 #define RETSIGTYPE $ac_cv_type_signal
13479 EOF
13480
13481 echo "$as_me:13481: checking for ANSI C header files" >&5
13482 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
13483 if test "${ac_cv_header_stdc+set}" = set; then
13484   echo $ECHO_N "(cached) $ECHO_C" >&6
13485 else
13486   cat >conftest.$ac_ext <<_ACEOF
13487 #line 13487 "configure"
13488 #include "confdefs.h"
13489 #include <stdlib.h>
13490 #include <stdarg.h>
13491 #include <string.h>
13492 #include <float.h>
13493
13494 _ACEOF
13495 if { (eval echo "$as_me:13495: \"$ac_cpp conftest.$ac_ext\"") >&5
13496   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13497   ac_status=$?
13498   egrep -v '^ *\+' conftest.er1 >conftest.err
13499   rm -f conftest.er1
13500   cat conftest.err >&5
13501   echo "$as_me:13501: \$? = $ac_status" >&5
13502   (exit $ac_status); } >/dev/null; then
13503   if test -s conftest.err; then
13504     ac_cpp_err=$ac_c_preproc_warn_flag
13505   else
13506     ac_cpp_err=
13507   fi
13508 else
13509   ac_cpp_err=yes
13510 fi
13511 if test -z "$ac_cpp_err"; then
13512   ac_cv_header_stdc=yes
13513 else
13514   echo "$as_me: failed program was:" >&5
13515   cat conftest.$ac_ext >&5
13516   ac_cv_header_stdc=no
13517 fi
13518 rm -f conftest.err conftest.$ac_ext
13519
13520 if test $ac_cv_header_stdc = yes; then
13521   # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
13522   cat >conftest.$ac_ext <<_ACEOF
13523 #line 13523 "configure"
13524 #include "confdefs.h"
13525 #include <string.h>
13526
13527 _ACEOF
13528 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13529   egrep "memchr" >/dev/null 2>&1; then
13530   :
13531 else
13532   ac_cv_header_stdc=no
13533 fi
13534 rm -rf conftest*
13535
13536 fi
13537
13538 if test $ac_cv_header_stdc = yes; then
13539   # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
13540   cat >conftest.$ac_ext <<_ACEOF
13541 #line 13541 "configure"
13542 #include "confdefs.h"
13543 #include <stdlib.h>
13544
13545 _ACEOF
13546 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
13547   egrep "free" >/dev/null 2>&1; then
13548   :
13549 else
13550   ac_cv_header_stdc=no
13551 fi
13552 rm -rf conftest*
13553
13554 fi
13555
13556 if test $ac_cv_header_stdc = yes; then
13557   # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
13558   if test "$cross_compiling" = yes; then
13559   :
13560 else
13561   cat >conftest.$ac_ext <<_ACEOF
13562 #line 13562 "configure"
13563 #include "confdefs.h"
13564 #include <ctype.h>
13565 #if ((' ' & 0x0FF) == 0x020)
13566 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
13567 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
13568 #else
13569 # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \
13570                      || ('j' <= (c) && (c) <= 'r') \
13571                      || ('s' <= (c) && (c) <= 'z'))
13572 # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
13573 #endif
13574
13575 #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
13576 int
13577 main ()
13578 {
13579   int i;
13580   for (i = 0; i < 256; i++)
13581     if (XOR (islower (i), ISLOWER (i))
13582         || toupper (i) != TOUPPER (i))
13583       $ac_main_return(2);
13584   $ac_main_return (0);
13585 }
13586 _ACEOF
13587 rm -f conftest$ac_exeext
13588 if { (eval echo "$as_me:13588: \"$ac_link\"") >&5
13589   (eval $ac_link) 2>&5
13590   ac_status=$?
13591   echo "$as_me:13591: \$? = $ac_status" >&5
13592   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
13593   { (eval echo "$as_me:13593: \"$ac_try\"") >&5
13594   (eval $ac_try) 2>&5
13595   ac_status=$?
13596   echo "$as_me:13596: \$? = $ac_status" >&5
13597   (exit $ac_status); }; }; then
13598   :
13599 else
13600   echo "$as_me: program exited with status $ac_status" >&5
13601 echo "$as_me: failed program was:" >&5
13602 cat conftest.$ac_ext >&5
13603 ac_cv_header_stdc=no
13604 fi
13605 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
13606 fi
13607 fi
13608 fi
13609 echo "$as_me:13609: result: $ac_cv_header_stdc" >&5
13610 echo "${ECHO_T}$ac_cv_header_stdc" >&6
13611 if test $ac_cv_header_stdc = yes; then
13612
13613 cat >>confdefs.h <<\EOF
13614 #define STDC_HEADERS 1
13615 EOF
13616
13617 fi
13618
13619 echo "$as_me:13619: checking whether time.h and sys/time.h may both be included" >&5
13620 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
13621 if test "${ac_cv_header_time+set}" = set; then
13622   echo $ECHO_N "(cached) $ECHO_C" >&6
13623 else
13624   cat >conftest.$ac_ext <<_ACEOF
13625 #line 13625 "configure"
13626 #include "confdefs.h"
13627 #include <sys/types.h>
13628 #include <sys/time.h>
13629 #include <time.h>
13630
13631 int
13632 main ()
13633 {
13634 if ((struct tm *) 0)
13635 return 0;
13636   ;
13637   return 0;
13638 }
13639 _ACEOF
13640 rm -f conftest.$ac_objext
13641 if { (eval echo "$as_me:13641: \"$ac_compile\"") >&5
13642   (eval $ac_compile) 2>&5
13643   ac_status=$?
13644   echo "$as_me:13644: \$? = $ac_status" >&5
13645   (exit $ac_status); } &&
13646          { ac_try='test -s conftest.$ac_objext'
13647   { (eval echo "$as_me:13647: \"$ac_try\"") >&5
13648   (eval $ac_try) 2>&5
13649   ac_status=$?
13650   echo "$as_me:13650: \$? = $ac_status" >&5
13651   (exit $ac_status); }; }; then
13652   ac_cv_header_time=yes
13653 else
13654   echo "$as_me: failed program was:" >&5
13655 cat conftest.$ac_ext >&5
13656 ac_cv_header_time=no
13657 fi
13658 rm -f conftest.$ac_objext conftest.$ac_ext
13659 fi
13660 echo "$as_me:13660: result: $ac_cv_header_time" >&5
13661 echo "${ECHO_T}$ac_cv_header_time" >&6
13662 if test $ac_cv_header_time = yes; then
13663
13664 cat >>confdefs.h <<\EOF
13665 #define TIME_WITH_SYS_TIME 1
13666 EOF
13667
13668 fi
13669
13670 for ac_header in \
13671 getopt.h \
13672 locale.h \
13673 math.h \
13674 stdarg.h \
13675 sys/ioctl.h \
13676 sys/select.h \
13677 sys/time.h \
13678 termios.h \
13679 unistd.h \
13680
13681 do
13682 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13683 echo "$as_me:13683: checking for $ac_header" >&5
13684 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13685 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13686   echo $ECHO_N "(cached) $ECHO_C" >&6
13687 else
13688   cat >conftest.$ac_ext <<_ACEOF
13689 #line 13689 "configure"
13690 #include "confdefs.h"
13691 #include <$ac_header>
13692 _ACEOF
13693 if { (eval echo "$as_me:13693: \"$ac_cpp conftest.$ac_ext\"") >&5
13694   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13695   ac_status=$?
13696   egrep -v '^ *\+' conftest.er1 >conftest.err
13697   rm -f conftest.er1
13698   cat conftest.err >&5
13699   echo "$as_me:13699: \$? = $ac_status" >&5
13700   (exit $ac_status); } >/dev/null; then
13701   if test -s conftest.err; then
13702     ac_cpp_err=$ac_c_preproc_warn_flag
13703   else
13704     ac_cpp_err=
13705   fi
13706 else
13707   ac_cpp_err=yes
13708 fi
13709 if test -z "$ac_cpp_err"; then
13710   eval "$as_ac_Header=yes"
13711 else
13712   echo "$as_me: failed program was:" >&5
13713   cat conftest.$ac_ext >&5
13714   eval "$as_ac_Header=no"
13715 fi
13716 rm -f conftest.err conftest.$ac_ext
13717 fi
13718 echo "$as_me:13718: result: `eval echo '${'$as_ac_Header'}'`" >&5
13719 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13720 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13721   cat >>confdefs.h <<EOF
13722 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13723 EOF
13724
13725 fi
13726 done
13727
13728 for ac_header in unistd.h getopt.h
13729 do
13730 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
13731 echo "$as_me:13731: checking for $ac_header" >&5
13732 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
13733 if eval "test \"\${$as_ac_Header+set}\" = set"; then
13734   echo $ECHO_N "(cached) $ECHO_C" >&6
13735 else
13736   cat >conftest.$ac_ext <<_ACEOF
13737 #line 13737 "configure"
13738 #include "confdefs.h"
13739 #include <$ac_header>
13740 _ACEOF
13741 if { (eval echo "$as_me:13741: \"$ac_cpp conftest.$ac_ext\"") >&5
13742   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
13743   ac_status=$?
13744   egrep -v '^ *\+' conftest.er1 >conftest.err
13745   rm -f conftest.er1
13746   cat conftest.err >&5
13747   echo "$as_me:13747: \$? = $ac_status" >&5
13748   (exit $ac_status); } >/dev/null; then
13749   if test -s conftest.err; then
13750     ac_cpp_err=$ac_c_preproc_warn_flag
13751   else
13752     ac_cpp_err=
13753   fi
13754 else
13755   ac_cpp_err=yes
13756 fi
13757 if test -z "$ac_cpp_err"; then
13758   eval "$as_ac_Header=yes"
13759 else
13760   echo "$as_me: failed program was:" >&5
13761   cat conftest.$ac_ext >&5
13762   eval "$as_ac_Header=no"
13763 fi
13764 rm -f conftest.err conftest.$ac_ext
13765 fi
13766 echo "$as_me:13766: result: `eval echo '${'$as_ac_Header'}'`" >&5
13767 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
13768 if test `eval echo '${'$as_ac_Header'}'` = yes; then
13769   cat >>confdefs.h <<EOF
13770 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
13771 EOF
13772
13773 fi
13774 done
13775
13776 echo "$as_me:13776: checking for header declaring getopt variables" >&5
13777 echo $ECHO_N "checking for header declaring getopt variables... $ECHO_C" >&6
13778 if test "${cf_cv_getopt_header+set}" = set; then
13779   echo $ECHO_N "(cached) $ECHO_C" >&6
13780 else
13781
13782 cf_cv_getopt_header=none
13783 for cf_header in stdio.h stdlib.h unistd.h getopt.h
13784 do
13785 cat >conftest.$ac_ext <<_ACEOF
13786 #line 13786 "configure"
13787 #include "confdefs.h"
13788
13789 #include <$cf_header>
13790 int
13791 main ()
13792 {
13793 int x = optind; char *y = optarg
13794   ;
13795   return 0;
13796 }
13797 _ACEOF
13798 rm -f conftest.$ac_objext
13799 if { (eval echo "$as_me:13799: \"$ac_compile\"") >&5
13800   (eval $ac_compile) 2>&5
13801   ac_status=$?
13802   echo "$as_me:13802: \$? = $ac_status" >&5
13803   (exit $ac_status); } &&
13804          { ac_try='test -s conftest.$ac_objext'
13805   { (eval echo "$as_me:13805: \"$ac_try\"") >&5
13806   (eval $ac_try) 2>&5
13807   ac_status=$?
13808   echo "$as_me:13808: \$? = $ac_status" >&5
13809   (exit $ac_status); }; }; then
13810   cf_cv_getopt_header=$cf_header
13811  break
13812 else
13813   echo "$as_me: failed program was:" >&5
13814 cat conftest.$ac_ext >&5
13815 fi
13816 rm -f conftest.$ac_objext conftest.$ac_ext
13817 done
13818
13819 fi
13820 echo "$as_me:13820: result: $cf_cv_getopt_header" >&5
13821 echo "${ECHO_T}$cf_cv_getopt_header" >&6
13822 if test $cf_cv_getopt_header != none ; then
13823         cat >>confdefs.h <<\EOF
13824 #define HAVE_GETOPT_HEADER 1
13825 EOF
13826
13827 fi
13828
13829 for ac_func in \
13830 gettimeofday \
13831 strdup \
13832
13833 do
13834 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13835 echo "$as_me:13835: checking for $ac_func" >&5
13836 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13837 if eval "test \"\${$as_ac_var+set}\" = set"; then
13838   echo $ECHO_N "(cached) $ECHO_C" >&6
13839 else
13840   cat >conftest.$ac_ext <<_ACEOF
13841 #line 13841 "configure"
13842 #include "confdefs.h"
13843 /* System header to define __stub macros and hopefully few prototypes,
13844     which can conflict with char $ac_func (); below.  */
13845 #include <assert.h>
13846 /* Override any gcc2 internal prototype to avoid an error.  */
13847 #ifdef __cplusplus
13848 extern "C"
13849 #endif
13850 /* We use char because int might match the return type of a gcc2
13851    builtin and then its argument prototype would still apply.  */
13852 char $ac_func ();
13853 char (*f) ();
13854
13855 int
13856 main ()
13857 {
13858 /* The GNU C library defines this for functions which it implements
13859     to always fail with ENOSYS.  Some functions are actually named
13860     something starting with __ and the normal name is an alias.  */
13861 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13862 choke me
13863 #else
13864 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13865 #endif
13866
13867   ;
13868   return 0;
13869 }
13870 _ACEOF
13871 rm -f conftest.$ac_objext conftest$ac_exeext
13872 if { (eval echo "$as_me:13872: \"$ac_link\"") >&5
13873   (eval $ac_link) 2>&5
13874   ac_status=$?
13875   echo "$as_me:13875: \$? = $ac_status" >&5
13876   (exit $ac_status); } &&
13877          { ac_try='test -s conftest$ac_exeext'
13878   { (eval echo "$as_me:13878: \"$ac_try\"") >&5
13879   (eval $ac_try) 2>&5
13880   ac_status=$?
13881   echo "$as_me:13881: \$? = $ac_status" >&5
13882   (exit $ac_status); }; }; then
13883   eval "$as_ac_var=yes"
13884 else
13885   echo "$as_me: failed program was:" >&5
13886 cat conftest.$ac_ext >&5
13887 eval "$as_ac_var=no"
13888 fi
13889 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13890 fi
13891 echo "$as_me:13891: result: `eval echo '${'$as_ac_var'}'`" >&5
13892 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13893 if test `eval echo '${'$as_ac_var'}'` = yes; then
13894   cat >>confdefs.h <<EOF
13895 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13896 EOF
13897
13898 fi
13899 done
13900
13901 if test "$cf_enable_widec" = yes; then
13902
13903 for ac_func in \
13904 mblen \
13905 mbrlen \
13906 mbrtowc \
13907 mbsrtowcs \
13908 mbstowcs \
13909 mbtowc \
13910 wcsrtombs \
13911 wcstombs \
13912
13913 do
13914 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
13915 echo "$as_me:13915: checking for $ac_func" >&5
13916 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
13917 if eval "test \"\${$as_ac_var+set}\" = set"; then
13918   echo $ECHO_N "(cached) $ECHO_C" >&6
13919 else
13920   cat >conftest.$ac_ext <<_ACEOF
13921 #line 13921 "configure"
13922 #include "confdefs.h"
13923 /* System header to define __stub macros and hopefully few prototypes,
13924     which can conflict with char $ac_func (); below.  */
13925 #include <assert.h>
13926 /* Override any gcc2 internal prototype to avoid an error.  */
13927 #ifdef __cplusplus
13928 extern "C"
13929 #endif
13930 /* We use char because int might match the return type of a gcc2
13931    builtin and then its argument prototype would still apply.  */
13932 char $ac_func ();
13933 char (*f) ();
13934
13935 int
13936 main ()
13937 {
13938 /* The GNU C library defines this for functions which it implements
13939     to always fail with ENOSYS.  Some functions are actually named
13940     something starting with __ and the normal name is an alias.  */
13941 #if defined (__stub_$ac_func) || defined (__stub___$ac_func)
13942 choke me
13943 #else
13944 f = $ac_func; /* workaround for ICC 12.0.3 */ if (f == 0) return 1;
13945 #endif
13946
13947   ;
13948   return 0;
13949 }
13950 _ACEOF
13951 rm -f conftest.$ac_objext conftest$ac_exeext
13952 if { (eval echo "$as_me:13952: \"$ac_link\"") >&5
13953   (eval $ac_link) 2>&5
13954   ac_status=$?
13955   echo "$as_me:13955: \$? = $ac_status" >&5
13956   (exit $ac_status); } &&
13957          { ac_try='test -s conftest$ac_exeext'
13958   { (eval echo "$as_me:13958: \"$ac_try\"") >&5
13959   (eval $ac_try) 2>&5
13960   ac_status=$?
13961   echo "$as_me:13961: \$? = $ac_status" >&5
13962   (exit $ac_status); }; }; then
13963   eval "$as_ac_var=yes"
13964 else
13965   echo "$as_me: failed program was:" >&5
13966 cat conftest.$ac_ext >&5
13967 eval "$as_ac_var=no"
13968 fi
13969 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
13970 fi
13971 echo "$as_me:13971: result: `eval echo '${'$as_ac_var'}'`" >&5
13972 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
13973 if test `eval echo '${'$as_ac_var'}'` = yes; then
13974   cat >>confdefs.h <<EOF
13975 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
13976 EOF
13977
13978 fi
13979 done
13980
13981 fi
13982
13983 echo "$as_me:13983: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5
13984 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6
13985 if test "${cf_cv_need_xopen_extension+set}" = set; then
13986   echo $ECHO_N "(cached) $ECHO_C" >&6
13987 else
13988
13989 cat >conftest.$ac_ext <<_ACEOF
13990 #line 13990 "configure"
13991 #include "confdefs.h"
13992
13993 #include <stdlib.h>
13994 #include <${cf_cv_ncurses_header:-curses.h}>
13995 int
13996 main ()
13997 {
13998
13999 #if defined(NCURSES_VERSION_PATCH)
14000 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
14001         make an error
14002 #endif
14003 #endif
14004         long x = winnstr(stdscr, "", 0);
14005         int x1, y1;
14006         getbegyx(stdscr, y1, x1)
14007   ;
14008   return 0;
14009 }
14010 _ACEOF
14011 rm -f conftest.$ac_objext conftest$ac_exeext
14012 if { (eval echo "$as_me:14012: \"$ac_link\"") >&5
14013   (eval $ac_link) 2>&5
14014   ac_status=$?
14015   echo "$as_me:14015: \$? = $ac_status" >&5
14016   (exit $ac_status); } &&
14017          { ac_try='test -s conftest$ac_exeext'
14018   { (eval echo "$as_me:14018: \"$ac_try\"") >&5
14019   (eval $ac_try) 2>&5
14020   ac_status=$?
14021   echo "$as_me:14021: \$? = $ac_status" >&5
14022   (exit $ac_status); }; }; then
14023   cf_cv_need_xopen_extension=no
14024 else
14025   echo "$as_me: failed program was:" >&5
14026 cat conftest.$ac_ext >&5
14027 cat >conftest.$ac_ext <<_ACEOF
14028 #line 14028 "configure"
14029 #include "confdefs.h"
14030
14031 #define _XOPEN_SOURCE_EXTENDED
14032 #include <stdlib.h>
14033 #include <${cf_cv_ncurses_header:-curses.h}>
14034 int
14035 main ()
14036 {
14037
14038 #ifdef NCURSES_VERSION
14039         cchar_t check;
14040         int check2 = curs_set((int)sizeof(check));
14041 #endif
14042         long x = winnstr(stdscr, "", 0);
14043         int x1, y1;
14044         getbegyx(stdscr, y1, x1)
14045   ;
14046   return 0;
14047 }
14048 _ACEOF
14049 rm -f conftest.$ac_objext conftest$ac_exeext
14050 if { (eval echo "$as_me:14050: \"$ac_link\"") >&5
14051   (eval $ac_link) 2>&5
14052   ac_status=$?
14053   echo "$as_me:14053: \$? = $ac_status" >&5
14054   (exit $ac_status); } &&
14055          { ac_try='test -s conftest$ac_exeext'
14056   { (eval echo "$as_me:14056: \"$ac_try\"") >&5
14057   (eval $ac_try) 2>&5
14058   ac_status=$?
14059   echo "$as_me:14059: \$? = $ac_status" >&5
14060   (exit $ac_status); }; }; then
14061   cf_cv_need_xopen_extension=yes
14062 else
14063   echo "$as_me: failed program was:" >&5
14064 cat conftest.$ac_ext >&5
14065 cf_cv_need_xopen_extension=unknown
14066 fi
14067 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14068 fi
14069 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14070 fi
14071 echo "$as_me:14071: result: $cf_cv_need_xopen_extension" >&5
14072 echo "${ECHO_T}$cf_cv_need_xopen_extension" >&6
14073 test $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED"
14074
14075 echo "$as_me:14075: checking for term.h" >&5
14076 echo $ECHO_N "checking for term.h... $ECHO_C" >&6
14077 if test "${cf_cv_term_header+set}" = set; then
14078   echo $ECHO_N "(cached) $ECHO_C" >&6
14079 else
14080
14081 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
14082 # for <term.h> if we do not find the variant.
14083
14084 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
14085
14086 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14087 */*)
14088         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
14089         cf_header_list="$cf_header_item $cf_header_list"
14090         ;;
14091 esac
14092
14093 for cf_header in $cf_header_list
14094 do
14095         cat >conftest.$ac_ext <<_ACEOF
14096 #line 14096 "configure"
14097 #include "confdefs.h"
14098
14099 #include <${cf_cv_ncurses_header:-curses.h}>
14100 #include <${cf_header}>
14101 int
14102 main ()
14103 {
14104 WINDOW *x
14105   ;
14106   return 0;
14107 }
14108 _ACEOF
14109 rm -f conftest.$ac_objext
14110 if { (eval echo "$as_me:14110: \"$ac_compile\"") >&5
14111   (eval $ac_compile) 2>&5
14112   ac_status=$?
14113   echo "$as_me:14113: \$? = $ac_status" >&5
14114   (exit $ac_status); } &&
14115          { ac_try='test -s conftest.$ac_objext'
14116   { (eval echo "$as_me:14116: \"$ac_try\"") >&5
14117   (eval $ac_try) 2>&5
14118   ac_status=$?
14119   echo "$as_me:14119: \$? = $ac_status" >&5
14120   (exit $ac_status); }; }; then
14121   cf_cv_term_header=$cf_header
14122          break
14123 else
14124   echo "$as_me: failed program was:" >&5
14125 cat conftest.$ac_ext >&5
14126 cf_cv_term_header=no
14127 fi
14128 rm -f conftest.$ac_objext conftest.$ac_ext
14129 done
14130
14131 case $cf_cv_term_header in #(vi
14132 no)
14133         # If curses is ncurses, some packagers still mess it up by trying to make
14134         # us use GNU termcap.  This handles the most common case.
14135         for cf_header in ncurses/term.h ncursesw/term.h
14136         do
14137                 cat >conftest.$ac_ext <<_ACEOF
14138 #line 14138 "configure"
14139 #include "confdefs.h"
14140
14141 #include <${cf_cv_ncurses_header:-curses.h}>
14142 #ifdef NCURSES_VERSION
14143 #include <${cf_header}>
14144 #else
14145 make an error
14146 #endif
14147 int
14148 main ()
14149 {
14150 WINDOW *x
14151   ;
14152   return 0;
14153 }
14154 _ACEOF
14155 rm -f conftest.$ac_objext
14156 if { (eval echo "$as_me:14156: \"$ac_compile\"") >&5
14157   (eval $ac_compile) 2>&5
14158   ac_status=$?
14159   echo "$as_me:14159: \$? = $ac_status" >&5
14160   (exit $ac_status); } &&
14161          { ac_try='test -s conftest.$ac_objext'
14162   { (eval echo "$as_me:14162: \"$ac_try\"") >&5
14163   (eval $ac_try) 2>&5
14164   ac_status=$?
14165   echo "$as_me:14165: \$? = $ac_status" >&5
14166   (exit $ac_status); }; }; then
14167   cf_cv_term_header=$cf_header
14168                          break
14169 else
14170   echo "$as_me: failed program was:" >&5
14171 cat conftest.$ac_ext >&5
14172 cf_cv_term_header=no
14173 fi
14174 rm -f conftest.$ac_objext conftest.$ac_ext
14175         done
14176         ;;
14177 esac
14178
14179 fi
14180 echo "$as_me:14180: result: $cf_cv_term_header" >&5
14181 echo "${ECHO_T}$cf_cv_term_header" >&6
14182
14183 case $cf_cv_term_header in #(vi
14184 term.h) #(vi
14185         cat >>confdefs.h <<\EOF
14186 #define HAVE_TERM_H 1
14187 EOF
14188
14189         ;;
14190 ncurses/term.h) #(vi
14191         cat >>confdefs.h <<\EOF
14192 #define HAVE_NCURSES_TERM_H 1
14193 EOF
14194
14195         ;;
14196 ncursesw/term.h)
14197         cat >>confdefs.h <<\EOF
14198 #define HAVE_NCURSESW_TERM_H 1
14199 EOF
14200
14201         ;;
14202 esac
14203
14204 echo "$as_me:14204: checking for unctrl.h" >&5
14205 echo $ECHO_N "checking for unctrl.h... $ECHO_C" >&6
14206 if test "${cf_cv_unctrl_header+set}" = set; then
14207   echo $ECHO_N "(cached) $ECHO_C" >&6
14208 else
14209
14210 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
14211 # for <unctrl.h> if we do not find the variant.
14212
14213 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
14214
14215 case ${cf_cv_ncurses_header:-curses.h} in #(vi
14216 */*)
14217         cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
14218         cf_header_list="$cf_header_item $cf_header_list"
14219         ;;
14220 esac
14221
14222 for cf_header in $cf_header_list
14223 do
14224         cat >conftest.$ac_ext <<_ACEOF
14225 #line 14225 "configure"
14226 #include "confdefs.h"
14227
14228 #include <${cf_cv_ncurses_header:-curses.h}>
14229 #include <${cf_header}>
14230 int
14231 main ()
14232 {
14233 WINDOW *x
14234   ;
14235   return 0;
14236 }
14237 _ACEOF
14238 rm -f conftest.$ac_objext
14239 if { (eval echo "$as_me:14239: \"$ac_compile\"") >&5
14240   (eval $ac_compile) 2>&5
14241   ac_status=$?
14242   echo "$as_me:14242: \$? = $ac_status" >&5
14243   (exit $ac_status); } &&
14244          { ac_try='test -s conftest.$ac_objext'
14245   { (eval echo "$as_me:14245: \"$ac_try\"") >&5
14246   (eval $ac_try) 2>&5
14247   ac_status=$?
14248   echo "$as_me:14248: \$? = $ac_status" >&5
14249   (exit $ac_status); }; }; then
14250   cf_cv_unctrl_header=$cf_header
14251          break
14252 else
14253   echo "$as_me: failed program was:" >&5
14254 cat conftest.$ac_ext >&5
14255 cf_cv_unctrl_header=no
14256 fi
14257 rm -f conftest.$ac_objext conftest.$ac_ext
14258 done
14259
14260 case $cf_cv_unctrl_header in #(vi
14261 no)
14262         { echo "$as_me:14262: WARNING: unctrl.h header not found" >&5
14263 echo "$as_me: WARNING: unctrl.h header not found" >&2;}
14264         ;;
14265 esac
14266
14267 fi
14268 echo "$as_me:14268: result: $cf_cv_unctrl_header" >&5
14269 echo "${ECHO_T}$cf_cv_unctrl_header" >&6
14270
14271 case $cf_cv_unctrl_header in #(vi
14272 unctrl.h) #(vi
14273         cat >>confdefs.h <<\EOF
14274 #define HAVE_UNCTRL_H 1
14275 EOF
14276
14277         ;;
14278 ncurses/unctrl.h) #(vi
14279         cat >>confdefs.h <<\EOF
14280 #define HAVE_NCURSES_UNCTRL_H 1
14281 EOF
14282
14283         ;;
14284 ncursesw/unctrl.h)
14285         cat >>confdefs.h <<\EOF
14286 #define HAVE_NCURSESW_UNCTRL_H 1
14287 EOF
14288
14289         ;;
14290 esac
14291
14292 for cf_func in \
14293 assume_default_colors \
14294 chgat \
14295 color_set \
14296 filter \
14297 getbegx \
14298 getcurx \
14299 getmaxx \
14300 getnstr \
14301 getparx \
14302 getwin \
14303 mvvline \
14304 mvwvline \
14305 napms \
14306 putwin \
14307 resize_term \
14308 resizeterm \
14309 ripoffline \
14310 scr_dump \
14311 setupterm \
14312 slk_color \
14313 slk_init \
14314 termattrs \
14315 tgetent \
14316 tigetnum \
14317 tigetstr \
14318 typeahead \
14319 use_default_colors \
14320 use_screen \
14321 use_window \
14322 vsscanf \
14323 vw_printw \
14324 wchgat \
14325 winsstr \
14326 wresize \
14327 wsyncdown \
14328
14329 do
14330
14331 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14332
14333         echo "$as_me:14333: checking for ${cf_func}" >&5
14334 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14335
14336 echo "${as_me:-configure}:14336: testing ${cf_func} ..." 1>&5
14337
14338         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14339   echo $ECHO_N "(cached) $ECHO_C" >&6
14340 else
14341
14342                 eval cf_result='$ac_cv_func_'$cf_func
14343                 if test ".$cf_result" != ".no"; then
14344                         cat >conftest.$ac_ext <<_ACEOF
14345 #line 14345 "configure"
14346 #include "confdefs.h"
14347
14348 #ifdef HAVE_XCURSES
14349 #include <xcurses.h>
14350 char * XCursesProgramName = "test";
14351 #else
14352 #include <${cf_cv_ncurses_header:-curses.h}>
14353 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14354 #include <ncursesw/term.h>
14355 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14356 #include <ncurses/term.h>
14357 #elif defined(HAVE_TERM_H)
14358 #include <term.h>
14359 #endif
14360 #endif
14361
14362 int
14363 main ()
14364 {
14365
14366 #ifndef ${cf_func}
14367 long foo = (long)(&${cf_func});
14368 if (foo + 1234 > 5678)
14369         ${cf_cv_main_return:-return}(foo);
14370 #endif
14371
14372   ;
14373   return 0;
14374 }
14375 _ACEOF
14376 rm -f conftest.$ac_objext conftest$ac_exeext
14377 if { (eval echo "$as_me:14377: \"$ac_link\"") >&5
14378   (eval $ac_link) 2>&5
14379   ac_status=$?
14380   echo "$as_me:14380: \$? = $ac_status" >&5
14381   (exit $ac_status); } &&
14382          { ac_try='test -s conftest$ac_exeext'
14383   { (eval echo "$as_me:14383: \"$ac_try\"") >&5
14384   (eval $ac_try) 2>&5
14385   ac_status=$?
14386   echo "$as_me:14386: \$? = $ac_status" >&5
14387   (exit $ac_status); }; }; then
14388   cf_result=yes
14389 else
14390   echo "$as_me: failed program was:" >&5
14391 cat conftest.$ac_ext >&5
14392 cf_result=no
14393 fi
14394 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14395                 fi
14396                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14397
14398 fi
14399
14400         # use the computed/retrieved cache-value:
14401         eval 'cf_result=$cf_cv_func_'$cf_func
14402         echo "$as_me:14402: result: $cf_result" >&5
14403 echo "${ECHO_T}$cf_result" >&6
14404         if test $cf_result != no; then
14405                 cat >>confdefs.h <<EOF
14406 #define HAVE_${cf_tr_func} 1
14407 EOF
14408
14409         fi
14410 done
14411
14412 for cf_func in tputs
14413 do
14414
14415 cf_tr_func=`echo "$cf_func" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
14416
14417         echo "$as_me:14417: checking for ${cf_func}" >&5
14418 echo $ECHO_N "checking for ${cf_func}... $ECHO_C" >&6
14419
14420 echo "${as_me:-configure}:14420: testing ${cf_func} ..." 1>&5
14421
14422         if eval "test \"\${cf_cv_func_$cf_func+set}\" = set"; then
14423   echo $ECHO_N "(cached) $ECHO_C" >&6
14424 else
14425
14426                 eval cf_result='$ac_cv_func_'$cf_func
14427                 if test ".$cf_result" != ".no"; then
14428                         cat >conftest.$ac_ext <<_ACEOF
14429 #line 14429 "configure"
14430 #include "confdefs.h"
14431
14432 #ifdef HAVE_XCURSES
14433 #include <xcurses.h>
14434 char * XCursesProgramName = "test";
14435 #else
14436 #include <${cf_cv_ncurses_header:-curses.h}>
14437 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
14438 #include <ncursesw/term.h>
14439 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
14440 #include <ncurses/term.h>
14441 #elif defined(HAVE_TERM_H)
14442 #include <term.h>
14443 #endif
14444 #endif
14445
14446 int
14447 main ()
14448 {
14449
14450 #ifndef ${cf_func}
14451 long foo = (long)(&${cf_func});
14452 if (foo + 1234 > 5678)
14453         ${cf_cv_main_return:-return}(foo);
14454 #endif
14455
14456   ;
14457   return 0;
14458 }
14459 _ACEOF
14460 rm -f conftest.$ac_objext conftest$ac_exeext
14461 if { (eval echo "$as_me:14461: \"$ac_link\"") >&5
14462   (eval $ac_link) 2>&5
14463   ac_status=$?
14464   echo "$as_me:14464: \$? = $ac_status" >&5
14465   (exit $ac_status); } &&
14466          { ac_try='test -s conftest$ac_exeext'
14467   { (eval echo "$as_me:14467: \"$ac_try\"") >&5
14468   (eval $ac_try) 2>&5
14469   ac_status=$?
14470   echo "$as_me:14470: \$? = $ac_status" >&5
14471   (exit $ac_status); }; }; then
14472   cf_result=yes
14473 else
14474   echo "$as_me: failed program was:" >&5
14475 cat conftest.$ac_ext >&5
14476 cf_result=no
14477 fi
14478 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14479                 fi
14480                 eval 'cf_cv_func_'$cf_func'=$cf_result'
14481
14482 fi
14483
14484         # use the computed/retrieved cache-value:
14485         eval 'cf_result=$cf_cv_func_'$cf_func
14486         echo "$as_me:14486: result: $cf_result" >&5
14487 echo "${ECHO_T}$cf_result" >&6
14488         if test $cf_result != no; then
14489                 cat >>confdefs.h <<EOF
14490 #define HAVE_${cf_tr_func} 1
14491 EOF
14492
14493         fi
14494 done
14495
14496 if test x$cf_cv_func_tputs = xyes
14497 then
14498         cf_done=no
14499         for cf_arg in int char
14500         do
14501                 for cf_ret in int void
14502                 do
14503                         if test $cf_ret = void
14504                         then
14505                                 cf_return="/* nothing */"
14506                         else
14507                                 cf_return="return value"
14508                         fi
14509                         cat >conftest.$ac_ext <<_ACEOF
14510 #line 14510 "configure"
14511 #include "confdefs.h"
14512
14513 #include <${cf_cv_ncurses_header:-curses.h}>
14514 #include <$cf_cv_term_header>
14515
14516 static $cf_ret outc($cf_arg value) { $cf_return; }
14517
14518 int
14519 main ()
14520 {
14521
14522         tputs("hello", 0, outc);
14523         ${cf_cv_main_return:-return}(0);
14524
14525   ;
14526   return 0;
14527 }
14528 _ACEOF
14529 rm -f conftest.$ac_objext
14530 if { (eval echo "$as_me:14530: \"$ac_compile\"") >&5
14531   (eval $ac_compile) 2>&5
14532   ac_status=$?
14533   echo "$as_me:14533: \$? = $ac_status" >&5
14534   (exit $ac_status); } &&
14535          { ac_try='test -s conftest.$ac_objext'
14536   { (eval echo "$as_me:14536: \"$ac_try\"") >&5
14537   (eval $ac_try) 2>&5
14538   ac_status=$?
14539   echo "$as_me:14539: \$? = $ac_status" >&5
14540   (exit $ac_status); }; }; then
14541
14542                 test -n "$verbose" && echo "    prototype $cf_ret func($cf_arg value)" 1>&6
14543
14544 echo "${as_me:-configure}:14544: testing prototype $cf_ret func($cf_arg value) ..." 1>&5
14545
14546                 cat >>confdefs.h <<EOF
14547 #define TPUTS_ARG               $cf_arg
14548 #define TPUTS_PROTO(func,value) $cf_ret func(TPUTS_ARG value)
14549 #define TPUTS_RETURN(value)     $cf_return
14550 EOF
14551                 cf_done=yes
14552                 break
14553
14554 else
14555   echo "$as_me: failed program was:" >&5
14556 cat conftest.$ac_ext >&5
14557 fi
14558 rm -f conftest.$ac_objext conftest.$ac_ext
14559                 done
14560                 test $cf_done = yes && break
14561         done
14562 fi
14563
14564 echo "$as_me:14564: checking for ncurses extended functions" >&5
14565 echo $ECHO_N "checking for ncurses extended functions... $ECHO_C" >&6
14566 if test "${cf_cv_ncurses_ext_funcs+set}" = set; then
14567   echo $ECHO_N "(cached) $ECHO_C" >&6
14568 else
14569
14570 cat >conftest.$ac_ext <<_ACEOF
14571 #line 14571 "configure"
14572 #include "confdefs.h"
14573
14574 #include <${cf_cv_ncurses_header:-curses.h}>
14575 int
14576 main ()
14577 {
14578
14579 int x = NCURSES_EXT_FUNCS
14580
14581   ;
14582   return 0;
14583 }
14584 _ACEOF
14585 rm -f conftest.$ac_objext
14586 if { (eval echo "$as_me:14586: \"$ac_compile\"") >&5
14587   (eval $ac_compile) 2>&5
14588   ac_status=$?
14589   echo "$as_me:14589: \$? = $ac_status" >&5
14590   (exit $ac_status); } &&
14591          { ac_try='test -s conftest.$ac_objext'
14592   { (eval echo "$as_me:14592: \"$ac_try\"") >&5
14593   (eval $ac_try) 2>&5
14594   ac_status=$?
14595   echo "$as_me:14595: \$? = $ac_status" >&5
14596   (exit $ac_status); }; }; then
14597   cf_cv_ncurses_ext_funcs=defined
14598 else
14599   echo "$as_me: failed program was:" >&5
14600 cat conftest.$ac_ext >&5
14601
14602 cat >conftest.$ac_ext <<_ACEOF
14603 #line 14603 "configure"
14604 #include "confdefs.h"
14605
14606 #include <${cf_cv_ncurses_header:-curses.h}>
14607 int
14608 main ()
14609 {
14610
14611         (void) assume_default_colors (0, 0);
14612         (void) curses_version ();
14613         (void) define_key (0, 0);
14614         (void) is_term_resized (0, 0);
14615         (void) key_defined (0);
14616         (void) keybound (0, 0);
14617         (void) keyok (0, 0);
14618         (void) resize_term (0, 0);
14619         (void) resizeterm (0, 0);
14620         (void) use_default_colors ();
14621         (void) use_extended_names (0);
14622         (void) wresize (0, 0, 0);
14623   ;
14624   return 0;
14625 }
14626 _ACEOF
14627 rm -f conftest.$ac_objext conftest$ac_exeext
14628 if { (eval echo "$as_me:14628: \"$ac_link\"") >&5
14629   (eval $ac_link) 2>&5
14630   ac_status=$?
14631   echo "$as_me:14631: \$? = $ac_status" >&5
14632   (exit $ac_status); } &&
14633          { ac_try='test -s conftest$ac_exeext'
14634   { (eval echo "$as_me:14634: \"$ac_try\"") >&5
14635   (eval $ac_try) 2>&5
14636   ac_status=$?
14637   echo "$as_me:14637: \$? = $ac_status" >&5
14638   (exit $ac_status); }; }; then
14639   cf_cv_ncurses_ext_funcs=yes
14640 else
14641   echo "$as_me: failed program was:" >&5
14642 cat conftest.$ac_ext >&5
14643 cf_cv_ncurses_ext_funcs=no
14644 fi
14645 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14646
14647 fi
14648 rm -f conftest.$ac_objext conftest.$ac_ext
14649
14650 fi
14651 echo "$as_me:14651: result: $cf_cv_ncurses_ext_funcs" >&5
14652 echo "${ECHO_T}$cf_cv_ncurses_ext_funcs" >&6
14653 test "$cf_cv_ncurses_ext_funcs" = yes && cat >>confdefs.h <<\EOF
14654 #define NCURSES_EXT_FUNCS 1
14655 EOF
14656
14657 if test "$cf_enable_widec" = yes
14658 then
14659         # workaround for systems with ncurses before 20111029, due to change of
14660         # feature test macro from _XPG5 to _XOPEN_SOURCE
14661         if test -n "$cf_cv_ncurses_version" && test "x$cf_cv_ncurses_version" != xno
14662         then
14663                 cf_define_xpg5=no
14664                 echo "$as_me:14664: checking if _XPG5 should be defined to enable wide-characters" >&5
14665 echo $ECHO_N "checking if _XPG5 should be defined to enable wide-characters... $ECHO_C" >&6
14666
14667                 cat >conftest.$ac_ext <<_ACEOF
14668 #line 14668 "configure"
14669 #include "confdefs.h"
14670
14671 #include <${cf_cv_ncurses_header:-curses.h}>
14672 int
14673 main ()
14674 {
14675 int x = _XPG5
14676   ;
14677   return 0;
14678 }
14679 _ACEOF
14680 rm -f conftest.$ac_objext
14681 if { (eval echo "$as_me:14681: \"$ac_compile\"") >&5
14682   (eval $ac_compile) 2>&5
14683   ac_status=$?
14684   echo "$as_me:14684: \$? = $ac_status" >&5
14685   (exit $ac_status); } &&
14686          { ac_try='test -s conftest.$ac_objext'
14687   { (eval echo "$as_me:14687: \"$ac_try\"") >&5
14688   (eval $ac_try) 2>&5
14689   ac_status=$?
14690   echo "$as_me:14690: \$? = $ac_status" >&5
14691   (exit $ac_status); }; }; then
14692   :
14693 else
14694   echo "$as_me: failed program was:" >&5
14695 cat conftest.$ac_ext >&5
14696 cf_save_cppflags="$CPPFLAGS"
14697                          CPPFLAGS="$CPPFLAGS -D_XPG5"
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 int x = _XPG5
14707   ;
14708   return 0;
14709 }
14710 _ACEOF
14711 rm -f conftest.$ac_objext
14712 if { (eval echo "$as_me:14712: \"$ac_compile\"") >&5
14713   (eval $ac_compile) 2>&5
14714   ac_status=$?
14715   echo "$as_me:14715: \$? = $ac_status" >&5
14716   (exit $ac_status); } &&
14717          { ac_try='test -s conftest.$ac_objext'
14718   { (eval echo "$as_me:14718: \"$ac_try\"") >&5
14719   (eval $ac_try) 2>&5
14720   ac_status=$?
14721   echo "$as_me:14721: \$? = $ac_status" >&5
14722   (exit $ac_status); }; }; then
14723   cf_define_xpg5=yes
14724 else
14725   echo "$as_me: failed program was:" >&5
14726 cat conftest.$ac_ext >&5
14727 fi
14728 rm -f conftest.$ac_objext conftest.$ac_ext
14729                          CPPFLAGS="$cf_save_cppflags"
14730 fi
14731 rm -f conftest.$ac_objext conftest.$ac_ext
14732                 echo "$as_me:14732: result: $cf_define_xpg5" >&5
14733 echo "${ECHO_T}$cf_define_xpg5" >&6
14734
14735                 if test "$cf_define_xpg5" = yes
14736                 then
14737                         CPPFLAGS="$CPPFLAGS -D_XPG5"
14738                 fi
14739         fi
14740
14741         echo "$as_me:14741: checking for wide-character functions" >&5
14742 echo $ECHO_N "checking for wide-character functions... $ECHO_C" >&6
14743 if test "${cf_cv_widechar_funcs+set}" = set; then
14744   echo $ECHO_N "(cached) $ECHO_C" >&6
14745 else
14746
14747         cat >conftest.$ac_ext <<_ACEOF
14748 #line 14748 "configure"
14749 #include "confdefs.h"
14750
14751 #include <${cf_cv_ncurses_header:-curses.h}>
14752 int
14753 main ()
14754 {
14755
14756                 static wchar_t src_wchar[2];
14757                 static cchar_t dst_cchar;
14758                 setcchar(&dst_cchar, src_wchar, A_NORMAL, 0, (void *) 0);
14759
14760   ;
14761   return 0;
14762 }
14763 _ACEOF
14764 rm -f conftest.$ac_objext conftest$ac_exeext
14765 if { (eval echo "$as_me:14765: \"$ac_link\"") >&5
14766   (eval $ac_link) 2>&5
14767   ac_status=$?
14768   echo "$as_me:14768: \$? = $ac_status" >&5
14769   (exit $ac_status); } &&
14770          { ac_try='test -s conftest$ac_exeext'
14771   { (eval echo "$as_me:14771: \"$ac_try\"") >&5
14772   (eval $ac_try) 2>&5
14773   ac_status=$?
14774   echo "$as_me:14774: \$? = $ac_status" >&5
14775   (exit $ac_status); }; }; then
14776   cf_cv_widechar_funcs=yes
14777 else
14778   echo "$as_me: failed program was:" >&5
14779 cat conftest.$ac_ext >&5
14780 cf_cv_widechar_funcs=no
14781 fi
14782 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14783
14784 fi
14785 echo "$as_me:14785: result: $cf_cv_widechar_funcs" >&5
14786 echo "${ECHO_T}$cf_cv_widechar_funcs" >&6
14787         if test "$cf_cv_widechar_funcs" != no ; then
14788                 cat >>confdefs.h <<\EOF
14789 #define USE_WIDEC_SUPPORT 1
14790 EOF
14791
14792         else
14793                 cat >>confdefs.h <<\EOF
14794 #define USE_WIDEC_SUPPORT 0
14795 EOF
14796
14797         fi
14798 else
14799         cat >>confdefs.h <<\EOF
14800 #define USE_WIDEC_SUPPORT 0
14801 EOF
14802
14803 fi
14804
14805 echo "$as_me:14805: checking if sys/time.h works with sys/select.h" >&5
14806 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6
14807 if test "${cf_cv_sys_time_select+set}" = set; then
14808   echo $ECHO_N "(cached) $ECHO_C" >&6
14809 else
14810
14811 cat >conftest.$ac_ext <<_ACEOF
14812 #line 14812 "configure"
14813 #include "confdefs.h"
14814
14815 #include <sys/types.h>
14816 #ifdef HAVE_SYS_TIME_H
14817 #include <sys/time.h>
14818 #endif
14819 #ifdef HAVE_SYS_SELECT_H
14820 #include <sys/select.h>
14821 #endif
14822
14823 int
14824 main ()
14825 {
14826
14827   ;
14828   return 0;
14829 }
14830 _ACEOF
14831 rm -f conftest.$ac_objext
14832 if { (eval echo "$as_me:14832: \"$ac_compile\"") >&5
14833   (eval $ac_compile) 2>&5
14834   ac_status=$?
14835   echo "$as_me:14835: \$? = $ac_status" >&5
14836   (exit $ac_status); } &&
14837          { ac_try='test -s conftest.$ac_objext'
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_sys_time_select=yes
14844 else
14845   echo "$as_me: failed program was:" >&5
14846 cat conftest.$ac_ext >&5
14847 cf_cv_sys_time_select=no
14848 fi
14849 rm -f conftest.$ac_objext conftest.$ac_ext
14850
14851 fi
14852
14853 echo "$as_me:14853: result: $cf_cv_sys_time_select" >&5
14854 echo "${ECHO_T}$cf_cv_sys_time_select" >&6
14855 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF
14856 #define HAVE_SYS_TIME_SELECT 1
14857 EOF
14858
14859 echo "$as_me:14859: checking for function curses_version" >&5
14860 echo $ECHO_N "checking for function curses_version... $ECHO_C" >&6
14861 if test "${cf_cv_func_curses_version+set}" = set; then
14862   echo $ECHO_N "(cached) $ECHO_C" >&6
14863 else
14864
14865 if test "$cross_compiling" = yes; then
14866   cf_cv_func_curses_version=unknown
14867 else
14868   cat >conftest.$ac_ext <<_ACEOF
14869 #line 14869 "configure"
14870 #include "confdefs.h"
14871
14872 #include <${cf_cv_ncurses_header:-curses.h}>
14873 int main()
14874 {
14875         char temp[1024];
14876         sprintf(temp, "%s\n", curses_version());
14877         ${cf_cv_main_return:-return}(0);
14878 }
14879
14880 _ACEOF
14881 rm -f conftest$ac_exeext
14882 if { (eval echo "$as_me:14882: \"$ac_link\"") >&5
14883   (eval $ac_link) 2>&5
14884   ac_status=$?
14885   echo "$as_me:14885: \$? = $ac_status" >&5
14886   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
14887   { (eval echo "$as_me:14887: \"$ac_try\"") >&5
14888   (eval $ac_try) 2>&5
14889   ac_status=$?
14890   echo "$as_me:14890: \$? = $ac_status" >&5
14891   (exit $ac_status); }; }; then
14892   cf_cv_func_curses_version=yes
14893
14894 else
14895   echo "$as_me: program exited with status $ac_status" >&5
14896 echo "$as_me: failed program was:" >&5
14897 cat conftest.$ac_ext >&5
14898 cf_cv_func_curses_version=no
14899
14900 fi
14901 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
14902 fi
14903 rm -f core
14904 fi
14905 echo "$as_me:14905: result: $cf_cv_func_curses_version" >&5
14906 echo "${ECHO_T}$cf_cv_func_curses_version" >&6
14907 test "$cf_cv_func_curses_version" = yes && cat >>confdefs.h <<\EOF
14908 #define HAVE_CURSES_VERSION 1
14909 EOF
14910
14911 echo "$as_me:14911: checking for ncurses wrap-prefix" >&5
14912 echo $ECHO_N "checking for ncurses wrap-prefix... $ECHO_C" >&6
14913
14914 # Check whether --with-ncurses-wrap-prefix or --without-ncurses-wrap-prefix was given.
14915 if test "${with_ncurses_wrap_prefix+set}" = set; then
14916   withval="$with_ncurses_wrap_prefix"
14917   NCURSES_WRAP_PREFIX=$withval
14918 else
14919   NCURSES_WRAP_PREFIX=_nc_
14920 fi;
14921 echo "$as_me:14921: result: $NCURSES_WRAP_PREFIX" >&5
14922 echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6
14923
14924 echo "$as_me:14924: checking for alternate character set array" >&5
14925 echo $ECHO_N "checking for alternate character set array... $ECHO_C" >&6
14926 if test "${cf_cv_curses_acs_map+set}" = set; then
14927   echo $ECHO_N "(cached) $ECHO_C" >&6
14928 else
14929
14930 cf_cv_curses_acs_map=unknown
14931 for name in acs_map _acs_map __acs_map ${NCURSES_WRAP_PREFIX}acs_map
14932 do
14933 cat >conftest.$ac_ext <<_ACEOF
14934 #line 14934 "configure"
14935 #include "confdefs.h"
14936
14937 #include <${cf_cv_ncurses_header:-curses.h}>
14938
14939 int
14940 main ()
14941 {
14942
14943 $name['k'] = ACS_PLUS
14944
14945   ;
14946   return 0;
14947 }
14948 _ACEOF
14949 rm -f conftest.$ac_objext conftest$ac_exeext
14950 if { (eval echo "$as_me:14950: \"$ac_link\"") >&5
14951   (eval $ac_link) 2>&5
14952   ac_status=$?
14953   echo "$as_me:14953: \$? = $ac_status" >&5
14954   (exit $ac_status); } &&
14955          { ac_try='test -s conftest$ac_exeext'
14956   { (eval echo "$as_me:14956: \"$ac_try\"") >&5
14957   (eval $ac_try) 2>&5
14958   ac_status=$?
14959   echo "$as_me:14959: \$? = $ac_status" >&5
14960   (exit $ac_status); }; }; then
14961   cf_cv_curses_acs_map=$name; break
14962 else
14963   echo "$as_me: failed program was:" >&5
14964 cat conftest.$ac_ext >&5
14965 fi
14966 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
14967 done
14968
14969 fi
14970 echo "$as_me:14970: result: $cf_cv_curses_acs_map" >&5
14971 echo "${ECHO_T}$cf_cv_curses_acs_map" >&6
14972
14973 test "$cf_cv_curses_acs_map" != unknown && cat >>confdefs.h <<EOF
14974 #define CURSES_ACS_ARRAY $cf_cv_curses_acs_map
14975 EOF
14976
14977 if test "$cf_enable_widec" = yes; then
14978
14979 echo "$as_me:14979: checking for wide alternate character set array" >&5
14980 echo $ECHO_N "checking for wide alternate character set array... $ECHO_C" >&6
14981 if test "${cf_cv_curses_wacs_map+set}" = set; then
14982   echo $ECHO_N "(cached) $ECHO_C" >&6
14983 else
14984
14985         cf_cv_curses_wacs_map=unknown
14986         for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
14987         do
14988         cat >conftest.$ac_ext <<_ACEOF
14989 #line 14989 "configure"
14990 #include "confdefs.h"
14991
14992 #ifndef _XOPEN_SOURCE_EXTENDED
14993 #define _XOPEN_SOURCE_EXTENDED
14994 #endif
14995 #include <${cf_cv_ncurses_header:-curses.h}>
14996 int
14997 main ()
14998 {
14999 void *foo = &($name['k'])
15000   ;
15001   return 0;
15002 }
15003 _ACEOF
15004 rm -f conftest.$ac_objext conftest$ac_exeext
15005 if { (eval echo "$as_me:15005: \"$ac_link\"") >&5
15006   (eval $ac_link) 2>&5
15007   ac_status=$?
15008   echo "$as_me:15008: \$? = $ac_status" >&5
15009   (exit $ac_status); } &&
15010          { ac_try='test -s conftest$ac_exeext'
15011   { (eval echo "$as_me:15011: \"$ac_try\"") >&5
15012   (eval $ac_try) 2>&5
15013   ac_status=$?
15014   echo "$as_me:15014: \$? = $ac_status" >&5
15015   (exit $ac_status); }; }; then
15016   cf_cv_curses_wacs_map=$name
15017          break
15018 else
15019   echo "$as_me: failed program was:" >&5
15020 cat conftest.$ac_ext >&5
15021 fi
15022 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15023         done
15024 fi
15025 echo "$as_me:15025: result: $cf_cv_curses_wacs_map" >&5
15026 echo "${ECHO_T}$cf_cv_curses_wacs_map" >&6
15027
15028 test "$cf_cv_curses_wacs_map" != unknown && cat >>confdefs.h <<EOF
15029 #define CURSES_WACS_ARRAY $cf_cv_curses_wacs_map
15030 EOF
15031
15032 echo "$as_me:15032: checking for wide alternate character constants" >&5
15033 echo $ECHO_N "checking for wide alternate character constants... $ECHO_C" >&6
15034 if test "${cf_cv_curses_wacs_symbols+set}" = set; then
15035   echo $ECHO_N "(cached) $ECHO_C" >&6
15036 else
15037
15038 cf_cv_curses_wacs_symbols=no
15039 if test "$cf_cv_curses_wacs_map" != unknown
15040 then
15041         cat >conftest.$ac_ext <<_ACEOF
15042 #line 15042 "configure"
15043 #include "confdefs.h"
15044
15045 #ifndef _XOPEN_SOURCE_EXTENDED
15046 #define _XOPEN_SOURCE_EXTENDED
15047 #endif
15048 #include <${cf_cv_ncurses_header:-curses.h}>
15049 int
15050 main ()
15051 {
15052 cchar_t *foo = WACS_PLUS;
15053          $cf_cv_curses_wacs_map['k'] = *WACS_PLUS
15054   ;
15055   return 0;
15056 }
15057 _ACEOF
15058 rm -f conftest.$ac_objext conftest$ac_exeext
15059 if { (eval echo "$as_me:15059: \"$ac_link\"") >&5
15060   (eval $ac_link) 2>&5
15061   ac_status=$?
15062   echo "$as_me:15062: \$? = $ac_status" >&5
15063   (exit $ac_status); } &&
15064          { ac_try='test -s conftest$ac_exeext'
15065   { (eval echo "$as_me:15065: \"$ac_try\"") >&5
15066   (eval $ac_try) 2>&5
15067   ac_status=$?
15068   echo "$as_me:15068: \$? = $ac_status" >&5
15069   (exit $ac_status); }; }; then
15070   cf_cv_curses_wacs_symbols=yes
15071 else
15072   echo "$as_me: failed program was:" >&5
15073 cat conftest.$ac_ext >&5
15074 fi
15075 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15076 else
15077         cat >conftest.$ac_ext <<_ACEOF
15078 #line 15078 "configure"
15079 #include "confdefs.h"
15080
15081 #ifndef _XOPEN_SOURCE_EXTENDED
15082 #define _XOPEN_SOURCE_EXTENDED
15083 #endif
15084 #include <${cf_cv_ncurses_header:-curses.h}>
15085 int
15086 main ()
15087 {
15088 cchar_t *foo = WACS_PLUS
15089   ;
15090   return 0;
15091 }
15092 _ACEOF
15093 rm -f conftest.$ac_objext conftest$ac_exeext
15094 if { (eval echo "$as_me:15094: \"$ac_link\"") >&5
15095   (eval $ac_link) 2>&5
15096   ac_status=$?
15097   echo "$as_me:15097: \$? = $ac_status" >&5
15098   (exit $ac_status); } &&
15099          { ac_try='test -s conftest$ac_exeext'
15100   { (eval echo "$as_me:15100: \"$ac_try\"") >&5
15101   (eval $ac_try) 2>&5
15102   ac_status=$?
15103   echo "$as_me:15103: \$? = $ac_status" >&5
15104   (exit $ac_status); }; }; then
15105   cf_cv_curses_wacs_symbols=yes
15106 else
15107   echo "$as_me: failed program was:" >&5
15108 cat conftest.$ac_ext >&5
15109 fi
15110 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15111 fi
15112
15113 fi
15114 echo "$as_me:15114: result: $cf_cv_curses_wacs_symbols" >&5
15115 echo "${ECHO_T}$cf_cv_curses_wacs_symbols" >&6
15116
15117 test "$cf_cv_curses_wacs_symbols" != no && cat >>confdefs.h <<\EOF
15118 #define CURSES_WACS_SYMBOLS 1
15119 EOF
15120
15121 fi
15122
15123 echo "$as_me:15123: checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15124 echo $ECHO_N "checking for type attr_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15125 cat >conftest.$ac_ext <<_ACEOF
15126 #line 15126 "configure"
15127 #include "confdefs.h"
15128
15129 #ifndef _XOPEN_SOURCE_EXTENDED
15130 #define _XOPEN_SOURCE_EXTENDED
15131 #endif
15132 #include <${cf_cv_ncurses_header:-curses.h}>
15133 int
15134 main ()
15135 {
15136
15137 attr_t foo
15138
15139   ;
15140   return 0;
15141 }
15142 _ACEOF
15143 rm -f conftest.$ac_objext
15144 if { (eval echo "$as_me:15144: \"$ac_compile\"") >&5
15145   (eval $ac_compile) 2>&5
15146   ac_status=$?
15147   echo "$as_me:15147: \$? = $ac_status" >&5
15148   (exit $ac_status); } &&
15149          { ac_try='test -s conftest.$ac_objext'
15150   { (eval echo "$as_me:15150: \"$ac_try\"") >&5
15151   (eval $ac_try) 2>&5
15152   ac_status=$?
15153   echo "$as_me:15153: \$? = $ac_status" >&5
15154   (exit $ac_status); }; }; then
15155   cf_result=yes
15156 else
15157   echo "$as_me: failed program was:" >&5
15158 cat conftest.$ac_ext >&5
15159 cf_result=no
15160 fi
15161 rm -f conftest.$ac_objext conftest.$ac_ext
15162 echo "$as_me:15162: result: $cf_result" >&5
15163 echo "${ECHO_T}$cf_result" >&6
15164 if test $cf_result = yes ; then
15165
15166 cf_result=`echo "have_type_attr_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15167
15168         cat >>confdefs.h <<EOF
15169 #define $cf_result 1
15170 EOF
15171
15172 else
15173         cat >>confdefs.h <<EOF
15174 #define attr_t long
15175 EOF
15176
15177 fi
15178
15179 if test "$cf_enable_widec" = yes; then
15180
15181 # This is needed on Tru64 5.0 to declare mbstate_t
15182 echo "$as_me:15182: checking if we must include wchar.h to declare mbstate_t" >&5
15183 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6
15184 if test "${cf_cv_mbstate_t+set}" = set; then
15185   echo $ECHO_N "(cached) $ECHO_C" >&6
15186 else
15187
15188 cat >conftest.$ac_ext <<_ACEOF
15189 #line 15189 "configure"
15190 #include "confdefs.h"
15191
15192 #include <stdlib.h>
15193 #include <stdarg.h>
15194 #include <stdio.h>
15195 #ifdef HAVE_LIBUTF8_H
15196 #include <libutf8.h>
15197 #endif
15198 int
15199 main ()
15200 {
15201 mbstate_t state
15202   ;
15203   return 0;
15204 }
15205 _ACEOF
15206 rm -f conftest.$ac_objext
15207 if { (eval echo "$as_me:15207: \"$ac_compile\"") >&5
15208   (eval $ac_compile) 2>&5
15209   ac_status=$?
15210   echo "$as_me:15210: \$? = $ac_status" >&5
15211   (exit $ac_status); } &&
15212          { ac_try='test -s conftest.$ac_objext'
15213   { (eval echo "$as_me:15213: \"$ac_try\"") >&5
15214   (eval $ac_try) 2>&5
15215   ac_status=$?
15216   echo "$as_me:15216: \$? = $ac_status" >&5
15217   (exit $ac_status); }; }; then
15218   cf_cv_mbstate_t=no
15219 else
15220   echo "$as_me: failed program was:" >&5
15221 cat conftest.$ac_ext >&5
15222 cat >conftest.$ac_ext <<_ACEOF
15223 #line 15223 "configure"
15224 #include "confdefs.h"
15225
15226 #include <stdlib.h>
15227 #include <stdarg.h>
15228 #include <stdio.h>
15229 #include <wchar.h>
15230 #ifdef HAVE_LIBUTF8_H
15231 #include <libutf8.h>
15232 #endif
15233 int
15234 main ()
15235 {
15236 mbstate_t value
15237   ;
15238   return 0;
15239 }
15240 _ACEOF
15241 rm -f conftest.$ac_objext
15242 if { (eval echo "$as_me:15242: \"$ac_compile\"") >&5
15243   (eval $ac_compile) 2>&5
15244   ac_status=$?
15245   echo "$as_me:15245: \$? = $ac_status" >&5
15246   (exit $ac_status); } &&
15247          { ac_try='test -s conftest.$ac_objext'
15248   { (eval echo "$as_me:15248: \"$ac_try\"") >&5
15249   (eval $ac_try) 2>&5
15250   ac_status=$?
15251   echo "$as_me:15251: \$? = $ac_status" >&5
15252   (exit $ac_status); }; }; then
15253   cf_cv_mbstate_t=yes
15254 else
15255   echo "$as_me: failed program was:" >&5
15256 cat conftest.$ac_ext >&5
15257 cf_cv_mbstate_t=unknown
15258 fi
15259 rm -f conftest.$ac_objext conftest.$ac_ext
15260 fi
15261 rm -f conftest.$ac_objext conftest.$ac_ext
15262 fi
15263 echo "$as_me:15263: result: $cf_cv_mbstate_t" >&5
15264 echo "${ECHO_T}$cf_cv_mbstate_t" >&6
15265
15266 if test "$cf_cv_mbstate_t" = yes ; then
15267         cat >>confdefs.h <<\EOF
15268 #define NEED_WCHAR_H 1
15269 EOF
15270
15271         NEED_WCHAR_H=1
15272 fi
15273
15274 # if we do not find mbstate_t in either place, use substitution to provide a fallback.
15275 if test "$cf_cv_mbstate_t" = unknown ; then
15276         NCURSES_MBSTATE_T=1
15277 fi
15278
15279 # if we find mbstate_t in either place, use substitution to provide a fallback.
15280 if test "$cf_cv_mbstate_t" != unknown ; then
15281         NCURSES_OK_MBSTATE_T=1
15282 fi
15283
15284 # This is needed on Tru64 5.0 to declare wchar_t
15285 echo "$as_me:15285: checking if we must include wchar.h to declare wchar_t" >&5
15286 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6
15287 if test "${cf_cv_wchar_t+set}" = set; then
15288   echo $ECHO_N "(cached) $ECHO_C" >&6
15289 else
15290
15291 cat >conftest.$ac_ext <<_ACEOF
15292 #line 15292 "configure"
15293 #include "confdefs.h"
15294
15295 #include <stdlib.h>
15296 #include <stdarg.h>
15297 #include <stdio.h>
15298 #ifdef HAVE_LIBUTF8_H
15299 #include <libutf8.h>
15300 #endif
15301 int
15302 main ()
15303 {
15304 wchar_t state
15305   ;
15306   return 0;
15307 }
15308 _ACEOF
15309 rm -f conftest.$ac_objext
15310 if { (eval echo "$as_me:15310: \"$ac_compile\"") >&5
15311   (eval $ac_compile) 2>&5
15312   ac_status=$?
15313   echo "$as_me:15313: \$? = $ac_status" >&5
15314   (exit $ac_status); } &&
15315          { ac_try='test -s conftest.$ac_objext'
15316   { (eval echo "$as_me:15316: \"$ac_try\"") >&5
15317   (eval $ac_try) 2>&5
15318   ac_status=$?
15319   echo "$as_me:15319: \$? = $ac_status" >&5
15320   (exit $ac_status); }; }; then
15321   cf_cv_wchar_t=no
15322 else
15323   echo "$as_me: failed program was:" >&5
15324 cat conftest.$ac_ext >&5
15325 cat >conftest.$ac_ext <<_ACEOF
15326 #line 15326 "configure"
15327 #include "confdefs.h"
15328
15329 #include <stdlib.h>
15330 #include <stdarg.h>
15331 #include <stdio.h>
15332 #include <wchar.h>
15333 #ifdef HAVE_LIBUTF8_H
15334 #include <libutf8.h>
15335 #endif
15336 int
15337 main ()
15338 {
15339 wchar_t value
15340   ;
15341   return 0;
15342 }
15343 _ACEOF
15344 rm -f conftest.$ac_objext
15345 if { (eval echo "$as_me:15345: \"$ac_compile\"") >&5
15346   (eval $ac_compile) 2>&5
15347   ac_status=$?
15348   echo "$as_me:15348: \$? = $ac_status" >&5
15349   (exit $ac_status); } &&
15350          { ac_try='test -s conftest.$ac_objext'
15351   { (eval echo "$as_me:15351: \"$ac_try\"") >&5
15352   (eval $ac_try) 2>&5
15353   ac_status=$?
15354   echo "$as_me:15354: \$? = $ac_status" >&5
15355   (exit $ac_status); }; }; then
15356   cf_cv_wchar_t=yes
15357 else
15358   echo "$as_me: failed program was:" >&5
15359 cat conftest.$ac_ext >&5
15360 cf_cv_wchar_t=unknown
15361 fi
15362 rm -f conftest.$ac_objext conftest.$ac_ext
15363 fi
15364 rm -f conftest.$ac_objext conftest.$ac_ext
15365 fi
15366 echo "$as_me:15366: result: $cf_cv_wchar_t" >&5
15367 echo "${ECHO_T}$cf_cv_wchar_t" >&6
15368
15369 if test "$cf_cv_wchar_t" = yes ; then
15370         cat >>confdefs.h <<\EOF
15371 #define NEED_WCHAR_H 1
15372 EOF
15373
15374         NEED_WCHAR_H=1
15375 fi
15376
15377 # if we do not find wchar_t in either place, use substitution to provide a fallback.
15378 if test "$cf_cv_wchar_t" = unknown ; then
15379         NCURSES_WCHAR_T=1
15380 fi
15381
15382 # if we find wchar_t in either place, use substitution to provide a fallback.
15383 if test "$cf_cv_wchar_t" != unknown ; then
15384         NCURSES_OK_WCHAR_T=1
15385 fi
15386
15387 # This is needed on Tru64 5.0 to declare wint_t
15388 echo "$as_me:15388: checking if we must include wchar.h to declare wint_t" >&5
15389 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6
15390 if test "${cf_cv_wint_t+set}" = set; then
15391   echo $ECHO_N "(cached) $ECHO_C" >&6
15392 else
15393
15394 cat >conftest.$ac_ext <<_ACEOF
15395 #line 15395 "configure"
15396 #include "confdefs.h"
15397
15398 #include <stdlib.h>
15399 #include <stdarg.h>
15400 #include <stdio.h>
15401 #ifdef HAVE_LIBUTF8_H
15402 #include <libutf8.h>
15403 #endif
15404 int
15405 main ()
15406 {
15407 wint_t state
15408   ;
15409   return 0;
15410 }
15411 _ACEOF
15412 rm -f conftest.$ac_objext
15413 if { (eval echo "$as_me:15413: \"$ac_compile\"") >&5
15414   (eval $ac_compile) 2>&5
15415   ac_status=$?
15416   echo "$as_me:15416: \$? = $ac_status" >&5
15417   (exit $ac_status); } &&
15418          { ac_try='test -s conftest.$ac_objext'
15419   { (eval echo "$as_me:15419: \"$ac_try\"") >&5
15420   (eval $ac_try) 2>&5
15421   ac_status=$?
15422   echo "$as_me:15422: \$? = $ac_status" >&5
15423   (exit $ac_status); }; }; then
15424   cf_cv_wint_t=no
15425 else
15426   echo "$as_me: failed program was:" >&5
15427 cat conftest.$ac_ext >&5
15428 cat >conftest.$ac_ext <<_ACEOF
15429 #line 15429 "configure"
15430 #include "confdefs.h"
15431
15432 #include <stdlib.h>
15433 #include <stdarg.h>
15434 #include <stdio.h>
15435 #include <wchar.h>
15436 #ifdef HAVE_LIBUTF8_H
15437 #include <libutf8.h>
15438 #endif
15439 int
15440 main ()
15441 {
15442 wint_t value
15443   ;
15444   return 0;
15445 }
15446 _ACEOF
15447 rm -f conftest.$ac_objext
15448 if { (eval echo "$as_me:15448: \"$ac_compile\"") >&5
15449   (eval $ac_compile) 2>&5
15450   ac_status=$?
15451   echo "$as_me:15451: \$? = $ac_status" >&5
15452   (exit $ac_status); } &&
15453          { ac_try='test -s conftest.$ac_objext'
15454   { (eval echo "$as_me:15454: \"$ac_try\"") >&5
15455   (eval $ac_try) 2>&5
15456   ac_status=$?
15457   echo "$as_me:15457: \$? = $ac_status" >&5
15458   (exit $ac_status); }; }; then
15459   cf_cv_wint_t=yes
15460 else
15461   echo "$as_me: failed program was:" >&5
15462 cat conftest.$ac_ext >&5
15463 cf_cv_wint_t=unknown
15464 fi
15465 rm -f conftest.$ac_objext conftest.$ac_ext
15466 fi
15467 rm -f conftest.$ac_objext conftest.$ac_ext
15468 fi
15469 echo "$as_me:15469: result: $cf_cv_wint_t" >&5
15470 echo "${ECHO_T}$cf_cv_wint_t" >&6
15471
15472 if test "$cf_cv_wint_t" = yes ; then
15473         cat >>confdefs.h <<\EOF
15474 #define NEED_WCHAR_H 1
15475 EOF
15476
15477         NEED_WCHAR_H=1
15478 fi
15479
15480 # if we do not find wint_t in either place, use substitution to provide a fallback.
15481 if test "$cf_cv_wint_t" = unknown ; then
15482         NCURSES_WINT_T=1
15483 fi
15484
15485 # if we find wint_t in either place, use substitution to provide a fallback.
15486 if test "$cf_cv_wint_t" != unknown ; then
15487         NCURSES_OK_WINT_T=1
15488 fi
15489
15490         if test "$NCURSES_OK_MBSTATE_T" = 0 ; then
15491
15492 echo "$as_me:15492: checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15493 echo $ECHO_N "checking for type mbstate_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15494 cat >conftest.$ac_ext <<_ACEOF
15495 #line 15495 "configure"
15496 #include "confdefs.h"
15497
15498 #ifndef _XOPEN_SOURCE_EXTENDED
15499 #define _XOPEN_SOURCE_EXTENDED
15500 #endif
15501 #include <${cf_cv_ncurses_header:-curses.h}>
15502 int
15503 main ()
15504 {
15505
15506 mbstate_t foo
15507
15508   ;
15509   return 0;
15510 }
15511 _ACEOF
15512 rm -f conftest.$ac_objext
15513 if { (eval echo "$as_me:15513: \"$ac_compile\"") >&5
15514   (eval $ac_compile) 2>&5
15515   ac_status=$?
15516   echo "$as_me:15516: \$? = $ac_status" >&5
15517   (exit $ac_status); } &&
15518          { ac_try='test -s conftest.$ac_objext'
15519   { (eval echo "$as_me:15519: \"$ac_try\"") >&5
15520   (eval $ac_try) 2>&5
15521   ac_status=$?
15522   echo "$as_me:15522: \$? = $ac_status" >&5
15523   (exit $ac_status); }; }; then
15524   cf_result=yes
15525 else
15526   echo "$as_me: failed program was:" >&5
15527 cat conftest.$ac_ext >&5
15528 cf_result=no
15529 fi
15530 rm -f conftest.$ac_objext conftest.$ac_ext
15531 echo "$as_me:15531: result: $cf_result" >&5
15532 echo "${ECHO_T}$cf_result" >&6
15533 if test $cf_result = yes ; then
15534
15535 cf_result=`echo "have_type_mbstate_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15536
15537         cat >>confdefs.h <<EOF
15538 #define $cf_result 1
15539 EOF
15540
15541 else
15542         cat >>confdefs.h <<EOF
15543 #define mbstate_t long
15544 EOF
15545
15546 fi
15547
15548         fi
15549
15550         if test "$NCURSES_OK_WCHAR_T" = 0 ; then
15551
15552 echo "$as_me:15552: checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15553 echo $ECHO_N "checking for type wchar_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15554 cat >conftest.$ac_ext <<_ACEOF
15555 #line 15555 "configure"
15556 #include "confdefs.h"
15557
15558 #ifndef _XOPEN_SOURCE_EXTENDED
15559 #define _XOPEN_SOURCE_EXTENDED
15560 #endif
15561 #include <${cf_cv_ncurses_header:-curses.h}>
15562 int
15563 main ()
15564 {
15565
15566 wchar_t foo
15567
15568   ;
15569   return 0;
15570 }
15571 _ACEOF
15572 rm -f conftest.$ac_objext
15573 if { (eval echo "$as_me:15573: \"$ac_compile\"") >&5
15574   (eval $ac_compile) 2>&5
15575   ac_status=$?
15576   echo "$as_me:15576: \$? = $ac_status" >&5
15577   (exit $ac_status); } &&
15578          { ac_try='test -s conftest.$ac_objext'
15579   { (eval echo "$as_me:15579: \"$ac_try\"") >&5
15580   (eval $ac_try) 2>&5
15581   ac_status=$?
15582   echo "$as_me:15582: \$? = $ac_status" >&5
15583   (exit $ac_status); }; }; then
15584   cf_result=yes
15585 else
15586   echo "$as_me: failed program was:" >&5
15587 cat conftest.$ac_ext >&5
15588 cf_result=no
15589 fi
15590 rm -f conftest.$ac_objext conftest.$ac_ext
15591 echo "$as_me:15591: result: $cf_result" >&5
15592 echo "${ECHO_T}$cf_result" >&6
15593 if test $cf_result = yes ; then
15594
15595 cf_result=`echo "have_type_wchar_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15596
15597         cat >>confdefs.h <<EOF
15598 #define $cf_result 1
15599 EOF
15600
15601 else
15602         cat >>confdefs.h <<EOF
15603 #define wchar_t long
15604 EOF
15605
15606 fi
15607
15608         fi
15609
15610         if test "$NCURSES_OK_WINT_T" = 0 ; then
15611
15612 echo "$as_me:15612: checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}" >&5
15613 echo $ECHO_N "checking for type wint_t in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15614 cat >conftest.$ac_ext <<_ACEOF
15615 #line 15615 "configure"
15616 #include "confdefs.h"
15617
15618 #ifndef _XOPEN_SOURCE_EXTENDED
15619 #define _XOPEN_SOURCE_EXTENDED
15620 #endif
15621 #include <${cf_cv_ncurses_header:-curses.h}>
15622 int
15623 main ()
15624 {
15625
15626 wint_t foo
15627
15628   ;
15629   return 0;
15630 }
15631 _ACEOF
15632 rm -f conftest.$ac_objext
15633 if { (eval echo "$as_me:15633: \"$ac_compile\"") >&5
15634   (eval $ac_compile) 2>&5
15635   ac_status=$?
15636   echo "$as_me:15636: \$? = $ac_status" >&5
15637   (exit $ac_status); } &&
15638          { ac_try='test -s conftest.$ac_objext'
15639   { (eval echo "$as_me:15639: \"$ac_try\"") >&5
15640   (eval $ac_try) 2>&5
15641   ac_status=$?
15642   echo "$as_me:15642: \$? = $ac_status" >&5
15643   (exit $ac_status); }; }; then
15644   cf_result=yes
15645 else
15646   echo "$as_me: failed program was:" >&5
15647 cat conftest.$ac_ext >&5
15648 cf_result=no
15649 fi
15650 rm -f conftest.$ac_objext conftest.$ac_ext
15651 echo "$as_me:15651: result: $cf_result" >&5
15652 echo "${ECHO_T}$cf_result" >&6
15653 if test $cf_result = yes ; then
15654
15655 cf_result=`echo "have_type_wint_t" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15656
15657         cat >>confdefs.h <<EOF
15658 #define $cf_result 1
15659 EOF
15660
15661 else
15662         cat >>confdefs.h <<EOF
15663 #define wint_t long
15664 EOF
15665
15666 fi
15667
15668         fi
15669 fi
15670
15671 echo "$as_me:15671: checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15672 echo $ECHO_N "checking for data boolnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15673
15674 cat >conftest.$ac_ext <<_ACEOF
15675 #line 15675 "configure"
15676 #include "confdefs.h"
15677
15678 #ifdef HAVE_XCURSES
15679 #include <xcurses.h>
15680 char * XCursesProgramName = "test";
15681 #else
15682 #include <${cf_cv_ncurses_header:-curses.h}>
15683 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15684 #include <ncursesw/term.h>
15685 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15686 #include <ncurses/term.h>
15687 #elif defined(HAVE_TERM_H)
15688 #include <term.h>
15689 #endif
15690 #endif
15691
15692 int
15693 main ()
15694 {
15695
15696 void *foo = &(boolnames)
15697
15698   ;
15699   return 0;
15700 }
15701 _ACEOF
15702 rm -f conftest.$ac_objext
15703 if { (eval echo "$as_me:15703: \"$ac_compile\"") >&5
15704   (eval $ac_compile) 2>&5
15705   ac_status=$?
15706   echo "$as_me:15706: \$? = $ac_status" >&5
15707   (exit $ac_status); } &&
15708          { ac_try='test -s conftest.$ac_objext'
15709   { (eval echo "$as_me:15709: \"$ac_try\"") >&5
15710   (eval $ac_try) 2>&5
15711   ac_status=$?
15712   echo "$as_me:15712: \$? = $ac_status" >&5
15713   (exit $ac_status); }; }; then
15714   cf_result=yes
15715 else
15716   echo "$as_me: failed program was:" >&5
15717 cat conftest.$ac_ext >&5
15718 cf_result=no
15719 fi
15720 rm -f conftest.$ac_objext conftest.$ac_ext
15721 echo "$as_me:15721: result: $cf_result" >&5
15722 echo "${ECHO_T}$cf_result" >&6
15723
15724 if test $cf_result = yes ; then
15725
15726 cf_result=`echo "have_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15727
15728         cat >>confdefs.h <<EOF
15729 #define $cf_result 1
15730 EOF
15731
15732 else
15733         echo "$as_me:15733: checking for data boolnames in library" >&5
15734 echo $ECHO_N "checking for data boolnames in library... $ECHO_C" >&6
15735         # BSD linkers insist on making weak linkage, but resolve at runtime.
15736         if test "$cross_compiling" = yes; then
15737
15738         # cross-compiling
15739         cat >conftest.$ac_ext <<_ACEOF
15740 #line 15740 "configure"
15741 #include "confdefs.h"
15742
15743 #ifdef HAVE_XCURSES
15744 #include <xcurses.h>
15745 char * XCursesProgramName = "test";
15746 #else
15747 #include <${cf_cv_ncurses_header:-curses.h}>
15748 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15749 #include <ncursesw/term.h>
15750 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15751 #include <ncurses/term.h>
15752 #elif defined(HAVE_TERM_H)
15753 #include <term.h>
15754 #endif
15755 #endif
15756
15757 extern char boolnames;
15758 int
15759 main ()
15760 {
15761
15762         do {
15763                 void *foo = &(boolnames);
15764                 ${cf_cv_main_return:-return}(foo == 0);
15765         } while (0)
15766
15767   ;
15768   return 0;
15769 }
15770 _ACEOF
15771 rm -f conftest.$ac_objext conftest$ac_exeext
15772 if { (eval echo "$as_me:15772: \"$ac_link\"") >&5
15773   (eval $ac_link) 2>&5
15774   ac_status=$?
15775   echo "$as_me:15775: \$? = $ac_status" >&5
15776   (exit $ac_status); } &&
15777          { ac_try='test -s conftest$ac_exeext'
15778   { (eval echo "$as_me:15778: \"$ac_try\"") >&5
15779   (eval $ac_try) 2>&5
15780   ac_status=$?
15781   echo "$as_me:15781: \$? = $ac_status" >&5
15782   (exit $ac_status); }; }; then
15783   cf_result=yes
15784 else
15785   echo "$as_me: failed program was:" >&5
15786 cat conftest.$ac_ext >&5
15787 cf_result=no
15788 fi
15789 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15790
15791 else
15792   cat >conftest.$ac_ext <<_ACEOF
15793 #line 15793 "configure"
15794 #include "confdefs.h"
15795
15796 #ifdef HAVE_XCURSES
15797 #include <xcurses.h>
15798 char * XCursesProgramName = "test";
15799 #else
15800 #include <${cf_cv_ncurses_header:-curses.h}>
15801 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15802 #include <ncursesw/term.h>
15803 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15804 #include <ncurses/term.h>
15805 #elif defined(HAVE_TERM_H)
15806 #include <term.h>
15807 #endif
15808 #endif
15809
15810 extern char boolnames;
15811 int main(void)
15812 {
15813         void *foo = &(boolnames);
15814         ${cf_cv_main_return:-return}(foo == 0);
15815 }
15816 _ACEOF
15817 rm -f conftest$ac_exeext
15818 if { (eval echo "$as_me:15818: \"$ac_link\"") >&5
15819   (eval $ac_link) 2>&5
15820   ac_status=$?
15821   echo "$as_me:15821: \$? = $ac_status" >&5
15822   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
15823   { (eval echo "$as_me:15823: \"$ac_try\"") >&5
15824   (eval $ac_try) 2>&5
15825   ac_status=$?
15826   echo "$as_me:15826: \$? = $ac_status" >&5
15827   (exit $ac_status); }; }; then
15828   cf_result=yes
15829 else
15830   echo "$as_me: program exited with status $ac_status" >&5
15831 echo "$as_me: failed program was:" >&5
15832 cat conftest.$ac_ext >&5
15833 cf_result=no
15834 fi
15835 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
15836 fi
15837         echo "$as_me:15837: result: $cf_result" >&5
15838 echo "${ECHO_T}$cf_result" >&6
15839         if test $cf_result = yes ; then
15840
15841 cf_result=`echo "decl_curses_data_boolnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15842
15843                 cat >>confdefs.h <<EOF
15844 #define $cf_result 1
15845 EOF
15846
15847         fi
15848 fi
15849
15850 echo "$as_me:15850: checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}" >&5
15851 echo $ECHO_N "checking for data boolfnames declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6
15852
15853 cat >conftest.$ac_ext <<_ACEOF
15854 #line 15854 "configure"
15855 #include "confdefs.h"
15856
15857 #ifdef HAVE_XCURSES
15858 #include <xcurses.h>
15859 char * XCursesProgramName = "test";
15860 #else
15861 #include <${cf_cv_ncurses_header:-curses.h}>
15862 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15863 #include <ncursesw/term.h>
15864 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15865 #include <ncurses/term.h>
15866 #elif defined(HAVE_TERM_H)
15867 #include <term.h>
15868 #endif
15869 #endif
15870
15871 int
15872 main ()
15873 {
15874
15875 void *foo = &(boolfnames)
15876
15877   ;
15878   return 0;
15879 }
15880 _ACEOF
15881 rm -f conftest.$ac_objext
15882 if { (eval echo "$as_me:15882: \"$ac_compile\"") >&5
15883   (eval $ac_compile) 2>&5
15884   ac_status=$?
15885   echo "$as_me:15885: \$? = $ac_status" >&5
15886   (exit $ac_status); } &&
15887          { ac_try='test -s conftest.$ac_objext'
15888   { (eval echo "$as_me:15888: \"$ac_try\"") >&5
15889   (eval $ac_try) 2>&5
15890   ac_status=$?
15891   echo "$as_me:15891: \$? = $ac_status" >&5
15892   (exit $ac_status); }; }; then
15893   cf_result=yes
15894 else
15895   echo "$as_me: failed program was:" >&5
15896 cat conftest.$ac_ext >&5
15897 cf_result=no
15898 fi
15899 rm -f conftest.$ac_objext conftest.$ac_ext
15900 echo "$as_me:15900: result: $cf_result" >&5
15901 echo "${ECHO_T}$cf_result" >&6
15902
15903 if test $cf_result = yes ; then
15904
15905 cf_result=`echo "have_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
15906
15907         cat >>confdefs.h <<EOF
15908 #define $cf_result 1
15909 EOF
15910
15911 else
15912         echo "$as_me:15912: checking for data boolfnames in library" >&5
15913 echo $ECHO_N "checking for data boolfnames in library... $ECHO_C" >&6
15914         # BSD linkers insist on making weak linkage, but resolve at runtime.
15915         if test "$cross_compiling" = yes; then
15916
15917         # cross-compiling
15918         cat >conftest.$ac_ext <<_ACEOF
15919 #line 15919 "configure"
15920 #include "confdefs.h"
15921
15922 #ifdef HAVE_XCURSES
15923 #include <xcurses.h>
15924 char * XCursesProgramName = "test";
15925 #else
15926 #include <${cf_cv_ncurses_header:-curses.h}>
15927 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15928 #include <ncursesw/term.h>
15929 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15930 #include <ncurses/term.h>
15931 #elif defined(HAVE_TERM_H)
15932 #include <term.h>
15933 #endif
15934 #endif
15935
15936 extern char boolfnames;
15937 int
15938 main ()
15939 {
15940
15941         do {
15942                 void *foo = &(boolfnames);
15943                 ${cf_cv_main_return:-return}(foo == 0);
15944         } while (0)
15945
15946   ;
15947   return 0;
15948 }
15949 _ACEOF
15950 rm -f conftest.$ac_objext conftest$ac_exeext
15951 if { (eval echo "$as_me:15951: \"$ac_link\"") >&5
15952   (eval $ac_link) 2>&5
15953   ac_status=$?
15954   echo "$as_me:15954: \$? = $ac_status" >&5
15955   (exit $ac_status); } &&
15956          { ac_try='test -s conftest$ac_exeext'
15957   { (eval echo "$as_me:15957: \"$ac_try\"") >&5
15958   (eval $ac_try) 2>&5
15959   ac_status=$?
15960   echo "$as_me:15960: \$? = $ac_status" >&5
15961   (exit $ac_status); }; }; then
15962   cf_result=yes
15963 else
15964   echo "$as_me: failed program was:" >&5
15965 cat conftest.$ac_ext >&5
15966 cf_result=no
15967 fi
15968 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
15969
15970 else
15971   cat >conftest.$ac_ext <<_ACEOF
15972 #line 15972 "configure"
15973 #include "confdefs.h"
15974
15975 #ifdef HAVE_XCURSES
15976 #include <xcurses.h>
15977 char * XCursesProgramName = "test";
15978 #else
15979 #include <${cf_cv_ncurses_header:-curses.h}>
15980 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
15981 #include <ncursesw/term.h>
15982 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
15983 #include <ncurses/term.h>
15984 #elif defined(HAVE_TERM_H)
15985 #include <term.h>
15986 #endif
15987 #endif
15988
15989 extern char boolfnames;
15990 int main(void)
15991 {
15992         void *foo = &(boolfnames);
15993         ${cf_cv_main_return:-return}(foo == 0);
15994 }
15995 _ACEOF
15996 rm -f conftest$ac_exeext
15997 if { (eval echo "$as_me:15997: \"$ac_link\"") >&5
15998   (eval $ac_link) 2>&5
15999   ac_status=$?
16000   echo "$as_me:16000: \$? = $ac_status" >&5
16001   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
16002   { (eval echo "$as_me:16002: \"$ac_try\"") >&5
16003   (eval $ac_try) 2>&5
16004   ac_status=$?
16005   echo "$as_me:16005: \$? = $ac_status" >&5
16006   (exit $ac_status); }; }; then
16007   cf_result=yes
16008 else
16009   echo "$as_me: program exited with status $ac_status" >&5
16010 echo "$as_me: failed program was:" >&5
16011 cat conftest.$ac_ext >&5
16012 cf_result=no
16013 fi
16014 rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
16015 fi
16016         echo "$as_me:16016: result: $cf_result" >&5
16017 echo "${ECHO_T}$cf_result" >&6
16018         if test $cf_result = yes ; then
16019
16020 cf_result=`echo "decl_curses_data_boolfnames" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
16021
16022                 cat >>confdefs.h <<EOF
16023 #define $cf_result 1
16024 EOF
16025
16026         fi
16027 fi
16028
16029 LD_RPATH_OPT=
16030 echo "$as_me:16030: checking for an rpath option" >&5
16031 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6
16032 case $cf_cv_system_name in #(vi
16033 irix*) #(vi
16034         if test "$GCC" = yes; then
16035                 LD_RPATH_OPT="-Wl,-rpath,"
16036         else
16037                 LD_RPATH_OPT="-rpath "
16038         fi
16039         ;;
16040 linux*|gnu*|k*bsd*-gnu) #(vi
16041         LD_RPATH_OPT="-Wl,-rpath,"
16042         ;;
16043 openbsd[2-9].*|mirbsd*) #(vi
16044         LD_RPATH_OPT="-Wl,-rpath,"
16045         ;;
16046 dragonfly*|freebsd*) #(vi
16047         LD_RPATH_OPT="-rpath "
16048         ;;
16049 netbsd*) #(vi
16050         LD_RPATH_OPT="-Wl,-rpath,"
16051         ;;
16052 osf*|mls+*) #(vi
16053         LD_RPATH_OPT="-rpath "
16054         ;;
16055 solaris2*) #(vi
16056         LD_RPATH_OPT="-R"
16057         ;;
16058 *)
16059         ;;
16060 esac
16061 echo "$as_me:16061: result: $LD_RPATH_OPT" >&5
16062 echo "${ECHO_T}$LD_RPATH_OPT" >&6
16063
16064 case "x$LD_RPATH_OPT" in #(vi
16065 x-R*)
16066         echo "$as_me:16066: checking if we need a space after rpath option" >&5
16067 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6
16068         cf_save_LIBS="$LIBS"
16069         LIBS="${LD_RPATH_OPT}$libdir $LIBS"
16070         cat >conftest.$ac_ext <<_ACEOF
16071 #line 16071 "configure"
16072 #include "confdefs.h"
16073
16074 int
16075 main ()
16076 {
16077
16078   ;
16079   return 0;
16080 }
16081 _ACEOF
16082 rm -f conftest.$ac_objext conftest$ac_exeext
16083 if { (eval echo "$as_me:16083: \"$ac_link\"") >&5
16084   (eval $ac_link) 2>&5
16085   ac_status=$?
16086   echo "$as_me:16086: \$? = $ac_status" >&5
16087   (exit $ac_status); } &&
16088          { ac_try='test -s conftest$ac_exeext'
16089   { (eval echo "$as_me:16089: \"$ac_try\"") >&5
16090   (eval $ac_try) 2>&5
16091   ac_status=$?
16092   echo "$as_me:16092: \$? = $ac_status" >&5
16093   (exit $ac_status); }; }; then
16094   cf_rpath_space=no
16095 else
16096   echo "$as_me: failed program was:" >&5
16097 cat conftest.$ac_ext >&5
16098 cf_rpath_space=yes
16099 fi
16100 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16101         LIBS="$cf_save_LIBS"
16102         echo "$as_me:16102: result: $cf_rpath_space" >&5
16103 echo "${ECHO_T}$cf_rpath_space" >&6
16104         test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
16105         ;;
16106 esac
16107
16108 echo "$as_me:16108: checking if rpath-hack should be disabled" >&5
16109 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6
16110
16111 # Check whether --enable-rpath-hack or --disable-rpath-hack was given.
16112 if test "${enable_rpath_hack+set}" = set; then
16113   enableval="$enable_rpath_hack"
16114   test "$enableval" != no && enableval=yes
16115   if test "$enableval" != "yes" ; then
16116     cf_disable_rpath_hack=yes
16117   else
16118     cf_disable_rpath_hack=no
16119   fi
16120 else
16121   enableval=yes
16122   cf_disable_rpath_hack=no
16123
16124 fi;
16125 echo "$as_me:16125: result: $cf_disable_rpath_hack" >&5
16126 echo "${ECHO_T}$cf_disable_rpath_hack" >&6
16127 if test "$cf_disable_rpath_hack" = no ; then
16128
16129 echo "$as_me:16129: checking for updated LDFLAGS" >&5
16130 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6
16131 if test -n "$LD_RPATH_OPT" ; then
16132         echo "$as_me:16132: result: maybe" >&5
16133 echo "${ECHO_T}maybe" >&6
16134
16135         for ac_prog in ldd
16136 do
16137   # Extract the first word of "$ac_prog", so it can be a program name with args.
16138 set dummy $ac_prog; ac_word=$2
16139 echo "$as_me:16139: checking for $ac_word" >&5
16140 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
16141 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then
16142   echo $ECHO_N "(cached) $ECHO_C" >&6
16143 else
16144   if test -n "$cf_ldd_prog"; then
16145   ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test.
16146 else
16147   ac_save_IFS=$IFS; IFS=$ac_path_separator
16148 ac_dummy="$PATH"
16149 for ac_dir in $ac_dummy; do
16150   IFS=$ac_save_IFS
16151   test -z "$ac_dir" && ac_dir=.
16152   $as_executable_p "$ac_dir/$ac_word" || continue
16153 ac_cv_prog_cf_ldd_prog="$ac_prog"
16154 echo "$as_me:16154: found $ac_dir/$ac_word" >&5
16155 break
16156 done
16157
16158 fi
16159 fi
16160 cf_ldd_prog=$ac_cv_prog_cf_ldd_prog
16161 if test -n "$cf_ldd_prog"; then
16162   echo "$as_me:16162: result: $cf_ldd_prog" >&5
16163 echo "${ECHO_T}$cf_ldd_prog" >&6
16164 else
16165   echo "$as_me:16165: result: no" >&5
16166 echo "${ECHO_T}no" >&6
16167 fi
16168
16169   test -n "$cf_ldd_prog" && break
16170 done
16171 test -n "$cf_ldd_prog" || cf_ldd_prog="no"
16172
16173         cf_rpath_list="/usr/lib /lib"
16174         if test "$cf_ldd_prog" != no
16175         then
16176                 cf_rpath_oops=
16177
16178 cat >conftest.$ac_ext <<_ACEOF
16179 #line 16179 "configure"
16180 #include "confdefs.h"
16181 #include <stdio.h>
16182 int
16183 main ()
16184 {
16185 printf("Hello");
16186   ;
16187   return 0;
16188 }
16189 _ACEOF
16190 rm -f conftest.$ac_objext conftest$ac_exeext
16191 if { (eval echo "$as_me:16191: \"$ac_link\"") >&5
16192   (eval $ac_link) 2>&5
16193   ac_status=$?
16194   echo "$as_me:16194: \$? = $ac_status" >&5
16195   (exit $ac_status); } &&
16196          { ac_try='test -s conftest$ac_exeext'
16197   { (eval echo "$as_me:16197: \"$ac_try\"") >&5
16198   (eval $ac_try) 2>&5
16199   ac_status=$?
16200   echo "$as_me:16200: \$? = $ac_status" >&5
16201   (exit $ac_status); }; }; then
16202   cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u`
16203                  cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[      ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u`
16204 else
16205   echo "$as_me: failed program was:" >&5
16206 cat conftest.$ac_ext >&5
16207 fi
16208 rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
16209
16210                 # If we passed the link-test, but get a "not found" on a given library,
16211                 # this could be due to inept reconfiguration of gcc to make it only
16212                 # partly honor /usr/local/lib (or whatever).  Sometimes this behavior
16213                 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
16214                 # /usr/local libraries.
16215                 if test -n "$cf_rpath_oops"
16216                 then
16217                         for cf_rpath_src in $cf_rpath_oops
16218                         do
16219                                 for cf_rpath_dir in \
16220                                         /usr/local \
16221                                         /usr/pkg \
16222                                         /opt/sfw
16223                                 do
16224                                         if test -f $cf_rpath_dir/lib/$cf_rpath_src
16225                                         then
16226                                                 test -n "$verbose" && echo "    ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6
16227
16228 echo "${as_me:-configure}:16228: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5
16229
16230                                                 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
16231                                                 break
16232                                         fi
16233                                 done
16234                         done
16235                 fi
16236         fi
16237
16238         test -n "$verbose" && echo "    ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16239
16240 echo "${as_me:-configure}:16240: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16241
16242 test -n "$verbose" && echo "    ...checking LDFLAGS $LDFLAGS" 1>&6
16243
16244 echo "${as_me:-configure}:16244: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5
16245
16246 cf_rpath_dst=
16247 for cf_rpath_src in $LDFLAGS
16248 do
16249         case $cf_rpath_src in #(vi
16250         -L*) #(vi
16251
16252                 # check if this refers to a directory which we will ignore
16253                 cf_rpath_skip=no
16254                 if test -n "$cf_rpath_list"
16255                 then
16256                         for cf_rpath_item in $cf_rpath_list
16257                         do
16258                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16259                                 then
16260                                         cf_rpath_skip=yes
16261                                         break
16262                                 fi
16263                         done
16264                 fi
16265
16266                 if test "$cf_rpath_skip" = no
16267                 then
16268                         # transform the option
16269                         if test "$LD_RPATH_OPT" = "-R " ; then
16270                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16271                         else
16272                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16273                         fi
16274
16275                         # if we have not already added this, add it now
16276                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16277                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16278                         then
16279                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16280
16281 echo "${as_me:-configure}:16281: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16282
16283                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16284                         fi
16285                 fi
16286                 ;;
16287         esac
16288         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16289 done
16290 LDFLAGS=$cf_rpath_dst
16291
16292 test -n "$verbose" && echo "    ...checked LDFLAGS $LDFLAGS" 1>&6
16293
16294 echo "${as_me:-configure}:16294: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5
16295
16296 test -n "$verbose" && echo "    ...checking LIBS $LIBS" 1>&6
16297
16298 echo "${as_me:-configure}:16298: testing ...checking LIBS $LIBS ..." 1>&5
16299
16300 cf_rpath_dst=
16301 for cf_rpath_src in $LIBS
16302 do
16303         case $cf_rpath_src in #(vi
16304         -L*) #(vi
16305
16306                 # check if this refers to a directory which we will ignore
16307                 cf_rpath_skip=no
16308                 if test -n "$cf_rpath_list"
16309                 then
16310                         for cf_rpath_item in $cf_rpath_list
16311                         do
16312                                 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
16313                                 then
16314                                         cf_rpath_skip=yes
16315                                         break
16316                                 fi
16317                         done
16318                 fi
16319
16320                 if test "$cf_rpath_skip" = no
16321                 then
16322                         # transform the option
16323                         if test "$LD_RPATH_OPT" = "-R " ; then
16324                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
16325                         else
16326                                 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
16327                         fi
16328
16329                         # if we have not already added this, add it now
16330                         cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
16331                         if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
16332                         then
16333                                 test -n "$verbose" && echo "    ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6
16334
16335 echo "${as_me:-configure}:16335: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5
16336
16337                                 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
16338                         fi
16339                 fi
16340                 ;;
16341         esac
16342         cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
16343 done
16344 LIBS=$cf_rpath_dst
16345
16346 test -n "$verbose" && echo "    ...checked LIBS $LIBS" 1>&6
16347
16348 echo "${as_me:-configure}:16348: testing ...checked LIBS $LIBS ..." 1>&5
16349
16350         test -n "$verbose" && echo "    ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6
16351
16352 echo "${as_me:-configure}:16352: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5
16353
16354 fi
16355
16356 fi
16357
16358 TEST_ARGS="$LIBS"
16359 LIBS=
16360
16361 ac_config_files="$ac_config_files Makefile"
16362 ac_config_commands="$ac_config_commands default"
16363 cat >confcache <<\_ACEOF
16364 # This file is a shell script that caches the results of configure
16365 # tests run on this system so they can be shared between configure
16366 # scripts and configure runs, see configure's option --config-cache.
16367 # It is not useful on other systems.  If it contains results you don't
16368 # want to keep, you may remove or edit it.
16369 #
16370 # config.status only pays attention to the cache file if you give it
16371 # the --recheck option to rerun configure.
16372 #
16373 # `ac_cv_env_foo' variables (set or unset) will be overriden when
16374 # loading this file, other *unset* `ac_cv_foo' will be assigned the
16375 # following values.
16376
16377 _ACEOF
16378
16379 # The following way of writing the cache mishandles newlines in values,
16380 # but we know of no workaround that is simple, portable, and efficient.
16381 # So, don't put newlines in cache variables' values.
16382 # Ultrix sh set writes to stderr and can't be redirected directly,
16383 # and sets the high bit in the cache file unless we assign to the vars.
16384 {
16385   (set) 2>&1 |
16386     case `(ac_space=' '; set | grep ac_space) 2>&1` in
16387     *ac_space=\ *)
16388       # `set' does not quote correctly, so add quotes (double-quote
16389       # substitution turns \\\\ into \\, and sed turns \\ into \).
16390       sed -n \
16391         "s/'/'\\\\''/g;
16392           s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
16393       ;;
16394     *)
16395       # `set' quotes correctly as required by POSIX, so do not add quotes.
16396       sed -n \
16397         "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
16398       ;;
16399     esac;
16400 } |
16401   sed '
16402      t clear
16403      : clear
16404      s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
16405      t end
16406      /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
16407      : end' >>confcache
16408 if cmp -s $cache_file confcache; then :; else
16409   if test -w $cache_file; then
16410     test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
16411     cat confcache >$cache_file
16412   else
16413     echo "not updating unwritable cache $cache_file"
16414   fi
16415 fi
16416 rm -f confcache
16417
16418 test "x$prefix" = xNONE && prefix=$ac_default_prefix
16419 # Let make expand exec_prefix.
16420 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
16421
16422 # VPATH may cause trouble with some makes, so we remove $(srcdir),
16423 # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
16424 # trailing colons and then remove the whole line if VPATH becomes empty
16425 # (actually we leave an empty line to preserve line numbers).
16426 if test "x$srcdir" = x.; then
16427   ac_vpsub='/^[         ]*VPATH[        ]*=/{
16428 s/:*\$(srcdir):*/:/;
16429 s/:*\${srcdir}:*/:/;
16430 s/:*@srcdir@:*/:/;
16431 s/^\([^=]*=[    ]*\):*/\1/;
16432 s/:*$//;
16433 s/^[^=]*=[      ]*$//;
16434 }'
16435 fi
16436
16437 DEFS=-DHAVE_CONFIG_H
16438
16439 : ${CONFIG_STATUS=./config.status}
16440 ac_clean_files_save=$ac_clean_files
16441 ac_clean_files="$ac_clean_files $CONFIG_STATUS"
16442 { echo "$as_me:16442: creating $CONFIG_STATUS" >&5
16443 echo "$as_me: creating $CONFIG_STATUS" >&6;}
16444 cat >$CONFIG_STATUS <<_ACEOF
16445 #! $SHELL
16446 # Generated automatically by configure.
16447 # Run this file to recreate the current configuration.
16448 # Compiler output produced by configure, useful for debugging
16449 # configure, is in config.log if it exists.
16450
16451 debug=false
16452 SHELL=\${CONFIG_SHELL-$SHELL}
16453 ac_cs_invocation="\$0 \$@"
16454
16455 _ACEOF
16456
16457 cat >>$CONFIG_STATUS <<\_ACEOF
16458 # Be Bourne compatible
16459 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
16460   emulate sh
16461   NULLCMD=:
16462 elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
16463   set -o posix
16464 fi
16465
16466 # Name of the executable.
16467 as_me=`echo "$0" |sed 's,.*[\\/],,'`
16468
16469 if expr a : '\(a\)' >/dev/null 2>&1; then
16470   as_expr=expr
16471 else
16472   as_expr=false
16473 fi
16474
16475 rm -f conf$$ conf$$.exe conf$$.file
16476 echo >conf$$.file
16477 if ln -s conf$$.file conf$$ 2>/dev/null; then
16478   # We could just check for DJGPP; but this test a) works b) is more generic
16479   # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
16480   if test -f conf$$.exe; then
16481     # Don't use ln at all; we don't have any links
16482     as_ln_s='cp -p'
16483   else
16484     as_ln_s='ln -s'
16485   fi
16486 elif ln conf$$.file conf$$ 2>/dev/null; then
16487   as_ln_s=ln
16488 else
16489   as_ln_s='cp -p'
16490 fi
16491 rm -f conf$$ conf$$.exe conf$$.file
16492
16493 as_executable_p="test -f"
16494
16495 # Support unset when possible.
16496 if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
16497   as_unset=unset
16498 else
16499   as_unset=false
16500 fi
16501
16502 # NLS nuisances.
16503 $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; }
16504 $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; }
16505 $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; }
16506 $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; }
16507 $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; }
16508 $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; }
16509 $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; }
16510 $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; }
16511
16512 # IFS
16513 # We need space, tab and new line, in precisely that order.
16514 as_nl='
16515 '
16516 IFS="   $as_nl"
16517
16518 # CDPATH.
16519 $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; }
16520
16521 exec 6>&1
16522
16523 _ACEOF
16524
16525 # Files that config.status was made for.
16526 if test -n "$ac_config_files"; then
16527   echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
16528 fi
16529
16530 if test -n "$ac_config_headers"; then
16531   echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
16532 fi
16533
16534 if test -n "$ac_config_links"; then
16535   echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
16536 fi
16537
16538 if test -n "$ac_config_commands"; then
16539   echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
16540 fi
16541
16542 cat >>$CONFIG_STATUS <<\EOF
16543
16544 ac_cs_usage="\
16545 \`$as_me' instantiates files from templates according to the
16546 current configuration.
16547
16548 Usage: $0 [OPTIONS] [FILE]...
16549
16550   -h, --help       print this help, then exit
16551   -V, --version    print version number, then exit
16552   -d, --debug      don't remove temporary files
16553       --recheck    update $as_me by reconfiguring in the same conditions
16554   --file=FILE[:TEMPLATE]
16555                    instantiate the configuration file FILE
16556   --header=FILE[:TEMPLATE]
16557                    instantiate the configuration header FILE
16558
16559 Configuration files:
16560 $config_files
16561
16562 Configuration headers:
16563 $config_headers
16564
16565 Configuration commands:
16566 $config_commands
16567
16568 Report bugs to <dickey@invisible-island.net>."
16569 EOF
16570
16571 cat >>$CONFIG_STATUS <<EOF
16572 ac_cs_version="\\
16573 config.status
16574 configured by $0, generated by GNU Autoconf 2.52.20120310,
16575   with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
16576
16577 Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
16578 Free Software Foundation, Inc.
16579 This config.status script is free software; the Free Software Foundation
16580 gives unlimited permission to copy, distribute and modify it."
16581 srcdir=$srcdir
16582 INSTALL="$INSTALL"
16583 EOF
16584
16585 cat >>$CONFIG_STATUS <<\EOF
16586 # If no file are specified by the user, then we need to provide default
16587 # value.  By we need to know if files were specified by the user.
16588 ac_need_defaults=:
16589 while test $# != 0
16590 do
16591   case $1 in
16592   --*=*)
16593     ac_option=`expr "x$1" : 'x\([^=]*\)='`
16594     ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
16595     shift
16596     set dummy "$ac_option" "$ac_optarg" ${1+"$@"}
16597     shift
16598     ;;
16599   -*);;
16600   *) # This is not an option, so the user has probably given explicit
16601      # arguments.
16602      ac_need_defaults=false;;
16603   esac
16604
16605   case $1 in
16606   # Handling of the options.
16607 EOF
16608 cat >>$CONFIG_STATUS <<EOF
16609   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
16610     echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion"
16611     exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;;
16612 EOF
16613 cat >>$CONFIG_STATUS <<\EOF
16614   --version | --vers* | -V )
16615     echo "$ac_cs_version"; exit 0 ;;
16616   --he | --h)
16617     # Conflict between --help and --header
16618     { { echo "$as_me:16618: error: ambiguous option: $1
16619 Try \`$0 --help' for more information." >&5
16620 echo "$as_me: error: ambiguous option: $1
16621 Try \`$0 --help' for more information." >&2;}
16622    { (exit 1); exit 1; }; };;
16623   --help | --hel | -h )
16624     echo "$ac_cs_usage"; exit 0 ;;
16625   --debug | --d* | -d )
16626     debug=: ;;
16627   --file | --fil | --fi | --f )
16628     shift
16629     CONFIG_FILES="$CONFIG_FILES $1"
16630     ac_need_defaults=false;;
16631   --header | --heade | --head | --hea )
16632     shift
16633     CONFIG_HEADERS="$CONFIG_HEADERS $1"
16634     ac_need_defaults=false;;
16635
16636   # This is an error.
16637   -*) { { echo "$as_me:16637: error: unrecognized option: $1
16638 Try \`$0 --help' for more information." >&5
16639 echo "$as_me: error: unrecognized option: $1
16640 Try \`$0 --help' for more information." >&2;}
16641    { (exit 1); exit 1; }; } ;;
16642
16643   *) ac_config_targets="$ac_config_targets $1" ;;
16644
16645   esac
16646   shift
16647 done
16648
16649 exec 5>>config.log
16650 cat >&5 << _ACEOF
16651
16652 ## ----------------------- ##
16653 ## Running config.status.  ##
16654 ## ----------------------- ##
16655
16656 This file was extended by $as_me 2.52.20120310, executed with
16657   CONFIG_FILES    = $CONFIG_FILES
16658   CONFIG_HEADERS  = $CONFIG_HEADERS
16659   CONFIG_LINKS    = $CONFIG_LINKS
16660   CONFIG_COMMANDS = $CONFIG_COMMANDS
16661   > $ac_cs_invocation
16662 on `(hostname || uname -n) 2>/dev/null | sed 1q`
16663
16664 _ACEOF
16665 EOF
16666
16667 cat >>$CONFIG_STATUS <<EOF
16668 #
16669 # INIT-COMMANDS section.
16670 #
16671
16672 AWK="$AWK"
16673 ECHO_CC="$ECHO_CC"
16674 ECHO_LD="$ECHO_LD"
16675 SHOW_CC="$SHOW_LD"
16676
16677 EOF
16678
16679 cat >>$CONFIG_STATUS <<\EOF
16680 for ac_config_target in $ac_config_targets
16681 do
16682   case "$ac_config_target" in
16683   # Handling of arguments.
16684   "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
16685   "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
16686   "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;;
16687   *) { { echo "$as_me:16687: error: invalid argument: $ac_config_target" >&5
16688 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
16689    { (exit 1); exit 1; }; };;
16690   esac
16691 done
16692
16693 # If the user did not use the arguments to specify the items to instantiate,
16694 # then the envvar interface is used.  Set only those that are not.
16695 # We use the long form for the default assignment because of an extremely
16696 # bizarre bug on SunOS 4.1.3.
16697 if $ac_need_defaults; then
16698   test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
16699   test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
16700   test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
16701 fi
16702
16703 # Create a temporary directory, and hook for its removal unless debugging.
16704 $debug ||
16705 {
16706   trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
16707   trap '{ (exit 1); exit 1; }' 1 2 13 15
16708 }
16709
16710 # Create a (secure) tmp directory for tmp files.
16711 : ${TMPDIR=/tmp}
16712 {
16713   tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` &&
16714   test -n "$tmp" && test -d "$tmp"
16715 }  ||
16716 {
16717   tmp=$TMPDIR/cs$$-$RANDOM
16718   (umask 077 && mkdir $tmp)
16719 } ||
16720 {
16721    echo "$me: cannot create a temporary directory in $TMPDIR" >&2
16722    { (exit 1); exit 1; }
16723 }
16724
16725 EOF
16726
16727 cat >>$CONFIG_STATUS <<EOF
16728
16729 #
16730 # CONFIG_FILES section.
16731 #
16732
16733 # No need to generate the scripts if there are no CONFIG_FILES.
16734 # This happens for instance when ./config.status config.h
16735 if test -n "\$CONFIG_FILES"; then
16736   # Protect against being on the right side of a sed subst in config.status.
16737   sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
16738    s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
16739 s,@SHELL@,$SHELL,;t t
16740 s,@exec_prefix@,$exec_prefix,;t t
16741 s,@prefix@,$prefix,;t t
16742 s,@program_transform_name@,$program_transform_name,;t t
16743 s,@bindir@,$bindir,;t t
16744 s,@sbindir@,$sbindir,;t t
16745 s,@libexecdir@,$libexecdir,;t t
16746 s,@datadir@,$datadir,;t t
16747 s,@sysconfdir@,$sysconfdir,;t t
16748 s,@sharedstatedir@,$sharedstatedir,;t t
16749 s,@localstatedir@,$localstatedir,;t t
16750 s,@libdir@,$libdir,;t t
16751 s,@includedir@,$includedir,;t t
16752 s,@oldincludedir@,$oldincludedir,;t t
16753 s,@infodir@,$infodir,;t t
16754 s,@mandir@,$mandir,;t t
16755 s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
16756 s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
16757 s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
16758 s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
16759 s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
16760 s,@build_alias@,$build_alias,;t t
16761 s,@host_alias@,$host_alias,;t t
16762 s,@target_alias@,$target_alias,;t t
16763 s,@ECHO_C@,$ECHO_C,;t t
16764 s,@ECHO_N@,$ECHO_N,;t t
16765 s,@ECHO_T@,$ECHO_T,;t t
16766 s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
16767 s,@DEFS@,$DEFS,;t t
16768 s,@LIBS@,$LIBS,;t t
16769 s,@build@,$build,;t t
16770 s,@build_cpu@,$build_cpu,;t t
16771 s,@build_vendor@,$build_vendor,;t t
16772 s,@build_os@,$build_os,;t t
16773 s,@host@,$host,;t t
16774 s,@host_cpu@,$host_cpu,;t t
16775 s,@host_vendor@,$host_vendor,;t t
16776 s,@host_os@,$host_os,;t t
16777 s,@SET_MAKE@,$SET_MAKE,;t t
16778 s,@CC@,$CC,;t t
16779 s,@CFLAGS@,$CFLAGS,;t t
16780 s,@LDFLAGS@,$LDFLAGS,;t t
16781 s,@CPPFLAGS@,$CPPFLAGS,;t t
16782 s,@ac_ct_CC@,$ac_ct_CC,;t t
16783 s,@EXEEXT@,$EXEEXT,;t t
16784 s,@OBJEXT@,$OBJEXT,;t t
16785 s,@CPP@,$CPP,;t t
16786 s,@AWK@,$AWK,;t t
16787 s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
16788 s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
16789 s,@INSTALL_DATA@,$INSTALL_DATA,;t t
16790 s,@LINT@,$LINT,;t t
16791 s,@LINT_OPTS@,$LINT_OPTS,;t t
16792 s,@CTAGS@,$CTAGS,;t t
16793 s,@ETAGS@,$ETAGS,;t t
16794 s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t
16795 s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t
16796 s,@MATH_LIB@,$MATH_LIB,;t t
16797 s,@top_builddir@,$top_builddir,;t t
16798 s,@CC_G_OPT@,$CC_G_OPT,;t t
16799 s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t
16800 s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t
16801 s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t
16802 s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t
16803 s,@LD@,$LD,;t t
16804 s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t
16805 s,@LDFLAGS_STATIC@,$LDFLAGS_STATIC,;t t
16806 s,@LD_MODEL@,$LD_MODEL,;t t
16807 s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t
16808 s,@LIBTOOL@,$LIBTOOL,;t t
16809 s,@LIB_CLEAN@,$LIB_CLEAN,;t t
16810 s,@LIB_COMPILE@,$LIB_COMPILE,;t t
16811 s,@LIB_LINK@,$LIB_LINK,;t t
16812 s,@LINK_TESTS@,$LINK_TESTS,;t t
16813 s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t
16814 s,@PTHREAD@,$PTHREAD,;t t
16815 s,@TEST_ARGS@,$TEST_ARGS,;t t
16816 s,@TEST_DEPS@,$TEST_DEPS,;t t
16817 s,@TEST_LIBS@,$TEST_LIBS,;t t
16818 s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t
16819 s,@TINFO_LIBS@,$TINFO_LIBS,;t t
16820 s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t
16821 s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t
16822 s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t
16823 s,@ECHO_LT@,$ECHO_LT,;t t
16824 s,@ECHO_LD@,$ECHO_LD,;t t
16825 s,@RULE_CC@,$RULE_CC,;t t
16826 s,@SHOW_CC@,$SHOW_CC,;t t
16827 s,@ECHO_CC@,$ECHO_CC,;t t
16828 s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t
16829 s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t
16830 s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t
16831 s,@PKG_CONFIG@,$PKG_CONFIG,;t t
16832 s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
16833 s,@X_CFLAGS@,$X_CFLAGS,;t t
16834 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
16835 s,@X_LIBS@,$X_LIBS,;t t
16836 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
16837 s,@XCURSES_CONFIG@,$XCURSES_CONFIG,;t t
16838 s,@ac_ct_XCURSES_CONFIG@,$ac_ct_XCURSES_CONFIG,;t t
16839 s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t
16840 s,@cf_ldd_prog@,$cf_ldd_prog,;t t
16841 s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t
16842 CEOF
16843
16844 EOF
16845
16846   cat >>$CONFIG_STATUS <<\EOF
16847   # Split the substitutions into bite-sized pieces for seds with
16848   # small command number limits, like on Digital OSF/1 and HP-UX.
16849   ac_max_sed_lines=48
16850   ac_sed_frag=1 # Number of current file.
16851   ac_beg=1 # First line for current file.
16852   ac_end=$ac_max_sed_lines # Line after last line for current file.
16853   ac_more_lines=:
16854   ac_sed_cmds=
16855   while $ac_more_lines; do
16856     if test $ac_beg -gt 1; then
16857       sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16858     else
16859       sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
16860     fi
16861     if test ! -s $tmp/subs.frag; then
16862       ac_more_lines=false
16863     else
16864       # The purpose of the label and of the branching condition is to
16865       # speed up the sed processing (if there are no `@' at all, there
16866       # is no need to browse any of the substitutions).
16867       # These are the two extra sed commands mentioned above.
16868       (echo ':t
16869   /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
16870       if test -z "$ac_sed_cmds"; then
16871         ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
16872       else
16873         ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
16874       fi
16875       ac_sed_frag=`expr $ac_sed_frag + 1`
16876       ac_beg=$ac_end
16877       ac_end=`expr $ac_end + $ac_max_sed_lines`
16878     fi
16879   done
16880   if test -z "$ac_sed_cmds"; then
16881     ac_sed_cmds=cat
16882   fi
16883 fi # test -n "$CONFIG_FILES"
16884
16885 EOF
16886 cat >>$CONFIG_STATUS <<\EOF
16887 for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
16888   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
16889   case $ac_file in
16890   - | *:- | *:-:* ) # input from stdin
16891         cat >$tmp/stdin
16892         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16893         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16894   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
16895         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
16896   * )   ac_file_in=$ac_file.in ;;
16897   esac
16898
16899   # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
16900   ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
16901          X"$ac_file" : 'X\(//\)[^/]' \| \
16902          X"$ac_file" : 'X\(//\)$' \| \
16903          X"$ac_file" : 'X\(/\)' \| \
16904          .     : '\(.\)' 2>/dev/null ||
16905 echo X"$ac_file" |
16906     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
16907           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
16908           /^X\(\/\/\)$/{ s//\1/; q; }
16909           /^X\(\/\).*/{ s//\1/; q; }
16910           s/.*/./; q'`
16911   if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
16912     { case "$ac_dir" in
16913   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
16914   *)                      as_incr_dir=.;;
16915 esac
16916 as_dummy="$ac_dir"
16917 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
16918   case $as_mkdir_dir in
16919     # Skip DOS drivespec
16920     ?:) as_incr_dir=$as_mkdir_dir ;;
16921     *)
16922       as_incr_dir=$as_incr_dir/$as_mkdir_dir
16923       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
16924     ;;
16925   esac
16926 done; }
16927
16928     ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`"
16929     # A "../" for each directory in $ac_dir_suffix.
16930     ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'`
16931   else
16932     ac_dir_suffix= ac_dots=
16933   fi
16934
16935   case $srcdir in
16936   .)  ac_srcdir=.
16937       if test -z "$ac_dots"; then
16938          ac_top_srcdir=.
16939       else
16940          ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'`
16941       fi ;;
16942   [\\/]* | ?:[\\/]* )
16943       ac_srcdir=$srcdir$ac_dir_suffix;
16944       ac_top_srcdir=$srcdir ;;
16945   *) # Relative path.
16946     ac_srcdir=$ac_dots$srcdir$ac_dir_suffix
16947     ac_top_srcdir=$ac_dots$srcdir ;;
16948   esac
16949
16950   case $INSTALL in
16951   [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
16952   *) ac_INSTALL=$ac_dots$INSTALL ;;
16953   esac
16954
16955   if test x"$ac_file" != x-; then
16956     { echo "$as_me:16956: creating $ac_file" >&5
16957 echo "$as_me: creating $ac_file" >&6;}
16958     rm -f "$ac_file"
16959   fi
16960   # Let's still pretend it is `configure' which instantiates (i.e., don't
16961   # use $as_me), people would be surprised to read:
16962   #    /* config.h.  Generated automatically by config.status.  */
16963   configure_input="Generated automatically from `echo $ac_file_in |
16964                                                  sed 's,.*/,,'` by configure."
16965
16966   # First look for the input files in the build tree, otherwise in the
16967   # src tree.
16968   ac_file_inputs=`IFS=:
16969     for f in $ac_file_in; do
16970       case $f in
16971       -) echo $tmp/stdin ;;
16972       [\\/$]*)
16973          # Absolute (can't be DOS-style, as IFS=:)
16974          test -f "$f" || { { echo "$as_me:16974: error: cannot find input file: $f" >&5
16975 echo "$as_me: error: cannot find input file: $f" >&2;}
16976    { (exit 1); exit 1; }; }
16977          echo $f;;
16978       *) # Relative
16979          if test -f "$f"; then
16980            # Build tree
16981            echo $f
16982          elif test -f "$srcdir/$f"; then
16983            # Source tree
16984            echo $srcdir/$f
16985          else
16986            # /dev/null tree
16987            { { echo "$as_me:16987: error: cannot find input file: $f" >&5
16988 echo "$as_me: error: cannot find input file: $f" >&2;}
16989    { (exit 1); exit 1; }; }
16990          fi;;
16991       esac
16992     done` || { (exit 1); exit 1; }
16993 EOF
16994 cat >>$CONFIG_STATUS <<EOF
16995   sed "$ac_vpsub
16996 $extrasub
16997 EOF
16998 cat >>$CONFIG_STATUS <<\EOF
16999 :t
17000 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
17001 s,@configure_input@,$configure_input,;t t
17002 s,@srcdir@,$ac_srcdir,;t t
17003 s,@top_srcdir@,$ac_top_srcdir,;t t
17004 s,@INSTALL@,$ac_INSTALL,;t t
17005 " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
17006   rm -f $tmp/stdin
17007   if test x"$ac_file" != x-; then
17008     mv $tmp/out $ac_file
17009   else
17010     cat $tmp/out
17011     rm -f $tmp/out
17012   fi
17013
17014 done
17015 EOF
17016 cat >>$CONFIG_STATUS <<\EOF
17017
17018 #
17019 # CONFIG_HEADER section.
17020 #
17021
17022 # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
17023 # NAME is the cpp macro being defined and VALUE is the value it is being given.
17024 #
17025 # ac_d sets the value in "#define NAME VALUE" lines.
17026 ac_dA='s,^\([   ]*\)#\([        ]*define[       ][      ]*\)'
17027 ac_dB='[        ].*$,\1#\2'
17028 ac_dC=' '
17029 ac_dD=',;t'
17030 # ac_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
17031 ac_iA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17032 ac_iB='\([      ]\),\1#\2define\3'
17033 ac_iC=' '
17034 ac_iD='\4,;t'
17035 # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
17036 ac_uA='s,^\([   ]*\)#\([        ]*\)undef\([    ][      ]*\)'
17037 ac_uB='$,\1#\2define\3'
17038 ac_uC=' '
17039 ac_uD=',;t'
17040
17041 for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
17042   # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
17043   case $ac_file in
17044   - | *:- | *:-:* ) # input from stdin
17045         cat >$tmp/stdin
17046         ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17047         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17048   *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
17049         ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
17050   * )   ac_file_in=$ac_file.in ;;
17051   esac
17052
17053   test x"$ac_file" != x- && { echo "$as_me:17053: creating $ac_file" >&5
17054 echo "$as_me: creating $ac_file" >&6;}
17055
17056   # First look for the input files in the build tree, otherwise in the
17057   # src tree.
17058   ac_file_inputs=`IFS=:
17059     for f in $ac_file_in; do
17060       case $f in
17061       -) echo $tmp/stdin ;;
17062       [\\/$]*)
17063          # Absolute (can't be DOS-style, as IFS=:)
17064          test -f "$f" || { { echo "$as_me:17064: error: cannot find input file: $f" >&5
17065 echo "$as_me: error: cannot find input file: $f" >&2;}
17066    { (exit 1); exit 1; }; }
17067          echo $f;;
17068       *) # Relative
17069          if test -f "$f"; then
17070            # Build tree
17071            echo $f
17072          elif test -f "$srcdir/$f"; then
17073            # Source tree
17074            echo $srcdir/$f
17075          else
17076            # /dev/null tree
17077            { { echo "$as_me:17077: error: cannot find input file: $f" >&5
17078 echo "$as_me: error: cannot find input file: $f" >&2;}
17079    { (exit 1); exit 1; }; }
17080          fi;;
17081       esac
17082     done` || { (exit 1); exit 1; }
17083   # Remove the trailing spaces.
17084   sed 's/[      ]*$//' $ac_file_inputs >$tmp/in
17085
17086 EOF
17087
17088 # Transform confdefs.h into a list of #define's.  We won't use it as a sed
17089 # script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS to
17090 # be either 'cat' or 'sort'.
17091 cat confdefs.h | uniq >conftest.vals
17092
17093 # Break up conftest.vals because some shells have a limit on
17094 # the size of here documents, and old seds have small limits too.
17095
17096 rm -f conftest.tail
17097 echo '  rm -f conftest.frag' >> $CONFIG_STATUS
17098 while grep . conftest.vals >/dev/null
17099 do
17100   # Write chunks of a limited-size here document to conftest.frag.
17101   echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
17102   sed ${ac_max_here_lines}q conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> $CONFIG_STATUS
17103   echo 'CEOF' >> $CONFIG_STATUS
17104   sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
17105   rm -f conftest.vals
17106   mv conftest.tail conftest.vals
17107 done
17108 rm -f conftest.vals
17109
17110 # Run sed to substitute the contents of conftest.frag into $tmp/in at the
17111 # marker @DEFS@.
17112 echo '  cat >> conftest.edit <<CEOF
17113 /@DEFS@/r conftest.frag
17114 /@DEFS@/d
17115 CEOF
17116 sed -f conftest.edit $tmp/in > $tmp/out
17117 rm -f $tmp/in
17118 mv $tmp/out $tmp/in
17119 rm -f conftest.edit conftest.frag
17120 ' >> $CONFIG_STATUS
17121
17122 cat >>$CONFIG_STATUS <<\EOF
17123   # Let's still pretend it is `configure' which instantiates (i.e., don't
17124   # use $as_me), people would be surprised to read:
17125   #    /* config.h.  Generated automatically by config.status.  */
17126   if test x"$ac_file" = x-; then
17127     echo "/* Generated automatically by configure.  */" >$tmp/config.h
17128   else
17129     echo "/* $ac_file.  Generated automatically by configure.  */" >$tmp/config.h
17130   fi
17131   cat $tmp/in >>$tmp/config.h
17132   rm -f $tmp/in
17133   if test x"$ac_file" != x-; then
17134     if cmp -s $ac_file $tmp/config.h 2>/dev/null; then
17135       { echo "$as_me:17135: $ac_file is unchanged" >&5
17136 echo "$as_me: $ac_file is unchanged" >&6;}
17137     else
17138       ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
17139          X"$ac_file" : 'X\(//\)[^/]' \| \
17140          X"$ac_file" : 'X\(//\)$' \| \
17141          X"$ac_file" : 'X\(/\)' \| \
17142          .     : '\(.\)' 2>/dev/null ||
17143 echo X"$ac_file" |
17144     sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
17145           /^X\(\/\/\)[^/].*/{ s//\1/; q; }
17146           /^X\(\/\/\)$/{ s//\1/; q; }
17147           /^X\(\/\).*/{ s//\1/; q; }
17148           s/.*/./; q'`
17149       if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
17150         { case "$ac_dir" in
17151   [\\/]* | ?:[\\/]* ) as_incr_dir=;;
17152   *)                      as_incr_dir=.;;
17153 esac
17154 as_dummy="$ac_dir"
17155 for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do
17156   case $as_mkdir_dir in
17157     # Skip DOS drivespec
17158     ?:) as_incr_dir=$as_mkdir_dir ;;
17159     *)
17160       as_incr_dir=$as_incr_dir/$as_mkdir_dir
17161       test -d "$as_incr_dir" || mkdir "$as_incr_dir"
17162     ;;
17163   esac
17164 done; }
17165
17166       fi
17167       rm -f $ac_file
17168       mv $tmp/config.h $ac_file
17169     fi
17170   else
17171     cat $tmp/config.h
17172     rm -f $tmp/config.h
17173   fi
17174 done
17175 EOF
17176 cat >>$CONFIG_STATUS <<\EOF
17177 #
17178 # CONFIG_COMMANDS section.
17179 #
17180 for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
17181   ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
17182   ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
17183
17184   case $ac_dest in
17185     default )
17186
17187 for cf_dir in .
17188 do
17189         if test ! -d $srcdir/$cf_dir; then
17190                 continue
17191         elif test -f $srcdir/$cf_dir/programs; then
17192                 $AWK -f $srcdir/mk-test.awk INSTALL=yes ECHO_LINK="$ECHO_LD" $srcdir/$cf_dir/programs >>$cf_dir/Makefile
17193         fi
17194 done
17195
17196         cat >>Makefile <<TEST_EOF
17197
17198 # These rules are generated so we do not rely on suffix rules, which do not
17199 # work consistently for different make-programs (the '\$(MODEL)/' confuses
17200 # some, and the '\$x' confuses others).
17201 TEST_EOF
17202
17203 LIST=`sed -e 's/[       ].*//' -e '/^[#@]/d' $srcdir/modules`
17204 for N in $LIST
17205 do
17206         cat >>Makefile <<TEST_EOF
17207
17208 \$(MODEL)/$N.o : \$(srcdir)/$N.c \\
17209         \$(srcdir)/test.priv.h \\
17210         ncurses_cfg.h
17211         $SHOW_CC
17212         $ECHO_CC\$(CC) -c \$(CFLAGS_DEFAULT) \$(srcdir)/$N.c
17213 TEST_EOF
17214 done
17215
17216 if test -f ../config.guess && test -f ../config.sub
17217 then
17218         cat >>Makefile <<TEST_EOF
17219
17220 # if we used CF_INHERIT for getting these files, we can remove them
17221 distclean::
17222         rm -f config.guess config.sub
17223 TEST_EOF
17224 fi
17225  ;;
17226   esac
17227 done
17228 EOF
17229
17230 cat >>$CONFIG_STATUS <<\EOF
17231
17232 { (exit 0); exit 0; }
17233 EOF
17234 chmod +x $CONFIG_STATUS
17235 ac_clean_files=$ac_clean_files_save
17236
17237 # configure is writing to config.log, and then calls config.status.
17238 # config.status does its own redirection, appending to config.log.
17239 # Unfortunately, on DOS this fails, as config.log is still kept open
17240 # by configure, so config.status won't be able to write to it; its
17241 # output is simply discarded.  So we exec the FD to /dev/null,
17242 # effectively closing config.log, so it can be properly (re)opened and
17243 # appended to by config.status.  When coming back to configure, we
17244 # need to make the FD available again.
17245 if test "$no_create" != yes; then
17246   ac_cs_success=:
17247   exec 5>/dev/null
17248   $SHELL $CONFIG_STATUS || ac_cs_success=false
17249   exec 5>>config.log
17250   # Use ||, not &&, to avoid exiting from the if with $? = 1, which
17251   # would make configure fail if this is the last instruction.
17252   $ac_cs_success || { (exit 1); exit 1; }
17253 fi
17254